2014-02-13 13:29:29 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWCommandHelpDialog class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dialog listing all command keyboard shortcuts.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.CommandHelpDialog
|
|
|
|
*
|
|
|
|
* @constructor
|
2014-07-14 21:32:49 +00:00
|
|
|
* @param {OO.ui.WindowManager} manager Manager of window
|
2014-02-13 13:29:29 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2014-07-14 21:32:49 +00:00
|
|
|
ve.ui.MWCommandHelpDialog = function VeUiMWCommandHelpDialog( manager, config ) {
|
2014-02-13 13:29:29 +00:00
|
|
|
// Parent constructor
|
2014-07-14 21:32:49 +00:00
|
|
|
ve.ui.MWCommandHelpDialog.super.call( this, manager, config );
|
2014-02-13 13:29:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWCommandHelpDialog, ve.ui.CommandHelpDialog );
|
|
|
|
|
|
|
|
/* Static methods */
|
|
|
|
|
2014-04-24 00:22:45 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2014-02-13 13:29:29 +00:00
|
|
|
ve.ui.MWCommandHelpDialog.static.getCommandGroups = function () {
|
2014-04-24 00:22:45 +00:00
|
|
|
var commandGroups = ve.ui.MWCommandHelpDialog.super.static.getCommandGroups.call( this ),
|
2014-02-13 13:29:29 +00:00
|
|
|
accessKeyPrefix = mw.util.tooltipAccessKeyPrefix.toUpperCase().replace( /-/g, ' + ' ),
|
|
|
|
save = ve.msg( 'accesskey-save' );
|
|
|
|
|
|
|
|
if ( save !== '-' && save !== '' ) {
|
|
|
|
commandGroups.other.commands.push(
|
|
|
|
{
|
2014-03-05 14:08:08 +00:00
|
|
|
'shortcuts': [ accessKeyPrefix + save.toUpperCase() ],
|
2014-02-13 13:29:29 +00:00
|
|
|
'msg': 'visualeditor-savedialog-label-save'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return commandGroups;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
2014-04-21 22:31:21 +00:00
|
|
|
ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );
|