@gregoriusrippenstein/node-red-contrib-nodedev 0.5.3 → 0.5.5
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.
package/nodes/10-node-factory.js
CHANGED
|
@@ -254,6 +254,7 @@ module.exports = function (RED) {
|
|
|
254
254
|
var jsPath = path.join(__dirname, 'templates', 'tmpl.js');
|
|
255
255
|
var localeJsonPath = path.join(__dirname, 'templates', 'locale', 'en-US', 'tmpl.json')
|
|
256
256
|
var localeHtmlPath = path.join(__dirname, 'templates', 'locale', 'en-US', 'tmpl.html')
|
|
257
|
+
var localeMarkdownPath = path.join(__dirname, 'templates', 'locale', 'en-US', 'tmpl.md')
|
|
257
258
|
|
|
258
259
|
var content = {};
|
|
259
260
|
|
|
@@ -263,13 +264,15 @@ module.exports = function (RED) {
|
|
|
263
264
|
handleTemplate(msg, node, fs.readFileSync(jsPath, 'utf8')).then((c) => { content["jasc"] = c }),
|
|
264
265
|
handleTemplate(msg, node, fs.readFileSync(localeJsonPath, 'utf8')).then((c) => { content["ljsn"] = c }),
|
|
265
266
|
handleTemplate(msg, node, fs.readFileSync(localeHtmlPath, 'utf8')).then((c) => { content["lhtm"] = c }),
|
|
267
|
+
handleTemplate(msg, node, fs.readFileSync(localeMarkdownPath, 'utf8')).then((c) => { content["lmkd"] = c }),
|
|
266
268
|
];
|
|
267
269
|
|
|
268
270
|
return Promise.all(promises).then(() => {
|
|
269
|
-
var secondId
|
|
271
|
+
var secondId = RED.util.generateId();
|
|
270
272
|
var secondIdTempJs = RED.util.generateId();
|
|
271
|
-
var thirdId
|
|
272
|
-
var fourthId
|
|
273
|
+
var thirdId = RED.util.generateId();
|
|
274
|
+
var fourthId = RED.util.generateId();
|
|
275
|
+
var fifthId = RED.util.generateId();
|
|
273
276
|
|
|
274
277
|
return [{
|
|
275
278
|
id: RED.util.generateId(),
|
|
@@ -293,13 +296,10 @@ module.exports = function (RED) {
|
|
|
293
296
|
"format": "javascript",
|
|
294
297
|
"syntax": "mustache",
|
|
295
298
|
"template": content["htjs"],
|
|
299
|
+
"output": "str",
|
|
296
300
|
"x": 100,
|
|
297
301
|
"y": 100,
|
|
298
|
-
"wires": [
|
|
299
|
-
[
|
|
300
|
-
secondId
|
|
301
|
-
]
|
|
302
|
-
]
|
|
302
|
+
"wires": [[secondId]]
|
|
303
303
|
},
|
|
304
304
|
{
|
|
305
305
|
id: secondId,
|
|
@@ -329,6 +329,20 @@ module.exports = function (RED) {
|
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
331
|
id: fourthId,
|
|
332
|
+
type: "template",
|
|
333
|
+
name: "Locale: " + msg.node.name + " Markdown",
|
|
334
|
+
field: msg.node.name + "TmplMarkdown",
|
|
335
|
+
fieldType: "msg",
|
|
336
|
+
template: content["lmkd"],
|
|
337
|
+
syntax: "mustache",
|
|
338
|
+
format: "markdown",
|
|
339
|
+
output: "str",
|
|
340
|
+
x: 120,
|
|
341
|
+
y: 250,
|
|
342
|
+
wires: [[fifthId]]
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
id: fifthId,
|
|
332
346
|
type: "PkgFile",
|
|
333
347
|
name: "Locale: " + msg.node.name + ".html",
|
|
334
348
|
filename: "nodes/locales/en-US/" + msg.node.namelwr + ".html",
|
|
@@ -337,7 +351,7 @@ module.exports = function (RED) {
|
|
|
337
351
|
format: "html",
|
|
338
352
|
output: "str",
|
|
339
353
|
x: 120,
|
|
340
|
-
y:
|
|
354
|
+
y: 300,
|
|
341
355
|
wires: [[]]
|
|
342
356
|
}
|
|
343
357
|
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{{ node.summary }}}
|
|
2
|
+
|
|
3
|
+
### Inputs
|
|
4
|
+
|
|
5
|
+
: payload (any) : what is expected as payload input.
|
|
6
|
+
: topic (string) : (optional) is a topic expected or handled.
|
|
7
|
+
|
|
8
|
+
### Outputs
|
|
9
|
+
|
|
10
|
+
: payload (any) : what is returned as payload.
|
|
11
|
+
|
|
12
|
+
### Description
|
|
13
|
+
|
|
14
|
+
{{{ node.description }}}
|
|
15
|
+
|
|
16
|
+
<!-- [Markdown documentation details](https://nodered.org/docs/creating-nodes/help-style-guide) -->
|
|
@@ -81,6 +81,12 @@
|
|
|
81
81
|
return this.name?"node_label_italic":"";
|
|
82
82
|
},
|
|
83
83
|
|
|
84
|
+
// called when node is added to workspace also if copied and pasted.
|
|
85
|
+
// once for each node added to the workspace
|
|
86
|
+
onadd: function() {
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// called when node added to palette - one time
|
|
84
90
|
onpaletteadd: function() {
|
|
85
91
|
{{#node.bak2frtcomm}}
|
|
86
92
|
this.messageFromBackendHandler = (topic,dataobj) => {
|