2014-01-06 09:07:24 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWMathNode class.
|
|
|
|
*
|
2015-01-16 12:06:38 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2014-01-06 09:07:24 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*global ve, OO */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DataModel MediaWiki math node.
|
|
|
|
*
|
|
|
|
* @class
|
2014-05-20 14:52:46 +00:00
|
|
|
* @extends ve.dm.MWInlineExtensionNode
|
2014-01-06 09:07:24 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
2014-05-20 14:52:46 +00:00
|
|
|
* @param {Object} [element]
|
2014-01-06 09:07:24 +00:00
|
|
|
*/
|
2014-05-20 14:52:46 +00:00
|
|
|
ve.dm.MWMathNode = function VeDmMWMathNode() {
|
2014-01-06 09:07:24 +00:00
|
|
|
// Parent constructor
|
2014-11-12 18:46:46 +00:00
|
|
|
ve.dm.MWMathNode.super.apply( this, arguments );
|
2014-01-06 09:07:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-05-20 14:52:46 +00:00
|
|
|
OO.inheritClass( ve.dm.MWMathNode, ve.dm.MWInlineExtensionNode );
|
2014-01-06 09:07:24 +00:00
|
|
|
|
|
|
|
/* Static members */
|
|
|
|
|
|
|
|
ve.dm.MWMathNode.static.name = 'mwMath';
|
|
|
|
|
|
|
|
ve.dm.MWMathNode.static.tagName = 'img';
|
|
|
|
|
|
|
|
ve.dm.MWMathNode.static.extensionName = 'math';
|
|
|
|
|
2015-09-14 15:38:10 +00:00
|
|
|
/* Static methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.dm.MWMathNode.static.getHashObject = function ( dataElement ) {
|
|
|
|
// Parent method
|
|
|
|
var hashObject = ve.dm.MWMathNode.super.static.getHashObject.call( this, dataElement );
|
|
|
|
// The id does not affect the rendering.
|
|
|
|
if ( hashObject.mw.attrs ) {
|
|
|
|
delete hashObject.mw.attrs.id;
|
|
|
|
}
|
|
|
|
return hashObject;
|
|
|
|
};
|
|
|
|
|
2014-01-06 09:07:24 +00:00
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWMathNode );
|