MediaWiki:Gadget-twinkleblock.js: Difference between revisions

Content deleted Content added
Better fix
Repo at f1b0573: Apply bugfix for always-on partialstatus
Line 320:
field_block_options.append({ type: 'hidden', name: 'reblock', value: '1' });
}
// Used to successfully build the blocking API parameters
field_block_options.append({ type: 'hidden', name: 'partial', value: partialBox });
}
 
Line 1,259 ⟶ 1,257:
toBlock = $form.find('[name=actiontype][value=block]').is(':checked'),
toWarn = $form.find('[name=actiontype][value=template]').is(':checked'),
if toPartial = (!$form.find('[name=actiontype][value=partial]').is(':checked')) {,
blockoptions = {}, templateoptions = {};
 
Line 1,265 ⟶ 1,264:
 
blockoptions = Twinkle.block.field_block_options;
if (!$form.find('[name=actiontype][value=partial]').is(':checked')) {
delete blockoptions.partial;
}
 
templateoptions = Twinkle.block.field_template_options;
Line 1,274 ⟶ 1,270:
delete blockoptions.expiry_preset; // remove extraneous
 
// Partial stuffAPI requires this to be gone, not false or 0
if (toPartial) {
// blockoptions.partial handled with hidden item
blockoptions.partial = templateoptions.partial = true;
templateoptions.partial = $form.find('[name=actiontype][value=partial]').is(':checked'),
}
templateoptions.pagerestrictions = $form.find('[name=pagerestrictions]').val() || [];
templateoptions.namespacerestrictions = $form.find('[name=namespacerestrictions]').val() || [];
Line 1,282 ⟶ 1,279:
blockoptions.pagerestrictions = templateoptions.pagerestrictions.join('|');
blockoptions.namespacerestrictions = templateoptions.namespacerestrictions.join('|');
 
console.log(blockoptions);
console.log(templateoptions);
// use block settings as warn options where not supplied
templateoptions.summary = templateoptions.summary || blockoptions.reason;