From 68f9fbb3f7862dd9f854a11bc74525985ddbb9c9 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 21 May 2022 16:38:28 +0300 Subject: Fixed buttons in the general tab --- src/pages/popup/popup.html | 39 ++++++++++++++++++++------------------- src/pages/popup/popup.js | 18 +++++++++--------- src/pages/popup/popup.pug | 30 +++++++++++++++++------------- src/pages/popup/style.css | 13 ++++++++++++- 4 files changed, 58 insertions(+), 42 deletions(-) (limited to 'src/pages/popup') diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 48f6f116..ffc1c864 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -35,7 +35,7 @@

Reddit

-
+ @@ -48,15 +48,15 @@

Medium

-
-

Peertube

+ - +

Unify Settings

+ + +
+
+

Settings

+ + +
+
diff --git a/src/pages/popup/popup.js b/src/pages/popup/popup.js index b9c75791..824f178b 100644 --- a/src/pages/popup/popup.js +++ b/src/pages/popup/popup.js @@ -98,14 +98,14 @@ utils.unify(true).then(r => { } }) - document.getElementById("more-options").addEventListener("click", () => browser.runtime.openOptionsPage()); -generalHelper.init().then(() => { - let popupFrontends = generalHelper.getPopupFrontends(); - for (const frontend of generalHelper.allPopupFrontends) - if (!popupFrontends.includes(frontend)) - document.getElementById(frontend).classList.add("hide") - else - document.getElementById(frontend).classList.remove("hide") -}); \ No newline at end of file +browser.storage.local.get( + 'popupFrontends', + r => { + for (const frontend of generalHelper.allPopupFrontends) + if (!r.popupFrontends.includes(frontend)) + document.getElementById(frontend).classList.add("hide") + else + document.getElementById(frontend).classList.remove("hide") + }); \ No newline at end of file diff --git a/src/pages/popup/popup.pug b/src/pages/popup/popup.pug index 35234b15..5e067f3f 100644 --- a/src/pages/popup/popup.pug +++ b/src/pages/popup/popup.pug @@ -52,7 +52,7 @@ html(lang="en") #wikipedia.some-block a.title(href="https://wikipedia.com") - img(src="../../assets/images/wikipedia-icon.png") + img(src="../../assets/images/wikipedia-icon.svg") h4 Wikipedia input#disable-wikipedia(type="checkbox") @@ -64,8 +64,8 @@ html(lang="en") #peertube.some-block a.title(href="https://peertube.com") - img(src="../../assets/images/peertube-icon.png") - h4 Peertube + img(src="../../assets/images/peertube-icon.svg") + h4 PeerTube input#disable-peertube(type="checkbox") #lbry.some-block @@ -75,7 +75,7 @@ html(lang="en") input#disable-lbry(type="checkbox") #search.some-block - a.title(href="https://libredirect.invalid") + a.title(href="https://search.libredirect.invalid") +search h4 Search input#disable-search(type="checkbox") @@ -93,30 +93,34 @@ html(lang="en") input#disable-osm(type="checkbox") #sendTargets.some-block - a.title(href="https://send.invalid") + a.title(href="https://send.libredirect.invalid") +send h4 Send Files input#disable-sendTargets(type="checkbox") + hr + #change_instance_div.some-block a#change_instance.title.button - +change_instance h4 Change Instance - - .some-block - a#more-options.title.button - +settings - h4 Settings + +change_instance #copy_raw_div.some-block(title="Copy the original redirected link") a#copy_raw.title.button - +copy_raw h4 Copy Raw + +copy_raw #unify_div.some-block(title="Unify cookies across all selected instances") a#unify.title.button - +unify h4 Unify Settings + +unify + + .some-block + a#more-options.title.button + h4 Settings + +settings + + .space script(type="module" src="../options/init.js") script(type="module" src="./popup.js") diff --git a/src/pages/popup/style.css b/src/pages/popup/style.css index 4cc56145..8136237a 100644 --- a/src/pages/popup/style.css +++ b/src/pages/popup/style.css @@ -1,5 +1,5 @@ body { - width: 240px; + width: 230px; min-height: auto; } @@ -9,4 +9,15 @@ html, body { .hide { display: none !important; +} + +.button { + display: flex; + margin: 0 auto; + justify-content: space-between; + width: 100%; +} + +.space { + height: 10px; } \ No newline at end of file -- cgit 1.4.1