User:Whatamidoing (WMF)/global.js: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
Maintenance: mw:RL/MGU - Removed redundant module
Making it global
Line 1: Line 1:
// Happiness //
if ( $( '#ca-addsection' ).length ) mw.loader.using( 'ext.discussionTools.init' );

// Highlight my username everywhere. From [[w:User:Ais523/highlightmyname2.js]]. See also global.css
// Highlight my username everywhere. From [[w:User:Ais523/highlightmyname2.js]]. See also global.css
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Ais523/highlightmyname2.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Ais523/highlightmyname2.js&action=raw&ctype=text/javascript');

Revision as of 17:34, 18 June 2020

// Happiness //
if ( $( '#ca-addsection' ).length ) mw.loader.using( 'ext.discussionTools.init' );

// Highlight my username everywhere. From [[w:User:Ais523/highlightmyname2.js]]. See also global.css
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Ais523/highlightmyname2.js&action=raw&ctype=text/javascript');
hmn2username="whatamidoing"; // This line is only needed if it differs from your full account name

// Gives some useful links on user pages
mw.loader.load('https://meta.wikimedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:MoreMenu.import.js');

 
// Useful script to tell if a user is currently blocked, by striking out the username
mw.loader.load('//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');
 
// A nice UTC clock
mw.loader.load('//mediawiki.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript');

 /* Change RecentChanges layout to not-ugly */
 /* Remove if https://phabricator.wikimedia.org/T202916 ever gets fixed */
mw.loader.using("mediawiki.user", function() {
	if ( mw.user.options.get('usenewrc') !== 0 ) {
		( new mw.Api() ).postWithToken( 'options', {
			action: "options",
			change: "usenewrc=0"
		} ).done( function() {
			mw.loader.using([], function(){
				mw.notify( "RecentChanges formatting has been reset.  You may need to change the URL to remove 'enhanced=1'." );
			} );
		} );
	} else {
		console.log('RecentChanges formatting was not ugly this time');
	}
} );

// [[File:userinfo.js]]
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:PleaseStand/userinfo.js&action=raw&ctype=text/javascript');