moved HKReadTextArea

This commit is contained in:
ReznoRMichael 2020-08-26 01:18:14 +02:00
parent e5fc0fa864
commit 9331d5bbca
3 changed files with 18 additions and 19 deletions

View file

@ -373,4 +373,17 @@ function checkWarriorDreams(divId, dataObject, playerData) {
fillHTML(divId, dataObject[i]);
delete dataObject[i];
}
}
function HKReadTextArea() {
cleanHTML(DIV_ID);
let textAreaId = "save-area";
let contents = document.getElementById(textAreaId).value;
if(contents.length > 0) {
let jsonObj = JSON.parse(contents);
HKCheckCompletion(jsonObj);
// console.log(jsonObj);
}
}

View file

@ -40,6 +40,7 @@
- Single Mask Shards locations
- Single Vessel Fragments locations
- Single Pale Ore locations?
- Deep clone Spells object
-->
<div id="content">
@ -60,9 +61,9 @@
<div style="margin-bottom: 20px;"></div>
<div>
<!-- <div>
<button id="startbutton" onclick="HKCheckCompletion(jsonObj);">Run Script</button>
</div>
</div> -->
<div style="margin-bottom: 20px;"></div>

View file

@ -5,7 +5,6 @@ var jsonObj = "";
* @param callback Asynchronous function.
*/
function loadJSON(callback) {
jsonObj = "";
// new Http request object (asynchronous), both the web page and the XML file it tries to load, must be located on the same server.
var xobj = new XMLHttpRequest();
@ -37,21 +36,7 @@ loadJSON(
function JSONparse(response) {
// Parse JSON string into object
jsonObj = JSON.parse(response);
document.getElementById("save-area").value = response;
// console.log(jsonObj);
}
);
function HKReadTextArea() {
jsonObj = "";
cleanHTML(DIV_ID);
let textAreaId = "save-area";
let contents = document.getElementById(textAreaId).value;
if(contents.length > 0) {
jsonObj = JSON.parse(contents);
HKCheckCompletion(jsonObj);
// console.log(jsonObj);
}
}
);