MediaWiki:Gadget-twinkleblock.js: Difference between revisions

Content deleted Content added
Repo at 49207b0: "Vandalism-only account": Link to policy rather than essay (#1658)
Repo at dff0416: disallow nested ternaries (#1695)
Line 1,482:
 
var blockSettings = Twinkle.block.blockPresetsInfo[blockPreset.value];
 
var registrationRestrict = blockSettings.forRegisteredOnly ? Twinkle.block.isRegistered : blockSettings.forAnonOnly ? !Twinkle.block.isRegistered : true;
var registrationRestrict;
if (blockSettings.forRegisteredOnly) {
registrationRestrict = Twinkle.block.isRegistered;
} else if (blockSettings.forAnonOnly) {
registrationRestrict = !Twinkle.block.isRegistered;
} else {
registrationRestrict = true;
}
 
if (!(blockSettings.templateName && show_template) && registrationRestrict) {
var templateName = blockSettings.templateName || blockPreset.value;