User:AuroratheCat/common.js

// ************************* COPY EVERYTHING BETWEEN THESE LINES *************************

// ==================================================================================================== // API GUI Plugin for Wikia common.js file // ====================================================================================================

// Define Handler function apiGUI {

} apiGUI.open = function { sessionStorage.apiGUIcontroller = 1; apiGUI.controller = window.open("","APIGUI Controller","width=500,height=500,scrollbars=no"); nocache = Math.random; nocache *= 1000000000; nocache = Math.round(nocache); httpget = null; httpget = new XMLHttpRequest; httpget.open("GET", wgServer+"/wiki/User:"+wgUserName+"/Controller.html?action=raw&nocache="+nocache, false); httpget.send( null ); httpresult = $.parseHTML(httpget.responseText); apiGUI.controller.document.write(httpget.responseText); apiGUI.button; apiGUI.controller.close = close; apiGUI.controller.onbeforeunload = function { apiGUI.close; }   apiGUI.controller.document.title = "APIGUI Controller"; } apiGUI.close = function { sessionStorage.apiGUIcontroller = 0; apiGUI.button; } apiGUI.button = function { if (sessionStorage.apiGUIcontroller == 1) { apiGUI.span.style.color = "#99ff99"; document.title = "APIGUI Target - " + document.title; }   else { apiGUI.span.style.color = "#ff9999"; } } apiGUI.li = document.createElement('li'); apiGUI.a = document.createElement('a'); apiGUI.span = document.createElement('span'); apiGUI.a.href = "#"; apiGUI.a.onclick = function { apiGUI.open; }; apiGUI.span.innerHTML="API Menu"; $(apiGUI.li).append(apiGUI.a); $(apiGUI.a).append(apiGUI.span); apiGUI.toolsbar = $(".tools")[0]; $(apiGUI.toolsbar).append(apiGUI.li); apiGUI.button; //import controller code importScriptPage("User:"+wgUserName+"/Controller.js"); // ==================================================================================================== // END API GUI Plugin for Wikia common.js file // ====================================================================================================

// ************************* COPY EVERYTHING BETWEEN THESE LINES *************************