about summary refs log tree commit diff stats
path: root/src/pages/options/maps
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-05-21 01:46:47 +0300
committerManeraKai <manerakai@protonmail.com>2022-05-21 01:46:47 +0300
commitebc9bf35a60325330c6403fbd26987a0f864422b (patch)
treeb1df80514c6dedb2384bad50468bc9cb8f57777c /src/pages/options/maps
parentAlligned Buttons in Extension Popup (#267) (diff)
downloadlibredirect-ebc9bf35a60325330c6403fbd26987a0f864422b.zip
Cleaned code. Added shortcuts for the CopyRaw btn #268
Diffstat (limited to 'src/pages/options/maps')
-rw-r--r--src/pages/options/maps/maps.js23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/pages/options/maps/maps.js b/src/pages/options/maps/maps.js
index 7e18def3..6db8c03e 100644
--- a/src/pages/options/maps/maps.js
+++ b/src/pages/options/maps/maps.js
@@ -1,5 +1,5 @@
 import mapsHelper from "../../../assets/javascripts/helpers/maps.js";
-import commonHelper from "../../../assets/javascripts/helpers/common.js";
+import utils from "../../../assets/javascripts/helpers/utils.js";
 
 const disable = document.getElementById("disable-osm");
 const frontend = document.getElementById("maps-frontend");
@@ -29,23 +29,4 @@ browser.storage.local.get(
         changeFrontendsSettings();
     }
 )
-commonHelper.processDefaultCustomInstances('maps', 'facil', 'normal', document);
-
-let latencyElement = document.getElementById("latency");
-let latencyLabel = document.getElementById("latency-label");
-latencyElement.addEventListener("click",
-    async () => {
-        let reloadWindow = () => location.reload();
-        latencyElement.addEventListener("click", reloadWindow);
-        await mapsHelper.init();
-        let redirects = mapsHelper.getRedirects();
-        const oldHtml = latencyLabel.innerHTML;
-        latencyLabel.innerHTML = '...';
-        commonHelper.testLatency(latencyLabel, redirects.facil.normal).then(r => {
-            browser.storage.local.set({ facilLatency: r });
-            latencyLabel.innerHTML = oldHtml;
-            commonHelper.processDefaultCustomInstances('maps', 'facil', 'normal', document);
-            latencyElement.removeEventListener("click", reloadWindow);
-        });
-    }
-);
\ No newline at end of file
+utils.processDefaultCustomInstances('maps', 'facil', 'normal', document);
\ No newline at end of file