From 49c6e53c2b677abfa8aa2adabd77f92605ee3744 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 17 Aug 2014 18:31:30 +0300 Subject: drag&drop load of json, plus save (kinda), some refactoring save & load json moved from buttons to rhizicore.js added a save as button (need to switch to normal ui for that menu, it's fixed right now) save not correct - instead of a save dialog since it is a json file the browser just displays it (even though it's base64 encoded). --- scripts/rhizicore.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'scripts/rhizicore.js') diff --git a/scripts/rhizicore.js b/scripts/rhizicore.js index f72d5176..ac3988a8 100644 --- a/scripts/rhizicore.js +++ b/scripts/rhizicore.js @@ -379,6 +379,53 @@ function myGraph(el) { force.resume(); } + function load_from_json(json) { + var data = JSON.parse(json); + if (data == null) { + console.log('load callback: no data to load'); + return; + } + for(var i=0; i