Merge "Reset $mConvRuleTitle before every language conversion run"
[lhc/web/wiklou.git] / resources / mediawiki.special / mediawiki.special.recentchanges.js
1 /**
2 * JavaScript for Special:RecentChanges
3 */
4 ( function ( mw, $ ) {
5 var rc,
6 $checkboxes,
7 $select;
8
9 rc = {
10
11 /**
12 * Handler to disable/enable the namespace selector checkboxes when the
13 * special 'all' namespace is selected/unselected respectively.
14 */
15 updateCheckboxes: function () {
16 // The option element for the 'all' namespace has an empty value
17 var isAllNS = $select.find( 'option:selected' ).val() === '';
18
19 // Iterates over checkboxes and propagate the selected option
20 $checkboxes.prop( 'disabled', isAllNS );
21 },
22
23 init: function () {
24 $select = $( '#namespace' );
25 $checkboxes = $( '#nsassociated, #nsinvert' );
26
27 // Bind to change event, and trigger once to set the initial state of the checkboxes.
28 rc.updateCheckboxes();
29 $select.change( rc.updateCheckboxes );
30 }
31 };
32
33 $( rc.init );
34
35 mw.special.recentchanges = rc;
36
37 }( mediaWiki, jQuery ) );