diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 731606bf..7b828e7d 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -144,29 +144,30 @@ updateAllChat(false); // WINDOW LISTENER window.addEventListener("DOMContentLoaded", () => { // theme selector - if (config.theme != "default" && config.theme != "default_light" && config.theme != "default_dark" && config.theme != "default_auto") { + if ( + config.theme != "default" && + config.theme != "default_light" && + config.theme != "default_dark" && + config.theme != "default_auto" + ) { var theme_path = "../node_modules/bootswatch/dist/" + config.theme + "/bootstrap.min.css"; document.getElementById("bootstrap_theme").href = escape(theme_path); - - } else if (config.theme == "default" || config.theme == "default_light"){ + } else if (config.theme == "default" || config.theme == "default_light") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.documentElement.setAttribute('data-bs-theme','light') - + document.documentElement.setAttribute("data-bs-theme", "light"); } else if (config.theme == "default_dark") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.querySelector("html").setAttribute('data-bs-theme','dark') - + document.querySelector("html").setAttribute("data-bs-theme", "dark"); } else if (config.theme == "default_auto") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("bootstrap_theme").href = escape(theme_path); - } else { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.documentElement.setAttribute('data-bs-theme','light') + document.documentElement.setAttribute("data-bs-theme", "light"); } const userInfoFields = [ diff --git a/gui/preload-main.js b/gui/preload-main.js index 6cfc994e..6333ee2a 100644 --- a/gui/preload-main.js +++ b/gui/preload-main.js @@ -338,45 +338,40 @@ window.addEventListener("DOMContentLoaded", () => { } // theme selector - if (config.theme != "default" && config.theme != "default_light" && config.theme != "default_dark" && config.theme != "default_auto") { + if ( + config.theme != "default" && + config.theme != "default_light" && + config.theme != "default_dark" && + config.theme != "default_auto" + ) { var theme_path = "../node_modules/bootswatch/dist/" + config.theme + "/bootstrap.min.css"; document.getElementById("theme_selector").value = config.theme; document.getElementById("bootstrap_theme").href = escape(theme_path); - - } else if (config.theme == "default" || config.theme == "default_light"){ + } else if (config.theme == "default" || config.theme == "default_light") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("theme_selector").value = "default_light"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.documentElement.setAttribute('data-bs-theme','light') - + document.documentElement.setAttribute("data-bs-theme", "light"); } else if (config.theme == "default_dark") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("theme_selector").value = "default_dark"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.querySelector("html").setAttribute('data-bs-theme','dark') - + document.querySelector("html").setAttribute("data-bs-theme", "dark"); } else if (config.theme == "default_auto") { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("theme_selector").value = "default_auto"; document.getElementById("bootstrap_theme").href = escape(theme_path); - } else { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; document.getElementById("theme_selector").value = "default_light"; document.getElementById("bootstrap_theme").href = escape(theme_path); - document.documentElement.setAttribute('data-bs-theme','light') + document.documentElement.setAttribute("data-bs-theme", "light"); } - - - - - - // Update channel selector document.getElementById("update_channel_selector").value = config.update_channel; @@ -1191,7 +1186,7 @@ window.addEventListener("DOMContentLoaded", () => { // Theme selector clicked document.getElementById("theme_selector").addEventListener("change", () => { -/* + /* var theme = document.getElementById("theme_selector").value; if (theme != "default") { var theme_path = @@ -1200,36 +1195,30 @@ window.addEventListener("DOMContentLoaded", () => { var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; } */ -var theme = document.getElementById("theme_selector").value; -if (theme != "default" && theme != "default_light" && theme != "default_dark" && theme != "default_auto") { - var theme_path = + var theme = document.getElementById("theme_selector").value; + if ( + theme != "default" && + theme != "default_light" && + theme != "default_dark" && + theme != "default_auto" + ) { + var theme_path = "../node_modules/bootswatch/dist/" + theme + "/bootstrap.min.css"; + } else if (theme == "default" || theme == "default_light") { + var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - } else if (theme == "default" || theme == "default_light"){ - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - - document.documentElement.setAttribute('data-bs-theme','light') - - } else if (theme == "default_dark") { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - - document.querySelector("html").setAttribute('data-bs-theme','dark') - - } else if (theme == "default_auto") { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - - } else { - var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; - - document.documentElement.setAttribute('data-bs-theme','light') - } - - - - - + document.documentElement.setAttribute("data-bs-theme", "light"); + } else if (theme == "default_dark") { + var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; + document.querySelector("html").setAttribute("data-bs-theme", "dark"); + } else if (theme == "default_auto") { + var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; + } else { + var theme_path = "../node_modules/bootstrap/dist/css/bootstrap.min.css"; + document.documentElement.setAttribute("data-bs-theme", "light"); + } //update path to css file document.getElementById("bootstrap_theme").href = escape(theme_path); diff --git a/gui/src/styles.css b/gui/src/styles.css index 9f929edf..1fc88516 100644 --- a/gui/src/styles.css +++ b/gui/src/styles.css @@ -105,5 +105,5 @@ https://stackoverflow.com/a/9622873 } /* default dark theme mods */ [data-bs-theme="dark"] { -/* default dark theme mods */ + /* default dark theme mods */ }