summaryrefslogtreecommitdiff
path: root/resources/src/mediawiki.special/mediawiki.special.recentchanges.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/src/mediawiki.special/mediawiki.special.recentchanges.js')
-rw-r--r--resources/src/mediawiki.special/mediawiki.special.recentchanges.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/resources/src/mediawiki.special/mediawiki.special.recentchanges.js b/resources/src/mediawiki.special/mediawiki.special.recentchanges.js
new file mode 100644
index 00000000..d43b62b0
--- /dev/null
+++ b/resources/src/mediawiki.special/mediawiki.special.recentchanges.js
@@ -0,0 +1,39 @@
+/*!
+ * JavaScript for Special:RecentChanges
+ */
+( function ( mw, $ ) {
+ var rc, $checkboxes, $select;
+
+ /**
+ * @class mw.special.recentchanges
+ * @singleton
+ */
+ 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.val() === '';
+
+ // Iterates over checkboxes and propagate the selected option
+ $checkboxes.prop( 'disabled', isAllNS );
+ },
+
+ /** */
+ init: function () {
+ $select = $( '#namespace' );
+ $checkboxes = $( '#nsassociated, #nsinvert' );
+
+ // Bind to change event, and trigger once to set the initial state of the checkboxes.
+ rc.updateCheckboxes();
+ $select.change( rc.updateCheckboxes );
+ }
+ };
+
+ $( rc.init );
+
+ mw.special.recentchanges = rc;
+
+}( mediaWiki, jQuery ) );