Commit f7b33748 authored by henry's avatar henry Committed by richard
Browse files

fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in...

fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection

Bug 41651: Use moz-toggle for enable-bridges switch.
parent db6f2f8f
Loading
Loading
Loading
Loading
+7 −7
Changes for browser/components/torpreferences/content/connectionPane.js: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ const gConnectionPane = (function () {
      currentHeader: "#torPreferences-currentBridges-header",
      currentDescription: "#torPreferences-currentBridges-description",
      currentDescriptionText: "#torPreferences-currentBridges-descriptionText",
      switchLabel: "#torPreferences-currentBridges-enableAll-label",
      switch: "#torPreferences-currentBridges-switch",
      cards: "#torPreferences-currentBridges-cards",
      cardTemplate: "#torPreferences-bridgeCard-template",
@@ -391,11 +390,10 @@ const gConnectionPane = (function () {
        selectors.bridges.currentHeader
      );
      bridgeHeader.textContent = TorStrings.settings.bridgeCurrent;
      prefpane.querySelector(selectors.bridges.switchLabel).textContent =
        TorStrings.settings.allBridgesEnabled;
      const bridgeSwitch = prefpane.querySelector(selectors.bridges.switch);
      bridgeSwitch.addEventListener("change", () => {
        TorSettings.bridges.enabled = bridgeSwitch.checked;
      bridgeSwitch.setAttribute("label", TorStrings.settings.allBridgesEnabled);
      bridgeSwitch.addEventListener("toggle", () => {
        TorSettings.bridges.enabled = bridgeSwitch.pressed;
        TorSettings.saveToPrefs();
        TorSettings.applySettings().then(result => {
          this._populateBridgeCards();
@@ -525,7 +523,7 @@ const gConnectionPane = (function () {
                strings.splice(index, 1);
              }
              TorSettings.bridges.enabled =
                bridgeSwitch.checked && !!strings.length;
                bridgeSwitch.pressed && !!strings.length;
              TorSettings.bridges.bridge_strings = strings.join("\n");
              TorSettings.saveToPrefs();
              TorSettings.applySettings().then(result => {
@@ -642,7 +640,9 @@ const gConnectionPane = (function () {
        bridgeHeader.hidden = false;
        bridgeDescription.hidden = false;
        bridgeCards.hidden = false;
        bridgeSwitch.checked = TorSettings.bridges.enabled;
        // Changing the pressed property on moz-toggle should not trigger its
        // "toggle" event.
        bridgeSwitch.pressed = TorSettings.bridges.enabled;
        bridgeCards.classList.toggle("disabled", !TorSettings.bridges.enabled);
        bridgeCards.classList.toggle("single-card", numBridges === 1);

+2 −8
Changes for browser/components/torpreferences/content/connectionPane.xhtml: 2 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -108,16 +108,10 @@
      <html:span id="torPreferences-currentBridges-descriptionText" />
    </description>
    <hbox align="center">
      <html:input
        type="checkbox"
      <html:moz-toggle
        id="torPreferences-currentBridges-switch"
        class="toggle-button"
        label-align-after=""
      />
      <html:label
        id="torPreferences-currentBridges-enableAll-label"
        for="torPreferences-currentBridges-switch"
      >
      </html:label>
      <spacer flex="1" />
      <button id="torPreferences-currentBridges-removeAll" />
    </hbox>
+0 −11
Changes for browser/components/torpreferences/content/torPreferences.css: 0 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -5,11 +5,6 @@
  list-style-image: url("chrome://browser/content/torconnect/tor-connect.svg");
}

html:dir(rtl) input[type="checkbox"].toggle-button::before {
  /* For some reason, the rule from toggle-button.css is not applied... */
  scale: -1;
}

/* Status */

#torPreferences-status-box {
@@ -83,12 +78,6 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before {
  font-weight: 700;
}

#torPreferences-currentBridges-enableAll-label {
  /* Block display to work with parent's xul box layout. */
  display: block;
  margin-inline: 6px;
}

/* Bridge cards */
:root {
  --bridgeCard-animation-time: 0.25s;