mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-12-04 19:18:12 +00:00
e1da9e2d63
Bug: T200334 Change-Id: I5b588e0dda95812543b270fbc5aece14a5583c83
34 lines
889 B
JavaScript
34 lines
889 B
JavaScript
( function () {
|
|
'use strict';
|
|
|
|
function invertSelections() {
|
|
var form = document.getElementById( 'choose_pages' ),
|
|
numElements = form.elements.length,
|
|
i,
|
|
curElement;
|
|
|
|
for ( i = 0; i < numElements; i++ ) {
|
|
curElement = form.elements[ i ];
|
|
|
|
if ( curElement.type === 'checkbox' && curElement.id !== 'create-redirect' &&
|
|
curElement.id !== 'watch-pages' && curElement.id !== 'botEdit' ) {
|
|
curElement.checked = !curElement.checked;
|
|
}
|
|
}
|
|
}
|
|
|
|
$( function () {
|
|
var $checkboxes = $( '#powersearch input[id^=mw-search-ns]' );
|
|
|
|
$( '.ext-replacetext-invert' ).on( 'click', invertSelections );
|
|
|
|
// 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 );
|
|
} );
|
|
} );
|
|
}() );
|