organize code

This commit is contained in:
ReznoRMichael 2021-06-21 15:41:07 +02:00
parent d35a360ba8
commit 71b943151f

View file

@ -134,6 +134,41 @@ function CompletionHTML(jsObj, hkGameCompletion) {
} }
} }
/* ################################### Optimized Functions ###################################### */
function GenerateInnerHTML(hkdb) {
console.log(hkdb);
let finalHTMLFill = "";
let textFill = "";
let sections = hkdb.DIV_ID;
for (let section in sections) {
/* creates a h2 tag for the current section and fills with current%/max% */
textFill = CompletionFill(sections[section]);
switch (section) {
case "intro":
break;
default:
}
finalHTMLFill += textFill;
}
console.log(finalHTMLFill);
}
/** /**
* Replaces the h2 titles with a current percent/max percent values as read from the save file * Replaces the h2 titles with a current percent/max percent values as read from the save file
* @param {object} jsObj Object with HTML data to fill * @param {object} jsObj Object with HTML data to fill
@ -190,36 +225,6 @@ function CompletionHTML(jsObj, hkGameCompletion) {
} }
function GenerateInnerHTML(hkdb) {
console.log(hkdb);
let finalHTMLFill = "";
let textFill = "";
let sections = hkdb.DIV_ID;
for (let section in sections) {
textFill = CompletionFill(sections[section]);
switch (section) {
case "intro":
break;
default:
}
finalHTMLFill += textFill;
}
console.log(finalHTMLFill);
}
/** /**
* Adds HTML string to an element with a given ID. * Adds HTML string to an element with a given ID.
* @param {object} divId object containing div ID of the HTML element to append to * @param {object} divId object containing div ID of the HTML element to append to