2015-08-05 21:43:23 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWMobileSaveDialog class.
|
|
|
|
*
|
2016-01-03 22:56:59 +00:00
|
|
|
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
|
2015-08-05 21:43:23 +00:00
|
|
|
* @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 );
|
|
|
|
|
2015-08-07 17:37:42 +00:00
|
|
|
/* 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 );
|
|
|
|
};
|
|
|
|
|
2015-08-05 21:43:23 +00:00
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ui.windowFactory.register( ve.ui.MWMobileSaveDialog );
|