From dde5fbcce979daa2ba986adfd3765d755cf3b79d Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:04:58 -0600 Subject: [PATCH 01/10] Custom underline tag --- static/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/style.css b/static/style.css index 58afb91..178066c 100644 --- a/static/style.css +++ b/static/style.css @@ -335,6 +335,10 @@ b, b > *, .activityTitle, .activityTitle > *, .bold { font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif; } +underline { + text-decoration: underline; +} + .activityTitle { text-decoration: underline; } From 1d6696999a5f82b5e211e1ae2a29aa637b49bdc4 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:31:53 -0600 Subject: [PATCH 02/10] Continuing to pollute and overcomplicate the highlight system --- pageUpdater.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index 67ddf71..37e6a48 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -146,15 +146,17 @@ function highlighter(json, full = true, linkParent = false) { var termKey = "{TERM" + index + "}" var termProps = dict while (element.content.includes(termKey)) { + var endRegex = " " + var termIndex = element.content.indexOf(termKey) - var spanEnd = element.content.indexOf(" ", termIndex) + var spanEnd = element.content.indexOf(endRegex, termIndex) if (spanEnd == -1) { spanEnd = element.content.length } - var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ") + 1 + var spanStart = element.content.substring(0, termIndex).lastIndexOf(endRegex) + 1 // if (highTable[index] == "ULTRAKILL") { // console.log(startContent, " ---- ", endContent) @@ -164,12 +166,27 @@ function highlighter(json, full = true, linkParent = false) { var endContent = element.content.substring(termIndex + termKey.length, spanEnd) if (startContent.includes("(") && !endContent.includes(")")) { - spanEnd = element.content.indexOf(")", spanStart) + 1 - endContent = element.content.substring(termIndex + termKey.length, spanEnd) + var newSpanEnd = element.content.indexOf(")", spanStart) + 1 + var newEndContent = element.content.substring(termIndex + termKey.length, newSpanEnd) + if (newEndContent.includes("<") || newEndContent.includes("TERM")) { + spanStart += 1 + startContent = startContent.substring(2) + } else { + spanEnd = newSpanEnd + endContent = newEndContent + } } else if (endContent.includes(")") && !startContent.includes("(")) { - spanStart = element.content.substring(0, spanStart).lastIndexOf("(") - startContent = element.content.substring(spanStart - 1, termIndex) + var newSpanStart = element.content.substring(0, spanStart).lastIndexOf("(") + var newStartContent = element.content.substring(newSpanStart - 1, termIndex) + if (newStartContent.includes("<") || newStartContent.includes("TERM")) { + spanEnd -= 1 + endContent = endContent.substring(0, endContent.length - 1) + } else { + console.log(newStartContent) + spanStart = newSpanStart + startContent = newStartContent + } } var style = termProps.style || "" From dd73c1a9a8b1908753cc9f52cdba9471f3f9fd84 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:37:36 -0600 Subject: [PATCH 03/10] Update highlight list --- constants.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/constants.json b/constants.json index 48d60ad..8f8850d 100644 --- a/constants.json +++ b/constants.json @@ -91,8 +91,7 @@ "words": [ "brain" ], - "color": "pink", - "caseInsensitive": true + "color": "#f5abb9" }, { "words": [ @@ -184,7 +183,8 @@ }, { "words": [ - "Fedi" + "Fedi", + "Sharkey" ], "color": "rgb(175, 125, 200)" }, From 8f18fe7d1fc4c040e126e3718979ca7f2a488ed8 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 14 Nov 2024 01:40:19 -0600 Subject: [PATCH 04/10] Add Signal to word list --- constants.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/constants.json b/constants.json index 8f8850d..1197c3a 100644 --- a/constants.json +++ b/constants.json @@ -194,6 +194,12 @@ ], "color": "rgb(100, 255, 200)" }, + { + "words": [ + "Signal" + ], + "color": "#3b45fd" + }, { "words": [ "Codeberg", From e0351a1ba14f26a5fc4bf58b3d436dcfbcebc9e4 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 14 Nov 2024 01:59:13 -0600 Subject: [PATCH 05/10] new display system for socials --- pageUpdater.js | 41 ++++++++++++++++++++++++++++++++------- static/index.html | 15 +++++++++++--- static/socials/index.html | 6 ++++-- static/subpage.css | 16 +++++++++++++++ 4 files changed, 66 insertions(+), 12 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index 37e6a48..db51641 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -183,7 +183,6 @@ function highlighter(json, full = true, linkParent = false) { spanEnd -= 1 endContent = endContent.substring(0, endContent.length - 1) } else { - console.log(newStartContent) spanStart = newSpanStart startContent = newStartContent } @@ -317,7 +316,7 @@ function converter(html, dynamic = true) { "WEATHER_MODIFIER": randomThemer.returnTheme(), "WEATHER_TEXT": "", "ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")), - "SOCIALS": () => { + "SOCIALS": (full) => { if (api.lanyard && api.lanyard.socials) { var socials = api.lanyard.socials var html = `
` @@ -330,8 +329,9 @@ function converter(html, dynamic = true) { for (var x = 0; x < sitesTable.length; x++) { var siteName = sitesTable[x] var siteData = sites[siteName] - html += `${siteName}: ${siteData.name}` - + if (siteData.main || full) { + html += `${siteName}: ${siteData.name}` + } } html += "
" } @@ -371,6 +371,9 @@ function converter(html, dynamic = true) { ` + }, + "TEST_KEYWORD": (arg1, arg2, arg3) => { + return `

The arguements you inputted are "${arg1}" and "${arg2}". Wow!

` } } @@ -397,10 +400,34 @@ function converter(html, dynamic = true) { for (let index = 0; index < rpTable.length; index++) { const text = rpTable[index]; - if (dynamic) { - replacers[text] = himalaya.stringify(highlighter(himalaya.parse(replacers[text]))) + const braceText = `{${text}}` + + if (typeof replacers[text] == "function" && replacers[text].length == 0) { + replacers[text] = replacers[text]() + } + + while (html.includes(braceText)) { + var posOfKeyword = html.indexOf(braceText) + var keywordLength = braceText.length + var args = undefined + if (html.charAt(posOfKeyword + keywordLength) == "(") { + args = html.substring(posOfKeyword + keywordLength + 1) + keywordLength = args.substring(0, args.indexOf(")")).length + keywordLength + 2 + args = args.substring(0, args.indexOf(")")) + args = args.split(",").map(item => item.trim()) + } + var fnString = replacers[text] + if (typeof fnString == "function") { + fnString = fnString.apply(null, args) + } + + if (dynamic) { + fnString = himalaya.stringify(highlighter(himalaya.parse(fnString))) + } + + html = html.substring(0, posOfKeyword) + fnString + html.substring(posOfKeyword + keywordLength) + // break } - html = html.replaceAll(`{${text}}`, replacers[text]) } if (!dynamic) { diff --git a/static/index.html b/static/index.html index 47f9eed..002ca87 100644 --- a/static/index.html +++ b/static/index.html @@ -78,17 +78,26 @@ {ANNOUNCEMENT} -


Services

+


Services

List of services for public use hosted on Violet's Purgatory.

+


Public:

SearXNG: sxng.violets-purgatory.dev - Forgejo: git.viois.gay Univerter: univerter.dev Thumbor: thumbor.violets-purgatory.dev +


Invite only:

+ Forgejo: git.viois.gay + Bluesky: pds.violets-purgatory.dev + Fedi (Sharkey): sharkey.violets-purgatory.dev +
+

Feel free to DM me anywhere (Discord & Fedi are best) for an invite! Do understand though, my instances are not stable!
+ By using my services, you are confirming you understand that there are risks of data loss, downtime, and bugs!!!


+

Socials

- {PATH_SOCIALS} +

Here's some of the sites you can find me on! Check the full socials page for more details & links.

+ {SOCIALS}
{SELECTED_VIDEO} diff --git a/static/socials/index.html b/static/socials/index.html index 69722c3..4262a7d 100644 --- a/static/socials/index.html +++ b/static/socials/index.html @@ -29,8 +29,10 @@

-

Here's most of the sites you can find me on-
if you needed that for some reason?

- {SOCIALS} +

Here's most of the sites you can find me on!

+ {SOCIALS}(Full) +

Gray border = preferred, Yellow = neutral, Red = not preferred.
+ Interacting via any site is perfectly fine! E.G. if you use both Fedi and Bluesky, Bluesky is yellow, so you should contact me through Fedi instead! But if you don't have Fedi, then just contact me through Bluesky!


diff --git a/static/subpage.css b/static/subpage.css index cd84030..4041708 100644 --- a/static/subpage.css +++ b/static/subpage.css @@ -15,4 +15,20 @@ h1:nth-of-type(1) { .mainDiv { margin: auto; +} + +.notpref { + border-color: rgb(150, 25, 25); +} + +.notpref:hover { + border-color: red; +} + +.neutralpref { + border-color: rgb(150, 150, 75); +} + +.neutralpref:hover { + border-color: yellow; } \ No newline at end of file From e86ce46477211f33b0b981319dc95c521de3c1ca Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:04:58 -0600 Subject: [PATCH 06/10] Custom underline tag --- static/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/style.css b/static/style.css index 58afb91..178066c 100644 --- a/static/style.css +++ b/static/style.css @@ -335,6 +335,10 @@ b, b > *, .activityTitle, .activityTitle > *, .bold { font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif; } +underline { + text-decoration: underline; +} + .activityTitle { text-decoration: underline; } From c40cb68059adffe7835b751c39ddb2a58cfd74bf Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:31:53 -0600 Subject: [PATCH 07/10] Continuing to pollute and overcomplicate the highlight system --- pageUpdater.js | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index 67ddf71..37e6a48 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -146,15 +146,17 @@ function highlighter(json, full = true, linkParent = false) { var termKey = "{TERM" + index + "}" var termProps = dict while (element.content.includes(termKey)) { + var endRegex = " " + var termIndex = element.content.indexOf(termKey) - var spanEnd = element.content.indexOf(" ", termIndex) + var spanEnd = element.content.indexOf(endRegex, termIndex) if (spanEnd == -1) { spanEnd = element.content.length } - var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ") + 1 + var spanStart = element.content.substring(0, termIndex).lastIndexOf(endRegex) + 1 // if (highTable[index] == "ULTRAKILL") { // console.log(startContent, " ---- ", endContent) @@ -164,12 +166,27 @@ function highlighter(json, full = true, linkParent = false) { var endContent = element.content.substring(termIndex + termKey.length, spanEnd) if (startContent.includes("(") && !endContent.includes(")")) { - spanEnd = element.content.indexOf(")", spanStart) + 1 - endContent = element.content.substring(termIndex + termKey.length, spanEnd) + var newSpanEnd = element.content.indexOf(")", spanStart) + 1 + var newEndContent = element.content.substring(termIndex + termKey.length, newSpanEnd) + if (newEndContent.includes("<") || newEndContent.includes("TERM")) { + spanStart += 1 + startContent = startContent.substring(2) + } else { + spanEnd = newSpanEnd + endContent = newEndContent + } } else if (endContent.includes(")") && !startContent.includes("(")) { - spanStart = element.content.substring(0, spanStart).lastIndexOf("(") - startContent = element.content.substring(spanStart - 1, termIndex) + var newSpanStart = element.content.substring(0, spanStart).lastIndexOf("(") + var newStartContent = element.content.substring(newSpanStart - 1, termIndex) + if (newStartContent.includes("<") || newStartContent.includes("TERM")) { + spanEnd -= 1 + endContent = endContent.substring(0, endContent.length - 1) + } else { + console.log(newStartContent) + spanStart = newSpanStart + startContent = newStartContent + } } var style = termProps.style || "" From 91e7e20c7cdabfa8a335b14a4923e47255c2e2c1 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Wed, 13 Nov 2024 23:37:36 -0600 Subject: [PATCH 08/10] Update highlight list --- constants.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/constants.json b/constants.json index 48d60ad..8f8850d 100644 --- a/constants.json +++ b/constants.json @@ -91,8 +91,7 @@ "words": [ "brain" ], - "color": "pink", - "caseInsensitive": true + "color": "#f5abb9" }, { "words": [ @@ -184,7 +183,8 @@ }, { "words": [ - "Fedi" + "Fedi", + "Sharkey" ], "color": "rgb(175, 125, 200)" }, From 3c372690752d54d04284f01702e61bfec10f53aa Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 14 Nov 2024 01:40:19 -0600 Subject: [PATCH 09/10] Add Signal to word list --- constants.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/constants.json b/constants.json index 8f8850d..1197c3a 100644 --- a/constants.json +++ b/constants.json @@ -194,6 +194,12 @@ ], "color": "rgb(100, 255, 200)" }, + { + "words": [ + "Signal" + ], + "color": "#3b45fd" + }, { "words": [ "Codeberg", From 659a5f0bfced4f439a1fa160611c9c45daf40d04 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Thu, 14 Nov 2024 01:59:13 -0600 Subject: [PATCH 10/10] new display system for socials --- pageUpdater.js | 41 ++++++++++++++++++++++++++++++++------- static/index.html | 15 +++++++++++--- static/socials/index.html | 6 ++++-- static/subpage.css | 16 +++++++++++++++ 4 files changed, 66 insertions(+), 12 deletions(-) diff --git a/pageUpdater.js b/pageUpdater.js index 37e6a48..db51641 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -183,7 +183,6 @@ function highlighter(json, full = true, linkParent = false) { spanEnd -= 1 endContent = endContent.substring(0, endContent.length - 1) } else { - console.log(newStartContent) spanStart = newSpanStart startContent = newStartContent } @@ -317,7 +316,7 @@ function converter(html, dynamic = true) { "WEATHER_MODIFIER": randomThemer.returnTheme(), "WEATHER_TEXT": "", "ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")), - "SOCIALS": () => { + "SOCIALS": (full) => { if (api.lanyard && api.lanyard.socials) { var socials = api.lanyard.socials var html = `
` @@ -330,8 +329,9 @@ function converter(html, dynamic = true) { for (var x = 0; x < sitesTable.length; x++) { var siteName = sitesTable[x] var siteData = sites[siteName] - html += `${siteName}: ${siteData.name}` - + if (siteData.main || full) { + html += `${siteName}: ${siteData.name}` + } } html += "
" } @@ -371,6 +371,9 @@ function converter(html, dynamic = true) { ` + }, + "TEST_KEYWORD": (arg1, arg2, arg3) => { + return `

The arguements you inputted are "${arg1}" and "${arg2}". Wow!

` } } @@ -397,10 +400,34 @@ function converter(html, dynamic = true) { for (let index = 0; index < rpTable.length; index++) { const text = rpTable[index]; - if (dynamic) { - replacers[text] = himalaya.stringify(highlighter(himalaya.parse(replacers[text]))) + const braceText = `{${text}}` + + if (typeof replacers[text] == "function" && replacers[text].length == 0) { + replacers[text] = replacers[text]() + } + + while (html.includes(braceText)) { + var posOfKeyword = html.indexOf(braceText) + var keywordLength = braceText.length + var args = undefined + if (html.charAt(posOfKeyword + keywordLength) == "(") { + args = html.substring(posOfKeyword + keywordLength + 1) + keywordLength = args.substring(0, args.indexOf(")")).length + keywordLength + 2 + args = args.substring(0, args.indexOf(")")) + args = args.split(",").map(item => item.trim()) + } + var fnString = replacers[text] + if (typeof fnString == "function") { + fnString = fnString.apply(null, args) + } + + if (dynamic) { + fnString = himalaya.stringify(highlighter(himalaya.parse(fnString))) + } + + html = html.substring(0, posOfKeyword) + fnString + html.substring(posOfKeyword + keywordLength) + // break } - html = html.replaceAll(`{${text}}`, replacers[text]) } if (!dynamic) { diff --git a/static/index.html b/static/index.html index 5822a69..5734961 100644 --- a/static/index.html +++ b/static/index.html @@ -77,17 +77,26 @@
{ANNOUNCEMENT} -


Services

+


Services

List of services for public use hosted on Violet's Purgatory.

+


Public:

SearXNG: sxng.violets-purgatory.dev - Forgejo: git.viois.gay Univerter: univerter.dev Thumbor: thumbor.violets-purgatory.dev +


Invite only:

+ Forgejo: git.viois.gay + Bluesky: pds.violets-purgatory.dev + Fedi (Sharkey): sharkey.violets-purgatory.dev +
+

Feel free to DM me anywhere (Discord & Fedi are best) for an invite! Do understand though, my instances are not stable!
+ By using my services, you are confirming you understand that there are risks of data loss, downtime, and bugs!!!


+

Socials

- {PATH_SOCIALS} +

Here's some of the sites you can find me on! Check the full socials page for more details & links.

+ {SOCIALS}
{SELECTED_VIDEO} diff --git a/static/socials/index.html b/static/socials/index.html index 69722c3..4262a7d 100644 --- a/static/socials/index.html +++ b/static/socials/index.html @@ -29,8 +29,10 @@

-

Here's most of the sites you can find me on-
if you needed that for some reason?

- {SOCIALS} +

Here's most of the sites you can find me on!

+ {SOCIALS}(Full) +

Gray border = preferred, Yellow = neutral, Red = not preferred.
+ Interacting via any site is perfectly fine! E.G. if you use both Fedi and Bluesky, Bluesky is yellow, so you should contact me through Fedi instead! But if you don't have Fedi, then just contact me through Bluesky!


diff --git a/static/subpage.css b/static/subpage.css index cd84030..4041708 100644 --- a/static/subpage.css +++ b/static/subpage.css @@ -15,4 +15,20 @@ h1:nth-of-type(1) { .mainDiv { margin: auto; +} + +.notpref { + border-color: rgb(150, 25, 25); +} + +.notpref:hover { + border-color: red; +} + +.neutralpref { + border-color: rgb(150, 150, 75); +} + +.neutralpref:hover { + border-color: yellow; } \ No newline at end of file