1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Remove name generation from link call and add to Function

This commit is contained in:
Nick O'Leary 2022-04-25 20:30:05 +01:00
parent 908f9562f6
commit 84e02fc144
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 14 additions and 14 deletions

View File

@ -74,7 +74,7 @@
RED.nodes.registerType('debug',{ RED.nodes.registerType('debug',{
category: 'common', category: 'common',
defaults: { defaults: {
name: {value:"_"}, name: {value:"_DEFAULT_"},
active: {value:true}, active: {value:true},
tosidebar: {value:true}, tosidebar: {value:true},
console: {value:false}, console: {value:false},
@ -546,7 +546,7 @@
$("#node-input-statusVal").val($("#node-input-typed-status").typedInput('value')); $("#node-input-statusVal").val($("#node-input-typed-status").typedInput('value'));
}, },
onadd: function() { onadd: function() {
if (this.name === '_') { if (this.name === '_DEFAULT_') {
this.name = '' this.name = ''
RED.actions.invoke("core:generate-node-names", this) RED.actions.invoke("core:generate-node-names", this)
} }

View File

@ -218,7 +218,7 @@
} }
function onAdd() { function onAdd() {
if (this.name === '_') { if (this.name === '_DEFAULT_') {
this.name = '' this.name = ''
RED.actions.invoke("core:generate-node-names", this) RED.actions.invoke("core:generate-node-names", this)
} }
@ -235,7 +235,7 @@
category: 'common', category: 'common',
color:"#ddd",//"#87D8CF", color:"#ddd",//"#87D8CF",
defaults: { defaults: {
name: { value: "_" }, name: { value: "_DEFAULT_" },
links: { value: [], type:"link out[]" } links: { value: [], type:"link out[]" }
}, },
inputs:0, inputs:0,
@ -271,7 +271,7 @@
category: 'common', category: 'common',
color:"#ddd",//"#87D8CF", color:"#ddd",//"#87D8CF",
defaults: { defaults: {
name: { value: "_" }, name: { value: "" },
links: { value: [], type:"link in[]" }, links: { value: [], type:"link in[]" },
linkType: { value:"static" }, linkType: { value:"static" },
timeout: { value: "30", validate:RED.validators.number(true) } timeout: { value: "30", validate:RED.validators.number(true) }
@ -319,20 +319,14 @@
oneditsave: function() { oneditsave: function() {
onEditSave(this); onEditSave(this);
}, },
oneditresize: resizeNodeList, oneditresize: resizeNodeList
onadd: function() {
if (this.name === '_') {
this.name = ''
RED.actions.invoke("core:generate-node-names", this)
}
}
}); });
RED.nodes.registerType('link out',{ RED.nodes.registerType('link out',{
category: 'common', category: 'common',
color:"#ddd",//"#87D8CF", color:"#ddd",//"#87D8CF",
defaults: { defaults: {
name: { value:"_" }, name: { value:"_DEFAULT_" },
mode: { value: "link" },// link || return mode: { value: "link" },// link || return
links: { value: [], type:"link in[]" } links: { value: [], type:"link in[]" }
}, },

View File

@ -355,7 +355,7 @@
color:"#fdd0a2", color:"#fdd0a2",
category: 'function', category: 'function',
defaults: { defaults: {
name: {value:""}, name: {value:"_DEFAULT_"},
func: {value:"\nreturn msg;"}, func: {value:"\nreturn msg;"},
outputs: {value:1}, outputs: {value:1},
noerr: {value:0,required:true,validate:function(v) { return !v; }}, noerr: {value:0,required:true,validate:function(v) { return !v; }},
@ -605,6 +605,12 @@
this.finalizeEditor.resize(); this.finalizeEditor.resize();
$("#node-input-libs-container").css("height", (height - 192)+"px"); $("#node-input-libs-container").css("height", (height - 192)+"px");
},
onadd: function() {
if (this.name === '_DEFAULT_') {
this.name = ''
RED.actions.invoke("core:generate-node-names", this)
}
} }
}); });
})(); })();