mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
e7d27cd04b
Follows-up 62c06d0
.
Change-Id: I7746ab1d0a445c69e29a0fde96773a89b4108dd5
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel GeneratedContentNode class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* DataModel generated content node.
|
|
*
|
|
* @class
|
|
* @abstract
|
|
* @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.GeneratedContentNode = function VeDmGeneratedContentNode() {
|
|
};
|
|
|
|
/* Static methods */
|
|
|
|
ve.dm.GeneratedContentNode.static = {};
|
|
|
|
/**
|
|
* Store HTML of DOM elements, hashed on data element
|
|
* @static
|
|
* @param {Object} dataElement Data element
|
|
* @param {Object|string|Array} generatedContents Generated contents
|
|
* @param {ve.dm.IndexValueStore} store Index-value store
|
|
* @returns {number} Index of stored data
|
|
*/
|
|
ve.dm.GeneratedContentNode.static.storeGeneratedContents = function ( dataElement, generatedContents, store ) {
|
|
var hash = OO.getHash( [ this.getHashObject( dataElement ), undefined ] );
|
|
return store.index( generatedContents, hash );
|
|
};
|