mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/buttons/ve.ui.MWMathButtonTool.js
Ed Sanders 0d30e1e77d MWMath cleanup
VisualEditor.php
* Add CSS file

ve.ce.MWMathNode.js
* Wrap the image in a span, so GenerateContentNode doesn't
  try to nest an image inside an image
* Remove unnecessary attribute setting
* Only pass unwrapped image to deferred.resolve
* Retrigger MathJax rendering

ve.ce.Node.css
* Use inline-block for image wrapper

ve.dm.MWMathNode.js
* Mixin GeneratedContentNode and implement getHash
* Copy over functionality of MWTransclusionNode:
  + Just store data-mw for attributes
  + Store orignal(DomElement|MW|Index) for selser

ve.init.mw.ViewPageTarget.js
* Add mwMath to the toolbar

ve.ui.MWMathInspector.js
* Remove static.InputWidget, not required in this architecture
* Use multiline TextInputWidget
* Only update mw attribute
* Allow creation of new math nodes

ve.ui.MWInspector.css
* Set height of TextInputWidget

Change-Id: I520f8ccc9f89a2ce70aa1d9e02ed0c6cacbecc2f
2013-07-30 23:47:37 +01:00

41 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
*/
/**
* UserInterface MediaWiki 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 = 'math';
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 );