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:
parent
7e2dbb13e4
commit
a0ac79384d
@ -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,"&").replace(/</g,"<").replace(/>/g,">");
|
var label = (this.name||this.payload).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||||
|
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user