mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Remove : from inject node label - people didn't like it.
Claim they can tell the difference between topic and payload as they wrote the flow...
This commit is contained in:
parent
41552625e0
commit
1261bf97ea
@ -138,15 +138,15 @@
|
||||
icon: "inject.png",
|
||||
label: function() {
|
||||
if (this.payloadType === "string") {
|
||||
if ((this.topic.length + this.payload.length) <= 32) {
|
||||
if ((this.topic !== "") && ((this.topic.length + this.payload.length) <= 32)) {
|
||||
return this.name||this.topic + ":" + this.payload;
|
||||
}
|
||||
else if (this.payload.length < 24) {
|
||||
return this.name||":"+this.payload;
|
||||
return this.name||this.payload;
|
||||
}
|
||||
}
|
||||
if ((this.topic.length < 24) && (this.topic.length > 0)) {
|
||||
return this.name||this.topic+":";
|
||||
return this.name||this.topic;
|
||||
}
|
||||
else { return this.name||(this.payloadType==="date"?"timestamp":null)||"inject"; }
|
||||
},
|
||||
@ -334,7 +334,7 @@
|
||||
|
||||
$("#node-input-payloadType").change(function() {
|
||||
var id = $("#node-input-payloadType option:selected").val();
|
||||
if (id == "string") {
|
||||
if (id === "string") {
|
||||
$("#node-input-row-payload").show();
|
||||
} else {
|
||||
$("#node-input-row-payload").hide();
|
||||
|
@ -56,7 +56,7 @@ module.exports = function(RED) {
|
||||
var msg = {topic:this.topic};
|
||||
if ( (this.payloadType == null && this.payload == "") || this.payloadType == "date") {
|
||||
msg.payload = Date.now();
|
||||
} else if (this.payloadType == null || this.payloadType == "string") {
|
||||
} else if (this.payloadType == null || this.payloadType === "string") {
|
||||
msg.payload = this.payload;
|
||||
} else {
|
||||
msg.payload = "";
|
||||
|
Loading…
Reference in New Issue
Block a user