Commit 223e43fc authored by Katie Frey's avatar Katie Frey

support for old orphans node

parent bc64d680
......@@ -292,8 +292,19 @@
var loadData = sortsaves[loadNum]["rootBranch"];
var loadRecycle = sortsaves[loadNum]["rootRecycle"];
var loadOrig = sortsaves[loadNum]["rootOrig"];
//support for old Orphans node
var loadOrphans = sortsaves[loadNum]["rootOrphans"];
recycle = JSON.parse(loadRecycle);
try {
//if loadRecycle exists...
recycle = JSON.parse(loadRecycle);
}
catch {
//else load older Orphans style
recycle = JSON.parse(loadOrphans);
}
branch = JSON.parse(loadData);
orig = JSON.parse(loadOrig);
......@@ -371,7 +382,15 @@ function savestuff(saveName,sortsaves){
recycle["name"] = "recycle";
recycle["children"] = root["children"][i]
orphan1 = JSON.stringify(recycle, getCircularReplacer());
recycle1 = JSON.stringify(recycle, getCircularReplacer());
} else if (root["children"][i]["name"] == "orphan") {
recycle = {};
recycle["name"] = "recycle";
recycle["children"] = root["children"][i]
recycle1 = JSON.stringify(recycle, getCircularReplacer());
} else {
......@@ -389,7 +408,7 @@ function savestuff(saveName,sortsaves){
var rootBranch = root1.replace(/_children/gm,'children').replace(/,"children":null/gm,'').replace(/,"depth":\d*/gm,"").replace(/,"x":\d*.\d*,"y":\d*/gm,"").replace(/,"x0":\d*.\d*,"y0":\d*/gm,"").replace(/,"id":\d*/gm,"");
var rootRecycle = orphan1.replace(/_children/gm,'children').replace(/,"children":null/gm,'').replace(/,"depth":\d*/gm,"").replace(/,"x":\d*.\d*,"y":\d*/gm,"").replace(/,"x0":\d*.\d*,"y0":\d*/gm,"").replace(/,"id":\d*/gm,"");
var rootRecycle = recycle1.replace(/_children/gm,'children').replace(/,"children":null/gm,'').replace(/,"depth":\d*/gm,"").replace(/,"x":\d*.\d*,"y":\d*/gm,"").replace(/,"x0":\d*.\d*,"y0":\d*/gm,"").replace(/,"id":\d*/gm,"");
var rootOrig = JSON.stringify(orig1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment