User:PedroM/global.js

/* Fix crappy search */ document.forms[0].addEventListener ("submit", function(event) { "use strict";  var suchText = this["query"].value;  if (suchText.indexOf(":") != -1) {    event.preventDefault;    //event.stopPropagation;    var loc = window.location.href;    window.location = loc.substring(0, 6 + loc.indexOf("/wiki/")) + encodeURI(suchText);  } });

/* fu AjaxRC; ©452 */ $(function{	localStorage.setItem('AjaxRC-refresh', false);	$("#ajaxRefresh").remove;	if (typeof ajaxTimer != "undefined") clearTimeout(ajaxTimer); });

/* RTEdit */ var pedroVE = document.getElementById("ca-ve-edit"); if (pedroVE != null) {

if (navigator.platform == "iPhone") { var pedroMW = document.createElement("a"); document.createElement("li").appendChild(pedroMW); pedroMW.href = pedroVE.href.replace('veaction=edit', "action=edit&useeditor=mediawiki"); pedroMW.innerHTML = "SourceEditor"; pedroVE.parentNode.parentNode.insertBefore(pedroMW.parentNode,pedroVE.parentNode); }

var pedroRTE = document.createElement("a"); document.createElement("li").appendChild(pedroRTE); pedroRTE.href = pedroVE.href.replace('veaction=edit', "action=edit&useeditor=wysiwyg"); pedroRTE.innerHTML = "RichTextEditor"; pedroVE.parentNode.parentNode.insertBefore(pedroRTE.parentNode,pedroVE.parentNode); }

if ( navigator.platform == "iPhone"    && window.location.href.indexOf ("useeditor") == -1 ) { $.getScript( "/load.php?mode=articles&articles=u:dev:MediaWiki:MobileEditor.js&only=scripts" ); }

document.getElementById("wds-company-logo-fandom-white").addEventListener("click", function(event) {   "use strict";    //event.preventDefault;    //event.stopPropagation;    document.cookie = 'useskin=oasis; domain=fandom.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';    document.cookie = 'useskin=oasis; domain=wikia.org; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';    document.cookie = 'useskin=toast; expires=Fri, 31 Dec 1999 23:59:59 GMT;';    document.cookie = 'tracking-opt-in-status=rejected; domain=fandom.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';    document.cookie = 'tracking-opt-in-status=rejected; domain=wikia.org; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';    document.cookie = 'tracking-opt-in-version=2; domain=fandom.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;';    document.cookie = 'tracking-opt-in-version=2; domain=wikia.org; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT;'; //window.location.replace('/wiki/' + encodeURI(wgPageName)); alert("set cookies."); });