Difference between revisions of "User:Kernigh/monobook.js"

From RogueBasin
Jump to navigation Jump to search
m (Minor script fixes.)
m (This wiki upgraded away from MediaWiki 1.3.9, try removing my 1.3.9-ish workaround.)
 
Line 4: Line 4:
  * Monobook script of Kernigh at RogueBasin - public domain
  * Monobook script of Kernigh at RogueBasin - public domain
  */
  */
// workaround - MediaWiki 1.3.9 is too old to have this function
function addOnloadHook( hook ) {
  if( window.addEventListener )
    window.addEventListener( "load", hook, false );
}


// load a script from some MediaWiki
// load a script from some MediaWiki

Latest revision as of 03:44, 6 August 2007

// <pre>

/*
 * Monobook script of Kernigh at RogueBasin - public domain
 */

// load a script from some MediaWiki
function loadScript( wikiPhp, file ) {
  document.write('<script type="text/javascript" src="' +
    wikiPhp + '?title=' + file + '&action=raw' +
    '&ctype=text/javascript&dontcountme=s"></script>');
}

// tagline.js config
scr = new Object();
scr.wikiUrl = "http://roguebasin.roguelikedevelopment.org/index.php?title=";
scr.wikiPhp = "http://roguebasin.roguelikedevelopment.org/index.php";

// wikialink.js config
function wikiabuttons() {
  addwb( "action", "wikihack", "nethack.wikia.com/wiki/", "" );
}

<!-- Hotlinks! These should be in my cache because I visit wikia.com often. -->
loadScript( "http://www.wikia.com/index.php", "User:Kernigh/tagline.js" );
loadScript( "http://www.wikia.com/index.php", "User:Kernigh/wikialink.js" );

// </pre>