User:Vastmine1029/global.js

// Show all announcements except those from the following [city_id] wikis window.announcementsIgnore = { option: 'opt-in-all', exceptWikiIds: [ 2502419, /* the-avocados */ 2009968, /* blox-fruits */ 2170197, /* bgs-community-content */ 1435365, /* sing */ 571430 /* wingsoffire */ ] };

importArticles({   type: 'script',    articles: [    	'u:dev:MediaWiki:AjaxBatchDelete.js',    	'u:dev:MediaWiki:AnnouncementsIgnore.js',    	'u:dev:MediaWiki:BlockLookup.js',    	/*'u:dev:MediaWiki:BlockSummary.js',*/    	'u:dev:MediaWiki:DisableCode/code2.js',    	'u:dev:MediaWiki:Discussions Delete All/code.js',        'u:dev:MediaWiki:DisplayTimer/code.js',		'u:dev:MediaWiki:LastEdited/code.js',		'u:dev:MediaWiki:MassBlock/code.js',		'u:dev:MediaWiki:MassEdit/code.js',		'u:dev:MediaWiki:MarkBlocked.js',		'u:dev:MediaWiki:PortableCSSPad/code.js',		/*'u:dev:MediaWiki:QuickBarPageTools.js',*/		'u:dev:MediaWiki:QuickDiff/code.js',		'u:dev:MediaWiki:Rollback/code.js',		'u:dev:MediaWiki:ShowUserGroups.js',		'u:dev:MediaWiki:Status/code.js',		'u:dev:MediaWiki:SyntaxHighlight.js',		'u:dev:MediaWiki:ThemeToggler.js',		'u:dev:MediaWiki:UserAccountAge/code2.js',		/*'u:dev:MediaWiki:UserAndIPTools.js', - Not compatible*/ 'u:dev:MediaWiki:WHAM/code.2.js', 'User:Vastmine1029/BlockSummaryTest.js', 'User:Vastmine1029/common.js' ] });

/* Credits to joritochip :) */ mw.hook("wikipage.content").add(function($content) { var links = $('#mw-content-text a.new'); links.each(function(index, element){       if (!$(element).attr('href')) {            var title = $(element).attr('title');            if (title.startsWith('User:') && title.endsWith('(page does not exist)')) {                title = title.slice(0, -22);                var decodedURL = mw.util.getUrl(title);                $(element).removeAttr('data-uncrawlable-url');                $(element).attr('href', decodedURL);            }        }    }); }); mw.loader.using('mediawiki.api', function { 'use strict'; var user = mw.config.get('wgRelevantUserName'); if (		window.DiscussionPLReady ||		!user	) return; window.DiscussionPLReady = true; var api = new mw.Api, data, id; api.get({		action: 'query',		list: 'users',		ususers: user	}).then(function(d) {		data = d.query.users;		if (!data.length) return;		id = data[0].userid;		var interval = setInterval(function { if ($('#userProfileApp .user-profile-navigation').length) { clearInterval(interval); var identity = $('.user-identity-stats a[href^="/wiki/Special:UserProfileActivity/'+user+'"]'); if (identity.length) { identity.each(function {						$(this).attr('href', '/f/u/'+id);					}); }			}		}, 1000);	}); });

/* https://adoptme.fandom.com/api.php?action=query&list=users&ususers=Shaki123Ss&usprop=blockinfo|groups|editcount|registration|emailable|gender*/ /*api.php?action=query&list=blocks&bkusers=USERNAME

/*mw.loader.using('mediawiki.api', function {	'use strict'; });*/

$(function {	if ($(".wds-banner-notification__text").html.includes("trivia")) {		$(".wds-banner-notification").remove;	}		else {		return;	} });

