User:Vastmine1029/common.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:DisplayTimer/code.js',		'u:dev:MediaWiki:LastEdited/code.js',		'u:dev:MediaWiki:MassBlock/code.js',		'u:dev:MediaWiki:PortableCSSPad/code.js',		'u:dev:MediaWiki:ShowUserGroups.js',		'u:dev:MediaWiki:Status/code.js',		'u:dev:MediaWiki:UserAccountAge/code2.js',		/*'u:dev:MediaWiki:UserAndIPTools.js', - Not compatible*/		'u:dev:MediaWiki:WHAM/code.2.js',		'u:dev:MediaWiki:QuickDiff/code.js'    ] });

/* Appending Block Summary */ mw.loader.using('mediawiki.api', function {	var user = mw.config.get('wgRelevantUserName');	var api = new mw.Api, data;	var blockr, blockID, blockperformer, blocktime, expire;

api.get({		action: 'query',		list: 'blocks',		bkusers: user	}).then(function(d) {		data = d.query.blocks;		blockr = data[0].reason;		blockID = data[0].id;		blockperformer = data[0].by;		blocktime = data[0].timestamp;		expire = data[0].expiry;		var ucp = mw.config.get('wgVersion') !== '1.19.24';		var selector = ucp ? $('.page-header__separator') : $('#contentSub > a:last-child');		if (window.BlockReport || !user)			return;		window.BlockReport = true;		function appendCSS(blockreason, blockID1, blockdoneby, blocktime1, blockexpire){			mw.util.addCSS( //mw-warning-with-logexcerpt ".blockreport-border {" + "padding: 3px;" + "margin-bottom: 3px;" + "border: 2px solid #2a4b8d;" + "clear: both;" + " }"				+ ".bolding {" + "font-weight: bold;" + "}"				// Break Line Class (For ) - Unused + ".break-line {" + "white-space: pre;" + "content: ' '" + "}"			);

// add groups + label to newly created element, then add to DOM var $content = $(' ') $content .addClass("blockreport-border") .append(					$(' ') 						.text("Block Report")						.append( $(" ")								.text("Username: " + user) .append(									$(" ")										.text("Block ID: " + blockID1)										.append( $(" ")												.text("Block Performer: " + blockdoneby) .append(													$(" ")														.text("Block Timestamp: " + blocktime1)														.append( $(" ")																.text("Block Reason: " + blockreason) .append(																	$(" ")																		.text("Block Expiry: " + expire)																) )												)										)								)						)				);			$("#firstHeading").eq(0).after($content); }		appendCSS(blockr, blockID, blockperformer, blocktime, expire); }); });

/* 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'; });*/