DynMapScript

// ==UserScript==
// @name         dynscript
// @match        http://pcgamemc.dip.jp:8123/*
// @grant        GM_addStyle
// @version      17.9.24
// ==/UserScript==
repeat() ;
function repeat()
{
  if( document.querySelector( '#mcmap.dynmap' ) ) load() ;
  else setTimeout( function() { repeat() ; } , 5000 ) ;
}
function load()
{
  GM_addStyle( [
    '' ,
    '.panel { overflow: scroll; height: 100%; }' ,
    'fieldset > ul { height: auto !important; }' ,
    'fieldset > div { display: none !important; }' ,
    '.__m #mcmap > :not( .map )' ,
    ' , .__p [ __p = "-1" ]' ,
    ' , .__m .leaflet-control-container' ,
    ' , .__m .playerMarker.leaflet-marker-icon { display: none !important; }' ,
  ].join( '\n' ) ) ;
  crawl() ;
  document.__m = true ;
  document.body.addEventListener( 'mouseenter' , function() {
    document.body.classList.toggle( '__p' ) ;
    if( document.__m )
    {
      document.__m = false ;
      setTimeout( function() { document.__m = true ; } , 9999 ) ;
      crawl() ;
    }
  } ) ;
  document.querySelector( '.largeclock' ).title = 'click to hide icons.' ;
  document.querySelector( '.largeclock' ).onclick = function() {
    document.body.classList.add( '__m' ) ;
    document.body.onmouseenter = function() {
      document.body.classList.remove( '__m' ) ;
      document.body.onmouseenter = '' ;
    } ;
  } ;
}

function crawl()
{
  while( document.querySelector( 'path:not( [__p] )' ) )
  {
    path = document.querySelector( 'path:not( [__p] )' ) ;
    path.setAttribute( '__p' , '1' ) ;
    path.onclick = function(e) {
      if( e.ctrlKey ) e.target.setAttribute( '__p' , -1 * e.target.getAttribute( '__p' ) ) ;
    } ;
  }
  console.log( 'userscript: detected dynmap. styling and tweaking.' ) ;
}