2018-12-06 17:42:31 +00:00
|
|
|
( function () {
|
2018-04-11 02:25:55 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-12-06 17:27:46 +00:00
|
|
|
function invertSelections() {
|
|
|
|
var form = document.getElementById( 'choose_pages' ),
|
|
|
|
numElements = form.elements.length,
|
|
|
|
i,
|
|
|
|
curElement;
|
2018-04-11 02:25:55 +00:00
|
|
|
|
2018-12-06 17:27:46 +00:00
|
|
|
for ( i = 0; i < numElements; i++ ) {
|
|
|
|
curElement = form.elements[ i ];
|
2018-04-11 02:25:55 +00:00
|
|
|
|
2018-12-06 17:27:46 +00:00
|
|
|
if ( curElement.type === 'checkbox' && curElement.id !== 'create-redirect' &&
|
2023-08-08 15:39:55 +00:00
|
|
|
curElement.id !== 'watch-pages' && curElement.id !== 'botEdit' ) {
|
2021-07-03 06:30:07 +00:00
|
|
|
curElement.checked = !curElement.checked;
|
2018-12-06 17:27:46 +00:00
|
|
|
}
|
2018-04-11 02:25:55 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-26 14:57:24 +00:00
|
|
|
|
|
|
|
$( function () {
|
2018-12-22 18:21:47 +00:00
|
|
|
var $checkboxes = $( '#powersearch input[id^=mw-search-ns]' );
|
|
|
|
|
2018-12-23 16:50:58 +00:00
|
|
|
$( '.ext-replacetext-invert' ).on( 'click', invertSelections );
|
2018-12-22 18:21:47 +00:00
|
|
|
|
2018-12-23 14:40:55 +00:00
|
|
|
// Attach handler for check all/none buttons
|
|
|
|
$( '#mw-search-toggleall' ).on( 'click', function () {
|
|
|
|
$checkboxes.prop( 'checked', true );
|
|
|
|
} );
|
|
|
|
$( '#mw-search-togglenone' ).on( 'click', function () {
|
|
|
|
$checkboxes.prop( 'checked', false );
|
|
|
|
} );
|
2018-04-26 14:57:24 +00:00
|
|
|
} );
|
2018-12-06 17:42:31 +00:00
|
|
|
}() );
|