mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
39 lines
798 B
JavaScript
39 lines
798 B
JavaScript
/**
|
|
* 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
|
|
* @returns {ve.ce.ParagraphNode}
|
|
*/
|
|
ve.dm.HeadingNode.prototype.createView = function() {
|
|
return new ve.ce.HeadingNode( this );
|
|
};
|
|
|
|
/* 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 );
|