about summary refs log tree commit diff stats
path: root/src/pages/options/twitter
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/options/twitter')
-rw-r--r--src/pages/options/twitter/twitter.html61
-rw-r--r--src/pages/options/twitter/twitter.js16
2 files changed, 77 insertions, 0 deletions
diff --git a/src/pages/options/twitter/twitter.html b/src/pages/options/twitter/twitter.html
new file mode 100644
index 00000000..b695a8b2
--- /dev/null
+++ b/src/pages/options/twitter/twitter.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <link href="../../stylesheets/styles.css" rel="stylesheet" />
+    <title>LibRedirect Options: Twitter</title>
+</head>
+
+<body class="option">
+
+    <section class="links">
+        <a href="../general/general.html">General</a>
+        <a href="../youtube/youtube.html">Youtube</a>
+        <a href="twitter.html" class="selected">Twitter</a>
+        <a href="../instagram/instagram.html">Instagram</a>
+        <a href="../reddit/reddit.html">Reddit</a>
+        <a href="../search/search.html">Search</a>
+        <a href="../translate/translate.html">Translate</a>
+        <a href="../maps/maps.html">Maps</a>
+        <a href="../wikipedia/wikipedia.html">Wikipedia</a>
+        <a href="../medium/medium.html">Medium</a>
+    </section>
+
+    <section class="option-block">
+
+        <div class="some-block option-block">
+            <h1>Enable</h1>
+            <input id="disable-nitter" type="checkbox" checked />
+        </div>
+        <!-- <div class="some-block option-block">
+            <h4>Instance</h4>
+            <div class="autocomplete">
+                <input id="nitter-instance" type="url" name="nitter-instance"
+                    data-localise-placeholder="__MSG_randomInstancePlaceholder__"
+                    placeholder="Random instance (none selected)" />
+            </div>
+        </div> -->
+
+        <!-- <section class="settings-block">
+            <h4>Instance List</h4>
+            <div class="random-pool">
+                <textarea id="nitter-random-pool" type="text"></textarea>
+                <ul id="nitter-random-pool-list"></ul>
+            </div>
+        </section> -->
+        <div class="some-block option-block">
+            <h4 data-localise="__MSG_removeTwitterSW__">Proactively remove Twitter service worker</h4>
+            <input id="remove-twitter-sw" type="checkbox" checked />
+        </div>
+
+    </section>
+
+    <script type="module" src="../init.js"></script>
+    <script type="module" src="./twitter.js"></script>
+    <!-- <script src="../../assets/javascripts/localise.js"></script> -->
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/pages/options/twitter/twitter.js b/src/pages/options/twitter/twitter.js
new file mode 100644
index 00000000..08fabb20
--- /dev/null
+++ b/src/pages/options/twitter/twitter.js
@@ -0,0 +1,16 @@
+import twitterHelper from "../../../assets/javascripts/helpers/twitter.js";
+
+let disableTwitterElement = document.getElementById("disable-nitter");
+disableTwitterElement.addEventListener("change",
+    (event) => twitterHelper.setDisableTwitter(!event.target.checked)
+);
+
+let removeTwitterSWElement = document.getElementById("remove-twitter-sw");
+removeTwitterSWElement.addEventListener("change", (event) => {
+    browser.storage.sync.set({ removeTwitterSW: !event.target.checked }); // Problem
+});
+
+twitterHelper.init().then(() => {
+    disableTwitterElement.checked = !twitterHelper.getDisableTwitter();
+    removeTwitterSWElement.checked = !remove.getRemoveTwitterSW; // Problem
+});
\ No newline at end of file