User:The Scythe Has Fallen/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 {   /**     * Format: addTopLink ('link label', 'link url');     **/        addTopLink('Sandbox', '/User:The Scythe Has Fallen/Sandbox');        addTopLink('New files', '/Special:NewFiles');        addTopLink('Untagged files', '/index.php?title=Special:UncategorizedFiles');        addTopLink('css', '/User:The Scythe Has Fallen/common.css');        addTopLink('mb css', '/User:The Scythe Has Fallen/monobook.css');        addTopLink('Monobook', '/User:The Scythe Has Fallen/monobook.js');        addTopLink('AN', '/GuildWiki:Admin_noticeboard');	addTopLink('CP', '/GW:Community_Portal');        addTopLink('RfC', 'GuildWiki:Requests_for_comment'); });

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