From 3cc2844e1c990a76096b6ecd46d530b4b19b4081 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Tue, 18 Jun 2024 06:58:17 -0500 Subject: [PATCH] Much more modular "Style" system will allow for more freedom of highlighting effects --- constants.json | 3 +++ pageUpdater.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/constants.json b/constants.json index 1fe2312..0e7c327 100644 --- a/constants.json +++ b/constants.json @@ -164,6 +164,9 @@ "Teto Territory": { "color": "rgb(255, 100, 100)", "caseInsensitive": true + }, + "Services": { + }, "Teto": { "color": "rgb(255, 100, 100)", diff --git a/pageUpdater.js b/pageUpdater.js index c6127a8..009d285 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -173,8 +173,14 @@ function converter(html) { var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ") var startContent = element.content.substring(spanStart, termIndex) - - var replacement = `${startContent + highTable[index] + endContent}` + + var style = "" + + if (termProps.color) { + style += `color: ${termProps.color};` + } + + var replacement = `${startContent + highTable[index] + endContent}` element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd) }