Richard Pospesel pushed to branch tor-browser-102.8.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
-
63afd83c
by Dan Ballard at 2023-02-27T14:55:03+00:00
-
6518ee5b
by Dan Ballard at 2023-02-27T14:55:03+00:00
5 changed files:
- browser/components/torpreferences/content/connectionPane.js
- browser/components/torpreferences/content/connectionPane.xhtml
- browser/components/torpreferences/content/torPreferences.css
- browser/modules/TorStrings.jsm
- toolkit/torbutton/chrome/locale/en-US/settings.properties
Changes:
... | ... | @@ -117,9 +117,9 @@ const gConnectionPane = (function() { |
117 | 117 | locationEntries: "#torPreferences-bridges-locationEntries",
|
118 | 118 | chooseForMe: "#torPreferences-bridges-buttonChooseBridgeForMe",
|
119 | 119 | currentHeader: "#torPreferences-currentBridges-header",
|
120 | - currentHeaderText: "#torPreferences-currentBridges-headerText",
|
|
121 | 120 | currentDescription: "#torPreferences-currentBridges-description",
|
122 | 121 | currentDescriptionText: "#torPreferences-currentBridges-descriptionText",
|
122 | + switchLabel: "#torPreferences-currentBridges-enableAll-label",
|
|
123 | 123 | switch: "#torPreferences-currentBridges-switch",
|
124 | 124 | cards: "#torPreferences-currentBridges-cards",
|
125 | 125 | cardTemplate: "#torPreferences-bridgeCard-template",
|
... | ... | @@ -426,10 +426,9 @@ const gConnectionPane = (function() { |
426 | 426 | const bridgeHeader = prefpane.querySelector(
|
427 | 427 | selectors.bridges.currentHeader
|
428 | 428 | );
|
429 | - bridgeHeader.querySelector(
|
|
430 | - selectors.bridges.currentHeaderText
|
|
431 | - ).textContent = TorStrings.settings.bridgeCurrent;
|
|
432 | - const bridgeSwitch = bridgeHeader.querySelector(selectors.bridges.switch);
|
|
429 | + bridgeHeader.textContent = TorStrings.settings.bridgeCurrent;
|
|
430 | + prefpane.querySelector(selectors.bridges.switchLabel).textContent = TorStrings.settings.allBridgesEnabled;
|
|
431 | + const bridgeSwitch = prefpane.querySelector(selectors.bridges.switch);
|
|
433 | 432 | bridgeSwitch.addEventListener("change", () => {
|
434 | 433 | TorSettings.bridges.enabled = bridgeSwitch.checked;
|
435 | 434 | TorSettings.saveToPrefs();
|
... | ... | @@ -860,35 +859,32 @@ const gConnectionPane = (function() { |
860 | 859 | }
|
861 | 860 | |
862 | 861 | {
|
863 | - const overlay = prefpane.querySelector(selectors.bridges.removeOverlay);
|
|
864 | 862 | this._confirmBridgeRemoval = () => {
|
865 | - overlay.classList.remove("hidden");
|
|
866 | - };
|
|
867 | - const closeDialog = () => {
|
|
868 | - overlay.classList.add("hidden");
|
|
863 | + const aParentWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
|
864 | + |
|
865 | + const ps = Services.prompt;
|
|
866 | + const btnFlags =
|
|
867 | + ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING +
|
|
868 | + ps.BUTTON_POS_0_DEFAULT +
|
|
869 | + ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL;
|
|
870 | + |
|
871 | + const notUsed = { value: false };
|
|
872 | + const btnIndex = ps.confirmEx(
|
|
873 | + aParentWindow,
|
|
874 | + TorStrings.settings.bridgeRemoveAllDialogTitle,
|
|
875 | + TorStrings.settings.bridgeRemoveAllDialogDescription,
|
|
876 | + btnFlags,
|
|
877 | + TorStrings.settings.remove,
|
|
878 | + null,
|
|
879 | + null,
|
|
880 | + null,
|
|
881 | + notUsed
|
|
882 | + );
|
|
883 | + |
|
884 | + if (btnIndex === 0) {
|
|
885 | + this.onRemoveAllBridges();
|
|
886 | + }
|
|
869 | 887 | };
|
870 | - overlay.addEventListener("click", closeDialog);
|
|
871 | - const modal = prefpane.querySelector(selectors.bridges.removeModal);
|
|
872 | - modal.addEventListener("click", e => {
|
|
873 | - e.stopPropagation();
|
|
874 | - });
|
|
875 | - const dismiss = prefpane.querySelector(selectors.bridges.removeDismiss);
|
|
876 | - dismiss.addEventListener("click", closeDialog);
|
|
877 | - const question = prefpane.querySelector(
|
|
878 | - selectors.bridges.removeQuestion
|
|
879 | - );
|
|
880 | - question.textContent = TorStrings.settings.removeBridgesQuestion;
|
|
881 | - const warning = prefpane.querySelector(selectors.bridges.removeWarning);
|
|
882 | - warning.textContent = TorStrings.settings.removeBridgesWarning;
|
|
883 | - const confirm = prefpane.querySelector(selectors.bridges.removeConfirm);
|
|
884 | - confirm.setAttribute("label", TorStrings.settings.remove);
|
|
885 | - confirm.addEventListener("command", () => {
|
|
886 | - this.onRemoveAllBridges();
|
|
887 | - closeDialog();
|
|
888 | - });
|
|
889 | - const cancel = prefpane.querySelector(selectors.bridges.removeCancel);
|
|
890 | - cancel.setAttribute("label", TorStrings.settings.cancel);
|
|
891 | - cancel.addEventListener("command", closeDialog);
|
|
892 | 888 | }
|
893 | 889 | |
894 | 890 | // Advanced setup
|
... | ... | @@ -91,12 +91,17 @@ |
91 | 91 | <button id="torPreferences-bridges-buttonChooseBridgeForMe" class="primary"/>
|
92 | 92 | </hbox>
|
93 | 93 | <html:h2 id="torPreferences-currentBridges-header">
|
94 | - <html:span id="torPreferences-currentBridges-headerText"/>
|
|
95 | - <html:input type="checkbox" id="torPreferences-currentBridges-switch" class="toggle-button"/>
|
|
96 | 94 | </html:h2>
|
97 | 95 | <description flex="1" id="torPreferences-currentBridges-description">
|
98 | 96 | <html:span id="torPreferences-currentBridges-descriptionText"/>
|
99 | 97 | </description>
|
98 | + <hbox align="center">
|
|
99 | + <html:input type="checkbox" id="torPreferences-currentBridges-switch" class="toggle-button"/>
|
|
100 | + <html:label id="torPreferences-currentBridges-enableAll-label" for="torPreferences-currentBridges-switch">
|
|
101 | + </html:label>
|
|
102 | + <spacer flex="1"/>
|
|
103 | + <button id="torPreferences-currentBridges-removeAll"/>
|
|
104 | + </hbox>
|
|
100 | 105 | <menupopup id="torPreferences-bridgeCard-menu"/>
|
101 | 106 | <vbox id="torPreferences-bridgeCard-template" class="torPreferences-bridgeCard">
|
102 | 107 | <hbox class="torPreferences-bridgeCard-heading">
|
... | ... | @@ -133,7 +138,6 @@ |
133 | 138 | <vbox id="torPreferences-currentBridges-cards"></vbox>
|
134 | 139 | <vbox align="center">
|
135 | 140 | <button id="torPreferences-currentBridges-showAll"/>
|
136 | - <button id="torPreferences-currentBridges-removeAll" class="primary danger-button"/>
|
|
137 | 141 | </vbox>
|
138 | 142 | <html:h2 id="torPreferences-addBridge-header"></html:h2>
|
139 | 143 | <hbox align="center">
|
... | ... | @@ -176,17 +180,4 @@ |
176 | 180 | </hbox>
|
177 | 181 | </groupbox>
|
178 | 182 | |
179 | -<html:div id="bridge-remove-overlay" class="hidden">
|
|
180 | - <html:div id="bridge-remove-modal">
|
|
181 | - <html:img id="bridge-remove-dismiss" src="chrome://global/skin/icons/close.svg"/>
|
|
182 | - <html:div id="bridge-remove-icon"/>
|
|
183 | - <html:p id="bridge-remove-question"/>
|
|
184 | - <html:p id="bridge-remove-warning"/>
|
|
185 | - <html:div id="bridge-remove-buttonbar">
|
|
186 | - <button id="bridge-remove-cancel"/>
|
|
187 | - <button id="bridge-remove-confirm"/>
|
|
188 | - </html:div>
|
|
189 | - </html:div>
|
|
190 | -</html:div>
|
|
191 | - |
|
192 | 183 | </html:template> |
... | ... | @@ -187,6 +187,12 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before { |
187 | 187 | font-weight: 700;
|
188 | 188 | }
|
189 | 189 | |
190 | +#torPreferences-currentBridges-enableAll-label {
|
|
191 | + /* Block display to work with parent's xul box layout. */
|
|
192 | + display: block;
|
|
193 | + margin-inline: 6px;
|
|
194 | +}
|
|
195 | + |
|
190 | 196 | /* Bridge cards */
|
191 | 197 | :root {
|
192 | 198 | --bridgeCard-animation-time: 0.25s;
|
... | ... | @@ -111,7 +111,10 @@ const Loader = { |
111 | 111 | bridgeCopy: "Copy Bridge Address",
|
112 | 112 | copied: "Copied!",
|
113 | 113 | bridgeShowAll: "Show All Bridges",
|
114 | + allBridgesEnabled: "Use current bridges",
|
|
114 | 115 | bridgeRemoveAll: "Remove All Bridges",
|
116 | + bridgeRemoveAllDialogTitle: "Remove all bridges?",
|
|
117 | + bridgeRemoveAllDialogDescription: "If these bridges were received from torproject.org or added manually, this action cannot be undone",
|
|
115 | 118 | bridgeAdd: "Add a New Bridge",
|
116 | 119 | bridgeSelectBrowserBuiltin:
|
117 | 120 | "Choose from one of Tor Browser’s built-in bridges",
|
... | ... | @@ -43,7 +43,10 @@ settings.bridgeShare=Share this bridge using the QR code or by copying its addre |
43 | 43 | settings.bridgeCopy=Copy Bridge Address
|
44 | 44 | settings.copied=Copied!
|
45 | 45 | settings.bridgeShowAll=Show All Bridges
|
46 | +settings.allBridgesEnabled=Use current bridges
|
|
46 | 47 | settings.bridgeRemoveAll=Remove All Bridges
|
48 | +settings.bridgeRemoveAllDialogTitle=Remove all bridges?
|
|
49 | +settings.bridgeRemoveAllDialogDescription=If these bridges were received from torproject.org or added manually, this action cannot be undone
|
|
47 | 50 | settings.bridgeAdd=Add a New Bridge
|
48 | 51 | settings.bridgeSelectBrowserBuiltin=Choose from one of Tor Browser’s built-in bridges
|
49 | 52 | settings.bridgeSelectBuiltin=Select a Built-In Bridge…
|