mediawiki-extensions-Visual.../modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
Ed Sanders 2ce113f0c7 Add MW-specific keyboard shortcut help
For now just accessKey+S for save.

Change-Id: Idf4fa31b98d1fa9ea62d9a9f2937ae7496a9a201
2014-02-19 23:53:22 +00:00

52 lines
1.3 KiB
JavaScript

/*!
* VisualEditor UserInterface MWCommandHelpDialog class.
*
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/*global mw */
/**
* Dialog listing all command keyboard shortcuts.
*
* @class
* @extends ve.ui.CommandHelpDialog
*
* @constructor
* @param {ve.ui.WindowSet} windowSet Window set this dialog is part of
* @param {Object} [config] Configuration options
*/
ve.ui.MWCommandHelpDialog = function VeUiMWCommandHelpDialog( windowSet, config ) {
// Parent constructor
ve.ui.CommandHelpDialog.call( this, windowSet, config );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWCommandHelpDialog, ve.ui.CommandHelpDialog );
/* Static methods */
/** */
ve.ui.MWCommandHelpDialog.static.getCommandGroups = function () {
var commandGroups = ve.ui.CommandHelpDialog.static.getCommandGroups.call( this ),
accessKeyPrefix = mw.util.tooltipAccessKeyPrefix.toUpperCase().replace( /-/g, ' + ' ),
save = ve.msg( 'accesskey-save' );
if ( save !== '-' && save !== '' ) {
commandGroups.other.commands.push(
{
'shortcut': accessKeyPrefix + save.toUpperCase(),
'msg': 'visualeditor-savedialog-label-save'
}
);
}
return commandGroups;
};
/* Registration */
ve.ui.dialogFactory.register( ve.ui.MWCommandHelpDialog );