mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
3386f66770
Depends on Ic92378b7 Bug: T111894 Change-Id: I5ca5f803642dd12db4e9fb213dc6478701661528
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWMobileSaveDialog class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Dialog for saving MediaWiki pages in mobile.
|
|
*
|
|
* Note that most methods are not safe to call before the dialog has initialized, except where
|
|
* noted otherwise.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.MWSaveDialog
|
|
*
|
|
* @constructor
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ui.MWMobileSaveDialog = function VeUiMwMobileSaveDialog( config ) {
|
|
// Parent constructor
|
|
ve.ui.MWMobileSaveDialog.super.call( this, config );
|
|
|
|
// Initialization
|
|
this.$element.addClass( 've-ui-mwMobileSaveDialog' );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWMobileSaveDialog, ve.ui.MWSaveDialog );
|
|
|
|
/* Methods */
|
|
ve.ui.MWMobileSaveDialog.prototype.getSetupProcess = function ( data ) {
|
|
return ve.ui.MWMobileSaveDialog.super.prototype.getSetupProcess.call( this, data )
|
|
.next( function () {
|
|
// Update save button label
|
|
this.actions.forEach( { actions: 'save' }, function ( action ) {
|
|
action.setLabel(
|
|
ve.msg(
|
|
// Possible messages:
|
|
// visualeditor-savedialog-label-restore-short, visualeditor-savedialog-label-save-short
|
|
'visualeditor-savedialog-label-' + ( this.restoring ? 'restore' : 'save' ) + '-short'
|
|
)
|
|
);
|
|
} );
|
|
}, this );
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.windowFactory.register( ve.ui.MWMobileSaveDialog );
|