Merge branch 'master' of github.com:node-red/node-red

This commit is contained in:
Nick O'Leary 2014-10-27 19:36:43 +00:00
commit 4c573b208c
3 changed files with 9 additions and 6 deletions

View File

@ -37,11 +37,11 @@ module.exports = function(RED) {
if (!isNaN(this.op1)) { this.op1 = Number(this.op1); }
if (!isNaN(this.op2)) { this.op2 = Number(this.op2); }
if (this.op1 == "true") { this.op1 = true; }
if (this.op2 == "true") { this.op1 = true; }
if (this.op1 == "false") { this.op2 = false; }
if (this.op2 == "true") { this.op2 = true; }
if (this.op1 == "false") { this.op1 = false; }
if (this.op2 == "false") { this.op2 = false; }
if (this.op1 == "null") { this.op1 = null; }
if (this.op2 == "null") { this.op1 = null; }
if (this.op2 == "null") { this.op2 = null; }
try { this.op1 = JSON.parse(this.op1); }
catch(e) { this.op1 = this.op1; }
try { this.op2 = JSON.parse(this.op2); }

View File

@ -136,6 +136,9 @@
<td><span class="help-key">Ctrl</span> <span class="help-key">+</span></td><td>Zoom in</td>
<td><span class="help-key">Ctrl</span> <span class="help-key">-</span></td><td>Zoom out</td>
</tr>
<tr>
<td colspan="4">Mac users can use the <b>⌘ - Cmd</b> key rather than Ctrl key.</td>
</tr>
</table>
</div>
<div class="modal-footer">

View File

@ -24,19 +24,20 @@ RED.keyboard = (function() {
if (handler && handler.ondown) {
if (!handler.modifiers ||
((!handler.modifiers.shift || d3.event.shiftKey) &&
(!handler.modifiers.ctrl || d3.event.ctrlKey ) &&
(!handler.modifiers.ctrl || !handler.modifiers.meta || d3.event.ctrlKey || d3.event.metaKey) &&
(!handler.modifiers.alt || d3.event.altKey ) )) {
handler.ondown();
}
}
});
d3.select(window).on("keyup",function() {
if (!active) { return; }
var handler = handlers[d3.event.keyCode];
if (handler && handler.onup) {
if (!handler.modifiers ||
((!handler.modifiers.shift || d3.event.shiftKey) &&
(!handler.modifiers.ctrl || d3.event.ctrlKey ) &&
(!handler.modifiers.ctrl || !handler.modifiers.meta || d3.event.ctrlKey || d3.event.metaKey) &&
(!handler.modifiers.alt || d3.event.altKey ) )) {
handler.onup();
}
@ -46,7 +47,6 @@ RED.keyboard = (function() {
var mod = modifiers;
var cbdown = ondown;
var cbup = onup;
if (typeof modifiers == "function") {
mod = {};
cbdown = modifiers;