2 * MediaWiki Widgets - AbandonEditDialog class.
4 * @copyright 2011-2018 VisualEditor Team and others; see AUTHORS.txt
5 * @license The MIT License (MIT); see LICENSE.txt
9 * @classdesc Confirm dialog shown when the user is leaving an editor without saving.
11 * The `useeditwarning` user option should be checked before showing this dialog.
14 * @extends OO.ui.MessageDialog
17 * @description Create an instance of `mw.widgets.AbandonEditDialog`.
18 * @param {Object} [config] Configuration options
20 mw.widgets.AbandonEditDialog = function VeUiAbandonEditDialog( config ) {
22 mw.widgets.AbandonEditDialog.super.call( this, config );
27 OO.inheritClass( mw.widgets.AbandonEditDialog, OO.ui.MessageDialog );
29 /* Static Properties */
31 mw.widgets.AbandonEditDialog.static.name = 'abandonedit';
33 mw.widgets.AbandonEditDialog.static.title =
34 OO.ui.deferMsg( 'mw-widgets-abandonedit-title' );
36 mw.widgets.AbandonEditDialog.static.message =
37 OO.ui.deferMsg( 'mw-widgets-abandonedit' );
39 mw.widgets.AbandonEditDialog.static.actions = [
40 { action: 'discard', label: OO.ui.deferMsg( 'mw-widgets-abandonedit-discard' ), flags: 'destructive' },
41 { action: 'keep', label: OO.ui.deferMsg( 'mw-widgets-abandonedit-keep' ), flags: [ 'primary', 'safe' ] }