Merge "Use upstream AbandonEditDialog"

This commit is contained in:
jenkins-bot 2018-11-05 18:19:23 +00:00 committed by Gerrit Code Review
commit 3f97176f7c
5 changed files with 8 additions and 58 deletions

View file

@ -662,7 +662,8 @@
"ext.visualEditor.core",
"ext.visualEditor.mwcore",
"ext.visualEditor.mwextensions",
"ext.visualEditor.mwsave"
"ext.visualEditor.mwsave",
"mediawiki.widgets.AbandonEditDialog"
],
"messages": [
"accesskey-save",
@ -1435,7 +1436,6 @@
"modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js",
"modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js",
"modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js",
"modules/ve-mw/ui/dialogs/ve.ui.MWCancelConfirmDialog.js",
"modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js",
"modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js",
"modules/ve-mw/ui/dialogs/ve.ui.MWPreDialog.js",
@ -1572,10 +1572,6 @@
"visualeditor-toolbar-savedialog",
"visualeditor-toolbar-savedialog-short",
"visualeditor-version-label",
"visualeditor-viewpage-savewarning",
"visualeditor-viewpage-savewarning-discard",
"visualeditor-viewpage-savewarning-keep",
"visualeditor-viewpage-savewarning-title",
"visualeditor-wikitext-progress",
"visualeditor-wikitext-warning-title"
],

View file

@ -407,10 +407,6 @@
"visualeditor-toolbar-savedialog-short": "Save",
"visualeditor-usernamespacepagelink": "Project:User namespace",
"visualeditor-version-label": "Version",
"visualeditor-viewpage-savewarning": "Are you sure you want to leave editing mode without saving first?",
"visualeditor-viewpage-savewarning-discard": "Discard edits",
"visualeditor-viewpage-savewarning-keep": "Continue editing",
"visualeditor-viewpage-savewarning-title": "Are you sure?",
"visualeditor-wikitext-progress": "Converting wikitext",
"visualeditor-wikitext-warning": "You are using the visual editor - [[{{MediaWiki:visualeditor-wikitext-warning-link}}|wikitext]] does not work here. To switch to source editing at any time without losing your changes, click on the switch button.",
"visualeditor-wikitext-warning-link": "mediawikiwiki:Special:MyLanguage/Help:Formatting",

View file

@ -421,10 +421,6 @@
"visualeditor-toolbar-savedialog-short": "Short label text for button to open save dialog on width-restricted devices\n{{Identical|Save}}",
"visualeditor-usernamespacepagelink": "Name of a page describing the user namespace (NS2) in this project.\n{{doc-important|Do not translate \"Project\"; it is automatically converted to the wiki's project namespace.}}",
"visualeditor-version-label": "Label text for version number\n{{Identical|Version}}",
"visualeditor-viewpage-savewarning": "Text shown when the user tries to leave the editor without saving their changes.\n\nFollowed by the following buttons:\n* {{msg-mw|Visualeditor-viewpage-savewarning-discard}}\n* {{msg-mw|Visualeditor-viewpage-savewarning-keep}}",
"visualeditor-viewpage-savewarning-discard": "Text shown on the button which closes VE and discards changes when the user confirms that they want to leave the editor.\n\nPreceded by the prompt {{msg-mw|Visualeditor-viewpage-savewarning}}.\n\nFollowed by the button {{msg-mw|Visualeditor-viewpage-savewarning-keep}}.",
"visualeditor-viewpage-savewarning-keep": "Text shown on the button which does not do anything when the user decides that they do not want to leave the editor.\n\nPreceded by the button {{msg-mw|Visualeditor-viewpage-savewarning-discard}}.",
"visualeditor-viewpage-savewarning-title": "Title of the dialog shown when the user tries to leave the editor without saving their changes.\n\nFollowed by the following buttons:\n* {{msg-mw|Visualeditor-viewpage-savewarning-discard}}\n* {{msg-mw|Visualeditor-viewpage-savewarning-keep}}\n{{Identical|Are you sure?}}",
"visualeditor-wikitext-progress": "Label for progress bar shown while converting pasted wikitext.",
"visualeditor-wikitext-warning": "Contents of notification displayed when Wikitext has been detected.\n\nRefers to:\n* {{msg-mw|Visualeditor-wikitext-warning-link}}\n* {{msg-mw|Visualeditor-toolbar-cancel}}\n* {{msg-mw|Visualeditor-mweditmodesource-title}}\nSee also:\n* {{msg-mw|Visualeditor-beta-warning}}",
"visualeditor-wikitext-warning-link": "Link to page describing what Wikitext is.\n\nUsed in:\n* {{msg-mw|Visualeditor-wikitext-warning}}.\n\nTranslate to a title where most wikis in the language you're translating to have one such help page; if they don't have one, you can use [[mw:Special:MyLanguage/Help:Formatting]] as target.",

View file

@ -1981,7 +1981,7 @@ ve.init.mw.ArticleTarget.prototype.tryTeardown = function ( noPrompt, trackMecha
if ( noPrompt || !this.edited ) {
return this.teardown( trackMechanism );
} else {
return this.getSurface().dialogs.openWindow( 'cancelconfirm' )
return this.getSurface().dialogs.openWindow( 'abandonedit' )
.closed.then( function ( data ) {
if ( data && data.action === 'discard' ) {
return target.teardown( trackMechanism );
@ -2670,3 +2670,8 @@ ve.init.mw.ArticleTarget.prototype.renderCategories = function ( categoryItems )
return $output;
} );
};
/* Registration */
// Used in tryTeardown
ve.ui.windowFactory.register( mw.widgets.AbandonEditDialog );

View file

@ -1,43 +0,0 @@
/*!
* VisualEditor user interface MWCancelConfirmDialog class.
*
* @copyright 2011-2018 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Dialog for letting the user choose how to switch to wikitext mode.
*
* @class
* @extends OO.ui.MessageDialog
*
* @constructor
* @param {Object} [config] Configuration options
*/
ve.ui.MWCancelConfirmDialog = function VeUiMWCancelConfirmDialog( config ) {
// Parent constructor
ve.ui.MWCancelConfirmDialog.super.call( this, config );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWCancelConfirmDialog, OO.ui.MessageDialog );
/* Static Properties */
ve.ui.MWCancelConfirmDialog.static.name = 'cancelconfirm';
ve.ui.MWCancelConfirmDialog.static.title =
OO.ui.deferMsg( 'visualeditor-viewpage-savewarning-title' );
ve.ui.MWCancelConfirmDialog.static.message =
OO.ui.deferMsg( 'visualeditor-viewpage-savewarning' );
ve.ui.MWCancelConfirmDialog.static.actions = [
{ action: 'discard', label: OO.ui.deferMsg( 'visualeditor-viewpage-savewarning-discard' ), flags: [ 'primary', 'destructive' ] },
{ action: 'keep', label: OO.ui.deferMsg( 'visualeditor-viewpage-savewarning-keep' ), flags: 'safe' }
];
/* Registration */
ve.ui.windowFactory.register( ve.ui.MWCancelConfirmDialog );