User:Skarmory/common.js

// Enable caching for resource loads, see User:SD0001/Making_user_scripts_load_faster, @revision 5 if (!/\bnocache=\b/.test(location.href)) { // Don't enable if nocache=1 url parameter is given var loadResource = function(page, sitename, ctype) { page = page.replace(/special:mypage/i, 'User:' + mw.config.get('wgUserName')); return $.get(			'https://' + sitename + '/w/api.php?titles=' + page + // page is already URL-encoded			'&origin=*&format=json&formatversion=2&uselang=content&maxage=86400&smaxage=86400' + 			'&action=query&prop=revisions|info&rvprop=content&rvlimit=1'		).then(function(apiResponse) {			var apiPage = apiResponse.query.pages[0];			if (apiPage.missing) {				return;			}			var content = apiPage.revisions[0].content;			if ((!ctype || ctype === 'text/javascript') && apiPage.contentmodel === 'javascript') {				if (apiPage.ns !== 2 && apiPage.ns !== 8) {					return $.Deferred.reject('Refused to load "' + page + '"@' + sitename + ': outside User and MediaWiki space');				}				var scriptTag = document.createElement('script');				scriptTag.innerHTML = content;				document.head.appendChild(scriptTag);		   } else if (ctype === 'text/css' && apiPage.contentmodel === 'css') {				mw.loader.addStyleTag(content); } else { return $.Deferred.reject('Refused to load "' + page + '"@' + sitename + ': content type mismatch'); }		});	};	var getSiteTitle = function(url) {		var siteRgx = /^(?:(?:https:)?\/\/(.*))?\/w\/index.php/.exec(url),			titleRgx = /\btitle=([^=?&]*)/.exec(url);		if (siteRgx && titleRgx && /\baction=raw\b/.test(url) && /\bctype=/.test(url)) {			return [titleRgx[1], siteRgx[1] || mw.config.get('wgServerName')];			} else return null;	};	window.importScript = function(page) {		loadResource(encodeURIComponent(page), mw.config.get('wgServerName'), 'text/javascript');	};	window.importStyleSheet = function(page) {		loadResource(encodeURIComponent(page), mw.config.get('wgServerName'), 'text/css');	};	var oldMwLoaderLoad = mw.loader.load;	mw.loader.load = function(url, type) {		var linkParts = getSiteTitle(url);		if (linkParts) {			loadResource(linkParts[0], linkParts[1], type);		} else {			oldMwLoaderLoad.apply(mw.loader, Array.prototype.slice.call(arguments));		}	};	var oldMwLoaderGetScript = mw.loader.getScript; mw.loader.getScript = function(url) { var linkParts = getSiteTitle(url); if (linkParts) { return loadResource(linkParts[0], linkParts[1], 'text/javascript'); } else { return oldMwLoaderGetScript.apply(mw.loader, Array.prototype.slice.call(arguments)); }	}; }