/************* Title       :   ContributionsTools Description :   Displays contribution tools from Special:Contributions on "User" name space pages Author      :   Vastmine1029 Version     :   1.0

mw.loader.using('mediawiki.api', function {	function main {		var config = mw.config.get([ 'wgUserName', 'wgUserGroups', 'wgVersion', 'wgCanonicalSpecialPageName' ]);		var user = mw.config.get('wgRelevantUserName');		var sitename, lang, langForSiteName = "", domain, rootdomain, subdomain;		var api = new mw.Api, data;			var userGroups = config.wgUserGroups.join; // e.g., str -> "*,user,autoconfirmed,emailconfirmed"		var checkUser = false;		var re = new RegExp('threadmoderator|content-moderator|sysop|staff|soap|helper|global-discussions-moderator|wiki-representative|wiki-representative');		var checkEligibleUser = re.test(userGroups);		//checkEligibleUser ? console.log("User has one or more user groups to use the tools.") : console.info("User does not a user group to use the tools.");		if (window.BlockReport)			return;		window.BlockReport = true;		console.log("Good");		var contributionsUserTools = document.createElement("div");		contributionsUserTools.classList.add("mw-contributions-user-tools");		contributionsUserTools.style.marginTop = "0.25em"; // setting top-margin for contributionsUserTools contributionsUserTools.style.marginBottom = "0.25em"; // setting bottom-margin for contributionsUserTools contributionsUserTools.style.paddingTop = "0.25em"; // setting padding-top for contributionsUserTools contributionsUserTools.style.paddingLeft = "0.25em"; // setting padding-left for contributionsUserTools contributionsUserTools.style.paddingRight = "0.25em"; // setting padding-right for contributionsUserTools contributionsUserTools.style.paddingBottom = "0.25em"; // setting padding-bottom for contributionsUserTools var forUserlink = document.createElement("span"); forUserlink.innerHTML = "For " + "" + user + " "; var changeslistLinks = document.createElement("span"); changeslistLinks.classList.add("mw-changeslist-links"); api.get({			action: 'query',			meta: 'siteinfo'		}).then(function(d) {			data = d.query.general;			// Ensuring that all necessary information from API has been loaded before proceeding.			var interval = setInterval(function { if ((data["server"] !== undefined) && (data["servername"] !== undefined) && (data["scriptpath"] !== undefined)&& (data["sitename"] !== undefined) && (data["lang"] !== undefined)) { clearInterval(interval); }			}, 1000);			sitename = data["sitename"]; // e.g., "Community Central"			lang = data["lang"];			domain = data["server"] + data["scriptpath"]; // e.g., https://community.fandom.com + /es			rootdomain = data["servername"]; // e.g., community			var rootDomainBreakdown = rootdomain.split(".");			subdomain = rootDomainBreakdown[0];			mw.hook('dev.enablewallext').add(function(wgMessageWallsExist) { wgMessageWallsExist.then(function {					// when Message Wall exists					if (checkEligibleUser === true) {						//"For " + "" + user + "  " +						changeslistLinks.innerHTML = " Message Wall " +						" block " +						" block log " +						" uploads " +						" logs " +						" deleted user contributions " +						" user rights management</a> ";					}					else {						changeslistLinks.innerHTML = "Message Wall</a> " + " block log</a> " + " uploads</a> " + " logs</a> "; }					//talk block log uploads logs },				function { if (checkEligibleUser === true) { // when Message Wall does not exists changeslistLinks.innerHTML = "talk page</a>" + " block</a> " + " block log</a> " + " uploads</a> " + " logs</a> " + " deleted user contributions</a> " + " user rights management</a> " + " user rights management</a> "; }					else { changeslistLinks.innerHTML = "talk page</a> " + " block log</a> " + " uploads</a> " + " <a href=\"" + domain + "/wiki/Special:Log/" + user + "\">logs</a> "; }				});			});			contributionsUserTools.appendChild(forUserlink); contributionsUserTools.appendChild(changeslistLinks); console.log("profileUserId: " + mw.config.get('profileUserId')); console.log("User Groups for " + config.wgUserName + ": " + config.wgUserGroups); });		var interval = setInterval(function { if ($('.ns-2 #userProfileApp').length) { clearInterval(interval); $(".ns-2 #userProfileApp").eq(0).after(contributionsUserTools); // prepending Box to ".ns-2 #content" }		}, 1000);		importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:WgMessageWallsExist.js' ]		});	}	main; });