Pier Angelo Vendrame pushed to branch tor-browser-115.3.1esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits: f14c6b11 by Pier Angelo Vendrame at 2023-10-10T08:33:38+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
Bug 41912: Hide "Use Current Bridges" when we do not have any bridge strings.
- - - - -
2 changed files:
- browser/components/torpreferences/content/connectionPane.js - browser/components/torpreferences/content/connectionPane.xhtml
Changes:
===================================== browser/components/torpreferences/content/connectionPane.js ===================================== @@ -99,6 +99,7 @@ const gConnectionPane = (function () { currentHeader: "#torPreferences-currentBridges-header", currentDescription: "#torPreferences-currentBridges-description", currentDescriptionText: "#torPreferences-currentBridges-descriptionText", + controls: "#torPreferences-currentBridges-controls", switch: "#torPreferences-currentBridges-switch", cards: "#torPreferences-currentBridges-cards", cardTemplate: "#torPreferences-bridgeCard-template", @@ -391,6 +392,7 @@ const gConnectionPane = (function () { selectors.bridges.currentHeader ); bridgeHeader.textContent = TorStrings.settings.bridgeCurrent; + const bridgeControls = prefpane.querySelector(selectors.bridges.controls); const bridgeSwitch = prefpane.querySelector(selectors.bridges.switch); bridgeSwitch.setAttribute("label", TorStrings.settings.allBridgesEnabled); bridgeSwitch.addEventListener("toggle", () => { @@ -629,18 +631,17 @@ const gConnectionPane = (function () {
const newStrings = new Set(TorSettings.bridges.bridge_strings); const numBridges = newStrings.size; - if (!newStrings.size) { - bridgeHeader.hidden = true; - bridgeDescription.hidden = true; - bridgeCards.hidden = true; + const noBridges = !numBridges; + bridgeHeader.hidden = noBridges; + bridgeDescription.hidden = noBridges; + bridgeControls.hidden = noBridges; + bridgeCards.hidden = noBridges; + if (noBridges) { showAll.hidden = true; removeAll.hidden = true; bridgeCards.textContent = ""; return; } - bridgeHeader.hidden = false; - bridgeDescription.hidden = false; - bridgeCards.hidden = false; // Changing the pressed property on moz-toggle should not trigger its // "toggle" event. bridgeSwitch.pressed = TorSettings.bridges.enabled; @@ -757,7 +758,7 @@ const gConnectionPane = (function () { bridge = provider.currentBridge; } catch (e) { console.warn("Could not get current bridge", e); - } + } if (bridge?.fingerprint !== this._currentBridgeId) { this._currentBridgeId = bridge?.fingerprint ?? null; this._updateConnectedBridges();
===================================== browser/components/torpreferences/content/connectionPane.xhtml ===================================== @@ -107,7 +107,7 @@ <description flex="1" id="torPreferences-currentBridges-description"> <html:span id="torPreferences-currentBridges-descriptionText" /> </description> - <hbox align="center"> + <hbox align="center" id="torPreferences-currentBridges-controls"> <html:moz-toggle id="torPreferences-currentBridges-switch" label-align-after=""
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/f14c6b11...
tor-commits@lists.torproject.org