mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
91152e2c05
Change-Id: I85628e9282d7b78a4fdd2ea2f3b0b72019302dcc
58 lines
1.9 KiB
JavaScript
58 lines
1.9 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWCommandHelpDialog class.
|
|
*
|
|
* @copyright 2011-2015 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 );
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );
|
|
|
|
( function () {
|
|
var accessKeyPrefix = $.fn.updateTooltipAccessKeys.getAccessKeyPrefix().toUpperCase().replace( /-/g, ' + ' ),
|
|
save = ve.msg( 'accesskey-save' );
|
|
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'textStyle', 'link', { sequence: [ 'wikitextLink' ] } );
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'formatting', 'blockquote', { sequence: [ 'wikitextDescription' ] } );
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'formatting', 'listNumber', { sequence: [ 'numberHash' ] } );
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'formatting', 'heading2', {
|
|
sequence: [ 'wikitextHeading' ],
|
|
msg: 'visualeditor-formatdropdown-format-heading2'
|
|
} );
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'other', 'template', {
|
|
sequence: [ 'wikitextTemplate' ],
|
|
msg: 'visualeditor-dialog-transclusion-add-template'
|
|
} );
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'other', 'ref', {
|
|
sequence: [ 'wikitextRef' ],
|
|
msg: 'visualeditor-dialog-reference-title'
|
|
} );
|
|
|
|
if ( save !== '-' && save !== '' ) {
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'other', 'save', {
|
|
shortcuts: [ accessKeyPrefix + save.toUpperCase() ],
|
|
msg: 'visualeditor-savedialog-label-save',
|
|
demote: true
|
|
} );
|
|
}
|
|
} )();
|