From 86f6cd0ad94e5c4464cd97acc70f09927d589d37 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 27 Jun 2024 00:21:57 -0500 Subject: [PATCH 1/3] Extra explanations on highlighting in FAQ --- static/faq/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/faq/index.html b/static/faq/index.html index c01e7ba..fe00df1 100644 --- a/static/faq/index.html +++ b/static/faq/index.html @@ -33,6 +33,8 @@

I like the way it looks to have certain words be highlighted, makes it look fancier and easier to read (imo). So, when I remade this site, I went ahead and added an Automatic Word Highlighting System! This allows me have words automatically highlighted, on the server side, without having to do it in the code manually. Here's the current list of highlighted words:

{ALL_HIGHLIGHTS}

As time continues, more words are added to the highlighting list, and I'm slowly adding more features, like disabling case sensitivity, boldness, italics, outlines, and more.

+

You may notice some highlighted words are "missing" on this list. This is because characters adjacent to the highlighted word are highlighted, too! What that means is, I can type HolyCowabungaILoveUltrakillItsSoEpic and it'll all be highlighted!

+

P.S. If you're wondering what YIP is for, its for YIPPEEEEEEEEEEEEEEEEEEEEEE!


I thought the site doesn't use Javascript? So why is it there?

Originally, all my sites were completely Javascript free. As of late, though, I decided to add Javascript to this one. Javascript will NEVER be a requirement on this site. Javascript will ONLY be used where necessary, and I will do everything possible to make the experience indistinguishable.

From c574a2b48a327f07ab4a24df470feb8cc2c564d7 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 27 Jun 2024 00:23:34 -0500 Subject: [PATCH 2/3] Add FAQ back to main page --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 0c5c503..ee2a0c3 100644 --- a/static/index.html +++ b/static/index.html @@ -85,8 +85,8 @@

Socials

{PATH_SOCIALS}
- +


FAQ

+ {PATH_FAQ} {SELECTED_VIDEO} From 3fd257cbe7bfc424aac06663f04dec24aba2c3c5 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 27 Jun 2024 00:45:19 -0500 Subject: [PATCH 3/3] Fix wacky highlighting stuff --- pageUpdater.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index 4d88a71..0bf117c 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -36,7 +36,7 @@ for (var i = 0; i < globResult.length; i++) { }) } -(async function() { +(async function () { globResult = glob.globSync("**/static/**/*.js", { absolute: true }) for (var i = 0; i < globResult.length; i++) { javascriptCache[globResult[i]] = await minify({ @@ -156,13 +156,18 @@ function highlighter(json, full = true) { classes = `class="${classes}"` } - var replacement = `${startContent + highTable[index] + endContent}` + var stuff = (startContent + highTable[index] + endContent).trim() - if (link) { - replacement = `${replacement}` + if (!stuff.includes("span")) { + var replacement = `${stuff}` + + if (link) { + replacement = `${replacement}` + } + element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd) + } else { + element.content = element.content.replace(termKey, highTable[index]) } - - element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd) } }