mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
8bda88f661
The extension registers a lot of sequences that don't apply to core VisualEditor. Pretty much the opposite of the trigger situation, where almost all are in core. So, merge them into the help dialog. Update VE core submodule to master (be148ae) New changes: 7380244 [BREAKING CHANGE] Include sequences in the command help dialog Bug: T116013 Change-Id: I5ad2939c10140b954fb29e1e50414ab7d79aeab7
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 = mw.util.tooltipAccessKeyPrefix.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
|
|
} );
|
|
}
|
|
} )();
|