Skip to content

Commit

Permalink
add SequenceNode
Browse files Browse the repository at this point in the history
  • Loading branch information
lopelex committed Nov 2, 2019
1 parent 21b11ce commit 6084b16
Show file tree
Hide file tree
Showing 8 changed files with 406 additions and 39 deletions.
2 changes: 1 addition & 1 deletion nodes/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@
this.activity = $('#node-input-activity').val();
}
});
</script>
</script>
36 changes: 9 additions & 27 deletions nodes/automation.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,18 @@
value: $('#node-input-json').val()
});
this.editor.focus();

if(config && config.ip) {
getStates(that.device);
}

$('#node-input-config').click(function() {

$('#node-input-activity').empty();
$('#node-input-activity').attr('disabled', 'disabled');
$('#node-input-command').empty();
$('#node-input-command').attr('disabled', 'disabled');

$.get('hws/config', {
ip: config.ip
})
.done(function(data) {
loadActivitiesAndDevices(node.activity);
})
.fail(function(err) {
RED.notify(err.responseText, 'error')
});
});

$('#node-input-device').on('change', function() {
if(!that.editor.getValue()) {
try {
var json = that.data[$('#node-input-device').val()];
that.editor.setValue(JSON.stringify(json, null, 4));
} catch (err) {

}
}
});
Expand All @@ -107,7 +89,7 @@
});
}
} catch (err) {

}
});

Expand All @@ -118,19 +100,19 @@
})
.done(function(data) {
that.data = JSON.parse(data);
$.each(that.data, function(device){
$('#node-input-device').append($('<option>', {
$.each(that.data, function(device){
$('#node-input-device').append($('<option/>', {
value: device,
text: device
}));
});
$('#node-input-device').val(selected).change();
if(callback) {
callback();
}
}
})
.fail(function(err) {

});
}
},
Expand All @@ -140,7 +122,7 @@
try {
var value = JSON.stringify(JSON.parse(value), null, 4);
} catch (err) {

}
$('#node-input-json').val(value);
this.editor.destroy();
Expand All @@ -163,4 +145,4 @@
this.editor.resize();
}
});
</script>
</script>
2 changes: 1 addition & 1 deletion nodes/command.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@
this.command = $('#node-input-command').val();
}
});
</script>
</script>
6 changes: 3 additions & 3 deletions nodes/observer.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@
oneditprepare: function() {

$('#node-input-toContext').on('change', function() {

if(this.checked) {
$('#node-input-context-group').show();
}
else {
else {
$('#node-input-context-group').hide();
}
});
}
});
</script>
</script>
Loading

0 comments on commit 6084b16

Please sign in to comment.