mediawiki-extensions-Visual.../modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
Trevor Parscal e4e6f8883e Use ActionDialog and NodeDialog
Based on I70e88f6 in VE core

* Cleanup dialogs by using node dialog and action dialog
* Move "Loading..." text from label of dialog apply button to dialog title
  (repurpose identical message)

Save dialog will be converted in a follow up.

Change-Id: I6a290f4bdc29e577c7c89b4babdab5853c4c10e5
2014-04-29 17:27:14 -07:00

53 lines
1.2 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 {Object} [config] Configuration options
*/
ve.ui.MWCommandHelpDialog = function VeUiMWCommandHelpDialog( config ) {
// Parent constructor
ve.ui.MWCommandHelpDialog.super.call( this, config );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWCommandHelpDialog, ve.ui.CommandHelpDialog );
/* Static methods */
/**
* @inheritdoc
*/
ve.ui.MWCommandHelpDialog.static.getCommandGroups = function () {
var commandGroups = ve.ui.MWCommandHelpDialog.super.static.getCommandGroups.call( this ),
accessKeyPrefix = mw.util.tooltipAccessKeyPrefix.toUpperCase().replace( /-/g, ' + ' ),
save = ve.msg( 'accesskey-save' );
if ( save !== '-' && save !== '' ) {
commandGroups.other.commands.push(
{
'shortcuts': [ accessKeyPrefix + save.toUpperCase() ],
'msg': 'visualeditor-savedialog-label-save'
}
);
}
return commandGroups;
};
/* Registration */
ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );