mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-25 07:56:58 +00:00
f66ef920fb
Change-Id: I95f59d9bef6bb8fec69b454dc8efe4b4c7e40805
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWMathNode class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel MediaWiki math node.
|
|
*
|
|
* @class
|
|
* @extends ve.dm.MWInlineExtensionNode
|
|
*
|
|
* @constructor
|
|
* @param {Object} [element]
|
|
*/
|
|
ve.dm.MWMathNode = function VeDmMWMathNode() {
|
|
// Parent constructor
|
|
ve.dm.MWMathNode.super.apply( this, arguments );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.dm.MWMathNode, ve.dm.MWInlineExtensionNode );
|
|
|
|
/* Static members */
|
|
|
|
ve.dm.MWMathNode.static.name = 'mwMath';
|
|
|
|
ve.dm.MWMathNode.static.tagName = 'img';
|
|
|
|
ve.dm.MWMathNode.static.extensionName = 'math';
|
|
|
|
/* Static Methods */
|
|
|
|
/**
|
|
* @inheritdoc ve.dm.GeneratedContentNode
|
|
*/
|
|
ve.dm.MWMathNode.static.getHashObjectForRendering = function ( dataElement ) {
|
|
// Parent method
|
|
var hashObject = ve.dm.MWMathNode.super.static.getHashObjectForRendering.call( this, dataElement );
|
|
|
|
// The id does not affect the rendering.
|
|
if ( hashObject.mw.attrs ) {
|
|
delete hashObject.mw.attrs.id;
|
|
}
|
|
return hashObject;
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWMathNode );
|