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' &&
|
|
|
|
curElement.id !== 'watch-pages' && curElement.id !== 'doAnnounce' ) {
|
|
|
|
form.elements[ i ].checked = form.elements[ i ].checked !== true;
|
|
|
|
}
|
2018-04-11 02:25:55 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-26 14:57:24 +00:00
|
|
|
|
|
|
|
$( function () {
|
|
|
|
$( '#replacetext-invert' )
|
2018-12-06 17:27:46 +00:00
|
|
|
.on( 'click', invertSelections )
|
2018-04-26 14:57:24 +00:00
|
|
|
.prop( 'disabled', false );
|
|
|
|
} );
|
2018-12-06 17:42:31 +00:00
|
|
|
}() );
|