User:Anja Astor/monobook.js

From Guild Wars Wiki
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*
==Poke/GWWT stuff==
*/

 /**** Guild Wars Wiki Tools
  * (c) 2007 by Patrick Westerhoff [poke]
  */
 var head = document.getElementsByTagName( 'head' )[0];
 head.appendChild( document.createElement( 'script' ) );
 head.lastChild.src  = '/index.php?title=User:Poke/GuildWarsWikiTools.js&action=raw&ctype=text/javascript';
 head.lastChild.type = 'text/javascript';

 /**** Guild Wars Wiki Tools - GuildWiki Switch
  * (c) 2007 by Patrick Westerhoff [poke]
  */
 function gwwtGuildWikiSwitch ()
 {
   if ( wgNamespaceNumber < 100 )
   {
     url = 'http://gw.gamewikis.org/wiki/' + wgCanonicalNamespace + ':' + encodeURIComponent( wgTitle );
     new PortletArea( 'p-cactions' ).addItem( 'gwwt-gwiki', 'GWiki', url, 'See this page on GuildWiki' );
   }
 }
 hookEvent( 'load', gwwtGuildWikiSwitch );

 function changeFavicon( url )
 {
   var head  = document.getElementsByTagName( 'head' )[0];
   var link  = document.createElement( 'link' );
   link.rel  = 'shortcut icon';
   link.type = "image/x-icon";
   link.href = url;
   var links = head.getElementsByTagName( 'link' );
  
   for ( var i = 0; i < links.length; i++ )
   {
     if ( links[i].rel == 'shortcut icon' )
     {
        head.removeChild( links[i] );
        break;
     }
   }
   head.appendChild( link );
 }

 // load function for gwwt, put new stuff inside here
 gwwtLoadAfter = function()
 {
   var personalPortlet = new PortletArea( 'p-personal' );
   personalPortlet.addItem( null, 'deletion', '/wiki/GWW:DEL', 'List of candidates for deletion', null, document.getElementById( 'pt-userpage' ) );
   personalPortlet.addItem( null, 'css', '/wiki/User:Anja_Astor/monobook.css', 'Monobook.css', null, document.getElementById( 'pt-userpage' ) );
   personalPortlet.addItem( null, 'js', '/wiki/User:Anja_Astor/monobook.js', 'Monobook.js', null, document.getElementById( 'pt-userpage' ) );
 }

/**** Sysop automaticPatrol
 * (c) 2008 by Patrick Westerhoff [poke]
 */
addScript( 'User:Poke/GuildWarsWikiTools/automaticPatrol.js' );
hookEvent( 'load', function ()
{ gwwtAutomaticPatrol( true ); } );