User:NguoiDungKhongDinhDanh/Gadget-markadmins.js: Difference between revisions
Jump to navigation
Jump to search
User:NguoiDungKhongDinhDanh/Gadget-markadmins.js (view source)
Revision as of 20:09, 12 March 2022
, 12 March 2022Tweak
(A better version of MediaWiki:Gadget-markadmins.js) |
m (Tweak) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
// | // For attribution: [[MediaWiki:Gadget-markadmins.js]] | ||
(function () { | (function () { | ||
Line 5: | Line 5: | ||
var userSetTips = { | var userSetTips = { | ||
'A' | 'A' : 'administrator', | ||
'B' | 'B' : 'bureaucrat', | ||
'C' | 'C' : 'checkuser', | ||
'F' | 'F' : 'interface administrator', | ||
'S' | 'S' : 'steward', | ||
'SA' : 'system administrator', | 'SA': 'system administrator', | ||
}; | }; | ||
Line 51: | Line 51: | ||
new mw.Api().get({ | new mw.Api().get({ | ||
action: 'query', | action: 'query', | ||
list: 'allusers', | list: 'allusers', | ||
augroup: 'sysop|bureaucrat|checkuser|interface-admin|steward|sysadmin', | |||
augroup: ' | |||
auprop: 'groups', | auprop: 'groups', | ||
aulimit: ' | aulimit: 500, | ||
format: 'json', | |||
formatversion: 2 | |||
}).done(function(ans) { | }).done(function(ans) { | ||
var list = ans.query.allusers, | var list = ans.query.allusers, | ||
Line 76: | Line 74: | ||
} | } | ||
} | } | ||
$links.each(function (i, link) { | $links.each(function (i, link) { | ||
Line 90: | Line 86: | ||
matches = /^User:(.+)|Talk:(.+)/.exec(link.title); | matches = /^User:(.+)|Talk:(.+)/.exec(link.title); | ||
if (!matches) return; | if (!matches) return; | ||
if (matches[2] | if (matches[2]) { | ||
if ($(link).parent().hasClass('mw-usertoollinks') || link.textContent.match(/обс/i)) return; | if ($(link).parent().hasClass('mw-usertoollinks') || link.textContent.match(/обс/i)) return; | ||
matches[1] = matches[2]; | matches[1] = matches[2]; |