mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-12-19 17:51:56 +00:00
c21c77840f
Bug:T191546
Change-Id: I14306c05b50a4a9319ed31f8e714a8cab629ca73
(cherry picked from commit 288bd4f5e2
)
28 lines
664 B
JavaScript
28 lines
664 B
JavaScript
window.invertSelections = function () {
|
|
'use strict';
|
|
|
|
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 ( $ ) {
|
|
$( function () {
|
|
$( '#replacetext-invert' )
|
|
.on( 'click', function () {
|
|
window.invertSelections();
|
|
} )
|
|
.prop( 'disabled', false );
|
|
} );
|
|
}( jQuery ) );
|