importScript('User:Evad37/rater.js'); // User:Evad37/rater importScript('User:Enterprisey/superjump.js'); //Linkback: User:Enterprisey/superjump.js Added by Script installer // importScript('User:Awesome Aasim/rcpatrol.js'); //Linkback: User:Awesome Aasim/rcpatrol.js Added by Script installer importScript('User:Eejit43/scripts/afcrc-helper.js'); // Backlink: User:Eejit43/scripts/afcrc-helper.js importScript('User:Gracenotes/rollback.js'); //Linkback: User:Gracenotes/rollback.js Added by Script installer // importScript('User:MPGuy2824/MoveToDraft.js'); //Linkback: User:MPGuy2824/MoveToDraft.js // importScript('User:Enterprisey/cv-revdel.js'); //Linkback: User:Enterprisey/cv-revdel.js Added by Script installer // importScript('User:Qwertyytrewqqwerty/DisamAssist.js'); //Linkback: User:Qwertyytrewqqwerty/DisamAssist.js Added by Script installer // importScript('User:Novem Linguae/Scripts/DraftCleaner.js'); //Linkback: User:Novem Linguae/Scripts/DraftCleaner.js Added by Script installer importScript( 'User:Ahecht/Scripts/pageswap.js' ); // Backlink: User:Ahecht/Scripts/pageswap importScript('User:TheTVExpert/rmCloser.js'); //Linkback: User:TheTVExpert/rmCloser.js Added by Script installer importScript('User:PleaseStand/userinfo.js'); //Linkback: User:PleaseStand/userinfo.js Added by Script installer // importScript('User:Enterprisey/user-tabs-on-contribs.js'); //Linkback: User:Enterprisey/user-tabs-on-contribs.js Added by Script installer // importScript('User:Ahecht/Scripts/draft-sorter.js'); //Linkback: User:Ahecht/Scripts/draft-sorter.js importScript('User:Novem Linguae/Scripts/CiteHighlighter.js'); //Linkback: User:Novem Linguae/Scripts/CiteHighlighter.js Added by Script installer // importScript('User:Danski454/stubsearch.js'); //Linkback: User:Danski454/stubsearch.js Added by Script installer // importScript('User:Wugapodes/Capricorn.js'); //Linkback: User:Wugapodes/Capricorn.js Added by Script installer // importScript('User:Evad37/duplinks-alt.js'); //Linkback: User:Evad37/duplinks-alt.js Added by Script installer // importScript('User:SD0001/DYK-helper.js'); //Linkback: User:SD0001/DYK-helper.js Added by Script installer importScript('User:Enterprisey/diff-permalink.js'); //Linkback: User:Enterprisey/diff-permalink.js Added by Script installer importScript('User:Nardog/MoveHistory.js'); //Linkback: User:Nardog/MoveHistory.js Added by Script installer window.hdedit_prefs = { 'eventToActivate': 'dblclick' // activate hdedit on double click }; importScript( 'User:The Evil IP address/hdedit.js' ); // Backlink: User:The Evil IP address/hdedit.js importScript('User:BrandonXLF/QuickEdit.js'); //Linkback: User:BrandonXLF/QuickEdit.js Added by Script installer importScript('User:MusikAnimal/scriptManager.js'); //Linkback: User:MusikAnimal/scriptManager.js Added by Script installer scriptsToManage = { "DisamAssist" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Qwertyytrewqqwerty/DisamAssist.js", "Shortdesc helper" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-Shortdesc-helper.js", "MoveToDraft" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:MPGuy2824/MoveToDraft.js", "cv-revdel" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Enterprisey/cv-revdel.js", "DraftCleaner" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Novem Linguae/Scripts/DraftCleaner.js", "rcpatrol" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Awesome Aasim/rcpatrol.js", "Wikibench" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Tzusheng/Wikibench-Editquality.js", "ReviewStatus" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Novem Linguae/Scripts/ReviewStatus.js", "OneClickArchiver" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Enterprisey/archiver.js", "CitationExpander" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-citations.js", "stubsearch" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Danski454/stubsearch.js", "RefRenamer" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Nardog/RefRenamer.js", "redirectcreator" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Awesome Aasim/redirectcreator.js", "Mass move" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Plastikspork/massmove.js", "duplinks" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Evad37/duplinks-alt.js", "DYK-helper" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:SD0001/DYK-helper.js", "GAN-helper" : "//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:SD0001/GAN-helper.js" }; // importScript('User:Enterprisey/archiver.js'); // Backlink: User:Enterprisey/archiver.js // importScript('User:SD0001/GAN-helper.js'); // Backlink: User:SD0001/GAN-helper.js // importScript('User:Awesome Aasim/redirectcreator.js'); // Backlink: User:Awesome Aasim/redirectcreator.js importScript('User:MJL/Archer.js'); // Backlink: User:MJL/Archer.js importScript('User:Joeytje50/JWB.js/load.js'); // Backlink: User:Joeytje50/JWB.js/load.js // importScript('User:Nardog/RefRenamer.js'); // Backlink: User:Nardog/RefRenamer.js // importScript('MediaWiki:Gadget-Shortdesc-helper.js'); // Backlink: MediaWiki:Gadget-Shortdesc-helper.js // importScript('MediaWiki:Gadget-citations.js'); // Backlink: MediaWiki:Gadget-citations.js // importScript('User:Novem Linguae/Scripts/ReviewStatus.js'); // Backlink: User:Novem Linguae/Scripts/ReviewStatus.js // importScript('User:Tzusheng/Wikibench-Editquality.js'); // Backlink: User:Tzusheng/Wikibench-Editquality.js importScript('User:SD0001/W-Ping.js'); // Backlink: User:SD0001/W-Ping.js // importScript('User:Plastikspork/massmove.js' ); //User:Plastikspork/massmove.js importScript('User:DannyS712/copyvio-check.js'); // Backlink: User:DannyS712/copyvio-check.js importScript('User:BilledMammal/MovePlus.js'); // Backlink: User:BilledMammal/MovePlus.js