mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-11 23:46:07 +00:00
905a834be2
Depends on I5d42943a0 in VE core. Bug: T114689 Change-Id: Ib64a1184132fbf62f38c6bd5dde689acff7b8ae5
55 lines
1.2 KiB
JavaScript
55 lines
1.2 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MWMathNode class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/*global ve, OO */
|
|
|
|
/**
|
|
* 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 );
|