From f454ced9490309f37199c2a47dcd8cbc7e976798 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Wed, 7 Dec 2022 10:51:43 +0300 Subject: Removed LatencyTest, AutoRedirect, Unify, DisableInstance --- src/pages/popup/popup.ejs | 102 +++++++++++++++++++++++----------------------- src/pages/popup/popup.js | 43 ------------------- 2 files changed, 50 insertions(+), 95 deletions(-) (limited to 'src/pages/popup') diff --git a/src/pages/popup/popup.ejs b/src/pages/popup/popup.ejs index e6cc6fca..72c96d60 100644 --- a/src/pages/popup/popup.ejs +++ b/src/pages/popup/popup.ejs @@ -1,55 +1,53 @@ - - - - - - - -
- - <%- include('src/pages/widgets/switches', {services: services}) -%> -
-
-
+ + + + + + + + + +
+ <%- include('src/pages/widgets/switches', {services: services}) -%> +
+
-
- <%- include('src/pages/widgets/switches', {services: services}) -%> -
-
- - - - - -
- - - - +
+
+ <%- include('src/pages/widgets/switches', {services: services}) -%> +
+
+ + + + +
+ + + + + \ No newline at end of file diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index 88c1433b..1ac804d0 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -39,7 +39,6 @@ const currSite = document.getElementsByClassName("current_site")[0] function setDivs() { return new Promise(resolve => { - divs.instance = document.getElementById("instance") for (const service in config.services) { divs[service] = {} divs[service].toggle = {} @@ -58,7 +57,6 @@ const currentSiteIsFrontend = document.getElementById("current_site_divider") browser.storage.local.get(["options", "redirects"], r => { browser.tabs.query({ active: true, currentWindow: true }, async tabs => { - document.getElementById("instance-div").classList.add("hide") for (const service in config.services) { if (!r.options.popupServices.includes(service)) allSites.getElementsByClassName(service)[0].classList.add("hide") else allSites.getElementsByClassName(service)[0].classList.remove("hide") @@ -75,7 +73,6 @@ browser.storage.local.get(["options", "redirects"], r => { url = new URL(tabs[0].url) } catch { currentSiteIsFrontend.classList.add("hide") - document.getElementById("unify_div").style.display = "none" return } @@ -89,51 +86,11 @@ browser.storage.local.get(["options", "redirects"], r => { service = service[0] let isCustom = false for (const network in config.networks) if (r.options[frontend][network].custom.indexOf(instance) > -1) isCustom = true - if (!isCustom) { - divs.instance.innerHTML = instance.replace(/https?:\/{2}/, "") - let tmp - let instanceNetwork - for (const network in config.networks) { - tmp = r.redirects[frontend][network].indexOf(instance) - if (tmp > -1) { - const instanceDiv = document.getElementById("instance-enabled") - tmp = r.options[frontend][network].enabled.indexOf(instance) - if (tmp > -1) instanceDiv.checked = true - else instanceDiv.checked = false - instanceNetwork = network - instanceDiv.addEventListener("change", () => { - browser.storage.local.get("options", r => { - // Although options would be available in this context, it is fetched again to make sure it is up to date - let options = r.options - if (instanceDiv.checked) options[frontend][instanceNetwork].enabled.push(instance) - else options[frontend][instanceNetwork].enabled.splice(options[frontend][instanceNetwork].enabled.indexOf(instance), 1) - browser.storage.local.set({ options }) - }) - }) - break - } - } - document.getElementById("instance-div").classList.remove("hide") - } } divs[service].current.classList.remove("hide") divs[service].all.classList.add("hide") - if (frontend && config.services[service].frontends[frontend].preferences && !config.services[service].frontends[frontend].preferences.token) { - const unify = document.getElementById("unify") - const textElement = document.getElementById("unify").getElementsByTagName("h4")[0] - unify.addEventListener("click", () => { - const oldHtml = textElement.innerHTML - textElement.innerHTML = "..." - browser.runtime.sendMessage({ function: "unify" }, response => { - if (response && response.response) textElement.innerHTML = oldHtml - }) - }) - } else { - document.getElementById("unify_div").style.display = "none" - } } else { currentSiteIsFrontend.classList.add("hide") - document.getElementById("unify_div").style.display = "none" } }) }) -- cgit 1.4.1 From d17377e6a54ca4490c14d6ad2b617fd9311f2efb Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 10 Dec 2022 12:44:40 +0300 Subject: Reverting back to Github + other stuff. Correcting http => https https://github.com/libredirect/libredirect/pull/482 --- src/assets/javascripts/utils.js | 2 +- src/pages/options/widgets/about.ejs | 8 ++++---- src/pages/options/widgets/general.js | 2 +- src/pages/popup/popup.ejs | 6 ------ 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/pages/popup') diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 2b69e9a6..b38277ad 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -159,7 +159,7 @@ async function processDefaultCustomInstances(service, frontend, network, documen x => `
${x} diff --git a/src/pages/options/widgets/about.ejs b/src/pages/options/widgets/about.ejs index a90e8b9e..c6f8a58f 100644 --- a/src/pages/options/widgets/about.ejs +++ b/src/pages/options/widgets/about.ejs @@ -10,22 +10,22 @@
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index a8eb11fb..a73ac85e 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -168,7 +168,7 @@ browser.storage.local.get("options", r => { x => `
${x}
-
-- cgit 1.4.1