From 2796e04204c9251187cd7499c75e830001d9668c Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Sun, 27 Jun 2021 13:03:12 +0200 Subject: [PATCH] no-unused-vars turn off --- .eslintrc.js | 1 + src/js/page-functions.js | 51 +++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 76fb97f..7c0ad23 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,5 +11,6 @@ module.exports = { }, "rules": { "no-prototype-builtins": 0, + "no-unused-vars": 0, } }; diff --git a/src/js/page-functions.js b/src/js/page-functions.js index 547a891..eaeb49a 100644 --- a/src/js/page-functions.js +++ b/src/js/page-functions.js @@ -171,19 +171,13 @@ function GenerateInnerHTML(hkdb) { let finalHTMLFill = ""; let textFill = ""; - let icon = ""; - let iconGreen = SYMBOL_TRUE; - let iconRed = SYMBOL_FALSE; - let iconClock = SYMBOL_CLOCK; - let iconNull = SYMBOL_EMPTY; - - let textPrefix = ""; - let textSuffix = ""; - let sections = hkdb.SECTION; + let entries = {}; for (let section in sections) { + entries = sections[section].entries; + /* starts a new
with the current section id */ textFill = SectionStart(sections[section]); @@ -191,6 +185,10 @@ function GenerateInnerHTML(hkdb) { textFill += CompletionFill(sections[section]); /* create all main entries */ + for (let entry in entries) { + textFill += SingleEntryFill(entries[entry]); + } + switch (section) { case "intro": @@ -270,6 +268,41 @@ function SectionStart(section) { } +function SingleEntryFill(entry) { + + let icon = ""; + let iconGreen = SYMBOL_TRUE; + let iconRed = SYMBOL_FALSE; + let iconClock = SYMBOL_CLOCK; + let iconNull = SYMBOL_EMPTY; + + let textPrefix = ""; + let textSuffix = ""; + let wiki = ""; + + let b = ["", ""]; + if (!textPrefix.length) b = ["", ""]; + if (wiki.length) b = [``, ""]; + + let span = ["", ""]; + let spoilerSpan = ["", ""]; + if (divId.id === "hk-hints") { + span[0] = ""; + icon = ""; + } + + // let dash = ""; + if (textSuffix.length && textPrefix.length) textSuffix = "— " + textSuffix; + if (textPrefix.includes("")) textSuffix = `${textSuffix}`; + + return ` +
+ +
+ `; + +} + /** * Adds HTML string to an element with a given ID. * @param {object} divId object containing div ID of the HTML element to append to