2012-04-30 11:23:03 +00:00
|
|
|
/*\
|
2012-05-03 20:47:16 +00:00
|
|
|
title: $:/core/modules/tree.js
|
2012-04-30 11:23:03 +00:00
|
|
|
type: application/javascript
|
|
|
|
module-type: global
|
|
|
|
|
|
|
|
Renderer objects encapsulate a tree of nodes that are capable of rendering and selectively updating an
|
|
|
|
HTML representation of themselves. The following node types are defined:
|
|
|
|
* ''Macro'' - represents an invocation of a macro
|
|
|
|
* ''Element'' - represents a single HTML element
|
|
|
|
* ''Text'' - represents an HTML text node
|
|
|
|
* ''Entity'' - represents an HTML entity node
|
|
|
|
* ''Raw'' - represents a chunk of unparsed HTML text
|
|
|
|
|
|
|
|
These node types are implemented with prototypal inheritance from a base Node class. One
|
|
|
|
unusual convenience in the implementation is that the node constructors can be called without an explicit
|
|
|
|
`new` keyword: the constructors check for `this` not being an instance of themselves, and recursively invoke
|
|
|
|
themselves with `new` when required.
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
2012-05-04 17:49:04 +00:00
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
2012-04-30 11:23:03 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
exports.Tree = {};
|
|
|
|
|
|
|
|
})();
|