diff --git a/constants.json b/constants.json index 1197c3a..48d60ad 100644 --- a/constants.json +++ b/constants.json @@ -91,7 +91,8 @@ "words": [ "brain" ], - "color": "#f5abb9" + "color": "pink", + "caseInsensitive": true }, { "words": [ @@ -183,8 +184,7 @@ }, { "words": [ - "Fedi", - "Sharkey" + "Fedi" ], "color": "rgb(175, 125, 200)" }, @@ -194,12 +194,6 @@ ], "color": "rgb(100, 255, 200)" }, - { - "words": [ - "Signal" - ], - "color": "#3b45fd" - }, { "words": [ "Codeberg", diff --git a/pageUpdater.js b/pageUpdater.js index db51641..67ddf71 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -146,17 +146,15 @@ 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(endRegex, termIndex) + var spanEnd = element.content.indexOf(" ", termIndex) if (spanEnd == -1) { spanEnd = element.content.length } - var spanStart = element.content.substring(0, termIndex).lastIndexOf(endRegex) + 1 + var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ") + 1 // if (highTable[index] == "ULTRAKILL") { // console.log(startContent, " ---- ", endContent) @@ -166,26 +164,12 @@ function highlighter(json, full = true, linkParent = false) { var endContent = element.content.substring(termIndex + termKey.length, spanEnd) if (startContent.includes("(") && !endContent.includes(")")) { - 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 - } + spanEnd = element.content.indexOf(")", spanStart) + 1 + endContent = element.content.substring(termIndex + termKey.length, spanEnd) } else if (endContent.includes(")") && !startContent.includes("(")) { - 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 { - spanStart = newSpanStart - startContent = newStartContent - } + spanStart = element.content.substring(0, spanStart).lastIndexOf("(") + startContent = element.content.substring(spanStart - 1, termIndex) } var style = termProps.style || "" @@ -316,7 +300,7 @@ function converter(html, dynamic = true) { "WEATHER_MODIFIER": randomThemer.returnTheme(), "WEATHER_TEXT": "", "ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")), - "SOCIALS": (full) => { + "SOCIALS": () => { if (api.lanyard && api.lanyard.socials) { var socials = api.lanyard.socials var html = `
` @@ -329,9 +313,8 @@ function converter(html, dynamic = true) { for (var x = 0; x < sitesTable.length; x++) { var siteName = sitesTable[x] var siteData = sites[siteName] - if (siteData.main || full) { - html += `${siteName}: ${siteData.name}` - } + html += `${siteName}: ${siteData.name}` + } html += "
" } @@ -371,9 +354,6 @@ function converter(html, dynamic = true) { ` - }, - "TEST_KEYWORD": (arg1, arg2, arg3) => { - return `

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

` } } @@ -400,34 +380,10 @@ function converter(html, dynamic = true) { for (let index = 0; index < rpTable.length; index++) { const text = rpTable[index]; - 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 + if (dynamic) { + replacers[text] = himalaya.stringify(highlighter(himalaya.parse(replacers[text]))) } + html = html.replaceAll(`{${text}}`, replacers[text]) } if (!dynamic) { diff --git a/static/index.html b/static/index.html index 5734961..5822a69 100644 --- a/static/index.html +++ b/static/index.html @@ -77,26 +77,17 @@ {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

-

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

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

-

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!

+

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

+ {SOCIALS}
diff --git a/static/style.css b/static/style.css index 178066c..58afb91 100644 --- a/static/style.css +++ b/static/style.css @@ -335,10 +335,6 @@ b, b > *, .activityTitle, .activityTitle > *, .bold { font-family: "RubikBold", Verdana, Geneva, Tahoma, sans-serif; } -underline { - text-decoration: underline; -} - .activityTitle { text-decoration: underline; } diff --git a/static/subpage.css b/static/subpage.css index 4041708..cd84030 100644 --- a/static/subpage.css +++ b/static/subpage.css @@ -15,20 +15,4 @@ 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