mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
394a40f27c
Change-Id: I280d2a59326bd83357c7a09c3a188a70fbc75335
38 lines
1.1 KiB
JavaScript
38 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 members */
|
|
|
|
ve.dm.GeneratedContentNode.static = {};
|
|
|
|
ve.dm.GeneratedContentNode.static.matchTagNames = [];
|
|
|
|
ve.dm.GeneratedContentNode.static.enableAboutGrouping = true;
|
|
|
|
/**
|
|
* Store HTML of DOM elements, hashed on data element
|
|
* @param {Object} dataElement Data element
|
|
* @param {HTMLElement[]} domElements DOM elements
|
|
* @param {ve.dm.IndexValueStore} store Index-value store
|
|
* @returns {number} Index of stored data
|
|
*/
|
|
ve.dm.GeneratedContentNode.static.storeDomElements = function ( dataElement, domElements, store ) {
|
|
var hash = ve.getHash( this.getHashObject( dataElement ) );
|
|
return store.index( domElements, hash );
|
|
}; |