2013-03-01 01:17:02 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel MWHeadingNode class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-04-17 17:53:26 +00:00
|
|
|
* DataModel MediaWiki heading node.
|
2013-03-01 01:17:02 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.dm.HeadingNode
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.dm.LeafNode[]} [children] Child nodes to attach
|
|
|
|
* @param {Object} [element] Reference to element in linear model
|
|
|
|
*/
|
|
|
|
ve.dm.MWHeadingNode = function VeDmMWHeadingNode( children, element ) {
|
|
|
|
// Parent constructor
|
|
|
|
ve.dm.HeadingNode.call( this, children, element );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.inheritClass( ve.dm.MWHeadingNode, ve.dm.HeadingNode );
|
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
2013-05-28 11:31:41 +00:00
|
|
|
ve.dm.MWHeadingNode.static.name = 'mwHeading';
|
2013-03-01 01:17:02 +00:00
|
|
|
|
|
|
|
ve.dm.MWHeadingNode.static.suggestedParentNodeTypes = [ 'document' ];
|
|
|
|
|
|
|
|
ve.dm.MWHeadingNode.static.toDataElement = function () {
|
|
|
|
var parentElement = ve.dm.HeadingNode.static.toDataElement.apply( this, arguments );
|
2013-05-28 11:31:41 +00:00
|
|
|
parentElement.type = 'mwHeading';
|
2013-03-01 01:17:02 +00:00
|
|
|
return parentElement;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.modelRegistry.register( ve.dm.MWHeadingNode );
|