Merge "ApiSandbox: Move labels outside progress bars"
[lhc/web/wiklou.git] / resources / src / mediawiki.rollback.confirmation.js
1 /*!
2 * JavaScript for rollback confirmation prompt
3 */
4 ( function () {
5
6 var postRollback = function ( url ) {
7 var $form = $( '<form>', {
8 action: url,
9 method: 'post'
10 } );
11 $form.appendTo( 'body' ).trigger( 'submit' );
12 };
13
14 $( '#mw-content-text' ).confirmable( {
15 i18n: {
16 confirm: mw.msg( 'rollback-confirmation-confirm' ),
17 yes: mw.msg( 'rollback-confirmation-yes' ),
18 no: mw.msg( 'rollback-confirmation-no' )
19 },
20 delegate: '.mw-rollback-link a[data-mw="interface"]',
21 handler: function ( e ) {
22 e.preventDefault();
23 postRollback( $( this ).attr( 'href' ) );
24 }
25 } );
26
27 }() );