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

Tidy up some little wrinkles in Inject node html labels etc

This commit is contained in:
Dave C-J 2014-09-14 18:38:30 +01:00
parent 7e2dbb13e4
commit a0ac79384d

View File

@ -136,10 +136,10 @@
outputs:1, outputs:1,
icon: "inject.png", icon: "inject.png",
label: function() { label: function() {
if (this.payloadType == "string") { if (this.payloadType === "string") {
return this.name||this.topic||this.payload||"inject"; return this.name||this.topic||this.payload||"inject";
} }
else { return this.name||"inject"; } else { return this.name||this.topic||"inject"; }
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
@ -399,6 +399,8 @@
button: { button: {
onclick: function() { onclick: function() {
var label = (this.name||this.payload).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); var label = (this.name||this.payload).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
if (this.payloadType === "date") { label = "timestamp"; }
if (this.payloadType === "none") { label = "blank"; }
d3.xhr("inject/"+this.id).post(function(err,resp) { d3.xhr("inject/"+this.id).post(function(err,resp) {
if (err) { if (err) {
if (err.status == 404) { if (err.status == 404) {