Skip to content

Commit c6a29a7

Browse files
author
Dave Conway-Jones
committed
Add warning about name needing to start ui_
1 parent 67ce6aa commit c6a29a7

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

docs/api.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ To support new widgets, the following runtime API is exported from the Node-RED
2929
| :--- | :------------------------- | :----------------------------------------------------------- |
3030
| 1 | node* | controlling node.<br/>optional if scope is "global". |
3131
| 2 | format | HTML code of widget.<br />Accepts HTML same as one for Template Dashboard widget node. |
32-
| 3 | group* | group node object to which widget belongs |
32+
| 3 | group | group node object to which widget belongs |
3333
| 4 | width* | width of widget |
3434
| 5 | height* | height of widget |
35-
| 6 | templateScope | scope of widget ("global" or "local") |
36-
| 7 | emitOnlyNewValues* | send message if changed |
37-
| 8 | forwardInputMessages* | forward input messages to output |
38-
| 9 | storeFrontEndInputAsState* | store received message |
39-
| 10 | convert* | callback to convert value to front-end |
40-
| 11 | beforeEmit* | callback to prepare message |
41-
| 12 | convertBack* | callback to convert sent message |
42-
| 13 | beforeSend* | callback to prepare message |
43-
| 14 | order | order in group |
35+
| 6 | order | order in group |
36+
| 7 | templateScope | scope of widget ("global" or "local") |
37+
| 8 | emitOnlyNewValues* | send message if changed |
38+
| 9 | forwardInputMessages* | forward input messages to output |
39+
| 10 | storeFrontEndInputAsState* | store received message |
40+
| 11 | convert* | callback to convert value to front-end |
41+
| 12 | beforeEmit* | callback to prepare message |
42+
| 13 | convertBack* | callback to convert sent message |
43+
| 14 | beforeSend* | callback to prepare message |
4444
| 15 | initController* | callback to initialize in controller |
4545

4646
`addWidget` returns a callback that should be called on close of controlling node.
@@ -142,7 +142,7 @@ To support new widgets, the following runtime API is exported from the Node-RED
142142
return conf;
143143
};
144144
145-
RED.nodes.registerType('ui_cal', mk_conf('cal'));
145+
RED.nodes.registerType('ui_cal', mk_conf('cal')); // NOTE: The type MUST start with "ui_"
146146
</script>
147147
```
148148
Use `ui_group` for configuring belonging group, and `elementSizer` for configuring widget size.
@@ -205,6 +205,6 @@ To support new widgets, the following runtime API is exported from the Node-RED
205205
}
206206
node.on("close", done);
207207
}
208-
RED.nodes.registerType('ui_cal', CalNode);
208+
RED.nodes.registerType('ui_cal', CalNode); // NOTE: The type MUST start with "ui_"
209209
};
210210
```

node-red-ui-node-lineargauge/linear_gauge.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
limitations under the License.
1212
-->
1313
<script type="text/javascript">
14-
RED.nodes.registerType('ui_lineargauge',{
14+
RED.nodes.registerType('ui_lineargauge',{ // type MUST start with ui_
1515
category: 'dashboard',
1616
color: 'rgb( 63, 173, 181)',
1717
defaults: {
@@ -76,7 +76,7 @@
7676
<div class="form-row">
7777
<label for="node-input-colorLowArea"><i class="fa fa-paint-brush"></i> Low Area Color</span></label>
7878
<input type="color" id="node-input-colorLowArea"/>
79-
</div>
79+
</div>
8080
<div class="form-row">
8181
<label for="node-input-unit"><i class="fa fa-asterisk" aria-hidden="true"></i> Unit</span></label>
8282
<input type="text" id="node-input-unit"/>
@@ -102,4 +102,3 @@
102102
<p>Actual Value: <code>msg.payload</code></p>
103103

104104
</script>
105-

node-red-ui-node-lineargauge/linear_gauge.js

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
/**
280280
* REQUIRED
281281
* Registers the node with a name, and a configuration.
282+
* Type MUST start with ui_
282283
*/
283284
RED.nodes.registerType("ui_lineargauge", LinearGaugeNode);
284285
};

ui_list/ui_list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
-->
1616

17-
<script type="text/x-red" data-template-name="ui_list">
17+
<script type="text/x-red" data-template-name="ui_list"> // type MUST start with ui_
1818
<!-- common input elements for dashboard widget -->
1919
<div class="form-row" id="template-row-group">
2020
<label for="node-input-group"><i class="fa fa-table"></i> <span data-i18n="ui_list.label.group"></span></label>

ui_list/ui_list.js

+1
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@ ${(allowMenu ? md_menu : "")}
180180
});
181181
}
182182
// register ui_list node
183+
// type MUST start with ui_
183184
RED.nodes.registerType('ui_list', ListNode);
184185
};

0 commit comments

Comments
 (0)