I'll get the format right eventually
parent
140d050f21
commit
147b50e19f
|
|
@ -94,7 +94,7 @@
|
||||||
var course_name = "Davis";
|
var course_name = "Davis";
|
||||||
$("#upload").click(function () {
|
$("#upload").click(function () {
|
||||||
sendCustomizedApp({
|
sendCustomizedApp({
|
||||||
storage: JSON.stringify(courses),
|
storage: courses,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
console.log(out);
|
console.log(out);
|
||||||
courses.push({
|
courses.push({
|
||||||
name: "golfcourse-" + course_name + ".json",
|
name: "golfcourse-" + course_name + ".json",
|
||||||
content: JSON.parse(JSON.stringify(out)) // deep copy
|
content: JSON.stringify(out),
|
||||||
});
|
});
|
||||||
$('#status').text("Course retrieved!");
|
$('#status').text("Course retrieved!");
|
||||||
$('#upload').attr("disabled", false);
|
$('#upload').attr("disabled", false);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ function distance(a,b) {
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/19721439/download-json-object-as-a-file-from-browser
|
// https://stackoverflow.com/questions/19721439/download-json-object-as-a-file-from-browser
|
||||||
function downloadObjectAsJSON(exportObj, exportName) {
|
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');
|
var downloadAnchorNode = document.createElement('a');
|
||||||
downloadAnchorNode.setAttribute("href", dataStr);
|
downloadAnchorNode.setAttribute("href", dataStr);
|
||||||
downloadAnchorNode.setAttribute("download", exportName + ".json");
|
downloadAnchorNode.setAttribute("download", exportName + ".json");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue