2015-10-19 22:27:16 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWSyntaxHighlightDialogTool class.
|
|
|
|
*
|
2024-02-29 15:13:03 +00:00
|
|
|
* @copyright VisualEditor Team and others
|
2015-10-19 22:27:16 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface syntax highlight tool.
|
|
|
|
*
|
|
|
|
* @class
|
2015-12-19 01:25:34 +00:00
|
|
|
* @extends ve.ui.FragmentWindowTool
|
2015-10-19 22:27:16 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.MWSyntaxHighlightDialogTool = function VeUiMWSyntaxHighlightDialogTool() {
|
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.super.apply( this, arguments );
|
|
|
|
};
|
2015-12-19 01:25:34 +00:00
|
|
|
OO.inheritClass( ve.ui.MWSyntaxHighlightDialogTool, ve.ui.FragmentWindowTool );
|
2015-10-19 22:27:16 +00:00
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.name = 'syntaxhighlightDialog';
|
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.group = 'object';
|
2018-03-20 17:19:10 +00:00
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.icon = 'markup';
|
2015-10-19 22:27:16 +00:00
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.title = OO.ui.deferMsg(
|
|
|
|
'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title' );
|
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.modelClasses = [ ve.dm.MWBlockSyntaxHighlightNode ];
|
|
|
|
ve.ui.MWSyntaxHighlightDialogTool.static.commandName = 'syntaxhighlightDialog';
|
|
|
|
ve.ui.toolFactory.register( ve.ui.MWSyntaxHighlightDialogTool );
|
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'syntaxhighlightDialog', 'window', 'open',
|
|
|
|
{ args: [ 'syntaxhighlightDialog' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|
2015-10-22 10:56:48 +00:00
|
|
|
|
|
|
|
ve.ui.sequenceRegistry.register(
|
|
|
|
// Don't wait for the user to type out the full <syntaxhighlight> tag
|
|
|
|
new ve.ui.Sequence( 'wikitextSyntax', 'syntaxhighlightDialog', '<syntax', 7 )
|
|
|
|
);
|
|
|
|
|
|
|
|
ve.ui.sequenceRegistry.register(
|
|
|
|
new ve.ui.Sequence( 'wikitextSource', 'syntaxhighlightDialog', '<source', 7 )
|
|
|
|
);
|
2015-11-05 10:14:14 +00:00
|
|
|
|
|
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'syntax', {
|
|
|
|
sequences: [ 'wikitextSyntax', 'wikitextSource' ],
|
|
|
|
label: OO.ui.deferMsg( 'syntaxhighlight-visualeditor-mwsyntaxhighlightinspector-title' )
|
|
|
|
} );
|