MediaWiki:Gadget-twinkleblock.js: Difference between revisions

Content deleted Content added
Repo at c63b1ede: Add DS topic codes for aeblock/aepblock
Repo at 00d4efa: Fix bug when toggling form option
Line 1,499:
Twinkle.block.callback.change_template = function twinkleblockcallbackChangeTemplate(e) {
var form = e.target.form, value = form.template.value, settings = Twinkle.block.blockPresetsInfo[value];
 
ifvar blockBox = (!$(form).find('[name=actiontype][value=block]').is(':checked')) {;
var partialBox = $(form).find('[name=actiontype][value=partial]').is(':checked');
var templateBox = $(form).find('[name=actiontype][value=template]').is(':checked');
 
// Block form is not present
if (!blockBox) {
if (settings.indefinite || settings.nonstandard) {
if (Twinkle.block.prev_template_expiry === null) {
Line 1,517 ⟶ 1,523:
}
Morebits.quickForm.setElementVisibility(form.notalk.parentNode, !settings.nonstandard);
// Partial
Morebits.quickForm.setElementVisibility(form.noemail_template.parentNode, $(form).find('[name=actiontype][value=partial]').is(':checked') && !$(form).find('[name=actiontype][value=block]').is(':checked'));
Morebits.quickForm.setElementVisibility(form.nocreate_templatenoemail_template.parentNode, $(form).find('[name=actiontype][value=partial]').is(':checked') && !$(form).find('[name=actiontype][value=block]').is(':checked')partialBox);
Morebits.quickForm.setElementVisibility(form.articlenocreate_template.parentNode, !!settings.pageParampartialBox);
} else {
} else if (templateBox) { // Only present if block && template forms both visible
Morebits.quickForm.setElementVisibility(
if ( form.blank_duration) {.parentNode,
Morebits.quickForm.setElementVisibility(
!settings.indefinite && !settings.nonstandard
form.blank_duration.parentNode,
);
!settings.indefinite && !settings.nonstandard
);
}
}
 
Morebits.quickForm.setElementVisibility(form.dstopic.parentNode, value === 'uw-aeblock' || value === 'uw-aepblock');
 
// Only particularly relevant if template form is present
Morebits.quickForm.setElementVisibility(form.article.parentNode, !!settings.pageParam);
Morebits.quickForm.setElementVisibility(form.block_reasonarticle.parentNode, settings && !!settings.reasonParampageParam);
Morebits.quickForm.setElementVisibility(form.block_reason.parentNode, settings && !!settings.reasonParam);
 
// Partial block
Morebits.quickForm.setElementVisibility(form.area.parentNode, $(form).find('[name=actiontype][value=partial]').is(':checked')partialBox && !$(form).find('[name=actiontype][value=block]').is(':checked')blockBox);
 
form.root.previewer.closePreview();