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:
Bartosz Dziewoński 2014-05-12 00:54:58 +02:00
parent d26e2004ab
commit d8de718a5d
2 changed files with 19 additions and 1 deletions

View file

@ -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' ]
}
] );

View file

@ -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 );