User:GW-Shadowphoenix/monobook.js

/**** Guild Wars Wiki Tools - GuildWiki Switch * (c) 2007 by Patrick Westerhoff [poke] */ function gwwtGuildWikiSwitch {  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', gwwtGuildWikiSwitch ); /* adds a Purge button to your toolbar */ // addPurge addOnloadHook(function {    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 for this page', '0'); }); /*This does not currently work correctly */ // Originally based on http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510 //See WikiProject User scripts/Scripts/Show last diff // addLastDiff function addLastDiff {   addPortletLink('p-cactions', 'http://guildwars.wikia.com/index.php?title=' + wgPageName + "&diff=cur&oldid=prev", 'last', 'ca-last', 'Show most recent diff'); } addOnloadHook(addLastDiff);

// adds a 'block logs for this user' link to the toolbox bar // if the page is not in the User namespace, then no link is displayed; the link may display in the mainspace, but should not work // should on be used on a person's userpage

addOnloadHook(function {    if ( wgCanonicalNamespace == "User" && wgPageName.indexOf("/") == -1 ) {       url = wgServer + "/index.php?title=Special%3ALog&type=block&user=&page=" + wgPageName;       addPortletLink("p-tb", url, "Block logs for this user", "pt-logs");    } });

//

//

// Please leave the following line // user:Where/usertabs addOnloadHook(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     addPortletLink("p-cactions", wgServer + "/wiki/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks received", "ca-blog", "Blocks received by this user");  } });

addOnloadHook(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     addPortletLink("p-cactions", wgServer + "/index.php?title=Special:Log&type=block&user=" + username, "Blocks given", "", "Blocks by this user");

} });

addOnloadHook(function { if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {     var username = encodeURIComponent( wgTitle );     addPortletLink("p-cactions", wgServer + "/index.php?title=Special:Log&type=protect&user=" + username, "Protections", "", "Protections by this user");  } });

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