summaryrefslogtreecommitdiff
path: root/resources/mediawiki.special/mediawiki.special.recentchanges.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /resources/mediawiki.special/mediawiki.special.recentchanges.js
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'resources/mediawiki.special/mediawiki.special.recentchanges.js')
-rw-r--r--resources/mediawiki.special/mediawiki.special.recentchanges.js31
1 files changed, 13 insertions, 18 deletions
diff --git a/resources/mediawiki.special/mediawiki.special.recentchanges.js b/resources/mediawiki.special/mediawiki.special.recentchanges.js
index 7996d935..d1c1354f 100644
--- a/resources/mediawiki.special/mediawiki.special.recentchanges.js
+++ b/resources/mediawiki.special/mediawiki.special.recentchanges.js
@@ -1,39 +1,34 @@
-/* JavaScript for Special:RecentChanges */
+/**
+ * JavaScript for Special:RecentChanges
+ */
( function ( mw, $ ) {
+ var rc, $checkboxes, $select;
- var checkboxes = [ 'nsassociated', 'nsinvert' ];
-
- /**
- * @var select {jQuery}
- */
- var $select = null;
-
- var rc = mw.special.recentchanges = {
-
+ rc = {
/**
* Handler to disable/enable the namespace selector checkboxes when the
* special 'all' namespace is selected/unselected respectively.
*/
updateCheckboxes: function () {
// The option element for the 'all' namespace has an empty value
- var isAllNS = $select.find('option:selected').val() === '';
+ var isAllNS = $select.val() === '';
// Iterates over checkboxes and propagate the selected option
- $.each( checkboxes, function ( i, id ) {
- $( '#' + id ).prop( 'disabled', isAllNS );
- });
+ $checkboxes.prop( 'disabled', isAllNS );
},
init: function () {
- // Populate
$select = $( '#namespace' );
+ $checkboxes = $( '#nsassociated, #nsinvert' );
// Bind to change event, and trigger once to set the initial state of the checkboxes.
- $select.change( rc.updateCheckboxes ).change();
+ rc.updateCheckboxes();
+ $select.change( rc.updateCheckboxes );
}
};
- // Run when document is ready
- $( rc.init );
+ $( document ).ready( rc.init );
+
+ mw.special.recentchanges = rc;
}( mediaWiki, jQuery ) );