mediawiki-extensions-Visual.../modules/ve-mw/ui/dialogs/ve.ui.MWWikitextConvertConfirmDialog.js
David Lynch d3fd979d3b Paste conversion dialog shouldn't be escapable
It doesn't have a "cancel and do nothing" route to fall back on, so pressing
escape does the non-progressive action, which is to paste-as-wikitext rather
than paste-as-plaintext. Neither of these is really an intuitive outcome.

Change-Id: I786b6fc87e3cdf3bb50898a070a15a353a242848
2018-06-04 11:16:19 -05:00

46 lines
1.4 KiB
JavaScript

/*
* VisualEditor user interface MWWikitextConvertConfirmDialog 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 whether to convert probable-wikitext
*
* @class
* @extends OO.ui.MessageDialog
*
* @constructor
* @param {Object} [config] Configuration options
*/
ve.ui.MWWikitextConvertConfirmDialog = function VeUiMWWikitextConvertConfirmDialog( config ) {
// Parent constructor
ve.ui.MWWikitextConvertConfirmDialog.super.call( this, config );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWWikitextConvertConfirmDialog, OO.ui.MessageDialog );
/* Static Properties */
ve.ui.MWWikitextConvertConfirmDialog.static.name = 'wikitextconvertconfirm';
ve.ui.MWWikitextConvertConfirmDialog.static.title =
OO.ui.deferMsg( 'visualeditor-wikitextconvert-title' );
ve.ui.MWWikitextConvertConfirmDialog.static.message =
OO.ui.deferMsg( 'visualeditor-wikitextconvert-message' );
ve.ui.MWWikitextConvertConfirmDialog.static.actions = [
{ action: 'convert', label: OO.ui.deferMsg( 'visualeditor-wikitextconvert-convert' ) },
{ action: 'plain', label: OO.ui.deferMsg( 'visualeditor-wikitextconvert-plain' ), flags: [ 'primary', 'progressive' ] }
];
ve.ui.MWWikitextConvertConfirmDialog.static.escapable = false;
/* Registration */
ve.ui.windowFactory.register( ve.ui.MWWikitextConvertConfirmDialog );