User:Whiteknight/switcher.js

function AddToolboxLink(text, href, onclick, linkid) { var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; var link = document.createElement('a'); link.onclick = onclick; link.href = href; link.appendChild(document.createTextNode(text)); var li = document.createElement('li'); li.id = linkid; li.appendChild(link); tb.insertBefore(li, tb.firstChild); return; }

function WKInsertStyleLink { var url = "http://en.wikibooks.org/w/index.php?title=" + encodeURIComponent(mw.config.get('wgPageName')) + "&useskin=monobook"; AddToolboxLink('Change Stylesheet', url, null, 'tb-ss'); }

$(WKInsertStyleLink);