User:Penguin-Pal/global.js

/* imports */

importArticles({	type: "script",	articles: [		"u:dev:EntityConvert/code.js"	] });

/*	this script loads w:c:cps05box:MediaWiki:ChatAwaySecurity.js the function below is based on the following StackOverflow discussion, as replied by Hrant Khachatrian http://stackoverflow.com/questions/6340160/how-to-get-the-references-of-all-already-opened-child-windows#answer-6341534 ChatEntryPoint.onClickChatButton = function (a) { var b = window.UserLoginModal; if (window.wgUserName) { (function {			var openedWindows = {},				o = window.open; // saving original function			window.open = function(url,name,params){				openedWindows[name] = o(url,name,params);			}			window.open(a, "wikiachat", window.wgWikiaChatWindowFeatures);			openedWindows["wikiachat"].addEventListener("load", function { s = document.createElement("script"); s.type = "text/javascript"; s.src = "http://cps05box.wikia.com/wiki/index.php?title=ChatAwaySecurity.js&oldid=5484&action=raw&ctype=text/javascript"; openedWindows["wikiachat"].document.head.appendChild(s); });			delete openedWindows;			delete window.open;		}); // perhaps moving this to a function, and apply it also on unload, to allow F5ing? } else { b.show({           origin: "chat",            callback: ChatEntryPoint.onSuccessfulLogin        }) } }