From 51b0df71b9220e3d0b84d25ba67818897c33610c Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 21 May 2022 02:38:24 +0300 Subject: Cleaned code. Fixed thing in CopyRaw #268 --- src/pages/popup/popup.html | 4 ++-- src/pages/popup/popup.js | 11 +++++++++-- src/pages/popup/popup.pug | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src/pages/popup') diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index b815bc1d..db7148c9 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -94,12 +94,12 @@

Settings

-
+ -
+
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index e465a7e0..dc6c373f 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -78,9 +78,16 @@ document.addEventListener("change", () => { }) document.getElementById("change_instance").addEventListener("click", utils.switchInstance); -document.getElementById('copy_raw').addEventListener("click", utils.copyRaw); +let copyRawElement = document.getElementById('copy_raw'); +copyRawElement.addEventListener("click", () => utils.copyRaw(false, copyRawElement)); + +utils.copyRaw(true).then(r => { if (!r) document.getElementById('copy_raw_div').style.display = 'none'; }) +// utils.unify().then(r => { if (!r) document.getElementById('unify_div').style.display = 'none'; }) + document.getElementById("more-options").addEventListener("click", () => browser.runtime.openOptionsPage()); -document.getElementById('unify').addEventListener("click", unify); + +let unifyElement = document.getElementById('unify'); +unifyElement.addEventListener("click", () => utils.unify(unifyElement)); generalHelper.init().then(() => { let popupFrontends = generalHelper.getPopupFrontends(); diff --git a/src/pages/popup/popup.pug b/src/pages/popup/popup.pug index 97f6d045..12588679 100644 --- a/src/pages/popup/popup.pug +++ b/src/pages/popup/popup.pug @@ -108,12 +108,12 @@ html(lang="en") +settings h4 Settings - .some-block(title="Copy the original redirected link") + #copy_raw_div.some-block(title="Copy the original redirected link") a#copy_raw.title.button +copy_raw h4 Copy Raw - .some-block(title="Unify cookies across all selected instances") + #unify_div.some-block(title="Unify cookies across all selected instances") a#unify.title.button +unify h4 Unify Settings -- cgit 1.4.1