|
| 1 | +<!-- |
| 2 | + Copyright JS Foundation and other contributors, http://js.foundation |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +--> |
1 | 16 |
|
2 | 17 | <script type="text/x-red" data-template-name="split"> |
3 | 18 | <div class="form-row"> |
|
73 | 88 | <option value="array">an Array</option> |
74 | 89 | <option value="object">a key/value Object</option> |
75 | 90 | <option value="merged">a merged Object</option> |
76 | | - <option value="accus">an accumlated key/value Object</option> |
77 | | - <option value="accum">an accumlated Object</option> |
78 | 91 | </select> |
79 | 92 | </div> |
80 | 93 | <div class="form-row node-row-key"> |
81 | 94 | <label style="vertical-align:top; margin-top:7px;">using</label> |
82 | 95 | <div style="display:inline-block"> |
83 | | - <input type="text" id="node-input-key" style="width:300px;"> |
84 | | - <div style="line-height:32px;"> |
85 | | - as the property key, and set the overall<br/> |
86 | | - <code>msg.<span id="node-newtopic">topic</span></code> |
87 | | - to <input type="text" id="node-input-topic" style="width:55%"> |
88 | | - </div> |
| 96 | + <input type="text" id="node-input-key" style="width:252px;"> as the key |
89 | 97 | </div> |
90 | 98 | </div> |
91 | 99 | <div class="form-row node-row-joiner"> |
|
95 | 103 | <div class="form-row node-row-trigger" id="trigger-row"> |
96 | 104 | <label style="width:auto;">Send the message:</label> |
97 | 105 | <ul> |
98 | | - <li style="height:40px;"> |
99 | | - <label style="width:280px;" for="node-input-count">After a number of message parts:</label> <input id="node-input-count" placeholder="count" type="text" style="width: 75px;"> |
| 106 | + <li> |
| 107 | + <label style="width:280px;" for="node-input-count">After a number of message parts</label> <input id="node-input-count" placeholder="count" type="text" style="width:75px;"> |
100 | 108 | </li> |
101 | | - <li style="height:40px;"> |
102 | | - <label style="width:280px;" for="node-input-timeout">After a timeout following the first message:</label> <input id="node-input-timeout" placeholder="seconds" type="text" style="width: 75px;"> |
| 109 | + <li style="list-style-type:none;"> |
| 110 | + <input type="checkbox" id="node-input-accumulate" style="display:inline-block; width:20px; list-style-type:none; margin-left:20px; vertical-align:top;"> and every subsequent message. |
103 | 111 | </li> |
104 | | - <li style="height:40px;"> |
| 112 | + <li> |
| 113 | + <label style="width:280px;" for="node-input-timeout">After a timeout following the first message</label> <input id="node-input-timeout" placeholder="seconds" type="text" style="width:75px;"> |
| 114 | + </li> |
| 115 | + <li> |
105 | 116 | <label style="width:auto; padding-top:6px;">After a message with the <code>msg.complete</code> property set</label> |
106 | 117 | </li> |
107 | 118 | </ul> |
|
129 | 140 | <li>a <b>key/value object</b> - created by using a property of each message to determine the key under which |
130 | 141 | the required value is stored.</li> |
131 | 142 | <li>a <b>merged object</b> - created by merging the property of each message under a single object.</li> |
132 | | - <li>an <b>accumulated object</b> - created by merging payload objects into a single object |
133 | | - continuously. Outputs every message once the required number has been reached. <code>msg.complete</code> will |
134 | | - send the msg and then clear the accumlation.</li> |
135 | | - <li>an <b>accumulated key/value object</b> - created by merging payloads of each message under a single object |
136 | | - using the specified property as a key. Outputs every message once the required number has been reached. |
137 | | - <code>msg.complete</code> will send the msg and then clear the accumlation.</li> |
138 | 143 | </ul> |
139 | 144 | The other properties of the output message are taken from the last message received before the result is sent.</p> |
140 | 145 | <p>A <i>count</i> can be set for how many messages should be received before generating the output message</p> |
|
164 | 169 | propertyType: { value:"msg"}, |
165 | 170 | key: {value:"topic"}, |
166 | 171 | joiner: { value:"\\n"}, |
167 | | - topic: { value:""}, |
| 172 | + accumulate: { value:"false" }, |
| 173 | + //topic: { value:""}, |
168 | 174 | timeout: {value:""}, |
169 | 175 | count: {value:""} |
170 | 176 | }, |
|
198 | 204 | // else { $("#trigger-row").show(); } |
199 | 205 | }); |
200 | 206 |
|
201 | | - $("#node-input-key").change(function(e) { |
202 | | - $("#node-newtopic").text($("#node-input-key").val()); |
203 | | - }); |
204 | | - |
205 | 207 | $("#node-input-property").typedInput({ |
206 | 208 | typeField: $("#node-input-propertyType"), |
207 | 209 | types:['msg', {value:"full", label:"complete message", hasValue:false}] |
|
0 commit comments