mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-24 16:25:38 +00:00
0dd7b21d44
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
31 lines
713 B
JavaScript
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 ) );
|