mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Move shortcut keys help from "Page options" dropdown to "Help" popup
Obviously it doesn't belong there. I think I'm getting the hang of this. :D Change-Id: I5933e32bb8a803d004c2e33d55d7900d1b18a44e
This commit is contained in:
parent
d26e2004ab
commit
d8de718a5d
|
@ -1122,7 +1122,7 @@ ve.init.mw.ViewPageTarget.prototype.attachToolbarButtons = function () {
|
|||
'type': 'list',
|
||||
'icon': 'menu',
|
||||
'title': ve.msg( 'visualeditor-pagemenu-tooltip' ),
|
||||
'include': [ 'meta', 'settings', 'advancedSettings', 'categories', 'languages', 'editModeSource', 'commandHelp' ]
|
||||
'include': [ 'meta', 'settings', 'advancedSettings', 'categories', 'languages', 'editModeSource' ]
|
||||
}
|
||||
] );
|
||||
|
||||
|
|
|
@ -114,6 +114,12 @@ ve.ui.MWHelpPopupTool = function VeUiMWHelpPopupTool( toolGroup, config ) {
|
|||
'target': '_blank',
|
||||
'label': ve.msg( 'visualeditor-help-label' )
|
||||
} );
|
||||
this.keyboardShortcutsButton = new OO.ui.ButtonWidget( {
|
||||
'$': this.$,
|
||||
'frameless': true,
|
||||
'icon': 'help',
|
||||
'label': ve.msg( 'visualeditor-dialog-command-help-title' )
|
||||
} );
|
||||
this.feedbackButton = new OO.ui.ButtonWidget( {
|
||||
'$': this.$,
|
||||
'frameless': true,
|
||||
|
@ -123,6 +129,7 @@ ve.ui.MWHelpPopupTool = function VeUiMWHelpPopupTool( toolGroup, config ) {
|
|||
|
||||
// Events
|
||||
this.feedbackButton.connect( this, { 'click': 'onFeedbackClick' } );
|
||||
this.keyboardShortcutsButton.connect( this, { 'click': 'onKeyboardShortcutsClick' } );
|
||||
|
||||
// Initialization
|
||||
this.$items
|
||||
|
@ -136,6 +143,7 @@ ve.ui.MWHelpPopupTool = function VeUiMWHelpPopupTool( toolGroup, config ) {
|
|||
this.$( '<div>' )
|
||||
.addClass( 've-ui-mwHelpPopupTool-item' )
|
||||
.append( this.helpButton.$element )
|
||||
.append( this.keyboardShortcutsButton.$element )
|
||||
.append( this.feedbackButton.$element )
|
||||
);
|
||||
if ( ve.version.id !== false ) {
|
||||
|
@ -197,6 +205,16 @@ ve.ui.MWHelpPopupTool.prototype.onFeedbackClick = function () {
|
|||
this.feedback.launch();
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle clicks on the keyboard shortcuts button.
|
||||
*
|
||||
* @method
|
||||
*/
|
||||
ve.ui.MWHelpPopupTool.prototype.onKeyboardShortcutsClick = function () {
|
||||
this.hidePopup();
|
||||
ve.ui.commandRegistry.lookup( 'commandHelp' ).execute( this.toolbar.getSurface() );
|
||||
};
|
||||
|
||||
/* Registration */
|
||||
|
||||
ve.ui.toolFactory.register( ve.ui.MWHelpPopupTool );
|
||||
|
|
Loading…
Reference in a new issue