2013-04-17 17:53:26 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWReferenceListNode class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DataModel MediaWiki reference list node.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.dm.LeafNode
|
|
|
|
* @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.MWReferenceListNode = function VeDmMWReferenceListNode( length, element ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.dm.LeafNode.call( this, 0, element );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.inheritClass( ve.dm.MWReferenceListNode, ve.dm.LeafNode );
|
|
|
|
|
|
|
|
/* Static members */
|
|
|
|
|
|
|
|
ve.dm.MWReferenceListNode.static.name = 'MWreferenceList';
|
|
|
|
|
|
|
|
ve.dm.MWReferenceListNode.static.matchTagNames = null;
|
|
|
|
|
|
|
|
ve.dm.MWReferenceListNode.static.matchRdfaTypes = [ 'mw:Object/References' ];
|
|
|
|
|
2013-05-08 04:22:22 +00:00
|
|
|
ve.dm.MWReferenceListNode.static.storeHtmlAttributes = false;
|
2013-04-17 17:53:26 +00:00
|
|
|
|
2013-05-08 04:22:22 +00:00
|
|
|
ve.dm.MWReferenceListNode.static.toDataElement = function ( domElements ) {
|
2013-04-17 17:53:26 +00:00
|
|
|
return {
|
|
|
|
'type': this.name,
|
|
|
|
'attributes': {
|
2013-05-08 04:22:22 +00:00
|
|
|
'domElements': ve.copyArray( domElements )
|
2013-04-17 17:53:26 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2013-05-08 04:22:22 +00:00
|
|
|
ve.dm.MWReferenceListNode.static.toDomElements = function ( dataElement ) {
|
|
|
|
return dataElement.attributes.domElements;
|
2013-04-17 17:53:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWReferenceListNode );
|