1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mediawiki_ynh.git synced 2024-09-03 19:46:05 +02:00
mediawiki_ynh/sources/mediawiki/resources/mediawiki.special/mediawiki.special.recentchanges.js

34 lines
866 B
JavaScript

/**
* JavaScript for Special:RecentChanges
*/
( function ( mw, $ ) {
var rc, $checkboxes, $select;
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 ) );