Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7442917
ve.dm.GeneratedContentNode.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.dm.GeneratedContentNode.js
View Options
/*!
* VisualEditor DataModel GeneratedContentNode class.
*
* @copyright See AUTHORS.txt
*/
/**
* DataModel generated content node.
*
* @class
* @abstract
*
* @constructor
*/
ve
.
dm
.
GeneratedContentNode
=
function
VeDmGeneratedContentNode
()
{
};
/* Inheritance */
OO
.
initClass
(
ve
.
dm
.
GeneratedContentNode
);
/* Events */
/**
* @event ve.dm.GeneratedContentNode#generatedContentsError
* @param {jQuery} $element Element containing the error message
*/
/* Static methods */
/**
* Store HTML of DOM elements, hashed on data element
*
* @static
* @param {ve.dm.LinearData.Element} dataElement Data element
* @param {Object|string|Array} generatedContents Generated contents
* @param {ve.dm.HashValueStore} store Hash-value store
* @return {string} Hash of stored data
*/
ve
.
dm
.
GeneratedContentNode
.
static
.
storeGeneratedContents
=
function
(
dataElement
,
generatedContents
,
store
)
{
const
hash
=
OO
.
getHash
(
[
this
.
getHashObjectForRendering
(
dataElement
),
undefined
]
);
return
store
.
hash
(
generatedContents
,
hash
);
};
/**
* Get as hash object that uniquely describes the rendering
*
* Sub-classes can simplify this hash if certain attributes
* don't affect the rendering.
*
* @static
* @param {ve.dm.LinearData.Element} dataElement Data element
* @return {Object} Hash object
*/
ve
.
dm
.
GeneratedContentNode
.
static
.
getHashObjectForRendering
=
function
(
dataElement
)
{
return
this
.
getHashObject
(
dataElement
);
};
/* Methods */
/**
* Get as hash object that uniquely describes the rendering
*
* The actual logic is in a static function as this needs
* to be accessible from ve.dm.Converter
*
* @return {Object} Hash object
*/
ve
.
dm
.
GeneratedContentNode
.
prototype
.
getHashObjectForRendering
=
function
()
{
return
this
.
constructor
.
static
.
getHashObjectForRendering
(
this
.
element
);
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 16:47 (16 h, 3 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ef/ac/cc8640477cbb58a4fe1277605b5a
Default Alt Text
ve.dm.GeneratedContentNode.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment