[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 23/33: fixup! squash! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection



This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.9.0esr-11.5-1
in repository tor-browser.

commit bc8da424873fe0045fc2598cfe8e1a77b1e2d932
Author: Pier Angelo Vendrame <pierov@xxxxxxxxxxxxxx>
AuthorDate: Thu Apr 14 14:09:55 2022 +0200

    fixup! squash! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
    
    Bug 40895: expand bridge automatically if connected (or it is the only
    one)
---
 .../torpreferences/content/connectionPane.js       | 11 +++++++---
 .../torpreferences/content/torPreferences.css      | 24 ++++++++++++++++++----
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/browser/components/torpreferences/content/connectionPane.js b/browser/components/torpreferences/content/connectionPane.js
index 2f2cf2df270ca..552ddb85e8a83 100644
--- a/browser/components/torpreferences/content/connectionPane.js
+++ b/browser/components/torpreferences/content/connectionPane.js
@@ -367,9 +367,7 @@ const gConnectionPane = (function() {
                 )
               );
             }
-            items.sort((left, right) =>
-              left.label.localeCompare(right.label)
-            );
+            items.sort((left, right) => left.label.localeCompare(right.label));
             locationEntries.append(...items);
           };
           locationEntries.append(
@@ -449,6 +447,12 @@ const gConnectionPane = (function() {
         card.removeAttribute("id");
         const grid = card.querySelector(selectors.bridges.cardQrGrid);
         card.addEventListener("click", e => {
+          if (
+            card.classList.contains("currently-connected") ||
+            bridgeCards.classList.contains("single-card")
+          ) {
+            return;
+          }
           let target = e.target;
           let apply = true;
           while (target !== null && target !== card && apply) {
@@ -627,6 +631,7 @@ const gConnectionPane = (function() {
         bridgeCards.removeAttribute("hidden");
         bridgeSwitch.checked = TorSettings.bridges.enabled;
         bridgeCards.classList.toggle("disabled", !TorSettings.bridges.enabled);
+        bridgeCards.classList.toggle("single-card", numBridges === 1);
 
         let shownCards = 0;
         const toShow = this._currentBridgesExpanded
diff --git a/browser/components/torpreferences/content/torPreferences.css b/browser/components/torpreferences/content/torPreferences.css
index 0c74b00907631..02ad792e83161 100644
--- a/browser/components/torpreferences/content/torPreferences.css
+++ b/browser/components/torpreferences/content/torPreferences.css
@@ -205,9 +205,12 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before {
   /* define border-radius here because of the transition */
   border-radius: 4px;
   transition: margin var(--bridgeCard-animation-time), box-shadow 150ms;
+  cursor: pointer;
 }
 
-.torPreferences-bridgeCard.expanded {
+.torPreferences-bridgeCard.expanded,
+.torPreferences-bridgeCard.currently-connected,
+.single-card .torPreferences-bridgeCard {
   margin: 12px 0;
   background: var(--in-content-box-background);
   box-shadow: var(--card-shadow);
@@ -216,7 +219,11 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before {
 .torPreferences-bridgeCard:hover {
   background: var(--in-content-box-background);
   box-shadow: var(--card-shadow-hover);
-  cursor: pointer;
+}
+
+.single-card .torPreferences-bridgeCard,
+.torPreferences-bridgeCard.currently-connected {
+  cursor: default;
 }
 
 .torPreferences-bridgeCard-heading {
@@ -248,7 +255,9 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before {
   text-overflow: ellipsis;
 }
 
-.expanded .torPreferences-bridgeCard-headingAddr {
+.expanded .torPreferences-bridgeCard-headingAddr,
+.currently-connected .torPreferences-bridgeCard-headingAddr,
+.single-card .torPreferences-bridgeCard-headingAddr {
   display: none;
 }
 
@@ -360,10 +369,17 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before {
   visibility: hidden;
 }
 
-.expanded .torPreferences-bridgeCard-grid {
+.expanded .torPreferences-bridgeCard-grid,
+.currently-connected .torPreferences-bridgeCard-grid,
+.single-card .torPreferences-bridgeCard-grid {
   visibility: visible;
 }
 
+.currently-connected .torPreferences-bridgeCard-grid,
+.single-card .torPreferences-bridgeCard-grid {
+  height: auto;
+}
+
 .torPreferences-bridgeCard-grid.to-animate {
   transition: height var(--bridgeCard-animation-time) ease-out, visibility var(--bridgeCard-animation-time);
   overflow: hidden;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits