mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-28 00:20:00 +00:00
7ec8d23740
Bug: T208951 Change-Id: Ie7580aef0af9f6cffed4826b0ae46d4b99446ae1
26 lines
622 B
JavaScript
26 lines
622 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 !== 'doAnnounce' ) {
|
|
form.elements[ i ].checked = form.elements[ i ].checked !== true;
|
|
}
|
|
}
|
|
}
|
|
|
|
$( function () {
|
|
$( '#replacetext-invert' )
|
|
.on( 'click', invertSelections )
|
|
.prop( 'disabled', false );
|
|
} );
|
|
}() );
|