Move mediawiki.special.js to the correct directory. Followup r90941, r90960
[lhc/web/wiklou.git] / resources / mediawiki.special / mediawiki.special.recentchanges.js
1 /* JavaScript for Special:RecentChanges */
2 ( function( $, mw ) {
3
4 mw.special.recentchanges = {
5 // -- Variables
6 'select' : false,
7 'checkboxes' : [ 'nsassociated', 'nsinvert' ],
8
9 // -- Methods
10 'init' : function() {
11 this.select = $( 'select#namespace' );
12
13 // Register an onChange trigger for the <select> element
14 this.select.change( function() {
15 mw.special.recentchanges.updateCheckboxes();
16 });
17 // on load, trigger the event to eventually update checkboxes statuses
18 this.select.change();
19 },
20
21 /**
22 * handler to disable/enable the namespace selector checkboxes when the
23 * special 'all' namespace is selected/unselected respectively.
24 */
25 'updateCheckboxes' : function() {
26 // The 'all' namespace is the FIRST in the list.
27 var isAllNS = this.select.find( 'option' ).first().is( ':selected' );
28
29 // Iterates over checkboxes and propagate the selected option
30 $.map( this.checkboxes, function(id) {
31 $( 'input#'+id ).attr( 'disabled', isAllNS );
32 });
33 },
34 };
35
36 mw.special.recentchanges.init();
37
38 }(jQuery, mediaWiki ) );