2012-04-30 11:23:03 +00:00
|
|
|
/*\
|
2012-05-03 20:47:16 +00:00
|
|
|
title: $:/core/modules/treenodes/raw.js
|
2012-04-30 11:23:03 +00:00
|
|
|
type: application/javascript
|
|
|
|
module-type: treenode
|
|
|
|
|
|
|
|
Raw, unparsed HTML nodes
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(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";
|
|
|
|
|
|
|
|
var Node = require("./node.js").Node;
|
|
|
|
|
|
|
|
var Raw = function(html) {
|
|
|
|
if(this instanceof Raw) {
|
|
|
|
this.html = html;
|
|
|
|
} else {
|
|
|
|
return new Raw(html);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Raw.prototype = new Node();
|
|
|
|
Raw.prototype.constructor = Raw;
|
|
|
|
|
|
|
|
Raw.prototype.render = function(type) {
|
|
|
|
return this.html;
|
|
|
|
};
|
|
|
|
|
|
|
|
Raw.prototype.renderInDom = function(domNode) {
|
|
|
|
this.domNode = document.createElement("div");
|
|
|
|
this.domNode.innerHTML = this.html;
|
|
|
|
domNode.appendChild(this.domNode);
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.Raw = Raw;
|
|
|
|
|
|
|
|
})();
|