2013-04-25 22:24:37 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel TableCaptionNode class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DataModel table caption node.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.dm.BranchNode
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.dm.BranchNode[]} [children] Child nodes to attach
|
|
|
|
* @param {Object} [element] Reference to element in linear model
|
|
|
|
*/
|
|
|
|
ve.dm.TableCaptionNode = function VeDmTableCaptionNode( children, element ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.dm.BranchNode.call( this, children, element );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.dm.TableCaptionNode, ve.dm.BranchNode );
|
2013-04-25 22:24:37 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.dm.TableCaptionNode.static.name = 'tableCaption';
|
|
|
|
|
|
|
|
ve.dm.TableCaptionNode.static.parentNodeTypes = [ 'table' ];
|
|
|
|
|
|
|
|
ve.dm.TableCaptionNode.static.matchTagNames = [ 'caption' ];
|
|
|
|
|
|
|
|
ve.dm.TableCaptionNode.static.toDataElement = function () {
|
|
|
|
return { 'type': 'tableCaption' };
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.dm.TableCaptionNode.static.toDomElements = function ( dataElement, doc ) {
|
|
|
|
return [ doc.createElement( 'caption' ) ];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.TableCaptionNode );
|