[Pkg-mozext-commits] [personasplus] 36/76: Remove useTextColor and useAccentColor Preferences

David Prévot taffit at moszumanska.debian.org
Fri Aug 4 21:45:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository personasplus.

commit ea6df61522b6437046f8c8846ee0d97e8a67f491
Author: Baris Derin <baris at barisderin.com>
Date:   Tue Aug 16 17:13:46 2016 +0300

    Remove useTextColor and useAccentColor Preferences
    
    Remove useTextColor and useAccentColor Preferences from preferences
    files and remove any related code from JS files.
---
 extension/content/preferences.xul       |   2 -
 extension/defaults/preferences/prefs.js |   8 ---
 extension/modules/personas.js           | 116 --------------------------------
 extension/modules/service.js            |  12 ----
 4 files changed, 138 deletions(-)

diff --git a/extension/content/preferences.xul b/extension/content/preferences.xul
index 8da02f9..90d0031 100644
--- a/extension/content/preferences.xul
+++ b/extension/content/preferences.xul
@@ -54,8 +54,6 @@
 
     <preferences>
       <preference id="preview" name="extensions.personas.previewEnabled" type="bool"/>
-      <preference id="textcolor" name="extensions.personas.useTextColor" type="bool"/>
-      <preference id="accentcolor" name="extensions.personas.useAccentColor" type="bool"/>
     </preferences>
 
     <groupbox>
diff --git a/extension/defaults/preferences/prefs.js b/extension/defaults/preferences/prefs.js
index 5566cab..8a1f0c2 100644
--- a/extension/defaults/preferences/prefs.js
+++ b/extension/defaults/preferences/prefs.js
@@ -86,14 +86,6 @@ pref("extensions.personas.previewTimeout", 200);
 // User preference to enable/disable preview when hovering over popup items.
 pref("extensions.personas.previewEnabled", true);
 
-// User preference to enable/disable use of the accent color provided
-// by Persona in the feed.
-pref("extensions.personas.useAccentColor", true);
-
-// User preference to enable/disable use of the text color provided
-// by Persona in the feed.
-pref("extensions.personas.useTextColor", true);
-
 // The version of the JSON data feed that this extension expects.
 pref("extensions.personas.data.version", 1);
 
diff --git a/extension/modules/personas.js b/extension/modules/personas.js
index 3950aa8..a5f296b 100644
--- a/extension/modules/personas.js
+++ b/extension/modules/personas.js
@@ -421,118 +421,6 @@ var PersonaController = {
             footer.style.backgroundImage = "url(" + this._escapeURLForCSS(footerURI.spec) + ")";
         }
 
