diff --git a/extension.json b/extension.json index fa48c0e611..6050be926b 100644 --- a/extension.json +++ b/extension.json @@ -438,6 +438,7 @@ "creating", "editing", "lastmodifiedat", + "mw-widgets-abandonedit", "redirectpagesub", "subject", "visualeditor-loadwarning", diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index a6d9984eee..8189479cf5 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -1502,7 +1502,7 @@ ve.init.mw.DesktopArticleTarget.prototype.onBeforeUnload = function () { mw.user.options.get( 'useeditwarning' ) ) { // Return our message - return ve.msg( 'visualeditor-viewpage-savewarning' ); + return ve.msg( 'mw-widgets-abandonedit' ); } }; diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index fa33c50c38..e2f9432889 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -2404,7 +2404,10 @@ ve.init.mw.ArticleTarget.prototype.switchToWikitextSection = function ( section, return; } if ( !noConfirm && this.edited && mw.user.options.get( 'useeditwarning' ) ) { - promise = OO.ui.confirm( mw.msg( 'visualeditor-viewpage-savewarning' ) ); + promise = this.getSurface().dialogs.openWindow( 'abandonedit' ) + .closed.then( function ( data ) { + return data && data.action === 'discard'; + } ); } else { promise = $.Deferred().resolve( true ).promise(); }