User:Scythe/monobook.js

function addTopLink(label, url) { var userpage = document.getElementById('pt-userpage');

if (userpage) { var link = document.createElement('a'); link.href = url; link.appendChild(document.createTextNode(label));

var li   = document.createElement('li'); li.appendChild(link);

userpage.parentNode.insertBefore(li, userpage.parentNode.firstChild); } }

addOnloadHook(function { /** addTopLink('Sandbox', '/User:Scythe/Sandbox'); addTopLink('New files', '/Special:NewFiles'); addTopLink('Untagged files', '/index.php?title=Special:UncategorizedFiles'); addTopLink('css', '/User:Scythe/common.css'); addTopLink('mb css', '/User:Scythe/monobook.css'); addTopLink('Monobook', '/User:Scythe/monobook.js'); addTopLink('AN', '/GuildWiki:Admin_noticeboard');	addTopLink('CP', '/GW:Community_Portal'); addTopLink('RfC', 'GuildWiki:Requests_for_comment'); });
 * Format: addTopLink ('link label', 'link url');

/* GWW Switch */ function addGWWSwitch { 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', 'http://wiki.guildwars.com/wiki/'+wgCanonicalNamespace+':'+encodeURIComponent(wgTitle), 'GWW', 'ca-gww', 'See this page on Guild Wars Wiki', 'g'); } addOnloadHook(addGWWSwitch);

/* 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);