JsBlueprintSpec

Specification

BLUEPRINT(uuid, prototype attributes, prototype factory);

Arguments

uuidstring

prototype attributesobject literal

prototype factoryfunction

Sample Specification

BLUEPRINT(
"~0169729ED9947D4f2dAF5B1C81D6CD4C26",
{
  "iterms" : [
              ["%startup", "onStartUp", 1],
              ["trigger_in", "onTrigger", 1]
             ],
  "oterms" : [
              "startup_message_out",
              "triggered_message_out"
             ],
  "properties" : [
                  "message"
                 ],
  "name" : "Send Message"
},
function(Class)
{
  Class.prototype._onInit = function(props)
  {
    this._msg = props["message"];
    if (this._msg === undefined) {
      this._msg = this.dom_node.innerHTML;
    }
  };

  Class.prototype.onStartUp = function(msg)
  {
    this.postMessage("startup_message_out", this._msg);
  };

  Class.prototype.onTrigger = function(msg)
  {
    this.postMessage("triggered_message_out", this._msg);
  };

 return Class;
});