mediawiki-extensions-Nuke/ext.nuke.js
glaisher 0dd7b21d44 Add 'Invert' checkbox selection feature to Special:Nuke
This will add a 'Invert' button next to Select: All, None
in Special:Nuke allowing to invert checkbox selection making
it easy to select many pages with a few clicks.

Bug: T86549
Change-Id: Id74369dc1cd6884e53367f4103a3b50254394641
2015-03-12 21:34:00 +05:00

31 lines
713 B
JavaScript

/**
* JavaScript for the Nuke MediaWiki extension.
* @see https://www.mediawiki.org/wiki/Extension:Nuke
*
* @licence GNU GPL v2 or later
* @author Jeroen De Dauw <jeroendedauw at gmail dot com>
*/
( function ( $ ) {
'use strict';
$( document ).ready( function () {
function selectPages( check ) {
$( 'input[type=checkbox]' ).prop( 'checked', check );
}
$( '#toggleall' ).click( function () {
selectPages( true );
} );
$( '#togglenone' ).click( function () {
selectPages( false );
} );
$( '#toggleinvert' ).click( function () {
$( 'input[type="checkbox"]' ).each( function () {
$( this ).prop( 'checked', !$( this ).is( ':checked' ) );
} );
} );
} );
}( jQuery ) );