mediawiki-extensions-Nuke/ext.nuke.confirm.js
Amir Sarabadani 8bf771fc40 Ask for confirmation when nuking
Bug: T131975
Change-Id: I908c1aacdc8069ea9ae1ec860eef5421d9da2fab
2017-10-04 16:48:38 +02:00

15 lines
381 B
JavaScript

( function ( mw, $ ) {
$( document ).ready( function () {
/*global confirm */
// Confirm nuke
$( 'form[name="nukelist"]' ).on( 'submit', function () {
var pages = $( this ).find( 'input[name="pages[]"][type="checkbox"]:checked' );
if ( pages.length ) {
return confirm( mw.msg( 'nuke-confirm', pages.length ).text() );
}
} );
} );
}( mediaWiki, jQuery ) );