User:Nifky/global.js

///////////////////////////////////////////////////////////////////////////////////////////////////////////

// Wikipedia navigation popups // Code courtesy of "Lupin" of Wikipedia. // Source: http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js // Modified by "Eulalia458678" on Wikia central. // Source: http://www.wikia.com/index.php?title=User:Eulalia459678/global.js&action=edit&oldid=191383

///////////////////////////////////////////////////////////////////////////////////////////////////////////

// Tools/Navigation_popups document.write(' ');

newOption('popupAdminLinks', true);

/* From http://en.wikipedia.org/wiki/User:Manishearth/purger

My script purger for developers This script will bypass your browser's cache for only the scripts listed in a cookie. This speeds up development. For this script to work, all the imports you want this to apply to should go to Special:MyPage/imports.js ADD ALL IMPORTS THERE, even ones you don't want purged. This script will purge the scripts in the cookie and no more. The imports.js subpage is only so that the imports are executed after this script is executed. //Init stuff, nothing important if(!readCookie("devMode")){ createCookie("devMode","",365) } addOnloadHook(function{ addPortletLink("p-tb","javascript:createCookie('devMode',prompt('Change the autopurge pages: (Separate the script names with commas, please). \n Do NOT press cancel, or all the data in the cookie will be erased. Instead, press Ok.',readCookie('devMode')),365)","Purge scripts") // Sets the cookie with a prompt if clicked, the default text of the prompt is the current value of the cookie }); //OVERRIDE importScript function importScript(page) { // copy of importScript, except it allows purging var devTail="&rand="+parseInt(Math.random*100000); //A random tail devTail2=(readCookie("devMode").toLowerCase.indexOf(page.toLowerCase)!=-1)?devTail :''; //Decide if the cookie tells us to purge var uri = wgScript + '?title=' +encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'+devTail2; //Add the tail return importScriptURI(uri); } function importScriptPurged(page) { // Forces purging without reading cookie var devTail="&rand="+parseInt(Math.random*100000); var uri = wgScript + '?title=' +encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'+devTail; return importScriptURI(uri); } //Force purge imports.js, any changes made there will go live immediately importScriptPurged("User:"+wgUserName+"/imports.js") function createCookie(name,value,days) { if (days) { var date = new Date; date.setTime(date.getTime+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString; }	else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); }	return null; }