User:Cizagna/global.js

// ***************************************************************** function skinview { var skinlink = document.location.href; var antiskin;

if(skinlink.indexOf('?')==-1) skinlink += '?useskin='; else skinlink += '&useskin='; if(skin == 'monobook') antiskin = 'monaco'; else antiskin = 'monobook';

skinlink += antiskin;

if(skin == 'monobook') { addPortletLink('p-cactions', skinlink, antiskin, 'ca-skin'); skinlink += '&usetheme=custom'; addPortletLink('p-cactions', skinlink, 'custom', 'ca-skin'); } else addPageBarlink(skinlink,antiskin,'control_skin'); } addOnloadHook(skinview)

function addPageBarlink(url,text,id) { var pc = document.getElementById('page_controls'); if(pc.length < 1) { return;} var d = document.createElement('div'); var link = document.createElement('a'); link.href = url; link.appendChild(document.createTextNode(text)); var nuli = document.createElement('li'); nuli.id = id; nuli.appendChild(d); nuli.appendChild(link); pc.appendChild(nuli); }