-        // Style the text color.
-        if (this._prefs.get("useTextColor")) {
-            // FIXME: fall back on the default text color instead of "black".
-            let textColor = persona.textcolor || "black";
-            header.style.color = textColor;
-            for (let i = 0; i < document.styleSheets.length; i++) {
-                let styleSheet = document.styleSheets[i];
-                if (styleSheet.href == "chrome://personas/content/overlay.css") {
-                    while (styleSheet.cssRules.length > 0)
-                        styleSheet.deleteRule(0);
-
-                    // On Mac we do several things differently:
-                    // 1. make text be regular weight, not bold (not sure why);
-                    // 2. explicitly style the Find toolbar label ("Find:" or
-                    //    "Quick Find:" in en-US) and status message ("Phrase not found"),
-                    //    which otherwise would be custom colors specified in findBar.css
-                    //    (note: we only do this in Firefox);
-                    // 3. style the tab color (Mac tabs are transparent).
-                    // In order to style the Find toolbar text, we have to both explicitly
-                    // reference it (.findbar-find-fast, .findbar-find-status) and make
-                    // the declaration !important to override an !important declaration
-                    // for the status text in findBar.css.
-                    // XXX Isn't |#main-window[persona]| unnecessary in this rule,
-                    // given that the rule is only inserted into the stylesheet when
-                    // a persona is active?
-                    if (PersonaService.appInfo.OS == "Darwin") {
-                        switch (PersonaService.appInfo.ID) {
-                            case PersonaService.FIREFOX_ID:
-                                styleSheet.insertRule(
-                                    "#main-window[persona] .tabbrowser-tab, " +
-                                    "#navigator-toolbox menubar > menu, " +
-                                    "#navigator-toolbox toolbarbutton, " +
-                                    "#browser-bottombox, " +
-                                    ".findbar-find-fast, " +
-                                    ".findbar-find-status, " +
-                                    "#browser-bottombox toolbarbutton " +
-                                    "{ color: inherit; " +
-                                    "font-weight: normal; }",
-                                    0
-                                );
-                                break;
-                            case PersonaService.THUNDERBIRD_ID:
-                                styleSheet.insertRule(
-                                    ".tabmail-tab, " +
-                                    "#mail-toolbox menubar > menu, " +
-                                    "#mail-toolbox toolbarbutton, " +
-                                    "#mail-toolbox toolbaritem > label, " +
-                                    "#status-bar " +
-                                    "{ color: " + textColor + " !important; " +
-                                    "font-weight: normal; }",
-                                    0
-                                );
-                                break;
-                            default:
-                                break;
-                        }
-                    } else {
-                        switch (PersonaService.appInfo.ID) {
-                            case PersonaService.FIREFOX_ID:
-                                styleSheet.insertRule(
-                                    "#navigator-toolbox menubar > menu, " +
-                                    "#navigator-toolbox toolbarbutton, " +
-                                    "#browser-bottombox, " +
-                                    "#browser-bottombox toolbarbutton " +
-                                    "{ color: inherit; }",
-                                    0
-                                );
-                                break;
-                            case PersonaService.THUNDERBIRD_ID:
-                                styleSheet.insertRule(
-                                    "#mail-toolbox menubar > menu, " +
-                                    "#mail-toolbox toolbarbutton, " +
-                                    "#mail-toolbox toolbaritem > label, " +
-                                    "#status-bar " +
-                                    "{ color: " + textColor + "}",
-                                    0
-                                );
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-
-                    // FIXME: figure out what to do about the disabled color.  Maybe we
-                    // should let personas specify it independently and then apply it via
-                    // a rule like this:
-                    // #navigator-toolbox toolbarbutton[disabled="true"],
-                    // #browser-toolbox toolbarbutton[disabled="true"],
-                    // #browser-bottombox toolbarbutton[disabled="true"]
-                    //   { color: #cccccc !important; }
-
-                    // Stop iterating through stylesheets.
-                    break;
-                }
-            }
-        }
-
-        // Style the titlebar with the accent color.
-        if (this._prefs.get("useAccentColor")) {
-            let general, active, inactive;
-            if (persona.accentcolor) {
-                general = persona.accentcolor;
-                active = persona.accentcolor;
-                inactive = persona.accentcolor;
-            } else {
-                general = "";
-                active = "";
-                inactive = "";
-            }
-            this._setTitlebarColors(general, active, inactive, document);
-        }
-
         // Opacity overrides (firefox only)
         if (PersonaService.appInfo.ID == PersonaService.FIREFOX_ID) {
             let overrideOpacity = this._prefs.get("override.opacity");
@@ -590,10 +478,6 @@ var PersonaController = {
         }
         header.style.color = "";
 
-        // Reset the titlebar color.
-        if (this._prefs.get("useAccentColor")) {
-            this._setTitlebarColors("", "", "", document);
-        }
     },
 
     _setTitlebarColors: function(general, active, inactive, document) {
diff --git a/extension/modules/service.js b/extension/modules/service.js
index 0a02ec6..cb9ccf4 100644
--- a/extension/modules/service.js
+++ b/extension/modules/service.js
@@ -145,8 +145,6 @@ var PersonaService = {
         Observers.add("http-on-examine-response",
             this.onHTTPResponse, this);
 
-        this._prefs.observe("useTextColor", this.onUseColorChanged, this);
-        this._prefs.observe("useAccentColor", this.onUseColorChanged, this);
         this._prefs.observe("selected", this.onSelectedModeChanged, this);
         this._prefs.observe("addons-host", this.onAddonsHostChanged, this);
 
@@ -252,8 +250,6 @@ var PersonaService = {
             this.onLightweightThemeChanged, this);
         Observers.remove("http-on-examine-response", this.onHTTPResponse, this);
 
-        this._prefs.ignore("useTextColor", this.onUseColorChanged, this);
-        this._prefs.ignore("useAccentColor", this.onUseColorChanged, this);
         this._prefs.ignore("selected", this.onSelectedModeChanged, this);
         this._prefs.ignore("addons-host", this.onAddonsHostChanged, this);
     },
@@ -1010,14 +1006,6 @@ var PersonaService = {
         }
     },
 
-    onUseColorChanged: function() {
-        // Notify observers that the persona has changed so the change in whether
-        // or not to use the text or accent color will get applied.  The persona
-        // hasn't really changed, but doing this has the desired effect without any
-        // known unwanted side effects.
-        Observers.notify("personas:persona:changed");
-    },
-
     previewingPersona: null,
 
     /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/personasplus.git



More information about the Pkg-mozext-commits mailing list