Compare commits

...

11 Commits

Author SHA1 Message Date
Nick O'Leary
9ec7bb8d41 bump version 2016-06-20 21:38:09 +01:00
Nick O'Leary
2b9bfbc309 MQTT In subscription qos not defaulting properly 2016-06-20 21:35:43 +01:00
Dave Conway-Jones
e50d04077b Let exec node handle 0 as well as "0" 2016-06-20 19:28:59 +01:00
Nick O'Leary
b6fcaacb77 Create default settings.js in the user-specified directory
Fixes #908
2016-06-20 14:41:47 +01:00
Nick O'Leary
939da4e551 bump version 2016-06-20 14:27:28 +01:00
Nick O'Leary
f30ce1f9eb Cannot add twitter credentials
Fixes #913
2016-06-20 14:25:11 +01:00
Nick O'Leary
343588b2a0 Support array references in Debug property field 2016-06-20 10:19:18 +01:00
Nick O'Leary
77b13ce9d4 Bump version & changelog 2016-06-20 09:56:29 +01:00
Nick O'Leary
7cb41d2ca9 Remove duplicate "Delete" entry in keyboard shortcut window
Fixes #911
2016-06-20 09:56:01 +01:00
Nicholas Humfrey
8bbc9e6502 Added 'exec' to the command in the node-red-pi script (#910) 2016-06-20 09:53:57 +01:00
Nick O'Leary
e29a0df3fd Handle undefined node properties when mapping array references 2016-06-20 09:38:16 +01:00
11 changed files with 47 additions and 22 deletions

View File

@@ -1,3 +1,26 @@
#### 0.14.3: Maintenance Release
Fixes
- Create default setting.js in user-specified directory. Fixes #908
- MQTT In subscription qos not defaulting properly
- Let exec node handle 0 as well as "0"
#### 0.14.2: Maintenance Release
Fixes
- Cannot add new twitter credentials. Fixes #913
- Support array references in Debug property field
#### 0.14.1: Maintenance Release
Fixes
- Handle undefined property that led to missing wires in the editor
- Remove duplicate 'Delete' entry in keyboard shortcut window. Closes #911
- Add 'exec' to node-red-pi launch script. Closes #910
#### 0.14.0: Milestone Release
Editor

View File

@@ -40,4 +40,4 @@ SCRIPT_PATH="`pwd`";
cd $CURRENT_PATH
# Run Node-RED
/usr/bin/env node $OPTIONS $SCRIPT_PATH/../red.js $ARGS
exec /usr/bin/env node $OPTIONS $SCRIPT_PATH/../red.js $ARGS

View File

@@ -903,7 +903,7 @@ RED.nodes = (function() {
if (configNode && configNode.users.indexOf(n) === -1) {
configNode.users.push(n);
}
} else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== null) {
} else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== undefined && n[d3] !== null) {
for (var j = 0;j<n[d3].length;j++) {
if (node_map[n[d3][j]]) {
n[d3][j] = node_map[n[d3][j]].id;

View File

@@ -110,7 +110,6 @@ RED.keyboard = (function() {
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">a</span></td><td>'+RED._("keyboard.selectAll")+'</td></tr>'+
'<tr><td><span class="help-key">Shift</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.selectAllConnected")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.addRemoveNode")+'</td></tr>'+
'<tr><td><span class="help-key">Delete</span></td><td>'+RED._("keyboard.deleteSelected")+'</td></tr>'+
'<tr><td>&nbsp;</td><td></td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">i</span></td><td>'+RED._("keyboard.importNode")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">e</span></td><td>'+RED._("keyboard.exportNode")+'</td></tr>'+

View File

@@ -39,8 +39,7 @@ RED.tray = (function() {
if (options.buttons) {
for (var i=0;i<options.buttons.length;i++) {
var button = options.buttons[i];
var b = $('<button>').appendTo(buttonBar);
var b = $('<button>').button().appendTo(buttonBar);
if (button.id) {
b.attr('id',button.id);
}

View File

@@ -83,8 +83,12 @@
border-color: $editor-button-background-primary;
color: $editor-button-color-primary;
background: $editor-button-background-primary;
&:not(.disabled):hover {
&.disabled, &.ui-state-disabled {
background: none;
color: $editor-button-color;
border-color: $form-input-border-color;
}
&:not(.disabled):not(.ui-button-disabled):hover {
border-color: $editor-button-background-primary-hover;
background: $editor-button-background-primary-hover;
color: $editor-button-color-primary !important;
@@ -101,8 +105,6 @@
}
&.leftButton {
float: left;
margin-top: 1px;
@@ -110,6 +112,9 @@
&:not(.leftButton):not(:last-child) {
margin-right: 16px;
}
&.ui-state-disabled {
opacity: 1;
}
}
}

View File

@@ -50,12 +50,9 @@ module.exports = function(RED) {
var output = msg[property];
if (this.complete !== "false" && typeof this.complete !== "undefined") {
property = this.complete;
var propertyParts = property.split(".");
try {
output = propertyParts.reduce(function (obj, i) {
return obj[i];
}, msg);
} catch (err) {
output = RED.util.getMessageProperty(msg,this.complete);
} catch(err) {
output = undefined;
}
}

View File

@@ -29,6 +29,7 @@ module.exports = function(RED) {
this.useSpawn = n.useSpawn;
this.timer = Number(n.timer || 0)*1000;
this.activeProcesses = {};
var node = this;
var cleanup = function(p) {
//console.log("CLEANUP!!!",p);
@@ -37,7 +38,6 @@ module.exports = function(RED) {
node.error("Exec node timeout");
}
var node = this;
this.on("input", function(msg) {
var child;
node.status({fill:"blue",shape:"dot",text:" "});
@@ -45,8 +45,8 @@ module.exports = function(RED) {
// make the extra args into an array
// then prepend with the msg.payload
var arg = node.cmd;
if (node.addpay) { arg += " "+msg.payload; }
arg += " "+node.append;
if ((node.addpay === true) && msg.hasOwnProperty("payload")) { arg += " "+msg.payload; }
if (node.append.trim() !== "") { arg += " "+node.append; }
// slice whole line by spaces (trying to honour quotes);
arg = arg.match(/(?:[^\s"]+|"[^"]*")+/g);
var cmd = arg.shift();
@@ -88,7 +88,7 @@ module.exports = function(RED) {
}
else {
var cl = node.cmd;
if ((node.addpay === true) && ((msg.payload || "").toString().trim() !== "")) { cl += " "+msg.payload; }
if ((node.addpay === true) && msg.hasOwnProperty("payload")) { cl += " "+msg.payload; }
if (node.append.trim() !== "") { cl += " "+node.append; }
/* istanbul ignore else */
if (RED.settings.verbose) { node.log(cl); }

View File

@@ -314,8 +314,10 @@ module.exports = function(RED) {
function MQTTInNode(n) {
RED.nodes.createNode(this,n);
this.topic = n.topic;
this.qos = parseInt(n.qos===undefined?"2":n.qos);
this.qos = parseInt(n.qos);
if (isNaN(this.qos) || this.qos < 0 || this.qos > 2) {
this.qos = 2;
}
this.broker = n.broker;
this.brokerConn = RED.nodes.getNode(this.broker);
if (!/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/.test(this.topic)) {

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red",
"version" : "0.14.0",
"version" : "0.14.3",
"description" : "A visual tool for wiring the Internet of Things",
"homepage" : "http://nodered.org",
"license" : "Apache-2.0",

2
red.js
View File

@@ -81,7 +81,7 @@ if (parsedArgs.settings) {
// NODE_RED_HOME contains user data - use its settings.js
settingsFile = path.join(process.env.NODE_RED_HOME,"settings.js");
} else {
var userDir = path.join(parsedArgs.userDir || process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red");
var userDir = parsedArgs.userDir || path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red");
var userSettingsFile = path.join(userDir,"settings.js");
if (fs.existsSync(userSettingsFile)) {
// $HOME/.node-red/settings.js exists