Skip to content
Snippets Groups Projects
Commit 9c45aa56 authored by henry's avatar henry Committed by morgan
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 41811: Use tor colors for connect buttons in bridge dialogs.
parent 134d30fc
Branches
Tags
2 merge requests!1202Bug_43099: 2024 YEC Strings,!1136Bug 43085: Rebased alpha onto 128.2.0esr
......@@ -70,6 +70,13 @@ const gBuiltinBridgeDialog = {
this._result.accepted = true;
});
// Add styling for tor-button to the dialog shadow root.
const styleLink = document.createElement("link");
styleLink.rel = "stylesheet";
styleLink.href =
"chrome://browser/content/torpreferences/torPreferences.css";
dialog.shadowRoot.append(styleLink);
this._acceptButton = dialog.getButton("accept");
Services.obs.addObserver(this, TorConnectTopics.StateChange);
......@@ -95,6 +102,7 @@ const gBuiltinBridgeDialog = {
"data-l10n-id",
connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-accept"
);
this._acceptButton.classList.toggle("tor-button", connect);
},
observe(subject, topic) {
......
......
......@@ -133,7 +133,7 @@
</menulist>
<button
id="torPreferences-bridges-buttonChooseBridgeForMe"
class="primary"
class="primary tor-button"
/>
</hbox>
<html:moz-toggle
......
......
......@@ -85,7 +85,7 @@ const gProvideBridgeDialog = {
this._acceptButton = this._dialog.getButton("accept");
// Inject our stylesheet into the shadow root so that the accept button can
// take the spoof-button-disabled styling.
// take the spoof-button-disabled styling and tor-button styling.
const styleLink = document.createElement("link");
styleLink.rel = "stylesheet";
styleLink.href =
......@@ -183,22 +183,21 @@ const gProvideBridgeDialog = {
* Callback for whenever the accept button may need to change.
*/
onAcceptStateChange() {
let connect = false;
if (this._page === "entry") {
document.l10n.setAttributes(
this._acceptButton,
this._acceptButton.setAttribute(
"data-l10n-id",
"user-provide-bridge-dialog-next-button"
);
this._result.connect = false;
} else {
this._acceptButton.removeAttribute("data-l10n-id");
const connect = TorConnect.canBeginBootstrap;
this._result.connect = connect;
connect = TorConnect.canBeginBootstrap;
this._acceptButton.setAttribute(
"data-l10n-id",
connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-accept"
);
}
this._result.connect = connect;
this._acceptButton.classList.toggle("tor-button", connect);
},
/**
......
......
......@@ -33,6 +33,13 @@ const gRequestBridgeDialog = {
"torPreferences-requestBridge-dialog"
);
// Add styling for tor-button to the dialog shadow root.
const styleLink = document.createElement("link");
styleLink.rel = "stylesheet";
styleLink.href =
"chrome://browser/content/torpreferences/torPreferences.css";
this._dialog.shadowRoot.append(styleLink);
// user may have opened a Request Bridge dialog in another tab, so update the
// CAPTCHA image or close out the dialog if we have a bridge list
this._dialog.addEventListener("focusin", () => {
......@@ -101,6 +108,7 @@ const gRequestBridgeDialog = {
"data-l10n-id",
connect ? "bridge-dialog-button-connect" : "bridge-dialog-button-submit"
);
this._submitButton.classList.toggle("tor-button", connect);
},
observe(subject, topic) {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment