@gregoriusrippenstein/node-red-contrib-nodedev 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,11 +5,17 @@
5
5
  </div>
6
6
 
7
7
  <div class="form-row">
8
- <label for="node-input-nodename"><i class="fa fa-tag"></i> Node Name</label>
9
- <div style="display: inline-block; width: calc(100% - 105px)"><input type="text" id="node-input-nodename" placeholder="Node Name">
8
+ <label for="node-input-nodename"><i class="fa fa-tag"></i> Node Type</label>
9
+ <div style="display: inline-block; width: calc(100% - 105px)"><input type="text" id="node-input-nodename" placeholder="Node Type">
10
10
  </div>
11
11
  </div>
12
12
 
13
+ <div class="form-row">
14
+ <label for="node-input-nodelabel"><i class="fa fa-tag"></i> Node Label</label>
15
+ <div style="display: inline-block; width: calc(100% - 105px)"><input type="text" id="node-input-nodelabel" placeholder="Node Label">
16
+ </div>
17
+ </div>
18
+
13
19
  <div class="form-row">
14
20
  <label for="node-input-category"><i class="fa fa-tag"></i> Node Category</label>
15
21
  <div style="display: inline-block; width: calc(100% - 105px)"><input type="text" id="node-input-category" placeholder="Node Category">
@@ -195,6 +201,7 @@
195
201
  data["icon"] = $('#red-ui-editor-node-icon').val();
196
202
  data["iconclass"] = "fa " + data["icon"].split("/")[1]; /* Assume font-awesomeness */
197
203
  data["name"] = $('#node-input-nodename').val();
204
+ data["nodelabel"] = $('#node-input-nodelabel').val();
198
205
  data["namelwr"] = data["name"].toLowerCase();
199
206
  data["outputcount"] = $('#node-input-outputcount').val();
200
207
  data["category"] = $('#node-input-category').val();
@@ -227,10 +234,11 @@
227
234
  data[attrname] = node[attrname]
228
235
  })
229
236
 
230
- data["name"] = node.nodename; // name clashes with the default 'name' attribute
231
- data["namelwr"] = data["name"].toLowerCase();
232
- data["iconclass"] = "fa " + data["icon"].split("/")[1]; /* Assume font-awesomeness */
233
- data["__task"] = "generate_from_templates";
237
+ data["name"] = node.nodename; // name clashes with the default 'name' attribute
238
+ data["namelwr"] = data["name"].toLowerCase();
239
+ data["iconclass"] = "fa " + data["icon"].split("/")[1]; /* Assume font-awesomeness */
240
+ data["__task"] = "generate_from_templates";
241
+ data["name_escaped"] = data["name"].replaceAll("-",'_').replace(new RegExp(/[ \t\s]/g),'')
234
242
 
235
243
  postDataOff(node,data)
236
244
  }
@@ -241,6 +249,7 @@
241
249
  defaults: {
242
250
  name: { value: "" },
243
251
  nodename: { value: "", required: true },
252
+ nodelabel: { value: "", required: true },
244
253
  color: { value: "#e5e4ef" },
245
254
  hasbutton: { value: false },
246
255
  minify: { value: false },
@@ -1,4 +1,18 @@
1
- <script type="text/html" data-help-name="{{ node.name }}">
2
- <p>{{{ node.summary }}}</p>
3
- {{{ node.description }}}
1
+ <script type="text/markdown" data-help-name="{{ node.name }}">
2
+ {{{ node.summary }}}
3
+
4
+ ### Inputs
5
+
6
+ : payload (any) : what is expected as payload input.
7
+ : topic (string) : (optional) is a topic expected or handled.
8
+
9
+ ### Outputs
10
+
11
+ : payload (any) : what is returned as payload.
12
+
13
+ ### Description
14
+
15
+ {{{ node.description }}}
16
+
17
+ <!-- [Markdown documentation details](https://nodered.org/docs/creating-nodes/help-style-guide) -->
4
18
  </script>
@@ -54,6 +54,7 @@
54
54
  color: '{{ node.color }}',
55
55
  icon: "{{{ node.icon }}}",
56
56
  category: '{{ node.category }}',
57
+ paletteLabel: '{{ node.nodelabel }}',
57
58
  defaults: {
58
59
  name: {
59
60
  value:"",
@@ -1,5 +1,5 @@
1
1
  module.exports = function(RED) {
2
- function Core{{ node.name }}Functionality(config) {
2
+ function Core{{ node.name_escaped }}Functionality(config) {
3
3
  RED.nodes.createNode(this,config);
4
4
 
5
5
  var node = this;
@@ -41,7 +41,7 @@ module.exports = function(RED) {
41
41
  });
42
42
  }
43
43
 
44
- RED.nodes.registerType("{{ node.name }}", Core{{ node.name }}Functionality);
44
+ RED.nodes.registerType("{{ node.name }}", Core{{ node.name_escaped }}Functionality);
45
45
 
46
46
  {{ #node.frt2bakcomm }}
47
47
  RED.httpAdmin.post("/{{ node.name }}/:id",
@@ -45,7 +45,7 @@
45
45
  hasUsers: false,
46
46
  users: [],
47
47
  name: "{{ node.name }}",
48
- label: function() { return this.name || "{{ node.name }}"},
48
+ label: function() { return "{{ node.nodelabel }}" || this.name },
49
49
  /* values and data defined by this config node */
50
50
  data: "some default value", // Default data
51
51
  }
@@ -7,7 +7,7 @@
7
7
  name: { value: "" },
8
8
  data: { value: "" }
9
9
  },
10
- paletteLabel: '{{ node.name }}Cfg',
10
+ paletteLabel: '{{ node.nodelabel }}',
11
11
  label: function () {
12
12
  return this.name;
13
13
  }
@@ -1,9 +1,9 @@
1
1
  module.exports = function (RED) {
2
- function Config{{ node.name }}Functionality(config) {
2
+ function Config{{ node.name_escaped }}Functionality(config) {
3
3
  RED.nodes.createNode(this, config)
4
4
  }
5
5
 
6
- RED.nodes.registerType('{{ node.name }}Cfg', Config{{ node.name }}Functionality);
6
+ RED.nodes.registerType('{{ node.name }}Cfg', Config{{ node.name_escaped }}Functionality);
7
7
 
8
8
  {{ #node.frt2bakcomm }}
9
9
  RED.httpAdmin.post("/{{ node.name }}Cfg",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name" : "@gregoriusrippenstein/node-red-contrib-nodedev",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "dependencies": {
5
5
  "pako": "^2.1.0",
6
6
  "tar-stream": "^3.1.6",