2014-02-13 13:29:29 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWCommandHelpDialog class.
|
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2014-02-13 13:29:29 +00:00
|
|
|
* @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
|
|
|
|
*/
|
2014-08-21 00:50:54 +00:00
|
|
|
ve.ui.MWCommandHelpDialog = function VeUiMWCommandHelpDialog( config ) {
|
2014-02-13 13:29:29 +00:00
|
|
|
// Parent constructor
|
2014-08-21 00:50:54 +00:00
|
|
|
ve.ui.MWCommandHelpDialog.super.call( this, config );
|
2014-02-13 13:29:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWCommandHelpDialog, ve.ui.CommandHelpDialog );
|
|
|
|
|
2015-10-23 17:21:11 +00:00
|
|
|
/* Registration */
|
2014-02-13 13:29:29 +00:00
|
|
|
|
2015-10-23 17:21:11 +00:00
|
|
|
ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );
|
|
|
|
|
|
|
|
( function () {
|
|
|
|
var accessKeyPrefix = mw.util.tooltipAccessKeyPrefix.toUpperCase().replace( /-/g, ' + ' ),
|
2014-02-13 13:29:29 +00:00
|
|
|
save = ve.msg( 'accesskey-save' );
|
|
|
|
|
2015-10-23 17:21:11 +00:00
|
|
|
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'
|
|
|
|
} );
|
|
|
|
|
2014-02-13 13:29:29 +00:00
|
|
|
if ( save !== '-' && save !== '' ) {
|
2015-10-23 17:21:11 +00:00
|
|
|
ve.ui.MWCommandHelpDialog.static.registerCommand( 'other', 'save', {
|
|
|
|
shortcuts: [ accessKeyPrefix + save.toUpperCase() ],
|
|
|
|
msg: 'visualeditor-savedialog-label-save',
|
|
|
|
demote: true
|
|
|
|
} );
|
2014-02-13 13:29:29 +00:00
|
|
|
}
|
2015-10-23 17:21:11 +00:00
|
|
|
} )();
|