1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-07 04:24:22 +00:00
TiddlyWiki5/rabbithole/core/modules/treenodes/raw.js
Jeremy Ruston d93bbbbe7b Introduce plugin module mechanism
See the readme for details
2012-04-30 12:23:03 +01:00

40 lines
664 B
JavaScript

/*\
title: $:/core/treenodes/raw.js
type: application/javascript
module-type: treenode
Raw, unparsed HTML nodes
\*/
(function(){
/*jshint node: true, browser: true */
"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;
})();