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

Send Files

-
-
-
-

Enable

- -
-
-

Protocol

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

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

Default Instances

-
-
-
-
-

Custom Instances

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