MediaWiki:Common.js: Difference between revisions
From Bulbanews, your community Pokémon newspaper.
Jump to navigationJump to search
(Always some little error...) |
(Fix for new article assistant script bug; temporary until upgrade is complete.) |
||
Line 699: | Line 699: | ||
} | } | ||
}); | |||
// New Article Assistant script. The current way of doing it (using the MediaWiki namespace) will not properly inject dependencies, so jQuery will not be present. | |||
$(document).ready(function() { | |||
$('#bnSourcetype').change(function() { | |||
var $sourceType = $(this).val(); | |||
if ($sourceType == 'exclusive' || $sourceType == 'none') { | |||
$('#bnSourcename').attr('disabled', true).closest('tr').fadeTo('fast', 0.5); | |||
} else { | |||
$('#bnSourcename').removeAttr('disabled').closest('tr').fadeTo('fast', 1.0); | |||
} | |||
if ($sourceType == 'exclusive' || $sourceType == 'magazine' || $sourceType == 'other' || $sourceType == 'none') { | |||
$('#bnSourcelink').attr('disabled', true).closest('tr').fadeTo('fast', 0.5); | |||
} else { | |||
$('#bnSourcelink').removeAttr('disabled').closest('tr').fadeTo('fast', 1.0); | |||
} | |||
}); | |||
$('#bnSourcename').attr('disabled', true).closest('tr').fadeTo(0, 0.5); | |||
$('#bnSourcelink').attr('disabled', true).closest('tr').fadeTo(0, 0.5); | |||
}); | }); | ||
/* </pre> */ | /* </pre> */ |