TextInfotron
History Key
- New content
Removed content
Recent Versions
Choose two versions to compare, or click the link to view it.
Fairly simple blueprint which displays text from the input terminal, with some formatting capabilities provided from properties.
Demos that use it
- dynamic_construction.html
- http.html
- timer.html
/*
Simple Text
*/
BLUEPRINT(
"~015B408D312408434bAC3DC477C612C8DE",
[
["value_in", "onValue", 10]
],
[
"changed_value_out"
],
function ()
{
var Blueprint = function(id, props, bp_uuid)
{
this.__init__(id, bp_uuid);
this._do_not_encode_html = props["renders_html"] || false;
};
Blueprint.prototype = new Infotron;
Blueprint.prototype.onValue = function(msg)
{
var s;
if (typeof(msg) != "string" && msg) {
s = msg.name || msg.text_content || msg.label || msg;
} else {
s = msg;
}
if (typeof(msg) != "string") {
s = s.toString();
}
if (!this._do_not_encode_html) {
s = s.replace(/&/g, "&");
s = s.replace(/</g, "<");
}
this.dom_node.innerHTML = s;
this.postMessage("changed_value_out", s);
};
return Blueprint;
}, "Text Element");