2 * Allows users to perform all / none / invert operations on a list of
3 * checkboxes on the page.
6 * @author Luke Faraone <luke at faraone dot cc>
8 * Based on ext.nuke.js from https://www.mediawiki.org/wiki/Extension:Nuke by
9 * Jeroen De Dauw <jeroendedauw at gmail dot com>
16 // FIXME: This shouldn't be a global selector to avoid conflicts
17 // with unrelated content on the same page. (T131318)
18 const $checkboxes = $( 'li input[type="checkbox"]' );
20 function selectAll( check ) {
21 $checkboxes.prop( 'checked', check ).trigger( 'change' );
24 $( '.mw-checkbox-all' ).on( 'click', () => {
27 $( '.mw-checkbox-none' ).on( 'click', () => {
30 $( '.mw-checkbox-invert' ).on( 'click', () => {
31 $checkboxes.prop( 'checked', ( i, val ) => !val ).trigger( 'change' );