From 80a4f10e7097aee071bb00e4b0ea5b58ce2d4f84 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Wed, 26 Aug 2020 00:40:26 +0200 Subject: [PATCH] read JSON file from textarea --- index.html | 3 +-- loadJson.js | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index e9fb5de..583d32a 100644 --- a/index.html +++ b/index.html @@ -40,7 +40,6 @@ - Single Mask Shards locations - Single Vessel Fragments locations - Single Pale Ore locations? - - Read JSON file from text input -->
@@ -62,7 +61,7 @@
- +
diff --git a/loadJson.js b/loadJson.js index 2aaa44f..1b3e2c1 100644 --- a/loadJson.js +++ b/loadJson.js @@ -38,4 +38,22 @@ loadJSON( jsonObj = JSON.parse(response); // console.log(jsonObj); } -); \ No newline at end of file +); + +function HKReadTextArea() { + let textAreaId = "save-area"; + let contents = document.getElementById(textAreaId).value; + + if(contents.length > 0) { + jsonObj = contents; + + loadJSON( + function JSONparse(response) { + // Parse JSON string into object + jsonObj = JSON.parse(response); + HKCheckCompletion(jsonObj); + // console.log(jsonObj); + } + ); + } +} \ No newline at end of file