diff --git a/nodes/core/core/20-inject.html b/nodes/core/core/20-inject.html index 328ad74b1..4cdac0069 100644 --- a/nodes/core/core/20-inject.html +++ b/nodes/core/core/20-inject.html @@ -1,142 +1,165 @@ - - - - - + + - - + + + d3.xhr("inject/"+this.id).post(function(err,resp) { + if (err) { + if (err.status == 404) { + RED.notify("Error: inject node not deployed","error"); + } else if (err.status == 500) { + RED.notify("Error: inject failed, see log for details.","error"); + } else if (err.status == 0) { + RED.notify("Error: no response from server","error"); + } else { + RED.notify("Error: unexpected error: ("+err.status+")"+err.response,"error"); + } + } else if (resp.status == 200) { + RED.notify("Successfully injected: "+label,"success"); + } else { + RED.notify("Error: unexpected response: ("+resp.status+") "+resp.response,"error"); + } + }); + } + } + }); + + diff --git a/nodes/core/core/20-inject.js b/nodes/core/core/20-inject.js index b3cbebf95..b97f11900 100644 --- a/nodes/core/core/20-inject.js +++ b/nodes/core/core/20-inject.js @@ -15,6 +15,7 @@ **/ module.exports = function(RED) { + "use strict"; var cron = require("cron"); function InjectNode(n) { @@ -54,7 +55,7 @@ module.exports = function(RED) { this.on("input",function(msg) { var msg = {topic:this.topic}; - if ( (this.payloadType == null && this.payload == "") || this.payloadType == "date") { + if ( (this.payloadType == null && this.payload === "") || this.payloadType === "date") { msg.payload = Date.now(); } else if (this.payloadType == null || this.payloadType === "string") { msg.payload = this.payload; diff --git a/public/style.css b/public/style.css index d532994b3..fc717d0f3 100644 --- a/public/style.css +++ b/public/style.css @@ -42,7 +42,7 @@ body { display: none; } #dropTarget div { - display: table-cell; + display: table-cell; vertical-align: middle; text-align: center; font-size: 40px; @@ -292,7 +292,7 @@ li.open #btn-sidemenu { padding: 5px; overflow-y: auto; box-sizing:border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; } .palette-spinner { padding-top: 40px; @@ -310,7 +310,7 @@ li.open #btn-sidemenu { padding: 3px; border-top: 1px solid #999; box-sizing:border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; } #palette-search i.fa-search { position: absolute; @@ -339,9 +339,9 @@ li.open #btn-sidemenu { margin: 0px; height: 30px; box-sizing:border-box; - -moz-box-sizing: border-box; - + -moz-box-sizing: border-box; } + #palette-search input:focus { border: none; box-shadow: none; @@ -412,7 +412,7 @@ li.open #btn-sidemenu { top:8px; left: -5px; box-sizing: border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; background:#d9d9d9; border-radius: 3px; width: 10px; @@ -431,7 +431,7 @@ li.open #btn-sidemenu { #sidebar { background: #fff; box-sizing: border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; } #sidebar.closing { background: #eee; @@ -760,6 +760,16 @@ g.link_unknown path.link_line { .form-row input { width:70%; } +.form-row label .cb1 { + display: inline !important; + width: auto !important; + vertical-align: top !important; +} +.form-row label .cb2 { + display: inline !important; + width: auto !important; + vertical-align: top !important; +} input.input-append-left { border-top-right-radius: 0px; @@ -1019,7 +1029,7 @@ ul.red-ui-tabs li { } ul.red-ui-tabs li a.red-ui-tab-label { - display: block; + display: block; padding: 3px 16px; color: #666; } @@ -1224,7 +1234,7 @@ i.spinner { #header ul.dropdown-menu li.disabled a { color: #666; } - + /* Deploy menu customisations */ #header ul#btn-deploy-options-submenu { width: 300px !important; @@ -1241,5 +1251,3 @@ i.spinner { #header ul#btn-deploy-options-submenu li a > i.fa { display: none !important; } - -