瀏覽代碼

Added import functionality of Arduino code (without disturbing whitespaces and empty lines)

dds
Manfred Müller-Späth 9 年之前
父節點
當前提交
563aa6482c
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      gui/red/ui/view.js

+ 13
- 0
gui/red/ui/view.js 查看文件

@@ -1475,7 +1475,20 @@ RED.view = (function() {
* - attached to mouse for placing - 'IMPORT_DRAGGING'
*/
function importNodes(newNodesStr,touchImport) {
// TODO: solve this more elegant as the system expects
if ($("#node-input-arduino").prop('checked') === true) {
newNodesStr = RED.nodes.cppToJSON(newNodesStr);
createNewIds = false;
RED.storage.clear();
localStorage.setItem("audio_library_guitool", newNodesStr);
RED.storage.load();
redraw();
return;
}

try {
var createNewIds = true;
var result = RED.nodes.import(newNodesStr,true);
if (result) {
var new_nodes = result[0];

Loading…
取消
儲存