|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
function importNodes(newNodesStr,touchImport) { |
|
|
function importNodes(newNodesStr,touchImport) { |
|
|
|
|
|
|
|
|
|
|
|
var createNewIds = true; |
|
|
|
|
|
|
|
|
// TODO: solve this more elegant as the system expects |
|
|
// TODO: solve this more elegant as the system expects |
|
|
if ($("#node-input-arduino").prop('checked') === true) { |
|
|
if ($("#node-input-arduino").prop('checked') === true) { |
|
|
newNodesStr = RED.nodes.cppToJSON(newNodesStr); |
|
|
newNodesStr = RED.nodes.cppToJSON(newNodesStr); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
var createNewIds = true; |
|
|
|
|
|
var result = RED.nodes.import(newNodesStr,true); |
|
|
|
|
|
|
|
|
var result = RED.nodes.import(newNodesStr,createNewIds); |
|
|
if (result) { |
|
|
if (result) { |
|
|
var new_nodes = result[0]; |
|
|
var new_nodes = result[0]; |
|
|
var new_links = result[1]; |
|
|
var new_links = result[1]; |