From c5a6623e0f320b2a789e0d2667ccfe2e1bd4335f Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Mon, 30 May 2022 01:02:59 +0300 Subject: Fixed settings theme and translation flashing #286 --- src/pages/options/tiktok/tiktok.html | 128 ----------------------------------- src/pages/options/tiktok/tiktok.js | 55 --------------- src/pages/options/tiktok/tiktok.pug | 36 ---------- 3 files changed, 219 deletions(-) delete mode 100644 src/pages/options/tiktok/tiktok.html delete mode 100644 src/pages/options/tiktok/tiktok.js delete mode 100644 src/pages/options/tiktok/tiktok.pug (limited to 'src/pages/options/tiktok') diff --git a/src/pages/options/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html deleted file mode 100644 index b4fb1d2a..00000000 --- a/src/pages/options/tiktok/tiktok.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - TikTok - - - - - -
-
-

TikTok

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- - -
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
- - - \ No newline at end of file diff --git a/src/pages/options/tiktok/tiktok.js b/src/pages/options/tiktok/tiktok.js deleted file mode 100644 index 5a57b46c..00000000 --- a/src/pages/options/tiktok/tiktok.js +++ /dev/null @@ -1,55 +0,0 @@ -import tiktokHelper from "../../../assets/javascripts/helpers/tiktok.js"; -import utils from "../../../assets/javascripts/helpers/utils.js"; - -let disable = document.getElementById("disable-tiktok"); -let protocol = document.getElementById("protocol") - -document.addEventListener("change", () => { - browser.storage.local.set({ - disableTiktok: !disable.checked, - tiktokProtocol: protocol.value, - }); - changeProtocolSettings(); -}) - -window.onblur = tiktokHelper.initProxiTokCookies; - -browser.storage.local.get( - [ - "disableTiktok", - "tiktokProtocol", - ], - r => { - disable.checked = !r.disableTiktok; - protocol.value = r.tiktokProtocol; - changeProtocolSettings(); - let normalDiv = document.getElementsByClassName("normal")[0]; - let torDiv = document.getElementsByClassName("tor")[0]; - if (r.tiktokProtocol == 'normal') { - normalDiv.style.display = 'block'; - torDiv.style.display = 'none'; - } - else if (r.tiktokProtocol == 'tor') { - normalDiv.style.display = 'none'; - torDiv.style.display = 'block'; - } - } -) - -function changeProtocolSettings() { - let normalDiv = document.getElementsByClassName("normal")[0]; - let torDiv = document.getElementsByClassName("tor")[0]; - if (protocol.value == 'normal') { - normalDiv.style.display = 'block'; - torDiv.style.display = 'none'; - } - else if (protocol.value == 'tor') { - normalDiv.style.display = 'none'; - torDiv.style.display = 'block'; - } -} - -utils.processDefaultCustomInstances('tiktok', 'proxiTok', 'normal', document); -utils.processDefaultCustomInstances('tiktok', 'proxiTok', 'tor', document); - -utils.latency('tiktok', 'proxiTok', document, location) \ No newline at end of file diff --git a/src/pages/options/tiktok/tiktok.pug b/src/pages/options/tiktok/tiktok.pug deleted file mode 100644 index db765c45..00000000 --- a/src/pages/options/tiktok/tiktok.pug +++ /dev/null @@ -1,36 +0,0 @@ -doctype html -html(lang="en") - include ../../widgets/head.pug - title TikTok -script(type="module" src="../../../assets/javascripts/localise.js") -body.option(dir="auto") - include ../../widgets/links.pug - +links('tiktok') - - section.option-block - .some-block.option-block - h1 TikTok - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#disable-tiktok(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_protocol__") Protocol - select#protocol - option(value="normal" data-localise="__MSG_normal__") Normal - option(value="tor" data-localise="__MSG_tor__") Tor - - #proxiTok - hr - .normal - include ../../widgets/instances.pug - +instances('https://proxitok.com') - include ../../widgets/latency.pug - +latency() - .tor - include ../../widgets/instances.pug - +instances('https://proxitok.onion') - - script(type="module" src="../init.js") - script(type="module" src="./tiktok.js") -- cgit 1.4.1