4 var config = mw.config.get( [ 'wgAction', 'wgCookiePrefix', 'wgCurRevisionId' ] ),
5 // This should match EditPage::POST_EDIT_COOKIE_KEY_PREFIX:
6 cookieKey = config.wgCookiePrefix + 'PostEditRevision' + config.wgCurRevisionId,
9 if ( config.wgAction !== 'view' || $.cookie( cookieKey ) !== '1' ) {
13 $.cookie( cookieKey, null, { path: '/' } );
14 mw.config.set( 'wgPostEdit', true );
16 function removeConfirmation() {
17 div.parentNode.removeChild( div );
18 mw.hook( 'postEdit.afterRemoval' ).fire();
21 function fadeOutConfirmation() {
23 div.firstChild.className = 'postedit postedit-faded';
24 setTimeout( removeConfirmation, 500 );
28 function showConfirmation() {
29 div = document.createElement( 'div' );
30 div.className = 'postedit-container';
32 '<div class="postedit">' +
33 '<div class="postedit-icon postedit-icon-checkmark">' +
34 mw.message( 'postedit-confirmation', mw.user ).escaped() +
36 '<a href="#" class="postedit-close">×</a>' +
38 id = setTimeout( fadeOutConfirmation, 3000 );
39 div.firstChild.lastChild.onclick = fadeOutConfirmation;
40 document.body.insertBefore( div, document.body.firstChild );
43 mw.hook( 'postEdit' ).add( showConfirmation ).fire();
45 } ( mediaWiki, jQuery ) );