summaryrefslogtreecommitdiff
path: root/application
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-12-02 22:26:33 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-12-02 22:26:33 +0100
commitaaaa4564b699fc6e8b059303987a56dbad42753f (patch)
treea68b2f09c46136b096642f7079eded2c25c8444b /application
parentcaba7e406d9bee4f454d4ff51140e821f09aac5d (diff)
downloaduxp-aaaa4564b699fc6e8b059303987a56dbad42753f.tar.gz
[BASILISK] Make CUI's PanelUI work with Weave.
Diffstat (limited to 'application')
-rw-r--r--application/basilisk/base/content/browser-fxaccounts.js43
-rw-r--r--application/basilisk/components/customizableui/content/panelUI.inc.xul5
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/browser.dtd3
3 files changed, 16 insertions, 35 deletions
diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js
index 94a591f1e5..cfd9758b67 100644
--- a/application/basilisk/base/content/browser-fxaccounts.js
+++ b/application/basilisk/base/content/browser-fxaccounts.js
@@ -153,11 +153,6 @@ var gFxAccounts = {
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
} catch (e) { }
- // Bail out if FxA is disabled.
- if (!this.weave.fxAccountsEnabled) {
- return Promise.resolve();
- }
-
this.panelUIFooter.hidden = false;
// Make sure the button is disabled in customization mode.
@@ -176,6 +171,7 @@ var gFxAccounts = {
let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel");
let errorLabel = this.panelUIStatus.getAttribute("errorlabel");
let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel");
+ let settingslabel = this.panelUIStatus.getAttribute("settingslabel");
// The localization string is for the signed in text, but it's the default text as well
let defaultTooltiptext = this.panelUIStatus.getAttribute("signedinTooltiptext");
@@ -191,34 +187,19 @@ var gFxAccounts = {
this.panelUIFooter.removeAttribute("fxastatus");
this.panelUIFooter.removeAttribute("fxaprofileimage");
this.panelUIAvatar.style.removeProperty("list-style-image");
- let showErrorBadge = false;
- if (userData) {
- // At this point we consider the user as logged-in (but still can be in an error state)
- if (this.loginFailed) {
- let tooltipDescription = this.strings.formatStringFromName("reconnectDescription", [userData.email], 1);
- this.panelUIFooter.setAttribute("fxastatus", "error");
- this.panelUILabel.setAttribute("label", errorLabel);
- this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription);
- showErrorBadge = true;
- } else if (!userData.verified) {
- let tooltipDescription = this.strings.formatStringFromName("verifyDescription", [userData.email], 1);
- this.panelUIFooter.setAttribute("fxastatus", "error");
- this.panelUIFooter.setAttribute("unverified", "true");
- this.panelUILabel.setAttribute("label", unverifiedLabel);
- this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription);
- showErrorBadge = true;
- } else {
- this.panelUIFooter.setAttribute("fxastatus", "signedin");
- this.panelUILabel.setAttribute("label", userData.email);
- }
- if (profileInfoEnabled) {
- this.panelUIFooter.setAttribute("fxaprofileimage", "enabled");
- }
+
+ if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED) {
+ // Leave the default state
+ return;
}
- if (showErrorBadge) {
- gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication");
+
+ if (this.loginFailed) {
+ this.panelUIFooter.setAttribute("fxastatus", "error");
+ this.panelUILabel.setAttribute("label", errorLabel);
} else {
- gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA);
+ this.panelUIFooter.setAttribute("fxastatus", "signedin");
+ this.panelUILabel.setAttribute("label", settingslabel);
+ this.panelUIStatus.setAttribute("tooltiptext", "");
}
}
diff --git a/application/basilisk/components/customizableui/content/panelUI.inc.xul b/application/basilisk/components/customizableui/content/panelUI.inc.xul
index 15fea435b4..8ebd933278 100644
--- a/application/basilisk/components/customizableui/content/panelUI.inc.xul
+++ b/application/basilisk/components/customizableui/content/panelUI.inc.xul
@@ -23,10 +23,11 @@
<hbox id="PanelUI-footer-fxa">
<hbox id="PanelUI-fxa-status"
defaultlabel="&fxaSignIn.label;"
- signedinTooltiptext="&fxaSignedIn.tooltip;"
- tooltiptext="&fxaSignedIn.tooltip;"
+ signedinTooltiptext="&syncSettings.label;"
+ tooltiptext="&syncSettings.label;"
errorlabel="&fxaSignInError.label;"
unverifiedlabel="&fxaUnverified.label;"
+ settingslabel="&syncSettings.label;"
onclick="if (event.which == 1) gFxAccounts.onMenuPanelCommand();">
<image id="PanelUI-fxa-avatar"/>
<toolbarbutton id="PanelUI-fxa-label"
diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.dtd b/application/basilisk/locales/en-US/chrome/browser/browser.dtd
index 02d66a5dc5..d02a6eedb6 100644
--- a/application/basilisk/locales/en-US/chrome/browser/browser.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/browser.dtd
@@ -116,10 +116,9 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY toggleReaderMode.key "R">
<!ENTITY fxaSignIn.label "Sign in to &syncBrand.shortName.label;">
-<!ENTITY fxaSignedIn.tooltip "Open &syncBrand.shortName.label; preferences">
<!ENTITY fxaSignInError.label "Reconnect to &syncBrand.shortName.label;">
<!ENTITY fxaUnverified.label "Verify Your Account">
-
+<!ENTITY syncSettings.label "Open &syncBrand.shortName.label; settings">
<!ENTITY fullScreenMinimize.tooltip "Minimize">
<!ENTITY fullScreenRestore.tooltip "Restore">