SendMessagesInfotron
Sample Declaration
<div id="messages1"
impl="~019448F213F49F471a8C71268CABD6424C"
script="http://localhost/SendMessages.js">
</div>
## Input Terminals
+ trigger: (expected message type: any)
## Output Terminals
+ startup\_message\_out :
+ triggered\_message\_out :
## Properties
+ messages : (type: array)
+ sends\_one\_at\_a\_time
## Demos that use it
+ N/A
## How does it work?
This blueprint is similar to its relative, SendMessageInfotron. The difference is that this one can take an array of messages, and optionally control if they are going to be sent all together or one at a time -----
/*
*/
BLUEPRINT(
"~019448F213F49F471a8C71268CABD6424C",
[
["%startup", "onStartUp", 1],
["trigger", "onTrigger", 1]
],
[
"startup_message_out",
"triggered_message_out"
],
function(props)
{
var Blueprint = function(id, props, bp_uuid)
{
this.__init__(id, bp_uuid);
this._msgs = props["messages"] || [];
this._one_at_a_time = props["sends_one_at_a_time"] || false;
this._curr_i = 0;
};
Blueprint.prototype = new Infotron;
Blueprint.prototype.onStartUp = function(msg)
{
this._sendMessages("startup_message_out");
};
Blueprint.prototype.onTrigger = function(msg)
{
this._sendMessages("triggered_message_out");
};
Blueprint.prototype._sendMessages = function(oterm)
{
var i;
var n = this._msgs.length;
if (!this._one_at_a_time) {
for (i = 0; i < n; i ++) {
this.postMessage(oterm, this._msgs[i]);
}
} else {
i = this._curr_i ++;
this.debug("_curr_i = " + this._curr_i);
this.postMessage(oterm, this._msgs[i]);
}
}
return Blueprint;
},"Send Message");
Wiki Pages
- AboutEform
- AdvancedExamples
- AlertInfotron
- AtomicConstructor
- BulletList
- ButtonInfotron
- ConstructorInfotron
- ContactTheMaintainers
- Dataflow Design Patterns
- DataflowDesignPatterns
- Demo43
- DemoButton
- DemoClock
- DemoEvDb
- DemoForm
- demoHierarchicalEncapsulation
- demoHttp
- DemoMap
- DemoMultiMap
- demoPhotobucketAndWebshot
- demoRssFeeds
- demoRssFeedsTimeline
- DemoSlideShow
- DemoStickyNote
- DemosWalkThrough
- demoYahooSearch
- EformMapperInfotron
- EformRouterInfotron
- EformWrapperInfotron
- EvolutionOfJDA
- FeedMagickInfotron
- FormInfotron
- FourPortRouterInfotron
- GettingStarted
- HowJdaWorks
- HtmlBlueprintSpec
- HtmlInfotron
- HtmlPagerInfotron
- HttpProxyInfotron
- IDA
- ImageInfotron
- InfotronDoc
- JDA Propaganda
- JdaCapabilities
- JdaIncapabilities
- JdaQuotes
- JdaResources
- JdaUsage
- JohnResigJsonRssToCollection
- JsBlueprintSpec
- JsonCallbackInfotron
- JsonXmlFilter
- JsStarDoc
- ListRouterInfotron
- OptionSelectorInfotron
- PasteboardInfotron
- PatternsForLoadingDependencies
- ScratchPad
- SendMessageInfotron
- SendMessagesInfotron
- SequenceMatcherInfotron
- SimpleGoogleMapInfotron
- SimpleYahooMapInfotron
- SlideShowInfotron
- SnifferInfotron
- StaticCalendarInfotron
- StickNotesInfotron
- TabularListingInfotron
- TextInfotron
- TextScrapListerInfotron
- TimeLineInfotron
- TimerInfotron
- Troubleshoot
- TwoStringJoinerInfotron
- UnofficialBlueprints
- UpcoingOrgInfotron
- XmlToEformInfotron
- YahooJsonInfotron
Space Home