User:Handheld/global.js

if(document.cookie.indexOf("chick")!= -1) { function work(ref) { "use strict"; var anchor = ""; if (ref.indexOf("#")!= -1) { ref = ref.split("#"); anchor = "#" + ref[1]; ref = ref[0]; }   if (ref.indexOf("useskin=") == -1) { if (ref.indexOf("?")!= -1) { return ref + "&useskin=chick" + anchor; } else return ref + "?useskin=chick" + anchor; } else return ref + anchor; }

if(window.location.href.indexOf("useskin") == -1) window.location.href = work(window.location.href);

var worknode = document.createElement("input"); worknode.setAttribute("type","hidden"); worknode.setAttribute("name","useskin"); worknode.setAttribute("value","chick");

window.onload = (function {   "use strict";    var links = document.links;    for (var i = 0; i < links.length; i++)      if ( links[i].href.indexOf("/wiki/")!= -1 )        links[i].href = work(links[i].href);    var forms = document.forms;    for (var  i = 0; i < forms.length; i++)      forms[i].appendChild(worknode.cloneNode);  }); }

var youarehere = encodeURI(wgPageName); addPortletLink ('p-cactions', 'javascript:document.cookie = "useskin=chick; path = /; domain = .wikia.com; expires = Fri, 31 Dec 9999 23:59:59 GMT"; window.location.replace("/wiki/" + youarehere + "?useskin=chick");', 'chic'); addPortletLink ('p-cactions', 'javascript:document.cookie = "useskin=monobook; path = /; domain = .wikia.com; expires = Fri, 31 Dec 9999 23:59:59 GMT"; window.location.replace("/wiki/" + youarehere + "?useskin=monobook");', 'mono'); addPortletLink ('p-cactions', 'javascript:document.cookie = "useskin=wikiamobile; path = /; domain = .wikia.com; expires = Fri, 31 Dec 9999 23:59:59 GMT"; window.location.replace("/wiki/" + youarehere + "?useskin=wikiamobile");', 'mobile'); var uplink = document.createElement("a"); uplink.appendChild( document.createTextNode( "↑" ) ); uplink.setAttribute( "href", "#top" ); document.body.appendChild(uplink); document.body.setAttribute( "onscroll", 'uplink.setAttribute( "style" , "border:solid thin deepskyblue; padding:1px; position:absolute; left:"+( window.pageXOffset + window.innerWidth / 6 * 5 )+"px; top:"+( window.pageYOffset + window.innerHeight / 9 * 8 )+"px; z-index:8;" );' );