User:DatGuy/common.js: Difference between revisions – Wikipedia

From Wikipedia, the free encyclopedia

Content deleted Content added


 

Line 37: Line 37:

}

}

if ([2, 3].includes(ns)) {

if ([2, 3].includes(ns)) {

start.load(‘[[User:PleaseStand/userinfo.js’);

start.load(‘[[User:PleaseStand/userinfo.js’);

start.load(‘[[User:Mr. Stradivarius/gadgets/SpamUserPage.js]]’);

start.load(‘[[User:Mr. Stradivarius/gadgets/SpamUserPage.js]]’);

}

}


Latest revision as of 10:17, 2 December 2025

mw.hook('start.ready').add(start => {
	const action = mw.config.get('wgAction');
	const diff = mw.config.get('wgDiffNewId') && mw.config.get('wgDiffOldId');
	const ns = mw.config.get('wgNamespaceNumber');
	const page = mw.config.get('wgPageName');
	const special = mw.config.get('wgCanonicalSpecialPageName');

	if (action === 'edit') {
		start.load('[[User:Js/ajaxPreview.js]]');
	}
	if (action === 'history') {
		start.load('[[User:Gary/highlight my username in history.js]]');
		start.load('[[User:Enterprisey/url-select-revdel.js]]');
	}
	if (action !== 'watchlist') {
		start.load('[[User:Aaron Liu/Watchlyst Greybar Unsin.js]]');
	}
	if (action === 'history' || diff || ['Contributions', 'DeletedContributions', 'Recentchanges', 'Undelete', 'Watchlist'].includes(special)) {
		start.load('[[User:Daniel Quinlan/Scripts/Unfiltered.js]]');
	}

	if (diff) {
		start.load('[[User:Nardog/SmartDiff.js]]');
	}
	
	if ([0, 1, 2].includes(ns)) {
		start.load('[[User:Nardog/MoveHistory.js]]');
	}
	if (ns === 0) {
		start.load('[[User:Ais523/stubtagtab2.js]]');
	}
	if ([0, 118].includes(ns)) {
		start.load('[[User:Novem Linguae/Scripts/CiteHighlighter.js]]');
	}
	if ([0, 1, 118, 119].includes(ns)) {
		start.load('[[User:Evad37/rater.js]]');
	}
	if ([2, 3].includes(ns)) {
		start.load('[[User:PleaseStand/userinfo.js]]');
		start.load('[[User:Mr. Stradivarius/gadgets/SpamUserPage.js]]');
	}
	if (ns % 2 === 1 || ns == 4) {
		start.load('[[User:Pythoncoder/voteSymbols.js]]');
		start.load('[[User:DaxServer/DiscussionCloser.js]]');
		start.load('[[User:Novem Linguae/Scripts/VoteCounter.js]]');
		start.load('[[User:Awesome Aasim/discussiontoolswordcount.js]]');
	}
	if (ns % 2 === 1) {
		start.load('[[User:Jackmcbarn/editProtectedHelper.js]]');
		if (mw.config.get('wgCategories').includes('Requested moves')) {
			start.load('[[User:TheTVExpert/rmCloser.js]]');
		}
	}
	if (ns === 3) {
		start.load('[[User:Enterprisey/unblock-review.js]]');
		start.load('[[User:Bellezzasolo/Scripts/arb.js]]');
		start.load('[[User:DatGuy/twinkle-config.js]]');
	}
	if ([4, 14].includes(ns)) {
		start.load('[[User:Daniel Quinlan/Scripts/SockDecay.js]]');
	}
	if (ns === 4) {
		start.load('[[User:MusikAnimal/responseHelper.js]]');
	}

	if (page.startsWith('Wikipedia:Articles for deletion/')) {
		start.load('[[User:Enterprisey/delsort.js]]');
	}
	if (page.startsWith('Wikipedia:Bots/')) {
		start.load('[[User:Enterprisey/easy-brfa.js]]');
	}
	if (page.startsWith('Wikipedia:Sockpuppet investigations/')) {
		start.load('[[User:DatGuy/spihelper.js]]');
		start.load('[[User:Daniel Quinlan/Scripts/SockTags.js]]');
	}
	if (page.startsWith('Wikipedia:Requests for permissions/')) {
		start.load('[[User:MusikAnimal/userRightsManager.js]]');
	}

	if (['Watchlist', 'Recentchanges', 'Contributions', 'Recentchangeslinked'].includes(special) || action === 'history') {
		inspectText = "+";
		showText = "+";
		hideText = "-";
		start.load('[[User:Writ Keeper/Scripts/commonHistory.js]]');
	}
	if (special === 'AbuseFilter') {
		start.load('[[User:Suffusion of Yellow/batchtest-plus-core.js]]');
		start.load('[[User:Suffusion of Yellow/filterNotes.js]]');
	}
	if (['Blankpage', 'AbuseFilter', 'AbuseLog'].includes(special)) {
		start.load('[[User:Suffusion of Yellow/FilterDebugger.js]]');
	}
	if (special === 'Contributions') {
		start.load('[[User:Writ Keeper/Scripts/massRollback.js]]');
		start.load('[[User:Writ Keeper/Scripts/massRevdel.js]]');
	}
	if (['Blankpage', 'Contributions', 'IPContributions', 'Log'].includes(special) || ns === 3) {
		start.load('[[User:Daniel Quinlan/Scripts/RangeHelper.js]]');
	}
	if (special === 'CheckUser') {
		start.load('[[User:Dbeef/cplus.js]]');
	}
	if (special === 'CheckUserLog') {
		start.load('[[User:Amalthea/culoghelper.js]]');
	}

	if (!mw.config.get('wgCurRevisionId')) {
		start.load('[[User:SD0001/quickViewDeleted.js]]');
	}
	
	// Might compartmentalise these ones later
	start.load('[[User:Writ Keeper/Scripts/deletionFinder.js]]');
	start.load('[[User:Suffusion of Yellow/filter-highlighter.js]]');
	start.load('[[User:GeneralNotability/InvestorGoat.js]]');
	// mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Bellezzasolo/Scripts/subpages.js'); //Linkback: [[User:Bellezzasolo/Scripts/subpages.js]] Added by Script installer
	// mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:GeneralNotability/cumarkips.js'); // Marks off-limit IPs
});

// Add link to Bullseye through MoreMenu
$(function () {
	mw.hook('moremenu.ready').add(function (config) {
	  const isIP = mw.util.isIPAddress(config.targetUser.name, false);
	  if (isIP) {
	  	MoreMenu.addSubmenuLink('user', 'ip-lookup', 'Bullseye', 'https://bullseye.toolforge.org/ip/' + config.targetUser.encodedName);
	  }
	});
});

Leave a Comment

Your email address will not be published. Required fields are marked *

Exit mobile version