User:NguoiDungKhongDinhDanh/Gadget-markadmins.js: Difference between revisions

Jump to navigation Jump to search
m
Tweak
(A better version of MediaWiki:Gadget-markadmins.js)
 
m (Tweak)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
// rewritten by [[m:User:Hoo man]]; 2012-08-26, adapted by [[User:Obersachse]], optimized by [[User:Jack who built the house]]
// For attribution: [[MediaWiki:Gadget-markadmins.js]]
(function () {
(function () {


Line 5: Line 5:


var userSetTips = {
var userSetTips = {
'A' : 'administrator',
'A' : 'administrator',
'B' : 'bureaucrat',
'B' : 'bureaucrat',
'C' : 'checkuser',
'C' : 'checkuser',
'F' : 'interface administrator',
'F' : 'interface administrator',
'S' : 'steward',
'S' : 'steward',
'SA' : 'system administrator',
'SA': 'system administrator',
};
};


Line 51: Line 51:
new mw.Api().get({
new mw.Api().get({
action: 'query',
action: 'query',
format: 'json',
list: 'allusers',
list: 'allusers',
meta: '',
augroup: 'sysop|bureaucrat|checkuser|interface-admin|steward|sysadmin',
formatversion: '2',
augroup: 'bureaucrat|sysop|sysadmin|suppress|steward|interface-admin|checkuser',
auprop: 'groups',
auprop: 'groups',
aulimit: '500',
aulimit: 500,
auwitheditsonly: 1
format: 'json',
formatversion: 2
}).done(function(ans) {
}).done(function(ans) {
var list = ans.query.allusers,
var list = ans.query.allusers,
Line 76: Line 74:
}
}
}
}
console.warn(userSet);
$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] && users_talkLinkOnly.indexOf(matches[2]) !== -1) {
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];
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu