2015-12-06 22:35:25 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface MWMathDialogTool class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2018-04-13 14:04:06 +00:00
|
|
|
* @license MIT
|
2015-12-06 22:35:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface math tool.
|
|
|
|
*
|
|
|
|
* @class
|
2015-12-12 01:09:48 +00:00
|
|
|
* @extends ve.ui.FragmentWindowTool
|
2015-12-06 22:35:25 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.MWMathDialogTool = function VeUiMWMathDialogTool( toolGroup, config ) {
|
|
|
|
ve.ui.MWMathDialogTool.super.call( this, toolGroup, config );
|
|
|
|
};
|
2015-12-12 01:09:48 +00:00
|
|
|
OO.inheritClass( ve.ui.MWMathDialogTool, ve.ui.FragmentWindowTool );
|
2015-12-06 22:35:25 +00:00
|
|
|
ve.ui.MWMathDialogTool.static.name = 'math';
|
|
|
|
ve.ui.MWMathDialogTool.static.group = 'object';
|
2019-01-23 22:36:14 +00:00
|
|
|
ve.ui.MWMathDialogTool.static.icon = 'mathematics';
|
2015-12-06 22:35:25 +00:00
|
|
|
ve.ui.MWMathDialogTool.static.title = OO.ui.deferMsg(
|
2017-01-11 21:50:35 +00:00
|
|
|
'math-visualeditor-mwmathdialog-title' );
|
2015-12-06 22:35:25 +00:00
|
|
|
ve.ui.MWMathDialogTool.static.modelClasses = [ ve.dm.MWMathNode ];
|
|
|
|
ve.ui.MWMathDialogTool.static.commandName = 'mathDialog';
|
|
|
|
ve.ui.toolFactory.register( ve.ui.MWMathDialogTool );
|
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'mathDialog', 'window', 'open',
|
|
|
|
{ args: [ 'mathDialog' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'mathInspector', 'window', 'open',
|
|
|
|
{ args: [ 'mathInspector' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
ve.ui.sequenceRegistry.register(
|
|
|
|
new ve.ui.Sequence( 'wikitextMath', 'mathDialog', '<math', 5 )
|
|
|
|
);
|
|
|
|
|
|
|
|
ve.ui.commandHelpRegistry.register( 'insert', 'mathDialog', {
|
|
|
|
sequences: [ 'wikitextMath' ],
|
2017-01-11 21:50:35 +00:00
|
|
|
label: OO.ui.deferMsg( 'math-visualeditor-mwmathdialog-title' )
|
2015-12-06 22:35:25 +00:00
|
|
|
} );
|