Jump to content

User:Izno/common.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.
function load_script(script) {
	mw.loader.load('/w/index.php?title=' + script + '&action=raw&ctype=text/javascript');
}

function load_scripts (scripts) {
	scripts.forEach(load_script);
}

const all_spaces_scripts = [
	'User:Evad37/rater.js', // [[User:Evad37/rater]]
	'User:Izno/persistentParams.js',
	'User:Qwertyytrewqqwerty/DisamAssist.js', // [[User:Qwertyytrewqqwerty/DisamAssist.js]]
	'User:Frietjes/findargdups.js', // [[User:Frietjes/findargdups]]
	'User:SD0001/quickViewDeleted.js', // [[User:SD0001/quickViewDeleted.js]]
	'User:Izno/unreliable.js', // [[User:Headbomb/unreliable]] and by request [[User:Headbomb/unreliable.js]]
	// 'User:PerfektesChaos/js/lintHint/r.js', // [[User:PerfektesChaos/js/lintHint]]
];

load_scripts(all_spaces_scripts);

if (mw.config.get('wgPageName') !== 'Special:RecentChanges'
	&& mw.config.get('wgPageName') !== 'Special:RecentChangesLinked'
	&& mw.config.get('wgCanonicalSpecialPageName') !== 'Special:Recentchangeslinked') {
	load_script('User:Bradv/Scripts/ExpandDiffs.js'); // [[User:Bradv/Scripts/ExpandDiffs]]
}

if( mw.config.get('wgNamespaceNumber') === 0 ) {
	
	const mainspace_scripts = [
		'User:Ohconfucius/script/MOSNUM_dates.js', // [[User:Ohconfucius/script/MOSNUM dates.js]]
		'User:Shubinator/DYKcheck.js', // [[User:Shubinator/DYKcheck]]
		'User:Trappist_the_monk/HarvErrors.js', // [[User:Trappist the monk/HarvErrors]]
	];

	load_scripts(mainspace_scripts);
}
else {
	
	const otherspace_scripts = [
		'User:Jackmcbarn/editProtectedHelper.js', //[[User:Jackmcbarn/editProtectedHelper.js]]
		'User:MusikAnimal/responseHelper.js', // [[User:MusikAnimal/responseHelper]]
		'User:Newslinger/Notifier.js', // [[User:Newslinger/Notifier.js]]
		'User:Bellezzasolo/Scripts/arb.js', // [[User:Bellezzasolo/Scripts/arb]]
		'User:Elli/OneClickArchiver.js', // [[User:Elli/OneClickArchiver]]
		'User:Andrybak/Scripts/Archiver.js', // [[User:Andrybak/Scripts/Archiver]]
		'User:Enterprisey/delsort.js', // [[User:Enterprisey/delsort]]
		'User:Enterprisey/easy-brfa.js', // [[User:Enterprisey/easy-brfa]]
		'User:GeneralNotability/spihelper.js', // [[User:GeneralNotability/spihelper]]
		'User:L235/culoghelper-personaltesting.js', // [[User:L235/culoghelper-personaltesting.js]]
		'User:GeneralNotability/InvestorGoat.js', // [[User:GeneralNotability/InvestorGoat.js]]
		'User:GeneralNotability/mark-locked.js', // [[User:GeneralNotability/mark-locked.js]]
		'User:Ingenuity/AbuseFilterContribs.js', // [[User:Ingenuity/AbuseFilterContribs]]
	];
	
	load_scripts(otherspace_scripts);
}