2012-02-06 23:50:56 +00:00
|
|
|
/**
|
|
|
|
* Creates an ve.dm.HeadingNode object.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @constructor
|
|
|
|
* @extends {ve.dm.LeafNode}
|
|
|
|
* @param {Object} element Document data element of this node
|
|
|
|
* @param {Integer} length Length of document data element
|
|
|
|
*/
|
|
|
|
ve.dm.HeadingNode = function( element, length ) {
|
|
|
|
// Inheritance
|
|
|
|
ve.dm.LeafNode.call( this, 'heading', element, length );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a heading view for this model.
|
|
|
|
*
|
|
|
|
* @method
|
2012-03-06 22:39:43 +00:00
|
|
|
* @returns {ve.ce.ParagraphNode}
|
2012-02-06 23:50:56 +00:00
|
|
|
*/
|
|
|
|
ve.dm.HeadingNode.prototype.createView = function() {
|
2012-03-06 22:39:43 +00:00
|
|
|
return new ve.ce.HeadingNode( this );
|
2012-02-06 23:50:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeModels.heading = ve.dm.HeadingNode;
|
|
|
|
|
|
|
|
ve.dm.DocumentNode.nodeRules.heading = {
|
|
|
|
'parents': null,
|
|
|
|
'children': []
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.extendClass( ve.dm.HeadingNode, ve.dm.LeafNode );
|