2011-11-02 21:00:55 +00:00
|
|
|
/**
|
2012-06-20 01:20:28 +00:00
|
|
|
* DataModel node for a document.
|
|
|
|
*
|
2011-11-02 21:00:55 +00:00
|
|
|
* @class
|
|
|
|
* @constructor
|
2012-02-06 23:50:56 +00:00
|
|
|
* @extends {ve.dm.BranchNode}
|
2012-06-20 01:20:28 +00:00
|
|
|
* @param {ve.dm.BranchNode[]} [children] Child nodes to attach
|
|
|
|
* @param {Object} [attributes] Reference to map of attribute key/value pairs
|
2011-11-02 21:00:55 +00:00
|
|
|
*/
|
2012-06-20 01:20:28 +00:00
|
|
|
ve.dm.DocumentNode = function( children, attributes ) {
|
2011-11-02 21:00:55 +00:00
|
|
|
// Inheritance
|
2012-06-20 01:20:28 +00:00
|
|
|
ve.dm.BranchNode.call( this, 'document', children, attributes );
|
2011-11-02 21:00:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Static Members */
|
|
|
|
|
|
|
|
/**
|
2012-06-20 01:20:28 +00:00
|
|
|
* Node rules.
|
|
|
|
*
|
|
|
|
* @see ve.dm.NodeFactory
|
2011-11-21 22:32:22 +00:00
|
|
|
* @static
|
2012-06-20 01:20:28 +00:00
|
|
|
* @member
|
2011-11-02 21:00:55 +00:00
|
|
|
*/
|
2012-06-20 01:20:28 +00:00
|
|
|
ve.dm.DocumentNode.rules = {
|
|
|
|
'isWrapped': false,
|
|
|
|
'isContent': false,
|
|
|
|
'canContainContent': false,
|
|
|
|
'childNodeTypes': null,
|
|
|
|
'parentNodeTypes': []
|
2011-11-02 21:00:55 +00:00
|
|
|
};
|
|
|
|
|
2012-06-20 01:20:28 +00:00
|
|
|
// This is a special node, no converter registration is required
|
|
|
|
ve.dm.DocumentNode.converters = null;
|
2011-11-02 21:00:55 +00:00
|
|
|
|
2012-06-20 01:20:28 +00:00
|
|
|
/* Registration */
|
2011-11-21 22:32:22 +00:00
|
|
|
|
2012-06-20 01:20:28 +00:00
|
|
|
ve.dm.nodeFactory.register( 'document', ve.dm.DocumentNode );
|
2012-03-12 00:07:33 +00:00
|
|
|
|
2012-06-20 01:20:28 +00:00
|
|
|
// This is a special node, no converter registration is required
|
2011-12-01 21:10:37 +00:00
|
|
|
|
2011-11-02 21:00:55 +00:00
|
|
|
/* Inheritance */
|
|
|
|
|
2012-02-06 23:50:56 +00:00
|
|
|
ve.extendClass( ve.dm.DocumentNode, ve.dm.BranchNode );
|