User:Entropy/monobook.js

// links for admins and bcrats function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' Command Center '+ ' '+ 'Deletion'+ 'Banning'+ 'Master Log'+ 'New Pages</li>'+ '<li id=\>New Images</a></li>'+ '<li id=\>Block User</a></li>'+ '<li id=\>Prefix Index</a></li>'+ '<li id=\>User Rights</a></li>'+ '</ul> '; }

addOnloadHook(addBar);

// add Purge function addPurge {   var hist; var url; if (!(hist = document.getElementById('ca-history') )) return; if (!(url = hist.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),                  'purge', 'ca-purge', 'Purge server cache', '0'); }

addOnloadHook(addPurge);

// add Credits function addCredits {   var hist; var url; if (!(hist = document.getElementById('ca-history') )) return; if (!(url = hist.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1credits$2'),                  'credits', 'ca-credits', 'Display article credits', '0'); } addOnloadHook(addCredits);

/**** Guild Wars Wiki Tools - GuildWiki Switch * (c) 2007 by Patrick Westerhoff [User:poke] */

// GWW tab function gwwSwitch {  if ( wgNamespaceNumber < 100 ) {    var itemNode = document.createElement( 'li' ); itemNode.appendChild( document.createElement( 'a' ) ); itemNode.lastChild.href = 'http://wiki.guildwars.com/wiki/' + wgCanonicalNamespace + ':' + encodeURIComponent( wgTitle ); itemNode.lastChild.title = 'See this page on Guild Wars Wiki'; itemNode.lastChild.appendChild( document.createTextNode( 'GWW' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', gwwSwitch );

// GW2W tab function gw2wSwitch {  if ( wgNamespaceNumber < 100 ) {    var itemNode = document.createElement( 'li' ); itemNode.appendChild( document.createElement( 'a' ) ); itemNode.lastChild.href = 'http://wiki.guildwars2.com/wiki/' + wgCanonicalNamespace + ':' + encodeURIComponent( wgTitle ); itemNode.lastChild.title = 'See this page on Guild Wars 2 Wiki'; itemNode.lastChild.appendChild( document.createTextNode( 'GW2W' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', gw2wSwitch );

// PvX tab function pvxSwitch {  if ( wgNamespaceNumber < 100 ) {    var itemNode = document.createElement( 'li' ); itemNode.appendChild( document.createElement( 'a' ) ); itemNode.lastChild.href = 'http://www.pvxwiki.com/' + wgCanonicalNamespace + ':' + encodeURIComponent( wgTitle ); itemNode.lastChild.title = 'See this page on PvX Wiki'; itemNode.lastChild.appendChild( document.createTextNode( 'PvX' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', pvxSwitch );

// correct the favicon 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 ); }

LoadAfter = function { changeFavicon( 'http://images1.wikia.nocookie.net/gw/images/2/2c/GuildWiki_icon.ico' ); }

addOnloadHook(LoadAfter);