@gregoriusrippenstein/node-red-contrib-nodedev 0.5.1 → 0.5.3
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.html +15 -6
- package/nodes/templates/tmpl.html.js +1 -0
- package/nodes/templates/tmpl.js +2 -2
- package/nodes/templates/tmplsidebar.html +1 -1
- package/nodes/templates/tmplsidebarnode.html +1 -1
- package/nodes/templates/tmplsidebarnode.js +2 -2
- package/package.json +1 -1
- package/plugins/node-factory-sidebar.html +17 -2
- package/plugins/support-drag-and-drop.html +5 -0
|
@@ -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
|
|
9
|
-
<div style="display: inline-block; width: calc(100% - 105px)"><input type="text" id="node-input-nodename" placeholder="Node
|
|
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"]
|
|
231
|
-
data["namelwr"]
|
|
232
|
-
data["iconclass"]
|
|
233
|
-
data["__task"]
|
|
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 },
|
package/nodes/templates/tmpl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = function(RED) {
|
|
2
|
-
function Core{{ node.
|
|
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.
|
|
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
|
|
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
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module.exports = function (RED) {
|
|
2
|
-
function Config{{ node.
|
|
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.
|
|
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
|
@@ -160,20 +160,24 @@
|
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
// Add first tab, pkg importer
|
|
164
163
|
tabs.addTab({
|
|
165
164
|
id: 'func-nodedev-pkgimporter-tab-pkgimport',
|
|
166
165
|
iconClass: 'fa fa-industry',
|
|
167
166
|
label: 'PkgImporter'
|
|
168
167
|
});
|
|
169
168
|
|
|
170
|
-
// Add first tab, otp
|
|
171
169
|
tabs.addTab({
|
|
172
170
|
id: 'func-nodedev-pkgimporter-tab-otpgenerator',
|
|
173
171
|
iconClass: 'fa fa-user-secret',
|
|
174
172
|
label: 'OTP Generator'
|
|
175
173
|
});
|
|
176
174
|
|
|
175
|
+
tabs.addTab({
|
|
176
|
+
id: 'func-nodedev-pkgimporter-tab-options',
|
|
177
|
+
iconClass: 'fa fa-cog',
|
|
178
|
+
label: 'Options'
|
|
179
|
+
});
|
|
180
|
+
|
|
177
181
|
ensureYourConfigNodeExists();
|
|
178
182
|
|
|
179
183
|
/*
|
|
@@ -464,5 +468,16 @@
|
|
|
464
468
|
<input type="text" id="node-input-nodedev-sidebar-otp" placeholder="OTP...">
|
|
465
469
|
</div>
|
|
466
470
|
</div>
|
|
471
|
+
|
|
472
|
+
<div id="func-nodedev-pkgimporter-tab-options" style="display:none">
|
|
473
|
+
<div class="form-row" style="margin-left: 10px;">
|
|
474
|
+
Drag & Drop
|
|
475
|
+
</div>
|
|
476
|
+
|
|
477
|
+
<div class="form-row" style="margin-left: 10px;">
|
|
478
|
+
<input style="width: 10%;" type="checkbox" id="nodedev-drag-drop-generate-pkgfile-nodes"/>
|
|
479
|
+
<label for="nodedev-drag-drop-generate-pkgfile-nodes" style="width: 40%;"><i class="fa fa-code" ></i> Create PkgFile nodes on drop?</label>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
467
482
|
</div>
|
|
468
483
|
</script>
|