about summary refs log tree commit diff stats
path: root/src/pages/options
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2024-07-25 15:17:57 +0300
committerManeraKai <manerakai@protonmail.com>2024-07-25 15:17:57 +0300
commitc6de68c4c4bda3edcf6cf012bd98adea3baf866b (patch)
tree419e5cb8cdfe04fd734c5590e78888fa16e58e51 /src/pages/options
parentMade Select Frontend searchable and with icons (diff)
downloadlibredirect-c6de68c4c4bda3edcf6cf012bd98adea3baf866b.zip
Migrating popup to svelte
Diffstat (limited to 'src/pages/options')
-rw-r--r--src/pages/options/index.html16
-rw-r--r--src/pages/options/init.js45
2 files changed, 17 insertions, 44 deletions
diff --git a/src/pages/options/index.html b/src/pages/options/index.html
new file mode 100644
index 00000000..c3dcff71
--- /dev/null
+++ b/src/pages/options/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+	<meta charset='utf-8'>
+	<meta name='viewport' content='width=device-width,initial-scale=1'>
+	<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg">
+	<title>Settings</title>
+	<link rel='stylesheet' href='build/bundle.css'>
+	<script defer src='build/bundle.js'></script>
+</head>
+
+<body>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/pages/options/init.js b/src/pages/options/init.js
index 07da1859..5a7ffb6e 100644
--- a/src/pages/options/init.js
+++ b/src/pages/options/init.js
@@ -1,51 +1,8 @@
 window.browser = window.browser || window.chrome
-
 import localise from "../../assets/javascripts/localise.js"
-import utils from "../../assets/javascripts/utils.js"
-import servicesHelper from "../../assets/javascripts/services.js"
-
-if (!(await utils.getOptions())) {
-  await servicesHelper.initDefaults()
-}
 
-async function changeTheme() {
-  switch ((await utils.getOptions()).theme) {
-    case "dark":
-      document.body.classList.add("dark-theme")
-      document.body.classList.remove("light-theme")
-      for (const element of document.body.getElementsByClassName("dark")) {
-        element.style.display = "none"
-      }
-      break
-    case "light":
-      document.body.classList.add("light-theme")
-      document.body.classList.remove("dark-theme")
-      for (const element of document.body.getElementsByClassName("light")) {
-        element.style.display = "none"
-      }
-      break
-    default:
-      if (matchMedia("(prefers-color-scheme: light)").matches) {
-        document.body.classList.add("light-theme")
-        document.body.classList.remove("dark-theme")
-        for (const element of document.body.getElementsByClassName("light")) {
-          element.style.display = "none"
-        }
-      } else {
-        document.body.classList.add("dark-theme")
-        document.body.classList.remove("light-theme")
-        for (const element of document.body.getElementsByClassName("dark")) {
-          element.style.display = "none"
-        }
-      }
-  }
-}
-
-changeTheme()
 if (["ar", "iw", "ku", "fa", "ur"].includes(browser.i18n.getUILanguage())) {
   document.getElementsByTagName("body")[0].classList.add("rtl")
   document.getElementsByTagName("body")[0].dir = "rtl"
 }
-localise.localisePage()
-
-window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", changeTheme)
+localise.localisePage()
\ No newline at end of file