[Pkg-mozext-commits] [personasplus] 34/76: Advanced Color Picker for Custom Persona

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 2f08150a51653e7d6824a9da52c04e261672c7ae
Author: Baris Derin <baris at barisderin.com>
Date:   Mon Aug 15 20:35:09 2016 +0300

    Advanced Color Picker for Custom Persona
    
    This will let users to have advanced operating system colour picker via
    html5 input color element, when creating Custom Persona
---
 extension/content/customPersonaEditor.js  | 12 ++++++------
 extension/content/customPersonaEditor.xul |  7 +++----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/extension/content/customPersonaEditor.js b/extension/content/customPersonaEditor.js
index 74a3447..9808b3f 100644
--- a/extension/content/customPersonaEditor.js
+++ b/extension/content/customPersonaEditor.js
@@ -169,8 +169,8 @@ var CustomPersonaEditor = {
     this._header.value = this.customPersona.headerURL || this.customPersona.header || "";
     this._footer.value = this.customPersona.footerURL || this.customPersona.footer || "";
     this._customName.value = this.customPersona.name || "";
-    this._textColorPicker.color = this.customPersona.textcolor || "#000000";
-    this._accentColorPicker.color = this.customPersona.accentcolor || "#C9C9C9";
+    this._textColorPicker.value = this.customPersona.textcolor || "#000000";
+    this._accentColorPicker.value = this.customPersona.accentcolor || "#C9C9C9";
 
     // FIXME: This is a workaround for bug 532741, where the LightweightThemeManager
     // needs a header and footer to be specified in order to preview the persona.
@@ -242,24 +242,24 @@ var CustomPersonaEditor = {
   },
 
   onChangeTextColor: function(aEvent) {
-    this.customPersona.textcolor = this._textColorPicker.color;
+    this.customPersona.textcolor = this._textColorPicker.value;
     PersonaService.resetPersona();
     this._save();
   },
 
   onSetDefaultTextColor: function(aEvent) {
-    this._textColorPicker.color = "#000000";
+    this._textColorPicker.value = "#000000";
     this.onChangeTextColor();
   },
 
   onChangeAccentColor: function(aEvent) {
-    this.customPersona.accentcolor = this._accentColorPicker.color;
+    this.customPersona.accentcolor = this._accentColorPicker.value;
     PersonaService.resetPersona();
     this._save();
   },
 
   onSetDefaultAccentColor: function(aEvent) {
-    this._accentColorPicker.color = "#C9C9C9";
+    this._accentColorPicker.value = "#C9C9C9";
     this.onChangeAccentColor();
   },
 
diff --git a/extension/content/customPersonaEditor.xul b/extension/content/customPersonaEditor.xul
index cb242ee..a08a2d6 100644
--- a/extension/content/customPersonaEditor.xul
+++ b/extension/content/customPersonaEditor.xul
@@ -42,6 +42,7 @@
 
 <page id="customPersonaEditor"
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      xmlns:html="http://www.w3.org/1999/xhtml"
       title="Custom Persona"
       align="center"
       onload="CustomPersonaEditor.onLoad()"
@@ -97,8 +98,7 @@
             <label control="textColorPicker" value="&textColorPicker.label;"/>
           </hbox>
           <hbox pack="start">
-            <colorpicker id="textColorPicker" type="button"
-                         onchange="CustomPersonaEditor.onChangeTextColor(event)"/>
+            <html:input type="color" id="textColorPicker" onchange="CustomPersonaEditor.onChangeTextColor(event)"/>
             <button label="&useDefaultColor.label;" oncommand="CustomPersonaEditor.onSetDefaultTextColor();"/>
           </hbox>
         </row>
@@ -107,8 +107,7 @@
             <label control="accentColorPicker" value="&accentColorPicker.label;"/>
           </hbox>
           <hbox pack="start">
-            <colorpicker id="accentColorPicker" type="button"
-                         onchange="CustomPersonaEditor.onChangeAccentColor(event)"/>
+            <html:input type="color" id="accentColorPicker" onchange="CustomPersonaEditor.onChangeAccentColor(event)"/>
             <button label="&useDefaultColor.label;" oncommand="CustomPersonaEditor.onSetDefaultAccentColor();"/>
           </hbox>
         </row>

-- 
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