Commit e8d5f530 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1779038: upgraded jscolor library"

parents 5d13f48b 6aacf209
......@@ -4,11 +4,11 @@ JSColor
Name : JavaScript Color Picker (Chooser)
Website: http://jscolor.com/
Author : (c)2008-2013 Jan Odvarko
Version: 2.0.4
Version: 2.0.5
Licence: jscolor is LGPL licensed (see: http://www.gnu.org/copyleft/lesser.html)
This color picker is used by Pieforms' color element.
Changes:
* Did not include "jscolor-example.html"
\ No newline at end of file
* Did not include "jscolor-example.html"
......@@ -5,7 +5,7 @@
* @license For open source use: GPLv3
* For commercial use: JSColor Commercial License
* @author Jan Odvarko
* @version 2.0.4
* @version 2.0.5
*
* See usage examples at http://jscolor.com/examples/
*/
......@@ -984,9 +984,10 @@ var jsc = {
this.required = true; // whether the associated text <input> can be left empty
this.refine = true; // whether to refine the entered color code (e.g. uppercase it and remove whitespace)
this.hash = false; // whether to prefix the HEX color code with # symbol
this.uppercase = true; // whether to uppercase the color code
this.uppercase = true; // whether to show the color code in upper case
this.onFineChange = null; // called instantly every time the color changes (value can be either a function or a string with javascript code)
this.activeClass = 'jscolor-active'; // class to be set to the target element when a picker window is open on it
this.overwriteImportant = false; // whether to overwrite colors of styleElement using !important
this.minS = 0; // min allowed saturation (0 - 100)
this.maxS = 100; // max allowed saturation (0 - 100)
this.minV = 0; // min allowed value (brightness) (0 - 100)
......@@ -1105,9 +1106,19 @@ var jsc = {
}
if (!(flags & jsc.leaveStyle)) {
if (this.styleElement) {
var bgColor = '#' + this.toString();
var fgColor = this.isLight() ? '#000' : '#FFF';
this.styleElement.style.backgroundImage = 'none';
this.styleElement.style.backgroundColor = '#' + this.toString();
this.styleElement.style.color = this.isLight() ? '#000' : '#FFF';
this.styleElement.style.backgroundColor = bgColor;
this.styleElement.style.color = fgColor;
if (this.overwriteImportant) {
this.styleElement.setAttribute('style',
'background: ' + bgColor + ' !important; ' +
'color: ' + fgColor + ' !important;'
);
}
}
}
if (!(flags & jsc.leavePad) && isPickerOwner()) {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment