Merge "Show keyboard shortcuts in button tooltips"

This commit is contained in:
jenkins-bot 2020-11-26 18:12:03 +00:00 committed by Gerrit Code Review
commit d52f6334ea
2 changed files with 19 additions and 3 deletions

View file

@ -124,7 +124,10 @@
"discussiontools-replywidget-reply",
"discussiontools-replywidget-summary",
"discussiontools-replywidget-terms-click",
"discussiontools-replywidget-transcluded"
"discussiontools-replywidget-transcluded",
"visualeditor-key-ctrl",
"visualeditor-key-enter",
"visualeditor-key-escape"
],
"dependencies": [
"oojs-ui-widgets",

View file

@ -53,12 +53,25 @@ function ReplyWidget( commentController, comment, pageName, oldId, config ) {
this.replyBodyWidget = this.createReplyBodyWidget( inputConfig );
this.replyButton = new OO.ui.ButtonWidget( {
flags: [ 'primary', 'progressive' ],
label: mw.msg( 'discussiontools-replywidget-reply' )
label: mw.msg( 'discussiontools-replywidget-reply' ),
title: mw.msg( 'discussiontools-replywidget-reply' ) + ' ' +
// TODO: Use VE keyboard shortcut generating code
( $.client.profile().platform === 'mac' ?
'⌘⏎' :
mw.msg( 'visualeditor-key-ctrl' ) + '+' + mw.msg( 'visualeditor-key-enter' )
)
} );
this.cancelButton = new OO.ui.ButtonWidget( {
flags: [ 'destructive' ],
label: mw.msg( 'discussiontools-replywidget-cancel' ),
framed: false
framed: false,
title: mw.msg( 'discussiontools-replywidget-cancel' ) + ' ' +
// TODO: Use VE keyboard shortcut generating code
( $.client.profile().platform === 'mac' ?
'⎋' :
mw.msg( 'visualeditor-key-escape' )
)
} );
this.modeTabSelect = new OO.ui.TabSelectWidget( {