mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
b7c7d06968
To align with the linked patch in MediaWiki core. Taking advantage of the opportunity to use core's messages for these, and remove some dead wood old messages that were never used like "restore" items in mobile. Bug: T139033 Depends-On: Ie81b5edd275963a965cd44d0fd325cae9ee2f1a6 Change-Id: Ie00e94cc77cb750a7e8d1104366bb3dad65af8a4
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWCommandHelpDialog class.
|
|
*
|
|
* @copyright 2011-2016 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
|
|
* @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 properties */
|
|
|
|
ve.ui.MWCommandHelpDialog.static.commandGroups = ve.extendObject( {}, ve.ui.MWCommandHelpDialog.static.commandGroups, {
|
|
insert: {
|
|
title: OO.ui.deferMsg( 'visualeditor-shortcuts-insert' ),
|
|
promote: [],
|
|
demote: []
|
|
}
|
|
} );
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );
|
|
|
|
( function () {
|
|
var accessKeyPrefix = $.fn.updateTooltipAccessKeys.getAccessKeyPrefix().toUpperCase().replace( /-/g, ' + ' ),
|
|
saveShortcut = ve.msg( 'accesskey-save' );
|
|
|
|
if ( saveShortcut !== '-' && saveShortcut !== '' ) {
|
|
ve.ui.commandHelpRegistry.register( 'other', 'save', {
|
|
shortcuts: [ accessKeyPrefix + saveShortcut.toUpperCase() ],
|
|
label: OO.ui.deferMsg( 'savechanges' ),
|
|
demote: true
|
|
} );
|
|
}
|
|
} )();
|