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/medium/medium.html | 128 ----------------------------------- src/pages/options/medium/medium.js | 42 ------------ src/pages/options/medium/medium.pug | 36 ---------- 3 files changed, 206 deletions(-) delete mode 100644 src/pages/options/medium/medium.html delete mode 100644 src/pages/options/medium/medium.js delete mode 100644 src/pages/options/medium/medium.pug (limited to 'src/pages/options/medium') diff --git a/src/pages/options/medium/medium.html b/src/pages/options/medium/medium.html deleted file mode 100644 index cf9bab82..00000000 --- a/src/pages/options/medium/medium.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - Medium - - - - - -
-
-

Medium

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
- - - \ No newline at end of file diff --git a/src/pages/options/medium/medium.js b/src/pages/options/medium/medium.js deleted file mode 100644 index 9f00878d..00000000 --- a/src/pages/options/medium/medium.js +++ /dev/null @@ -1,42 +0,0 @@ -import mediumHelper from "../../../assets/javascripts/helpers/medium.js"; -import utils from "../../../assets/javascripts/helpers/utils.js"; - -let disable = document.getElementById("disable-medium"); -let protocol = document.getElementById("protocol") - -browser.storage.local.get( - [ - "disableMedium", - "mediumProtocol" - ], - r => { - disable.checked = !r.disableMedium; - protocol.value = r.mediumProtocol; - changeProtocolSettings(); - } -) -utils.processDefaultCustomInstances('medium', 'scribe', 'normal', document); -utils.processDefaultCustomInstances('medium', 'scribe', 'tor', document); - -document.addEventListener("change", async () => { - await browser.storage.local.set({ - disableMedium: !disable.checked, - mediumProtocol: protocol.value, - }) - changeProtocolSettings(); -}) - -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.latency('medium', 'scribe', document, location) \ No newline at end of file diff --git a/src/pages/options/medium/medium.pug b/src/pages/options/medium/medium.pug deleted file mode 100644 index eb640c46..00000000 --- a/src/pages/options/medium/medium.pug +++ /dev/null @@ -1,36 +0,0 @@ -doctype html -html(lang="en") - include ../../widgets/head.pug - title Medium -script(type="module" src="../../../assets/javascripts/localise.js") -body.option(dir="auto") - include ../../widgets/links.pug - +links('medium') - - section.option-block - .some-block.option-block - h1 Medium - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#disable-medium(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 - - #scribe - hr - .normal - include ../../widgets/instances.pug - +instances('https://scribe.com') - include ../../widgets/latency.pug - +latency() - .tor - include ../../widgets/instances.pug - +instances('https://scribe.onion') - - script(type="module" src="../init.js") - script(type="module" src="./medium.js") \ No newline at end of file -- cgit 1.4.1