2013-10-15 12:18:11 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWImageNode class.
|
|
|
|
*
|
2014-01-05 12:05:05 +00:00
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
2013-10-15 12:18:11 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DataModel generated content node.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @abstract
|
|
|
|
* @extends ve.dm.GeneratedContentNode
|
|
|
|
* @constructor
|
|
|
|
* @param {number} [length] Length of content data in document; ignored and overridden to 0
|
|
|
|
* @param {Object} [element] Reference to element in linear model
|
|
|
|
*/
|
|
|
|
ve.dm.MWImageNode = function VeDmMWImageNode() {
|
|
|
|
// Parent constructor
|
|
|
|
ve.dm.GeneratedContentNode.call( this );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.dm.MWImageNode, ve.dm.GeneratedContentNode );
|
2013-10-15 12:18:11 +00:00
|
|
|
|
|
|
|
/* Static methods */
|
|
|
|
|
|
|
|
ve.dm.MWImageNode.static.getHashObject = function ( dataElement ) {
|
|
|
|
return {
|
|
|
|
'type': dataElement.type,
|
|
|
|
'resource': dataElement.attributes.resource,
|
|
|
|
'width': dataElement.attributes.width,
|
|
|
|
'height': dataElement.attributes.height
|
|
|
|
};
|
|
|
|
};
|