summaryrefslogtreecommitdiff
path: root/extensions/Nuke/ext.nuke.js
blob: ff5aecfbba2ec7a26bb647915a5d21e0d44397a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * 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 ) );