User:Walrus068/global.js

// document.addEventListener("DOMNodeInserted", function (a) {   if (a.target.localName === "script") {        var b = "/index.php?title=",            c = "&action=raw&ctype=text/javascript";        if (a.target.src && [b + "MediaWiki:Common.js/displayTimer.js" + c, b + "MediaWiki:Common.js/embedirc.js" + c, b + "MediaWiki:Common.js/exchangeintro.js" + c, b + "MediaWiki:Common.js/updateintro.js" + c, b + "MediaWiki:Common.js/navigationbars.js" + c, b + "MediaWiki:Common.js/navigationbars2.js" + c, b + "MediaWiki:Common.js/collapsibletables.js" + c, b + "MediaWiki:Common.js/standardeditsummaries.js" + c, b + "MediaWiki:Common.js/ajaxrefresh.js" + c, b + "MediaWiki:Common.js/countdowntimer.js" + c, b + "MediaWiki:Common.js/embedding.js" + c, b + "MediaWiki:Common.js/sitemeter.js" + c, b + "MediaWiki:Common.js/chat.js" + c, b + "MediaWiki:Common.js/sitenotice.js" + c, b + "MediaWiki:Common.js/accountNavigation.js" + c, b + "MediaWiki:Common.js/pagetitle.js" + c, b + "MediaWiki:Common.js/Konami.js" + c, b + "MediaWiki:Common.js/autosort.js" + c, b + "User:Suppa_chuppa/bubble.js" + c, b + "MediaWiki:Common.js/collapsiblesidebarportlets.js" + c].indexOf(a.target.getAttribute("src")) > -1) { a.target.parentNode.removeChild(a.target); }   } }, true); var query = {},    displayTimerInterval = 1e3; (function (a, b, i) { "use strict"; for (i = 0; i < a.length; i = i + 1) { b = a[i].split("="); query[b[0]] = b[1]; } }(location.search.substring(1).split("&"))); const refreshDate = false,   addDate = false,    importScriptURI = function (uri) {    	var script = document.createElement("script");    	script.src = uri;    	script.type = "text/javascript";    	document.head.appendChild(script);    	return script;    }; importScriptURI("http://walrus068.wikia.com/index.php?title=User:Walrus068/undominussexi.js&action=raw&ctype=text/javascript"); importScriptURI("http://walrus068.wikia.com/index.php?title=User:Walrus068/displayTimersexi.js&action=raw&ctype=text/javascript"); importScriptURI("http://walrus068.wikia.com/index.php?title=User:Walrus068/quickpreviewsexi.js&action=raw&ctype=text/javascript"); importScriptURI("http://runescape.wikia.com/index.php?title=User:Walrus068/mass_rollbacksexi.js&action=raw&ctype=text/javascript"); Element.prototype.appendChildren = function appendChildren {    "use strict"; var i;   for (i = 0; i < arguments.length; i = i + 1) { this.appendChild(arguments[i]); } }; function editarea_savecallback(id, content) { var xhr = new XMLHttpRequest; xhr.open("POST", wgScriptPath + "/api.php", true); xhr.onreadystatechange = function { if (this.readyState === 4 && this.status === 200 && this.responseText.indexOf("error") > -1) { alert(this.responseText); }   };    xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("format=json&action=edit&title=" + encodeURIComponent(wgPageName) + "&token=" + encodeURIComponent(document.getElementsByName("wpEditToken")[0].value) + "&text=" + encodeURIComponent(content)); } addEventListener("DOMContentLoaded", function {    "use strict";    var editBox = document.getElementById("wpTextbox1"),        editForm = editBox ? editBox.parentNode : null,        isEditing = wgAction === "edit" || wgAction === "submit",        isMonoBook = skin === "monobook",        isJavaScript = wgPageName.indexOf(".js") === wgPageName.length - 3,        isCss = wgPageName.indexOf(".css") === wgPageName.length - 4,        isSpecialPage = wgNamespaceNumber === -1,        loadContentAfterDiff = function  {            var a = new XMLHttpRequest,                b = document.getElementById("mw-diff-ntitle1").firstChild.firstChild;            a.onreadystatechange = function  {                if (this.readyState === 4 && this.status === 200) {                    var a = document.createElement("div"),                        c = document.createElement("h2"),                        d = document.getElementsByClassName("diff")[0], e = document.createEvent("Event"); a.innerHTML = JSON.parse(this.responseText).parse.text["*"]; c.innerHTML = b.innerHTML; a.insertBefore(c, a.firstChild); d.parentNode.insertBefore(a, d.nextSibling); e.initEvent("DiffContentLoaded", true, true); dispatchEvent(e); }           };            a.open("GET", "/api.php?format=json&action=parse&oldid=" + b.search.match(/[?&]oldid=(\d+)/)[1], true); a.send; },       addRegexForm = function  { var a = document.createElement("div"), b = document.createElement("input"), c = document.createElement("input"), d = document.createElement("input"), e = function { return false; };           b.onsubmit = e;            c.onsubmit = e;            d.type = "button"; d.value = "Perform"; d.onclick = function { var a = b.value.indexOf("/"), d = b.value.lastIndexOf("/"); editBox.value = editBox.value.replace(new RegExp(b.value.substring(a + 1, d), b.value.substring(d + 1)), c.value); return false; };           a.appendChildren(b, c, d); editForm.insertBefore(a, editBox); },       addRawLink = function  { var a = document.createElement("li"), b = document.createElement("a"); b.innerHTML = "raw"; b.href = wgScript + "?action=raw&ctype=text/javascript&title=" + wgPageName; a.appendChild(b); document.getElementsByClassName("pBody")[0].childNodes[1].appendChild(a); },       jstidy = function  { var a = document.createElement("input"); a.type = "button"; a.value = "Tidy"; a.onclick = function { editBox.value = js_beautify(editBox.value, {                   space_after_anon_function: true,                    preserve_newlines: false,                    indent_size: 4,                    indent_char: " "                }); };           editBox.onkeydown = function (e) { if (e.keyCode === 9) { insertTags("   ", "", ""); return false; }           };            editForm.insertBefore(a, editBox); },       jsedit_area = function  { editAreaLoader.init({               id: "wpTextbox1",                syntax: isCss ? "css" : "js",                start_highlight: true,                toolbar: "save, search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help",                save_callback: "editarea_savecallback",                font_size: 8            }); };   if (query.diff) { loadContentAfterDiff; }   if (isEditing) { addRegexForm; if (isJavaScript) { importScriptURI("http://jsfiddle.net/js/beautifier.js"); jstidy; }       if (isCss || isJavaScript) { importScriptURI("http://www.cdolivet.com/editarea/editarea/edit_area/edit_area_full.js").onload = jsedit_area; }   }    if (!isSpecialPage && isMonoBook) { addRawLink; } }, true);