mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
86591e5325
Change-Id: I7023e1f334694d59767491f1010e7c4c59c0ce54
39 lines
779 B
JavaScript
39 lines
779 B
JavaScript
/**
|
|
* DataModel node for a heading.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @extends {ve.dm.BranchNode}
|
|
* @param {ve.dm.LeafNode[]} [children] Child nodes to attach
|
|
* @param {Object} [attributes] Reference to map of attribute key/value pairs
|
|
*/
|
|
ve.dm.HeadingNode = function( children, attributes ) {
|
|
// Inheritance
|
|
ve.dm.BranchNode.call( this, 'heading', children, attributes );
|
|
};
|
|
|
|
/* Static Members */
|
|
|
|
/**
|
|
* Node rules.
|
|
*
|
|
* @see ve.dm.NodeFactory
|
|
* @static
|
|
* @member
|
|
*/
|
|
ve.dm.HeadingNode.rules = {
|
|
'isWrapped': true,
|
|
'isContent': false,
|
|
'canContainContent': true,
|
|
'childNodeTypes': null,
|
|
'parentNodeTypes': null
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.dm.factory.register( 'heading', ve.dm.HeadingNode );
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.dm.HeadingNode, ve.dm.BranchNode );
|