1 /* JavaScript for Special:RecentChanges */
4 var checkboxes = [ 'nsassociated', 'nsinvert' ];
11 var rc = mw.special.recentchanges = {
14 * Handler to disable/enable the namespace selector checkboxes when the
15 * special 'all' namespace is selected/unselected respectively.
17 updateCheckboxes: function() {
18 // The option element for the 'all' namespace has an empty value
19 var isAllNS = ('' === $select.find('option:selected').val() );
21 // Iterates over checkboxes and propagate the selected option
22 $.each( checkboxes, function( i, id ) {
23 $( '#' + id ).attr( 'disabled', isAllNS );
29 $select = $( '#namespace' );
31 // Bind to change event, and trigger once to set the initial state of the checkboxes.
32 $select.change( rc.updateCheckboxes ).change();
36 // Run when document is ready