JsBlueprintSpec

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 6. over 4 years by slim
  2. 5. over 4 years by slim
  3. 4. over 4 years by slim
  4. 3. over 4 years by slim
  5. 2. over 4 years by slim
  6. 1. over 4 years by slim
 

Specification

BLUEPRINT( uuid, prototype attributes, prototype factoryfunction);

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;
});