mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
37240aca59
Show an inspector with inputwidget when the user clicks a math node. The data of the math equation is shown in the edit box, it can re-render the math tag image when the inspector is closed, and save the change when saving the page. TODO: * Change the icon from link to math * Translate title by translatewiki in i18n * Other further UI improvements Change-Id: I4d7533af25186cc39cc4bc6a4326d222ffd6db19
37 lines
1 KiB
JavaScript
37 lines
1 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWMathButtonTool class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Math button tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.InspectorButtonTool
|
|
* @constructor
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ui.MWMathButtonTool = function VeUiMWMathButtonTool( toolbar, config ) {
|
|
// Parent constructor
|
|
ve.ui.InspectorButtonTool.call( this, toolbar, config );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.MWMathButtonTool, ve.ui.InspectorButtonTool );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ui.MWMathButtonTool.static.name = 'mwMath';
|
|
ve.ui.MWMathButtonTool.static.icon = 'link';
|
|
ve.ui.MWMathButtonTool.static.titleMessage = 'visualeditor-mwmathinspector-title';
|
|
ve.ui.MWMathButtonTool.static.inspector = 'mwMathInspector';
|
|
ve.ui.MWMathButtonTool.static.modelClasses = [ ve.dm.MWMathNode ];
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.toolFactory.register( 'mwMath', ve.ui.MWMathButtonTool );
|