MediaWiki:Gadget-twinkleblock.js: Difference between revisions

Content deleted Content added
Repo at b3b2e20: fix IE bug; remove unused variables
Repo at 2b6f9a7: use test, not search, when we're not using the output; Fix for usergroup checking of IPs; better detect bots and turn off autoblock; Don't follow cross-namespace redirect when issuing block template; Remove 10k z-index on select2 dropdowns
Line 106:
bkusers: mw.config.get('wgRelevantUserName'),
ususers: mw.config.get('wgRelevantUserName'),
usprop: 'groupmemberships',
letitle: 'User:' + mw.config.get('wgRelevantUserName')
})
Line 113 ⟶ 114:
 
Twinkle.block.isRegistered = !!userinfo.userid;
relevantUserName =if (Twinkle.block.isRegistered ? 'User:' + mw.config.get('wgRelevantUserName') : mw.config.get('wgRelevantUserName');{
relevantUserName = 'User:' + mw.config.get('wgRelevantUserName');
Twinkle.block.userIsBot = !!userinfo.groupmemberships && userinfo.groupmemberships.map(function(e) {
return e.group;
}).indexOf('bot') !== -1;
} else {
relevantUserName = mw.config.get('wgRelevantUserName');
Twinkle.block.userIsBot = false;
}
 
if (blockinfo) {
Line 494 ⟶ 503:
 
mw.util.addCSS(
// prevent dropdown from appearing behind the dialog, just in case
'.select2-container { z-index: 10000; }' +
// Reduce padding
'.select2-results .select2-results__option { padding-top: 1px; padding-bottom: 1px; }' +
Line 1,295 ⟶ 1,302:
 
// disable autoblock if blocking a bot
if (Twinkle.block.isRegistereduserIsBot &&|| relevantUserName.search(/bot\b/i.test(relevantUserName) > 0) {
data.autoblock = false;
}
Line 1,541 ⟶ 1,548:
var wikipedia_page = new Morebits.wiki.page(userTalkPage, 'User talk page modification');
wikipedia_page.setCallbackParameters(params);
wikipedia_page.setFollowRedirect(true, false);
wikipedia_page.load(Twinkle.block.callback.main);
};
Line 1,665 ⟶ 1,672:
};
 
Twinkle.addInitCallback(Twinkle.block, 'block');
})(jQuery);