Localisation updates for core and extension messages from translatewiki.net (2011...
[mediawiki.git] / resources / mediawiki.special / mediawiki.special.recentchanges.js
blob7e284fbd027bf1c91900f4325203f5ad5bbe4638
1 /* JavaScript for Special:RecentChanges */
2 ( function( $ ) {
4         var checkboxes = [ 'nsassociated', 'nsinvert' ];
6         /**
7          * @var select {jQuery}
8          */
9         var $select = null;
11         var rc = mw.special.recentchanges = {
12         
13                 /**
14                  * Handler to disable/enable the namespace selector checkboxes when the
15                  * special 'all' namespace is selected/unselected respectively.
16                  */
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 );
24                         });
25                 },
27                 init: function() {
28                         // Populate
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();
33                 }
34         };
36         // Run when document is ready
37         $( rc.init );
39 })( jQuery );