User:Ahmad Kanik/global.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
(function () {
	var npl = document.querySelectorAll('a.new');
	for (var i = 0; i < npl.length; i++) {
		npl[i].href = npl[i].href.replace(/[?&]action=edit/, '');
	}
	if (mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') {
		var user = mw.config.get('wgRelevantUserName');
		mw.loader.using('mediawiki.util', function () {
			mw.util.addPortletLink('p-tb', 'https://xtools.wmflabs.org/globalcontribs/' + user, 'GContribs');
			if (mw.util.isIPAddress(user)) {
				mw.util.addPortletLink('p-tb', 'https://whois.toolforge.org/gateway.py?lookup=true&ip=' + user, 'WHOIS');
			} else {
				mw.util.addPortletLink('p-tb', 'https://meta.wikimedia.org/wiki/Special:CentralAuth/' + user, 'CentralAuth');
			}
		});
	}
})();

// w:en:User:Anomie/diffcur
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Anomie/diffcur.js&action=raw&ctype=text/javascript');

// w:bn:User:Ahmad_Kanik/বৈশ্বিক_সম্পাদনা_সংখ্যা
mw.loader.load('//bn.wikipedia.org/w/index.php?title=User:Ahmad_Kanik/বৈশ্বিক_সম্পাদনা_সংখ্যা.js&action=raw&ctype=text/javascript');