separate span for spoilers

This commit is contained in:
ReznoRMichael 2021-01-27 01:23:07 +01:00
parent 02140ac225
commit 586a904050
4 changed files with 13 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -448,6 +448,10 @@ a:hover {
display: none; display: none;
} }
.spoiler-text {
display: inline-block;
}
.radio, .radio,
.checkbox { .checkbox {
position: relative; position: relative;

View file

@ -338,6 +338,10 @@ a:hover {
display: none; display: none;
} }
.spoiler-text {
display: inline-block;
}
.radio, .radio,
.checkbox { .checkbox {
position: relative; position: relative;

View file

@ -340,14 +340,15 @@ function CompletionHTML(jsObj) {
* Generates and appends a new entry inside the HTML of a given ID * Generates and appends a new entry inside the HTML of a given ID
* @param {object} divId object containing div ID and h2 title of the HTML element * @param {object} divId object containing div ID and h2 title of the HTML element
* @param {string} textPrefix Main name of the entry * @param {string} textPrefix Main name of the entry
* @param {string} textSuffix Optional suffix after the main name * @param {string} textSuffix Optional suffix after the main name (locations, costs etc.)
*/ */
function FillHTML(divId, textPrefix = "Unknown Completion Element: ", textSuffix = "") { function FillHTML(divId, textPrefix = "Unknown Completion Element: ", textSuffix = "Unknown Description Element") {
let icon = completionSymbol; let icon = completionSymbol;
let b = ["<b>", "</b>"]; let b = ["<b>", "</b>"];
if (!textPrefix.length) b = ["", ""]; if (!textPrefix.length) b = ["", ""];
let span = ["<span class='flex-row location hidden'>", "</span>"]; let span = ["<span class='flex-row location hidden'>", "</span>"];
let spoilerSpan = ["<span class='spoiler-text'>", "</span>"];
if (divId === DIV_ID.hints) { if (divId === DIV_ID.hints) {
span[0] = "<span>"; span[0] = "<span>";
icon = ""; icon = "";
@ -356,7 +357,7 @@ function FillHTML(divId, textPrefix = "Unknown Completion Element: ", textSuffix
let dash = ""; let dash = "";
if (textSuffix.length && textPrefix.length) dash = " — "; if (textSuffix.length && textPrefix.length) dash = " — ";
document.getElementById(divId.id).innerHTML += divStart + icon + b[0] + textPrefix + b[1] + span[0] + pSpan + dash + textSuffix + span[1] + divEnd; document.getElementById(divId.id).innerHTML += divStart + icon + b[0] + textPrefix + b[1] + span[0] + pSpan + spoilerSpan[0] + dash + textSuffix + spoilerSpan[1] + span[1] + divEnd;
} }
/** /**