1 /* JavaScript for Special:RecentChanges */
4 mw
.special
.recentchanges
= {
7 'checkboxes' : [ 'nsassociated', 'nsinvert' ],
11 this.select
= $( 'select#namespace' );
13 // Register an onChange trigger for the <select> element
14 this.select
.change( function() {
15 mw
.special
.recentchanges
.updateCheckboxes();
17 // on load, trigger the event to eventually update checkboxes statuses
22 * handler to disable/enable the namespace selector checkboxes when the
23 * special 'all' namespace is selected/unselected respectively.
25 'updateCheckboxes' : function() {
26 // The 'all' namespace is the FIRST in the list.
27 var isAllNS
= this.select
.find( 'option' ).first().is( ':selected' );
29 // Iterates over checkboxes and propagate the selected option
30 $.map( this.checkboxes
, function(id
) {
31 $( 'input#'+id
).attr( 'disabled', isAllNS
);
36 mw
.special
.recentchanges
.init();
38 }(jQuery
, mediaWiki
) );