MediaWiki:Gadget-test.js: Difference between revisions

MediaWiki interface page
m (Testing user-specific message (only for sysops))
m (Hiding element)
Line 2: Line 2:
if (mw.config.get('wgPageName') == 'Special:ConfirmAccounts/authors') {
if (mw.config.get('wgPageName') == 'Special:ConfirmAccounts/authors') {
if (mw.config.get('wgUserGroups').includes('sysop')) {
if (mw.config.get('wgUserGroups').includes('sysop')) {
console.log("page name: " + mw.config.get('wgPageName'));
var emailprovider = $(".mw-confirmaccount-body-0 tr:nth-child(2) td:nth-child(2) strong")[0].previousSibling.nodeValue.split("@")[1];
$(".mw-confirmaccount-body-0 tr:nth-child(2) td:nth-child(2) strong")[0].previousSibling.nodeValue = "(hidden)" + emailprovider;
}
}
}
}
});
});

Revision as of 09:14, 7 January 2024

$(function() {
	if (mw.config.get('wgPageName') == 'Special:ConfirmAccounts/authors') {
		if (mw.config.get('wgUserGroups').includes('sysop')) {
			var emailprovider = $(".mw-confirmaccount-body-0 tr:nth-child(2) td:nth-child(2) strong")[0].previousSibling.nodeValue.split("@")[1];
			$(".mw-confirmaccount-body-0 tr:nth-child(2) td:nth-child(2) strong")[0].previousSibling.nodeValue = "(hidden)" + emailprovider;
		}
	}
});