User:Handheld/global.js

var hereUserHandheld = encodeURI(wgPageName);

function fixCrapSearch(event) { "use strict"; var suchText = document.getElementById("searchInput").value; if (suchText.indexOf(":") != -1) { event.preventDefault; //event.stopPropagation; window.location = '/wiki/' + encodeURI(suchText); } }

if ( skin == "oasis" ) { // HERE BE LE MONOBOOK BUTTON; WE DON'T NEED NO STARTING A WIKI document.getElementById("notificationsEntryPoint").nextSibling.nextSibling.addEventListener("click", function(event) {                                                                                  "use strict";                                                                                   event.preventDefault;                   document.cookie = 'useskin=monobook; domain=wikia.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';                                              document.cookie = 'useskin=toast; expires=Fri, 31 Dec 1999 23:59:59 GMT;';                                              window.location.replace('/wiki/' + hereUserHandheld + '?useskin=monobook');  }); document.getElementById("searchForm").addEventListener ("submit", fixCrapSearch); document.body.style.width = "auto";

} else {

document.getElementById("searchform").addEventListener ("submit", fixCrapSearch);

addPortletLink ('p-cactions', "javascript:document.cookie = 'useskin=monobook; domain=wikia.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;'; window.location.replace('/wiki/' + hereUserHandheld + '?useskin=monobook');", 'mono'); addPortletLink ('p-cactions', "javascript:document.cookie = 'useskin=wikiamobile; domain=wikia.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;'; window.location.replace('/wiki/' + hereUserHandheld + '?useskin=wikiamobile');", 'mobo'); addPortletLink ('p-cactions', "javascript:document.cookie = 'useskin=oasis; domain=wikia.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;'; window.location.replace('/wiki/' + hereUserHandheld + '?useskin=oasis');", 'oasis');

var uplink = document.createElement("img"); uplink.setAttribute( "onclick", "window.scrollTo(0, 0);" ); uplink.setAttribute( "alt", "↑" ); uplink.setAttribute( "src", "http://img2.wikia.nocookie.net/__cb20140413102022/mh3u/de/images/a/a1/Uplink.png" ); document.body.appendChild(uplink); document.body.setAttribute( "onscroll", 'uplink.setAttribute( "style" , "position:absolute; left:"+( window.pageXOffset + window.innerWidth * 7 / 10 )+"px; top:"+( window.pageYOffset + window.innerHeight * 5 / 6 )+"px; z-index:8;" );' );

document.getElementById("firstHeading").addEventListener ("click", function { document.body.style.width = "720px"; });

}