Jump to content

User:Manishearth/GadgetUS.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//if() this block later

function importScriptPurged(page) {
	// Forces purging without reading cookie
	var devTail="&rand="+parseInt(Math.random()*100000);
	var uri = mw.config.get('wgScript') + '?title=' +encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'+devTail;
	return mw.loader.load(uri);
}
function importScriptPurged(page,seed) {
	// Forces purging without reading cookie-- but purges to a seed. For example, put the date in the seed to have it purge once a day
	var devTail="&rand="+seed;
	var uri = mw.config.get('wgScript') + '?title=' +encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') + '&action=raw&ctype=text/javascript'+devTail;
	return mw.loader.load(uri);
}
importScriptPurged("User:"+mw.config.get('wgUserName')+"/GadgetUSimports.js")
if(mw.config.get('wgPageName')=="Special:Scripts"){
var importsHeader="DO NOT EDIT\nThis script must be edited only be the GadgetUS script"
importScriptPurged("User:Manishearth/GadgetUS/USlist.js",new Date().getDate())
importScript("User:Manishearth/GadgetUS/generate.js")

}