mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Use ellipsis on toolbar save/publish button
Bug: T189803 Depends-On: Ic29717a660de5e80ee2a37f583b2a61c11fa87c4 Change-Id: Idaf80ea7e6ae9ffa165a8638af886bf6ab21a7f0
This commit is contained in:
parent
5fe7fb1813
commit
0f56af016d
|
@ -1349,9 +1349,13 @@
|
|||
"hidetoc",
|
||||
"ooui-dialog-process-continue",
|
||||
"publishchanges",
|
||||
"publishchanges-start",
|
||||
"publishpage",
|
||||
"publishpage-start",
|
||||
"savearticle",
|
||||
"savearticle-start",
|
||||
"savechanges",
|
||||
"savechanges-start",
|
||||
"showpreview",
|
||||
"showtoc",
|
||||
"summary-preview",
|
||||
|
@ -1392,12 +1396,14 @@
|
|||
"visualeditor-savedialog-label-create",
|
||||
"visualeditor-savedialog-label-error",
|
||||
"visualeditor-savedialog-label-publish-short",
|
||||
"visualeditor-savedialog-label-publish-short-start",
|
||||
"visualeditor-savedialog-label-report",
|
||||
"visualeditor-savedialog-label-resolve-conflict",
|
||||
"visualeditor-savedialog-label-resume-editing",
|
||||
"visualeditor-savedialog-label-review",
|
||||
"visualeditor-savedialog-label-review-good",
|
||||
"visualeditor-savedialog-label-save-short",
|
||||
"visualeditor-savedialog-label-save-short-start",
|
||||
"visualeditor-savedialog-label-visual-diff-report",
|
||||
"visualeditor-savedialog-label-warning",
|
||||
"visualeditor-savedialog-review-nosummary",
|
||||
|
|
|
@ -107,12 +107,18 @@ ve.init.mw.MobileArticleTarget.prototype.onSurfaceFocus = function () {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.init.mw.MobileArticleTarget.prototype.getSaveButtonLabel = function () {
|
||||
ve.init.mw.MobileArticleTarget.prototype.getSaveButtonLabel = function ( startProcess ) {
|
||||
var suffix = startProcess ? '-start' : '';
|
||||
// The following messages can be used here:
|
||||
// * visualeditor-savedialog-label-publish-short
|
||||
// * visualeditor-savedialog-label-publish-short-start
|
||||
// * visualeditor-savedialog-label-save-short
|
||||
// * visualeditor-savedialog-label-save-short-start
|
||||
if ( mw.config.get( 'wgEditSubmitButtonLabelPublish' ) ) {
|
||||
return OO.ui.deferMsg( 'visualeditor-savedialog-label-publish-short' );
|
||||
return OO.ui.deferMsg( 'visualeditor-savedialog-label-publish-short' + suffix );
|
||||
}
|
||||
|
||||
return OO.ui.deferMsg( 'visualeditor-savedialog-label-save-short' );
|
||||
return OO.ui.deferMsg( 'visualeditor-savedialog-label-save-short' + suffix );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1925,14 +1925,25 @@ ve.init.mw.ArticleTarget.prototype.setupToolbar = function () {
|
|||
/**
|
||||
* Getting the message for the toolbar / save dialog save / publish button
|
||||
*
|
||||
* @param {boolean} [startProcess] Use version of the label for starting that process, i.e. with an ellipsis after it
|
||||
* @return {Function|string} An i18n message or resolveable function
|
||||
*/
|
||||
ve.init.mw.ArticleTarget.prototype.getSaveButtonLabel = function () {
|
||||
ve.init.mw.ArticleTarget.prototype.getSaveButtonLabel = function ( startProcess ) {
|
||||
var suffix = startProcess ? '-start' : '';
|
||||
// The following messages can be used here
|
||||
// * publishpage
|
||||
// * pubishhpage-start
|
||||
// * publishchanges
|
||||
// * pubishhchanges-start
|
||||
// * savearticle
|
||||
// * savearticle-start
|
||||
// * savechanges
|
||||
// * savechanges-start
|
||||
if ( mw.config.get( 'wgEditSubmitButtonLabelPublish' ) ) {
|
||||
return OO.ui.deferMsg( !this.pageExists ? 'publishpage' : 'publishchanges' );
|
||||
return OO.ui.deferMsg( ( !this.pageExists ? 'publishpage' : 'publishchanges' ) + suffix );
|
||||
}
|
||||
|
||||
return OO.ui.deferMsg( !this.pageExists ? 'savearticle' : 'savechanges' );
|
||||
return OO.ui.deferMsg( ( !this.pageExists ? 'savearticle' : 'savechanges' ) + suffix );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1943,7 +1954,7 @@ ve.init.mw.ArticleTarget.prototype.getSaveButtonLabel = function () {
|
|||
ve.init.mw.ArticleTarget.prototype.setupToolbarSaveButton = function ( config ) {
|
||||
if ( !this.toolbarSaveButton ) {
|
||||
this.toolbarSaveButton = new OO.ui.ButtonWidget( ve.extendObject( {
|
||||
label: this.getSaveButtonLabel(),
|
||||
label: this.getSaveButtonLabel( true ),
|
||||
flags: [ 'progressive', 'primary' ],
|
||||
disabled: !this.restoring
|
||||
}, config ) );
|
||||
|
|
Loading…
Reference in a new issue