From 147b50e19f5bab782bac622f30c17fa290c2d1af Mon Sep 17 00:00:00 2001 From: Jason Dekarske Date: Thu, 7 Apr 2022 14:35:57 -0700 Subject: [PATCH] I'll get the format right eventually --- apps/golfview/custom.html | 4 ++-- apps/golfview/maptools.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/golfview/custom.html b/apps/golfview/custom.html index dde6d1268..06161a388 100644 --- a/apps/golfview/custom.html +++ b/apps/golfview/custom.html @@ -94,7 +94,7 @@ var course_name = "Davis"; $("#upload").click(function () { sendCustomizedApp({ - storage: JSON.stringify(courses), + storage: courses, }); }); @@ -110,7 +110,7 @@ console.log(out); courses.push({ name: "golfcourse-" + course_name + ".json", - content: JSON.parse(JSON.stringify(out)) // deep copy + content: JSON.stringify(out), }); $('#status').text("Course retrieved!"); $('#upload').attr("disabled", false); diff --git a/apps/golfview/maptools.js b/apps/golfview/maptools.js index fffd57ca0..e475c798b 100644 --- a/apps/golfview/maptools.js +++ b/apps/golfview/maptools.js @@ -53,7 +53,7 @@ function distance(a,b) { // https://stackoverflow.com/questions/19721439/download-json-object-as-a-file-from-browser function downloadObjectAsJSON(exportObj, exportName) { - var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj)); + var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(exportObj); // must be stringified!! var downloadAnchorNode = document.createElement('a'); downloadAnchorNode.setAttribute("href", dataStr); downloadAnchorNode.setAttribute("download", exportName + ".json");