diff --git a/Gruntfile.js b/Gruntfile.js
index 432024d6e4..263d753cf6 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -124,7 +124,6 @@ module.exports = function (grunt) {
"api/js/etemplate/et2_widget_button.js",
"api/js/etemplate/et2_core_valueWidget.js",
"api/js/etemplate/et2_core_inputWidget.js",
- "api/js/jquery/jpicker/jpicker-1.1.6.js",
"api/js/etemplate/et2_widget_color.js",
"api/js/jquery/blueimp/js/blueimp-gallery.min.js",
"api/js/etemplate/expose.js",
diff --git a/api/js/etemplate/et2_widget_color.js b/api/js/etemplate/et2_widget_color.js
index 9667866139..5fce6968f6 100644
--- a/api/js/etemplate/et2_widget_color.js
+++ b/api/js/etemplate/et2_widget_color.js
@@ -14,7 +14,6 @@
/vendor/bower-asset/jquery/dist/jquery.js;
et2_core_inputWidget;
et2_core_valueWidget;
- /api/js/jquery/jpicker/jpicker-1.1.6.js;
*/
/**
@@ -25,27 +24,6 @@
var et2_color = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
- "alphaSupport": {
- "name": "Transparancy",
- "type": "boolean",
- "default": false,
- "description": "Allow selection of alpha channel as well as color"
- }
- },
-
- // Settings for jPicker - internal
- defaults: {
- "window": {
- expandable: true,
- effects: {"type":"none"},
- position: { "x": "screenCenter", "y": "screenCenter"}
- },
- "images": {
- clientPath: egw_webserverUrl + "/api/js/jquery/jpicker/images/"
- },
- "color": {
- "active": new jQuery.jPicker.Color()
- }
},
/**
@@ -58,167 +36,18 @@ var et2_color = (function(){ "use strict"; return et2_inputWidget.extend(
// included via etemplate2.css
//this.egw().includeCSS("phpgwapi/js/jquery/jpicker/css/jPicker-1.1.6.min.css");
- this.input = this.$node = jQuery(document.createElement("span"));
-
- // Translations
- for(var key in jQuery.fn.jPicker.defaults.localization.text)
- {
- if(jQuery.fn.jPicker.defaults.localization.text[key])
- {
- jQuery.fn.jPicker.defaults.localization.text[key] = this.egw().lang(jQuery.fn.jPicker.defaults.localization.text[key]);
- }
- }
- for(var key in jQuery.fn.jPicker.defaults.localization.tooltips)
- {
- if(jQuery.fn.jPicker.defaults.localization.tooltips[key].ok)
- {
- jQuery.fn.jPicker.defaults.localization.tooltips[key].ok = this.egw().lang(jQuery.fn.jPicker.defaults.localization.tooltips[key].ok);
- }
- if(jQuery.fn.jPicker.defaults.localization.tooltips[key].cancel)
- {
- jQuery.fn.jPicker.defaults.localization.tooltips[key].cancel = this.egw().lang(jQuery.fn.jPicker.defaults.localization.tooltips[key].cancel);
- }
- }
- this.options = jQuery.extend({}, this.defaults, this.options);
+ this.input = this.$node = jQuery("");
this.setDOMNode(this.$node[0]);
},
- /**
- * Clean up and remove references to jPicker
- */
- destroy: function() {
- if(this.get_jPicker())
- {
- this.get_jPicker().destroy();
- jQuery("table.jPicker").dialog("destroy");
- jQuery("table.jPicker").remove();
- this.$node.next("span").remove();
- }
- this._super.call(this, arguments);
- },
-
- doLoadingFinished: function()
- {
- // as tabs can cause a double loading, we check here if jPicker is already initialised
- if (this.get_jPicker()) return;
-
- this._super.apply(this, arguments);
-
- var self = this;
-
- // Initialize jPicker
-
- this.options.color.active = new jQuery.jPicker.Color(this.value ? {hex:this.value} : {});
-
- // Do this to get a reference to the actual jPicker used, so we can fully remove it in destroy()
- var list_id = jQuery.jPicker.List.length ? jQuery.jPicker.List.length : 0;
-
- var val = this.$node.jPicker(this.options,
- // Ok
- function(value) {
- self.set_value(value);
- jQuery("table.jPicker").dialog("close");
- },
- // Color change
- null,
- // Cancel
- function(color) {
- jQuery("table.jPicker").dialog("close");
- }
- );
- jQuery.jPicker.List[list_id].id = this.id + "_jPicker";
-
- // jPicker doesn't allow translation of this one
- jQuery('.Image', this.$node.parent()).attr('title', this.egw().lang('Click to open colorpicker'));
-
- // Make it look better - plugin defers initialization, so we have to also
- setTimeout(function() {
- //Regex to exclude invalid charachters from class identifier name, to be able to address the class name with jquery selector later.
- var regExClassName = /[\[\]']+/g;
-
- // Make the buttons look like all the others
- jQuery("div.jPicker :button").addClass("et2_button et2_button_text");
-
- // Turn it into a full dialog
- jQuery("table.jPicker").dialog({
- title: self.options.statustext ? self.options.statustext : self.egw().lang('Select color'),
- autoOpen: false,
- resizable: false,
- width: "auto"
- });
- jQuery('table.jPicker').each(function(){
- if (!this.getAttribute('class').match(/jPickerColorIden/))
- {
- //Add an identifier to dialog for later on to bind a click handler to it
- //as jquery dialog has already an unique id, we make a unique class identifier with help of the widget id
- jQuery(this).addClass('jPickerColorIden-'+self.id.replace(regExClassName, '_'));
- return false;
- }
- });
- // Hide original move bar
- jQuery('table.jPicker .Move').hide();
-
- // Trigger dialog opening
- jQuery('.Image',self.$node.next()).click(function() {
- jQuery("table.jPickerColorIden-"+self.id.replace(regExClassName, '_')).dialog("open");
- });
- },500);
- return true;
- },
-
- /**
- * Get the jPicker object for this widget, so further things can be done to it
- *
- * Id of jPicker node is either our id+'_jPicker' or our dom_id (no idea why).
- */
- get_jPicker: function() {
- for(var i=0; i < jQuery.jPicker.List.length; ++i)
- {
- var node = jQuery.jPicker.List[i];
- if (node && (node.id == this.id+'_jPicker' || node.id == this.dom_id))
- {
- return node;
- }
- }
- return null;
- },
-
getValue: function() {
- return this.value;
+ return this.$node.val();
},
set_value: function(color) {
- if(typeof color == "string") {
- this.value = color;
- }
- else if (typeof color == "object" && color.val)
- {
- // Prefix # to match previous picker values
- var hex = color.val('hex');
- // Hex might be null
- if(hex)
- {
- hex = '#'+hex;
- }
- else if(this.value != hex)
- {
- // Color was cleared
- hex = '';
- }
- this.value = hex;
- }
- // Update picker
- if(jQuery.jPicker.List.length)
- {
- var self = this;
- var picker = this.get_jPicker();
- if(picker)
- {
- picker.color.active = new jQuery.jPicker.Color(self.options.value);
- }
- }
+ this.$node.val(color);
}
});}).call(this);
et2_register_widget(et2_color, ["colorpicker"]);
diff --git a/api/js/jquery/jpicker/ChangeLog.txt b/api/js/jquery/jpicker/ChangeLog.txt
deleted file mode 100644
index b173dba9d5..0000000000
--- a/api/js/jquery/jpicker/ChangeLog.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-Change Log
-______________
-1.1.6
- Corrected bug preventing selections inside input values in some browsers - the onselectstart function no longer captures on input boxes.
- Added support for up/down arrow adjustments of the currently focused input box making the picker more keyboard friendly.
- Added ticks around the backgroundImage assignments to correct for paths with whitespace.
-
-1.1.5
- Corrected Color object constructor to allow setting of the "alpha" value as per the documentation which previously didn't work.
- Added support for translucency for quickList colors with checkered background - Only available if "alphaSupport" is enabled.
- Restricted default color to "alpha" of 255 if "alphaSupport" is disabled - It will now assign an explicit alpha of 255 when disabled.
- Added new setting variable "alphaPrecision" which indicates the number of decimal points to allow in the alpha percentage display - Now defaults to 0.
-
-1.1.4
- Changed "alpha" range from 0-100 to 0-255 to correct truncating and rounding errors caused by attempting to get an integer percentage that matches a hex value.
- "alpha" percentage display will now show up to 1 decimal point for more accurate representation of "alpha" value.
- Color object now accepts "alpha" values in a range of 0-255 and also returns the same when getting the "alpha" value. You will need to run ((alpha * 100) / 255) to retrieve a percentage value.
- Reworked the table layout and labels to remove the need for the label to reference the radio input box. This reduces injected code and removes the need to generate unique ids on the radio buttons.
- Transparent/invisible caret on NULL color is now corrected - uses the same caret color as a white color.
- Setting a binded input value of "" or no value attribute will now create a NULL color on initialization instead of the settings default color.
- Added a dynamic, invisible "iframe" behind a dialog picker in all browsers that fail jQuery.support.boxModel (currently IE <= 7 Quirks Mode). This prevents "select" box from showing through the picker.
-
-1.1.3
- Now adding popup color pickers to document.body instead of inline with the popup control. This corrects issues with the picker not showing beyond a relative container scope.
- No longer need to hide popup icon in Internet Explorer for picker elements lower in the DOM than the currently active one since the picker itself is attached to document.body (it is always higher in the DOM now).
- Popup pickers are now bring-to-front selectable. Clicking on the picker will bring it above all other pickers on the page instead of having to drag one out from underneath another.
- Corrected jPicker.List/setTimeout bug which allowed an instance to bind to the List in an order other than the order the initialization function was called.
- Added a updateInputColor option (default true) to allow for a binded input field that does not automatically update its background/text color.
-
-1.1.2
- Reworked the find methods and contexts for element searches. Now using ":first" instead of ".eq(0)" to take advantage of early out searches. Much faster initialization of the picker, on the order of 6 times.
- Now using setTimeout for calling visual updates. Dramatically improved marker dragging in all browsers. Reduces blocking as re-rendering is internal to the browser and independent of the other javascript still in progress.
- Marker updates can now cancel a previous valueChanged event when a new mouseMove event comes in. IE8 marker dragging is still slower, much over 5 times faster than it was.
- Reworked entire quickPick list creation. It now adds up source code and does a single "html" method instead of multiple "append" methods. This is a large part of the speed increase on initialization.
- The vast majority of all running scripts on both initialization and dragging is now occupied altering the style rules and finding elements (init only) instead of jPicker code.
- All methods previously called with global context now use the "call" method for using the context of the class running the method. "this" in a callback is now the DOM node (jQuery style) and jPicker instead of "window".
- Added "effects" section of window settings to allow different show/hide effects and durations.
- Removed change log and read me from the full source code to separate files (ChangeLog.txt and ReadMe.txt) and an HTML demonstration/documentation page (Example.txt).
-
-1.1.1
- Correct IE exception caused by attempting to set "#transparent" to CSS background-color.
-
-1.1.0
- Reworked nearly the entire plugin including the internal and external event model, bindings, DOM searches, classes, and overall presentation.
- The Color object now supports a changed event that you can bind to (or just bind to the picker events still included).
- Event order has been reversed, instead of a change event on the map/bar/text fields updating the display, they now update the Color object which then fires the events that update the display.
- alphaSupport re-implemented by request - default behavior is off.
- Hex code now only 6 characters again.
- Color object can now have its value changed from code, using the "val" method, and it will fire all events necessary to update the display.
- Removed all "get_*" methods from the color object, instead opting for a single "val" method for getting and setting, more in line with familiar jQuery methods.
- Better rendering for all IE versions in Quirks mode.
-
-1.0.13
- Updated transparency algorithm for red/green/blue color modes. The algorithm from John Dyers' color picker was close but incorrect. Bar colors are now pixel perfect with the new algorithm.
- Changed from using "background-position" on the color maps to an element of full height using the "top" attribute for image-map location using "overflow: hidden" to hide overdraw.
- IE7/8 ignores opacity on elements taller than 4096px. Image maps therefore no longer include a blank first map so the Bar is just under 4096. Blank is now accomplished by setting the "top" setting to below the map display.
- New colorBar picker image that does not draw outside of the element since the elements now hide overdraw.
- Added IE5.5/6 support for the picker. This is why it now uses maps of full height and the "top" attribute for map locations.
- Moved the images in the maps to 4 pixels apart from each other. IE7/8 change the first pixel of the bottom-border of 2px to partially transparent showing a portion of a different color map without this.
-
-1.0.12
- Added minified CSS file.
- Added IE7/8 Quirks Mode support.
- Added configurable string constants for all text and tooltips. You can now change the default values for different languages.
- Privatized the RGBA values in the Color object for better NULL handling. YOU MUST USE THE NEW GET FUNCTIONS TO ACCESS THE COLOR PROPERTIES.
- Better NULL color handling and an additional "No Color Selected" quick pick color.
- More consistent behavior across multiple versions of browsers.
- Added alpha response to the binded color picker icon.
- Removed "alphaSupport" variable. It is now always supported.
-
-1.0.11b
- Corrected NULL behavior in IE. jQuery was getting an exception when attempting to assign a backgroundColor style of '#'. Now assigns 'transparent' if color is NULL.
- Can now create new Color object WITH OR WITHOUT the '#' prefix.
-
-1.0.11
- Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well.
- cancelCallback now returns the original color for use in programming responses.
-
-1.0.10
- Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier.
-
-1.0.9
- Added optional title variable for each jPicker window.
-
-1.0.8
- Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run.
-
-1.0.7
- RENAMED CSS FILE TO INCLUDE VERSION NUMBER!!! YOU MUST USE THIS VERSIONED CSS FILE!!! There will be no need to do your own CSS version number increments from now on.
- Added opacity feedback to color preview boxes.
- Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code.
- Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required.
-
-1.0.6
- Corrected picker bugs introduced with 1.0.5.
- Removed alpha slider bar until activated - default behavior for alpha is now OFF.
- Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol).
- Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).
- THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
-
-1.0.5
- Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol)
- Added title attributes to input elements - gives short tooltip directions on what button or field does.
- Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization.
- THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
-
-1.0.4
- Added ability for smaller picker icon with expandable window on any DOM element (not just input).
- "draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.
-
-1.0.3
- Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)
-
-1.0.2
- Random bug fixes - speed concerns.
-
-1.0.1
- Corrected closure based memeory leak - there may be others?
-
-1.0.0
- First Release.
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/Example.html b/api/js/jquery/jpicker/Example.html
deleted file mode 100644
index 0c70908fc5..0000000000
--- a/api/js/jquery/jpicker/Example.html
+++ /dev/null
@@ -1,774 +0,0 @@
-
-
-
-
-
- Digital Magic Productions - jPicker - A jQuery Color Picker Plugin
-
-
-
-
-
-
-
-
-
jPicker - A jQuery Color Picker Plugin.
-
- jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects. It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.
- jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari, and Opera.
- If you are updating a current version, you MUST always use the CSS and image files from the download as there may have been changes.
- If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the Color object returned by the callback functions.
Attaching multiple jPicker objects on a single page will slow performance.
-
-
jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances.
-
-
-
-
Coming Soon
-
-
-
-
Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists.
-
-
-
-
Planned For Future Release
-
-
- Move the jPicker object to a single instance that all selection instances point to.
-
-
This will result in much faster operation and initialization for pages with multiple pickers.
-
-
-
Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.
-
-
Change Log
-
-
-
V1.1.5:
-
-
Corrected Color object constructor to allow setting of the "alpha" value as per the documentation which previously didn't work.
-
Added support for translucency for quickList colors with checkered background - Only available if "alphaSupport" is enabled.
-
Restricted default color to "alpha" of 255 if "alphaSupport" is disabled - It will now assign an explicit alpha of 255 when disabled.
-
Added new setting variable "alphaPrecision" which indicates the number of decimal points to allow in the alpha percentage display - Now defaults to 0.
-
-
-
-
V1.1.4:
-
-
Changed "alpha" range from 0-100 to 0-255 to correct truncating and rounding errors caused by attempting to get an integer percentage that matches a hex value.
-
"alpha" percentage display will now show up to 1 decimal point for more accurate representation of "alpha" value.
-
Color object now accepts "alpha" values in a range of 0-255 and also returns the same when getting the "alpha" value. You will need to run ((alpha * 100) / 255) to retrieve a percentage value.
-
Reworked the table layout and labels to remove the need for the label to reference the radio input box. This reduces injected code and removes the need to generate unique ids on the radio buttons.
-
Transparent/invisible caret on NULL color is now corrected - uses the same caret color as a white color.
-
Setting a binded input value of "" or no value attribute will now create a NULL color on initialization instead of the settings default color.
-
Added a dynamic, invisible "iframe" behind a dialog picker in all browsers that fail jQuery.support.boxModel (currently IE <= 7 Quirks Mode). This prevents "select" box from showing through the picker.
-
-
-
-
V1.1.3:
-
-
Now adding popup color pickers to document.body instead of inline with the popup control. This corrects issues with the picker not showing beyond a relative container scope.
-
No longer need to hide popup icon in Internet Explorer for picker elements lower in the DOM than the currently active one since the picker itself is attached to document.body (it is always higher in the DOM now).
-
Popup pickers are now bring-to-front selectable. Clicking on the picker will bring it above all other pickers on the page instead of having to drag one out from underneath another.
-
Corrected jPicker.List/setTimeout bug which allowed an instance to bind to the List in an order other than the order the initialization function was called.
-
Added a updateInputColor option (default true) to allow for a binded input field that does not automatically update its background/text color.
-
-
-
-
-
V1.1.2:
-
-
Reworked the find methods and contexts for element searches. Now using ":first" instead of ".eq(0)" to take advantage of early out searches. Much faster initialization of the picker, on the order of 6 times.
-
Now using setTimeout for calling visual updates. Dramatically improved marker dragging in all browsers. Reduces blocking as re-rendering is internal to the browser and independent of the other javascript still in progress.
-
Marker updates can now cancel a previous valueChanged event when a new mouseMove event comes in. IE8 marker dragging is still slower, much over 5 times faster than it was.
-
Reworked entire quickPick list creation. It now adds up source code and does a single "html" method instead of multiple "append" methods. This is a large part of the speed increase on initialization.
-
The vast majority of all running scripts on both initialization and dragging is now occupied altering the style rules and finding elements (init only) instead of jPicker code.
-
All methods previously called with global context now use the "call" method for using the context of the class running the method. "this" in a callback is now the DOM node (jQuery style) and jPicker instead of "window".
-
Added "effects" section of window settings to allow different show/hide effects and durations.
-
Removed change log and read me from the full source code to separate files (ChangeLog.txt and ReadMe.txt) and an HTML demonstration/documentation page (Example.txt).
-
-
-
-
-
V1.1.1:
-
-
Correct IE exception caused by attempting to set "#transparent" to CSS background-color.
-
-
-
-
-
V1.1.0:
-
-
Reworked nearly the entire plugin including the internal and external event model, bindings, DOM searches, classes, and overall presentation.
-
The Color object now supports a changed event that you can bind to (or just bind to the picker events still included).
-
Event order has been reversed, instead of an change event on the map/bar/text fields updating the display, they now update the Color object which then fires the events that update the display.
-
alphaSupport re-implemented by request - default behavior is off.
-
Hex code now only 6 characters again.
-
Color object can now have its value changed from code, using the "val" method, and it will fire all events necessary to update the display.
-
Removed all "get_*" methods from the color object, instead opting for a single "val" method for getting and setting, more in line with familiar jQuery methods.
-
Better rendering for all IE versions in Quirks mode.
-
-
-
-
-
V1.0.13:
-
-
Updated transparency algorithm for red/green/blue color modes. The algorithm from John Dyers' color picker was close but incorrect. Bar colors are now pixel perfect with the new algorithm.
-
Changed from using "background-position" on the color maps to an element of full height using the "top" attribute for image-map location using "overflow: hidden" to hide overdraw.
-
IE7/8 ignores opacity on elements taller than 4096px. Image maps therefore no longer include a blank first map so the Bar is just under 4096. Blank is now accomplished by setting the "top" setting to below the map display.
-
New colorBar picker image that does not draw outside of the element since the elements now hide overdraw.
-
Added IE5.5/6 support for the picker. This is why it now uses maps of full height and the "top" attribute for map locations.
-
Moved the images in the maps to 4 pixels apart from each other. IE7/8 change the first pixel of the bottom-border of 2px to partially transparent showing a portion of a different color map without this.
-
-
-
-
-
V1.0.12:
-
-
Added minified CSS file.
-
Added IE7/8 Quirks Mode support.
-
Added configurable string constants for all text and tooltips. You can now change the default values for different languages.
-
Privatized the RGBA values in the Color object for better NULL handling. YOU MUST USE THE NEW GET FUNCTIONS TO ACCESS THE COLOR PROPERTIES.
-
Better NULL color handling and an additional "No Color Selected" quick pick color.
-
More consistent behavior across multiple versions of browsers.
-
Added alpha response to the binded color picker icon.
-
Removed "alphaSupport" variable. It is now always supported.
-
-
-
-
-
V1.0.11b:
-
-
Corrected NULL behavior in IE. jQuery was getting an exception when attempting to assign a backgroundColor style of '#'. Now assigns 'transparent' if color is NULL.
-
Can now create new Color object WITH OR WITHOUT the '#' prefix.
-
-
-
-
-
V1.0.11:
-
-
Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well.
-
cancelCallback now returns the original color for use in programming responses.
-
-
-
-
-
V1.0.10:
-
-
Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier.
-
-
-
-
-
V1.0.9:
-
-
Added optional title variable for each jPicker window.
-
-
-
-
-
V1.0.8:
-
-
Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run.
-
-
-
-
-
V1.0.7:
-
-
RENAMED CSS FILE TO INCLUDE VERSION NUMBER!!! YOU MUST USE THIS VERSIONED CSS FILE!!! There will be no need to do your own CSS version number increments from now on.
-
Added opacity feedback to color preview boxes.
-
Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code.
-
Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required.
-
-
-
-
-
V1.0.6:
-
-
Corrected picker bugs introduced with 1.0.5.
-
Removed alpha slider bar until activated - default behavior for alpha is now OFF.
-
Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol).
-
Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).
-
THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
-
-
-
-
-
V1.0.5:
-
-
Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol)
-
Added title attributes to input elements - gives short tooltip directions on what button or field does.
-
Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization.
-
THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
-
-
-
-
-
V1.0.4:
-
-
Added ability for smaller picker icon with expandable window on any DOM element (not just input).
-
"draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.
-
-
-
-
-
V1.0.3
-
-
Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)
-
-
-
-
-
V1.0.2
-
-
Random bug fixes - speed concerns.
-
-
-
-
-
V1.0.1
-
-
Corrected closure based memeory leak - there may be others?
-
-
-
-
-
V1.0.0
-
-
First Release.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/ReadMe.txt b/api/js/jquery/jpicker/ReadMe.txt
deleted file mode 100644
index a2006d2f17..0000000000
--- a/api/js/jquery/jpicker/ReadMe.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-jPicker 1.1.6
-
-jQuery Plugin for Photoshop style color picker
-
-Copyright (c) 2010 Christopher T. Tillman
-Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/)
-MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE
-
-Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework.
-
-John Dyers' website: (http://johndyer.name)
-Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx)
-
-
- jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects.
-It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.
-
- jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari,
-and Opera.
-
- If you are updating a current version, you MUST always use the CSS and image files from the download as
-there may have been changes.
-
- If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the
-Color object returned by the callback functions.
-
-
-Known Issues
-______________
-Attaching multiple jPicker objects on a single page will slow performance.
- jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances.
-
-
-Coming Soon
-______________
-
- Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists.
-
-Planned For Future Release
-______________
-
- Move the jPicker object to a single instance that all selection instances point to.
- - This will result in much faster operation and initialization for pages with multiple pickers.
-
- Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.
-
- Add multiple window modes for picker operation, include modal, popup, windowed, and exclusive.
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/css/jPicker-1.1.6.css b/api/js/jquery/jpicker/css/jPicker-1.1.6.css
deleted file mode 100644
index c46f09b72e..0000000000
--- a/api/js/jquery/jpicker/css/jPicker-1.1.6.css
+++ /dev/null
@@ -1,232 +0,0 @@
-.jPicker .Icon {
- display: inline-block;
- height: 24px; /* change this value if using a different sized color picker icon */
- position: relative; /* make this element an absolute positioning container */
- text-align: left; /* make the zero width children position to the left of container */
- width: 25px; /* change this value if using a different sized color picker icon */
-}
-.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
- background-position: 2px 2px;
- display: block;
- height: 100%;
- left: 0px;
- position: absolute;
- top: 0px;
- width: 100%;
-}
-.jPicker .Icon span.Image {
- background-repeat: no-repeat;
- cursor: pointer;
- display: block;
- height: 100%;
- left: 0px;
- position: absolute;
- top: 0px;
- width: 100%;
-}
-.jPicker.Container {
- color: #000;
- z-index: 10;
-}
-table.jPicker {
- background-color: #efefef;
- border: 1px outset #666;
- font-family: Arial, Helvetica, Sans-Serif;
- font-size: 12px !important;
- margin: 0px;
- padding: 5px;
- width: 545px;
- z-index: 20;
-}
-.jPicker .Move {
- background-color: #dddddd;
- border-color: #fff #666 #666 #fff;
- border-style: solid;
- border-width: 1px;
- cursor: move;
- height: 12px;
- padding: 0px;
-}
-.jPicker .Title {
- font-size: 11px !important;
- font-weight: bold;
- margin: -2px 0px 0px 0px;
- padding: 10px 0px 0px 0px;
- text-align: center;
- width: 100%;
-}
-.jPicker div.Map {
- border-bottom: 2px solid #fff;
- border-left: 2px solid #9a9a9a;
- border-right: 2px solid #fff;
- border-top: 2px solid #9a9a9a;
- cursor: crosshair;
- height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
- margin: 0px 10px 10px 10px;
- overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */
- padding: 0px;
- position: relative; /* make this element an absolute positioning container */
- width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
-}
-.jPicker div[class="Map"] {
- height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
- width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
-}
-.jPicker div.Bar {
- border-bottom: 2px solid #fff;
- border-left: 2px solid #9a9a9a;
- border-right: 2px solid #fff;
- border-top: 2px solid #9a9a9a;
- cursor: n-resize;
- height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
- margin: 12px 10px 0px 5px;
- overflow: hidden;
- padding: 0px;
- position: relative;
- width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */
-}
-.jPicker div[class="Bar"] {
- height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
- width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
-}
-.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
- background-color: transparent;
- background-image: none;
- display: block;
- left: 0px;
- position: absolute;
- top: 0px;
-}
-.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 {
- height: 2596px;
- width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
- would not be drawn if its overflow is set to hidden. */
-}
-.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
- height: 3896px;
- width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
- would not be drawn if its overflow is set to hidden. */
-}
-.jPicker .Bar .Map5, .jPicker .Bar .Map6 {
- height: 256px;
- width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
- would not be drawn if its overflow is set to hidden. */
-}
-.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 {
- background-repeat: no-repeat;
-}
-.jPicker .Map .Map3, .jPicker .Bar .Map5 {
- background-repeat: repeat;
-}
-.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
- background-repeat: repeat-x;
-}
-.jPicker .Map .Arrow {
- display: block;
- position: absolute;
-}
-.jPicker .Bar .Arrow {
- display: block;
- left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */
- position: absolute;
-}
-.jPicker .Preview {
- font-size: 9px;
- padding: 5px 0px 0px 0px;
- text-align: center;
-}
-.jPicker .Preview div {
- border: 2px inset #eee;
- height: 62px;
- margin: 0px auto;
- padding: 0px;
- width: 62px;
-}
-.jPicker .Preview div span {
- border: 1px solid #000;
- display: block;
- height: 30px;
- margin: 0px auto;
- padding: 0px;
- width: 60px;
-}
-.jPicker .Preview .Active {
- border-bottom-width: 0px;
-}
-.jPicker .Preview .Current {
- border-top-width: 0px;
- cursor: pointer;
-}
-.jPicker input {
- font-size: 13px;
-}
-.jPicker .Button {
- text-align: center;
- padding: 0px 4px;
- width: 115px;
-}
-.jPicker .Button input {
- padding: 2px 0px;
- width: 100px;
-}
-.jPicker .Button .Ok {
- margin: 12px 0px 5px 0px;
-}
-.jPicker td {
- margin: 0px;
- padding: 0px;
-}
-.jPicker td.Radio {
- margin: 0px;
- padding: 0px;
- width: 31px;
-}
-.jPicker td.Radio input {
- margin: 0px 5px 0px 0px;
- padding: 0px;
-}
-.jPicker td.Text {
- font-size: 12px !important;
- height: 22px;
- margin: 0px;
- padding: 0px;
- text-align: left;
- width: 70px;
-}
-.jPicker tr.Hex td.Text {
- width: 100px;
-}
-.jPicker td.Text input {
- background-color: #fff;
- border: 1px inset #aaa;
- height: 19px;
- margin: 0px 0px 0px 5px;
- text-align: left;
- width: 30px;
-}
-.jPicker td[class="Text"] input {
- height: 15px;
-}
-.jPicker tr.Hex td.Text input.Hex {
- width: 50px;
-}
-.jPicker tr.Hex td.Text input.AHex {
- width: 20px;
-}
-.jPicker .Grid {
- text-align: center;
- width: 114px;
-}
-.jPicker .Grid span.QuickColor {
- border: 1px inset #aaa;
- cursor: pointer;
- display: inline-block;
- height: 15px;
- line-height: 15px;
- margin: 0px;
- padding: 0px;
- width: 19px;
-}
-.jPicker .Grid span[class="QuickColor"] {
- width: 17px;
-}
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/css/jPicker-1.1.6.min.css b/api/js/jquery/jpicker/css/jPicker-1.1.6.min.css
deleted file mode 100644
index c131616fb9..0000000000
--- a/api/js/jquery/jpicker/css/jPicker-1.1.6.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.jPicker .Icon{display:inline-block;height:24px;position:relative;text-align:left;width:25px}.jPicker .Icon span.Color,.jPicker .Icon span.Alpha{background-position:2px 2px;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker .Icon span.Image{background-repeat:no-repeat;cursor:pointer;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker.Container{color:#000;z-index:10}table.jPicker{background-color:#efefef;border:1px outset #666;font-family:Arial,Helvetica,Sans-Serif;font-size:12px!important;margin:0;padding:5px;width:545px;z-index:20}.jPicker .Move{background-color:#ddd;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;cursor:move;height:12px;padding:0}.jPicker .Title{font-size:11px!important;font-weight:bold;margin:-2px 0 0 0;padding:10px 0 0 0;text-align:center;width:100%}.jPicker div.Map{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:crosshair;height:260px;margin:0 10px 10px 10px;overflow:hidden;padding:0;position:relative;width:260px}.jPicker div[class="Map"]{height:256px;width:256px}.jPicker div.Bar{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:n-resize;height:260px;margin:12px 10px 0 5px;overflow:hidden;padding:0;position:relative;width:24px}.jPicker div[class="Bar"]{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3,.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4,.jPicker .Bar .Map5,.jPicker .Bar .Map6{background-color:transparent;background-image:none;display:block;left:0;position:absolute;top:0}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3{height:2596px;width:256px}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{height:3896px;width:20px}.jPicker .Bar .Map5,.jPicker .Bar .Map6{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Bar .Map6{background-repeat:no-repeat}.jPicker .Map .Map3,.jPicker .Bar .Map5{background-repeat:repeat}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{background-repeat:repeat-x}.jPicker .Map .Arrow{display:block;position:absolute}.jPicker .Bar .Arrow{display:block;left:0;position:absolute}.jPicker .Preview{font-size:9px;padding:5px 0 0 0;text-align:center}.jPicker .Preview div{border:2px inset #eee;height:62px;margin:0 auto;padding:0;width:62px}.jPicker .Preview div span{border:1px solid #000;display:block;height:30px;margin:0 auto;padding:0;width:60px}.jPicker .Preview .Active{border-bottom-width:0}.jPicker .Preview .Current{border-top-width:0;cursor:pointer}.jPicker input{font-size:13px}.jPicker .Button{text-align:center;padding:0 4px;width:115px}.jPicker .Button input{padding:2px 0;width:100px}.jPicker .Button .Ok{margin:12px 0 5px 0}.jPicker td{margin:0;padding:0}.jPicker td.Radio{margin:0;padding:0;width:31px}.jPicker td.Radio input{margin:0 5px 0 0;padding:0}.jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px}.jPicker tr.Hex td.Text{width:100px}.jPicker td.Text input{background-color:#fff;border:1px inset #aaa;height:19px;margin:0 0 0 5px;text-align:left;width:30px}.jPicker td[class="Text"] input{height:15px}.jPicker tr.Hex td.Text input.Hex{width:50px}.jPicker tr.Hex td.Text input.AHex{width:20px}.jPicker .Grid{text-align:center;width:114px}.jPicker .Grid span.QuickColor{border:1px inset #aaa;cursor:pointer;display:inline-block;height:15px;line-height:15px;margin:0;padding:0;width:19px}.jPicker .Grid span[class="QuickColor"]{width:17px}
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/images/AlphaBar.png b/api/js/jquery/jpicker/images/AlphaBar.png
deleted file mode 100644
index 2950daeb87..0000000000
Binary files a/api/js/jquery/jpicker/images/AlphaBar.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/Bars.png b/api/js/jquery/jpicker/images/Bars.png
deleted file mode 100644
index 80eb2bbe76..0000000000
Binary files a/api/js/jquery/jpicker/images/Bars.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/Maps.png b/api/js/jquery/jpicker/images/Maps.png
deleted file mode 100644
index 853d38c68e..0000000000
Binary files a/api/js/jquery/jpicker/images/Maps.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/NoColor.png b/api/js/jquery/jpicker/images/NoColor.png
deleted file mode 100644
index 5dc47670ef..0000000000
Binary files a/api/js/jquery/jpicker/images/NoColor.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/Thumbs.db b/api/js/jquery/jpicker/images/Thumbs.db
deleted file mode 100644
index 27621da65d..0000000000
Binary files a/api/js/jquery/jpicker/images/Thumbs.db and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/bar-opacity.png b/api/js/jquery/jpicker/images/bar-opacity.png
deleted file mode 100644
index e42ad08126..0000000000
Binary files a/api/js/jquery/jpicker/images/bar-opacity.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/map-opacity.png b/api/js/jquery/jpicker/images/map-opacity.png
deleted file mode 100644
index 6756cee6df..0000000000
Binary files a/api/js/jquery/jpicker/images/map-opacity.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/mappoint.gif b/api/js/jquery/jpicker/images/mappoint.gif
deleted file mode 100644
index f5f855745c..0000000000
Binary files a/api/js/jquery/jpicker/images/mappoint.gif and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/picker.gif b/api/js/jquery/jpicker/images/picker.gif
deleted file mode 100644
index 374d891042..0000000000
Binary files a/api/js/jquery/jpicker/images/picker.gif and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/preview-opacity.png b/api/js/jquery/jpicker/images/preview-opacity.png
deleted file mode 100644
index 0dd9a2f8b9..0000000000
Binary files a/api/js/jquery/jpicker/images/preview-opacity.png and /dev/null differ
diff --git a/api/js/jquery/jpicker/images/rangearrows.gif b/api/js/jquery/jpicker/images/rangearrows.gif
deleted file mode 100644
index 9fe89f472d..0000000000
Binary files a/api/js/jquery/jpicker/images/rangearrows.gif and /dev/null differ
diff --git a/api/js/jquery/jpicker/jPicker.css b/api/js/jquery/jpicker/jPicker.css
deleted file mode 100644
index f63f8e5fb7..0000000000
--- a/api/js/jquery/jpicker/jPicker.css
+++ /dev/null
@@ -1,17 +0,0 @@
-@media all
-{
- #jPicker { margin: 0px 8px; text-align: left; }
- #jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; }
- #jPicker ul li { list-style: disc; padding: 2px 0px; }
- #jPicker ul li ul { margin-bottom: 10px; }
- #jPicker ul li ul li { list-style: circle; }
- #jPicker p { font-size: 13px; padding: 0px 10px; }
- #jPicker hr { clear: both; }
- #jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; }
- #jPicker code { color: #8bd; font-size: 14px; font-weight: bold; }
- #jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; }
- #jPicker span { font-size: 13px; text-align: center; }
- #jPicker a { color: #ff8050; }
- #jPicker input { font-size: 13px; padding: 2px 5px; }
- #jPicker h2 { font-size: 16px; margin: 10px 0px; }
-}
\ No newline at end of file
diff --git a/api/js/jquery/jpicker/jpicker-1.1.6.js b/api/js/jquery/jpicker/jpicker-1.1.6.js
deleted file mode 100644
index dd6d47f517..0000000000
--- a/api/js/jquery/jpicker/jpicker-1.1.6.js
+++ /dev/null
@@ -1,2086 +0,0 @@
-/*
- * jPicker 1.1.6
- *
- * jQuery Plugin for Photoshop style color picker
- *
- * Copyright (c) 2010 Christopher T. Tillman
- * Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/)
- * MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE
- *
- * Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework.
- *
- * John Dyers' website: (http://johndyer.name)
- * Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx)
- *
- */
-(function($, version)
-{
- Math.precision = function(value, precision)
- {
- if (precision === undefined) precision = 0;
- return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
- };
- var Slider = // encapsulate slider functionality for the ColorMap and ColorBar - could be useful to use a jQuery UI draggable for this with certain extensions
- function(bar, options)
- {
- var $this = this, // private properties, methods, and events - keep these variables and classes invisible to outside code
- arrow = bar.find('img:first'), // the arrow image to drag
- minX = 0,
- maxX = 100,
- rangeX = 100,
- minY = 0,
- maxY = 100,
- rangeY = 100,
- x = 0,
- y = 0,
- offset,
- timeout,
- changeEvents = new Array(),
- fireChangeEvents =
- function(context)
- {
- for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context);
- },
- mouseDown = // bind the mousedown to the bar not the arrow for quick snapping to the clicked location
- function(e)
- {
- var off = bar.offset();
- offset = { l: off.left | 0, t: off.top | 0 };
- clearTimeout(timeout);
- timeout = setTimeout( // using setTimeout for visual updates - once the style is updated the browser will re-render internally allowing the next Javascript to run
- function()
- {
- setValuesFromMousePosition.call($this, e);
- }, 0);
- // Bind mousemove and mouseup event to the document so it responds when dragged of of the bar - we will unbind these when on mouseup to save processing
- $(document).bind('mousemove', mouseMove).bind('mouseup', mouseUp);
- e.preventDefault(); // don't try to select anything or drag the image to the desktop
- },
- mouseMove = // set the values as the mouse moves
- function(e)
- {
- clearTimeout(timeout);
- timeout = setTimeout(
- function()
- {
- setValuesFromMousePosition.call($this, e);
- }, 0);
- e.stopPropagation();
- e.preventDefault();
- return false;
- },
- mouseUp = // unbind the document events - they aren't needed when not dragging
- function(e)
- {
- $(document).unbind('mouseup', mouseUp).unbind('mousemove', mouseMove);
- e.stopPropagation();
- e.preventDefault();
- return false;
- },
- setValuesFromMousePosition = // calculate mouse position and set value within the current range
- function(e)
- {
- var locX = e.pageX - offset.l,
- locY = e.pageY - offset.t,
- barW = bar.w, // local copies for YUI compressor
- barH = bar.h;
- // keep the arrow within the bounds of the bar
- if (locX < 0) locX = 0;
- else if (locX > barW) locX = barW;
- if (locY < 0) locY = 0;
- else if (locY > barH) locY = barH;
- val.call($this, 'xy', { x: ((locX / barW) * rangeX) + minX, y: ((locY / barH) * rangeY) + minY });
- },
- draw =
- function()
- {
- var arrowOffsetX = 0,
- arrowOffsetY = 0,
- barW = bar.w,
- barH = bar.h,
- arrowW = arrow.w,
- arrowH = arrow.h;
- setTimeout(
- function()
- {
- if (rangeX > 0) // range is greater than zero
- {
- // constrain to bounds
- if (x == maxX) arrowOffsetX = barW;
- else arrowOffsetX = ((x / rangeX) * barW) | 0;
- }
- if (rangeY > 0) // range is greater than zero
- {
- // constrain to bounds
- if (y == maxY) arrowOffsetY = barH;
- else arrowOffsetY = ((y / rangeY) * barH) | 0;
- }
- // if arrow width is greater than bar width, center arrow and prevent horizontal dragging
- if (arrowW >= barW) arrowOffsetX = (barW >> 1) - (arrowW >> 1); // number >> 1 - superfast bitwise divide by two and truncate (move bits over one bit discarding lowest)
- else arrowOffsetX -= arrowW >> 1;
- // if arrow height is greater than bar height, center arrow and prevent vertical dragging
- if (arrowH >= barH) arrowOffsetY = (barH >> 1) - (arrowH >> 1);
- else arrowOffsetY -= arrowH >> 1;
- // set the arrow position based on these offsets
- arrow.css({ left: arrowOffsetX + 'px', top: arrowOffsetY + 'px' });
- }, 0);
- },
- val =
- function(name, value, context)
- {
- var set = value !== undefined;
- if (!set)
- {
- if (name === undefined || name == null) name = 'xy';
- switch (name.toLowerCase())
- {
- case 'x': return x;
- case 'y': return y;
- case 'xy':
- default: return { x: x, y: y };
- }
- }
- if (context != null && context == $this) return;
- var changed = false,
- newX,
- newY;
- if (name == null) name = 'xy';
- switch (name.toLowerCase())
- {
- case 'x':
- newX = value && (value.x && value.x | 0 || value | 0) || 0;
- break;
- case 'y':
- newY = value && (value.y && value.y | 0 || value | 0) || 0;
- break;
- case 'xy':
- default:
- newX = value && value.x && value.x | 0 || 0;
- newY = value && value.y && value.y | 0 || 0;
- break;
- }
- if (newX != null)
- {
- if (newX < minX) newX = minX;
- else if (newX > maxX) newX = maxX;
- if (x != newX)
- {
- x = newX;
- changed = true;
- }
- }
- if (newY != null)
- {
- if (newY < minY) newY = minY;
- else if (newY > maxY) newY = maxY;
- if (y != newY)
- {
- y = newY;
- changed = true;
- }
- }
- changed && fireChangeEvents.call($this, context || $this);
- },
- range =
- function (name, value)
- {
- var set = value !== undefined;
- if (!set)
- {
- if (name === undefined || name == null) name = 'all';
- switch (name.toLowerCase())
- {
- case 'minx': return minX;
- case 'maxx': return maxX;
- case 'rangex': return { minX: minX, maxX: maxX, rangeX: rangeX };
- case 'miny': return minY;
- case 'maxy': return maxY;
- case 'rangey': return { minY: minY, maxY: maxY, rangeY: rangeY };
- case 'all':
- default: return { minX: minX, maxX: maxX, rangeX: rangeX, minY: minY, maxY: maxY, rangeY: rangeY };
- }
- }
- var changed = false,
- newMinX,
- newMaxX,
- newMinY,
- newMaxY;
- if (name == null) name = 'all';
- switch (name.toLowerCase())
- {
- case 'minx':
- newMinX = value && (value.minX && value.minX | 0 || value | 0) || 0;
- break;
- case 'maxx':
- newMaxX = value && (value.maxX && value.maxX | 0 || value | 0) || 0;
- break;
- case 'rangex':
- newMinX = value && value.minX && value.minX | 0 || 0;
- newMaxX = value && value.maxX && value.maxX | 0 || 0;
- break;
- case 'miny':
- newMinY = value && (value.minY && value.minY | 0 || value | 0) || 0;
- break;
- case 'maxy':
- newMaxY = value && (value.maxY && value.maxY | 0 || value | 0) || 0;
- break;
- case 'rangey':
- newMinY = value && value.minY && value.minY | 0 || 0;
- newMaxY = value && value.maxY && value.maxY | 0 || 0;
- break;
- case 'all':
- default:
- newMinX = value && value.minX && value.minX | 0 || 0;
- newMaxX = value && value.maxX && value.maxX | 0 || 0;
- newMinY = value && value.minY && value.minY | 0 || 0;
- newMaxY = value && value.maxY && value.maxY | 0 || 0;
- break;
- }
- if (newMinX != null && minX != newMinX)
- {
- minX = newMinX;
- rangeX = maxX - minX;
- }
- if (newMaxX != null && maxX != newMaxX)
- {
- maxX = newMaxX;
- rangeX = maxX - minX;
- }
- if (newMinY != null && minY != newMinY)
- {
- minY = newMinY;
- rangeY = maxY - minY;
- }
- if (newMaxY != null && maxY != newMaxY)
- {
- maxY = newMaxY;
- rangeY = maxY - minY;
- }
- },
- bind =
- function (callback)
- {
- if ($.isFunction(callback)) changeEvents.push(callback);
- },
- unbind =
- function (callback)
- {
- if (!$.isFunction(callback)) return;
- var i;
- while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1);
- },
- destroy =
- function()
- {
- // unbind all possible events and null objects
- $(document).unbind('mouseup', mouseUp).unbind('mousemove', mouseMove);
- bar.unbind('mousedown', mouseDown);
- bar = null;
- arrow = null;
- changeEvents = null;
- };
- $.extend(true, $this, // public properties, methods, and event bindings - these we need to access from other controls
- {
- val: val,
- range: range,
- bind: bind,
- unbind: unbind,
- destroy: destroy
- });
- // initialize this control
- arrow.src = options.arrow && options.arrow.image;
- arrow.w = options.arrow && options.arrow.width || arrow.width();
- arrow.h = options.arrow && options.arrow.height || arrow.height();
- bar.w = options.map && options.map.width || bar.width();
- bar.h = options.map && options.map.height || bar.height();
- // bind mousedown event
- bar.bind('mousedown', mouseDown);
- bind.call($this, draw);
- },
- ColorValuePicker = // controls for all the input elements for the typing in color values
- function(picker, color, bindedHex, alphaPrecision)
- {
- var $this = this, // private properties and methods
- inputs = picker.find('td.Text input'),
- red = inputs.eq(3),
- green = inputs.eq(4),
- blue = inputs.eq(5),
- alpha = inputs.length > 7 ? inputs.eq(6) : null,
- hue = inputs.eq(0),
- saturation = inputs.eq(1),
- value = inputs.eq(2),
- hex = inputs.eq(inputs.length > 7 ? 7 : 6),
- ahex = inputs.length > 7 ? inputs.eq(8) : null,
- keyDown = // input box key down - use arrows to alter color
- function(e)
- {
- if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return;
- if (!validateKey(e)) return e;
- switch (e.target)
- {
- case red.get(0):
- switch (e.keyCode)
- {
- case 38:
- red.val(setValueInRange.call($this, (red.val() << 0) + 1, 0, 255));
- color.val('r', red.val(), e.target);
- return false;
- case 40:
- red.val(setValueInRange.call($this, (red.val() << 0) - 1, 0, 255));
- color.val('r', red.val(), e.target);
- return false;
- }
- break;
- case green.get(0):
- switch (e.keyCode)
- {
- case 38:
- green.val(setValueInRange.call($this, (green.val() << 0) + 1, 0, 255));
- color.val('g', green.val(), e.target);
- return false;
- case 40:
- green.val(setValueInRange.call($this, (green.val() << 0) - 1, 0, 255));
- color.val('g', green.val(), e.target);
- return false;
- }
- break;
- case blue.get(0):
- switch (e.keyCode)
- {
- case 38:
- blue.val(setValueInRange.call($this, (blue.val() << 0) + 1, 0, 255));
- color.val('b', blue.val(), e.target);
- return false;
- case 40:
- blue.val(setValueInRange.call($this, (blue.val() << 0) - 1, 0, 255));
- color.val('b', blue.val(), e.target);
- return false;
- }
- break;
- case alpha && alpha.get(0):
- switch (e.keyCode)
- {
- case 38:
- alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) + 1, 0, 100));
- color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target);
- return false;
- case 40:
- alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) - 1, 0, 100));
- color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target);
- return false;
- }
- break;
- case hue.get(0):
- switch (e.keyCode)
- {
- case 38:
- hue.val(setValueInRange.call($this, (hue.val() << 0) + 1, 0, 360));
- color.val('h', hue.val(), e.target);
- return false;
- case 40:
- hue.val(setValueInRange.call($this, (hue.val() << 0) - 1, 0, 360));
- color.val('h', hue.val(), e.target);
- return false;
- }
- break;
- case saturation.get(0):
- switch (e.keyCode)
- {
- case 38:
- saturation.val(setValueInRange.call($this, (saturation.val() << 0) + 1, 0, 100));
- color.val('s', saturation.val(), e.target);
- return false;
- case 40:
- saturation.val(setValueInRange.call($this, (saturation.val() << 0) - 1, 0, 100));
- color.val('s', saturation.val(), e.target);
- return false;
- }
- break;
- case value.get(0):
- switch (e.keyCode)
- {
- case 38:
- value.val(setValueInRange.call($this, (value.val() << 0) + 1, 0, 100));
- color.val('v', value.val(), e.target);
- return false;
- case 40:
- value.val(setValueInRange.call($this, (value.val() << 0) - 1, 0, 100));
- color.val('v', value.val(), e.target);
- return false;
- }
- break;
- }
- },
- keyUp = // input box key up - validate value and set color
- function(e)
- {
- if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return;
- if (!validateKey(e)) return e;
- switch (e.target)
- {
- case red.get(0):
- red.val(setValueInRange.call($this, red.val(), 0, 255));
- color.val('r', red.val(), e.target);
- break;
- case green.get(0):
- green.val(setValueInRange.call($this, green.val(), 0, 255));
- color.val('g', green.val(), e.target);
- break;
- case blue.get(0):
- blue.val(setValueInRange.call($this, blue.val(), 0, 255));
- color.val('b', blue.val(), e.target);
- break;
- case alpha && alpha.get(0):
- alpha.val(setValueInRange.call($this, alpha.val(), 0, 100));
- color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target);
- break;
- case hue.get(0):
- hue.val(setValueInRange.call($this, hue.val(), 0, 360));
- color.val('h', hue.val(), e.target);
- break;
- case saturation.get(0):
- saturation.val(setValueInRange.call($this, saturation.val(), 0, 100));
- color.val('s', saturation.val(), e.target);
- break;
- case value.get(0):
- value.val(setValueInRange.call($this, value.val(), 0, 100));
- color.val('v', value.val(), e.target);
- break;
- case hex.get(0):
- hex.val(hex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6));
- bindedHex && bindedHex.val(hex.val());
- color.val('hex', hex.val() != '' ? hex.val() : null, e.target);
- break;
- case bindedHex && bindedHex.get(0):
- bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6));
- hex.val(bindedHex.val());
- color.val('hex', bindedHex.val() != '' ? bindedHex.val() : null, e.target);
- break;
- case ahex && ahex.get(0):
- ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 2));
- color.val('a', ahex.val() != null ? parseInt(ahex.val(), 16) : null, e.target);
- break;
- }
- },
- blur = // input box blur - reset to original if value empty
- function(e)
- {
- if (color.val() != null)
- {
- switch (e.target)
- {
- case red.get(0): red.val(color.val('r')); break;
- case green.get(0): green.val(color.val('g')); break;
- case blue.get(0): blue.val(color.val('b')); break;
- case alpha && alpha.get(0): alpha.val(Math.precision((color.val('a') * 100) / 255, alphaPrecision)); break;
- case hue.get(0): hue.val(color.val('h')); break;
- case saturation.get(0): saturation.val(color.val('s')); break;
- case value.get(0): value.val(color.val('v')); break;
- case hex.get(0):
- case bindedHex && bindedHex.get(0):
- hex.val(color.val('hex'));
- bindedHex && bindedHex.val(color.val('hex'));
- break;
- case ahex && ahex.get(0): ahex.val(color.val('ahex').substring(6)); break;
- }
- }
- },
- validateKey = // validate key
- function(e)
- {
- switch(e.keyCode)
- {
- case 9:
- case 16:
- case 29:
- case 37:
- case 39:
- return false;
- case 'c'.charCodeAt():
- case 'v'.charCodeAt():
- if (e.ctrlKey) return false;
- }
- return true;
- },
- setValueInRange = // constrain value within range
- function(value, min, max)
- {
- if (value == '' || isNaN(value)) return min;
- if (value > max) return max;
- if (value < min) return min;
- return value;
- },
- colorChanged =
- function(ui, context)
- {
- var all = ui.val('all');
- if (context != red.get(0)) red.val(all != null ? all.r : '');
- if (context != green.get(0)) green.val(all != null ? all.g : '');
- if (context != blue.get(0)) blue.val(all != null ? all.b : '');
- if (alpha && context != alpha.get(0)) alpha.val(all != null ? Math.precision((all.a * 100) / 255, alphaPrecision) : '');
- if (context != hue.get(0)) hue.val(all != null ? all.h : '');
- if (context != saturation.get(0)) saturation.val(all != null ? all.s : '');
- if (context != value.get(0)) value.val(all != null ? all.v : '');
- if (context != hex.get(0) && (bindedHex && context != bindedHex.get(0) || !bindedHex)) hex.val(all != null ? all.hex : '');
- if (bindedHex && context != bindedHex.get(0) && context != hex.get(0)) bindedHex.val(all != null ? all.hex : '');
- if (ahex && context != ahex.get(0)) ahex.val(all != null ? all.ahex.substring(6) : '');
- },
- destroy =
- function()
- {
- // unbind all events and null objects
- red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).unbind('keyup', keyUp).unbind('blur', blur);
- red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).unbind('keydown', keyDown);
- color.unbind(colorChanged);
- red = null;
- green = null;
- blue = null;
- alpha = null;
- hue = null;
- saturation = null;
- value = null;
- hex = null;
- ahex = null;
- };
- $.extend(true, $this, // public properties and methods
- {
- destroy: destroy
- });
- red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).bind('keyup', keyUp).bind('blur', blur);
- red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).bind('keydown', keyDown);
- color.bind(colorChanged);
- };
- $.jPicker =
- {
- List: [], // array holding references to each active instance of the control
- Color: // color object - we will be able to assign by any color space type or retrieve any color space info
- // we want this public so we can optionally assign new color objects to initial values using inputs other than a string hex value (also supported)
- function(init)
- {
- var $this = this,
- r,
- g,
- b,
- a,
- h,
- s,
- v,
- changeEvents = new Array(),
- fireChangeEvents =
- function(context)
- {
- for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context);
- },
- val =
- function(name, value, context)
- {
- var set = value !== undefined;
- if (!set)
- {
- if (name === undefined || name == null || name == '') name = 'all';
- if (r == null) return null;
- switch (name.toLowerCase())
- {
- case 'ahex': return ColorMethods.rgbaToHex({ r: r, g: g, b: b, a: a });
- case 'hex': return val('ahex').substring(0, 6);
- case 'all': return { r: r, g: g, b: b, a: a, h: h, s: s, v: v, hex: val.call($this, 'hex'), ahex: val.call($this, 'ahex') };
- default:
- var ret={};
- for (var i = 0; i < name.length; i++)
- {
- switch (name.charAt(i))
- {
- case 'r':
- if (name.length == 1) ret = r;
- else ret.r = r;
- break;
- case 'g':
- if (name.length == 1) ret = g;
- else ret.g = g;
- break;
- case 'b':
- if (name.length == 1) ret = b;
- else ret.b = b;
- break;
- case 'a':
- if (name.length == 1) ret = a;
- else ret.a = a;
- break;
- case 'h':
- if (name.length == 1) ret = h;
- else ret.h = h;
- break;
- case 's':
- if (name.length == 1) ret = s;
- else ret.s = s;
- break;
- case 'v':
- if (name.length == 1) ret = v;
- else ret.v = v;
- break;
- }
- }
- return ret == {} ? val.call($this, 'all') : ret;
- break;
- }
- }
- if (context != null && context == $this) return;
- var changed = false;
- if (name == null) name = '';
- if (value == null)
- {
- if (r != null)
- {
- r = null;
- changed = true;
- }
- if (g != null)
- {
- g = null;
- changed = true;
- }
- if (b != null)
- {
- b = null;
- changed = true;
- }
- if (a != null)
- {
- a = null;
- changed = true;
- }
- if (h != null)
- {
- h = null;
- changed = true;
- }
- if (s != null)
- {
- s = null;
- changed = true;
- }
- if (v != null)
- {
- v = null;
- changed = true;
- }
- changed && fireChangeEvents.call($this, context || $this);
- return;
- }
- switch (name.toLowerCase())
- {
- case 'ahex':
- case 'hex':
- var ret = ColorMethods.hexToRgba(value && (value.ahex || value.hex) || value || '00000000');
- val.call($this, 'rgba', { r: ret.r, g: ret.g, b: ret.b, a: name == 'ahex' ? ret.a : a != null ? a : 255 }, context);
- break;
- default:
- if (value && (value.ahex != null || value.hex != null))
- {
- val.call($this, 'ahex', value.ahex || value.hex || '00000000', context);
- return;
- }
- var newV = {}, rgb = false, hsv = false;
- if (value.r !== undefined && !name.indexOf('r') == -1) name += 'r';
- if (value.g !== undefined && !name.indexOf('g') == -1) name += 'g';
- if (value.b !== undefined && !name.indexOf('b') == -1) name += 'b';
- if (value.a !== undefined && !name.indexOf('a') == -1) name += 'a';
- if (value.h !== undefined && !name.indexOf('h') == -1) name += 'h';
- if (value.s !== undefined && !name.indexOf('s') == -1) name += 's';
- if (value.v !== undefined && !name.indexOf('v') == -1) name += 'v';
- for (var i = 0; i < name.length; i++)
- {
- switch (name.charAt(i))
- {
- case 'r':
- if (hsv) continue;
- rgb = true;
- newV.r = value && value.r && value.r | 0 || value && value | 0 || 0;
- if (newV.r < 0) newV.r = 0;
- else if (newV.r > 255) newV.r = 255;
- if (r != newV.r)
- {
- r = newV.r;
- changed = true;
- }
- break;
- case 'g':
- if (hsv) continue;
- rgb = true;
- newV.g = value && value.g && value.g | 0 || value && value | 0 || 0;
- if (newV.g < 0) newV.g = 0;
- else if (newV.g > 255) newV.g = 255;
- if (g != newV.g)
- {
- g = newV.g;
- changed = true;
- }
- break;
- case 'b':
- if (hsv) continue;
- rgb = true;
- newV.b = value && value.b && value.b | 0 || value && value | 0 || 0;
- if (newV.b < 0) newV.b = 0;
- else if (newV.b > 255) newV.b = 255;
- if (b != newV.b)
- {
- b = newV.b;
- changed = true;
- }
- break;
- case 'a':
- newV.a = value && value.a != null ? value.a | 0 : value != null ? value | 0 : 255;
- if (newV.a < 0) newV.a = 0;
- else if (newV.a > 255) newV.a = 255;
- if (a != newV.a)
- {
- a = newV.a;
- changed = true;
- }
- break;
- case 'h':
- if (rgb) continue;
- hsv = true;
- newV.h = value && value.h && value.h | 0 || value && value | 0 || 0;
- if (newV.h < 0) newV.h = 0;
- else if (newV.h > 360) newV.h = 360;
- if (h != newV.h)
- {
- h = newV.h;
- changed = true;
- }
- break;
- case 's':
- if (rgb) continue;
- hsv = true;
- newV.s = value && value.s != null ? value.s | 0 : value != null ? value | 0 : 100;
- if (newV.s < 0) newV.s = 0;
- else if (newV.s > 100) newV.s = 100;
- if (s != newV.s)
- {
- s = newV.s;
- changed = true;
- }
- break;
- case 'v':
- if (rgb) continue;
- hsv = true;
- newV.v = value && value.v != null ? value.v | 0 : value != null ? value | 0 : 100;
- if (newV.v < 0) newV.v = 0;
- else if (newV.v > 100) newV.v = 100;
- if (v != newV.v)
- {
- v = newV.v;
- changed = true;
- }
- break;
- }
- }
- if (changed)
- {
- if (rgb)
- {
- r = r || 0;
- g = g || 0;
- b = b || 0;
- var ret = ColorMethods.rgbToHsv({ r: r, g: g, b: b });
- h = ret.h;
- s = ret.s;
- v = ret.v;
- }
- else if (hsv)
- {
- h = h || 0;
- s = s != null ? s : 100;
- v = v != null ? v : 100;
- var ret = ColorMethods.hsvToRgb({ h: h, s: s, v: v });
- r = ret.r;
- g = ret.g;
- b = ret.b;
- }
- a = a != null ? a : 255;
- fireChangeEvents.call($this, context || $this);
- }
- break;
- }
- },
- bind =
- function(callback)
- {
- if ($.isFunction(callback)) changeEvents.push(callback);
- },
- unbind =
- function(callback)
- {
- if (!$.isFunction(callback)) return;
- var i;
- while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1);
- },
- destroy =
- function()
- {
- changeEvents = null;
- }
- $.extend(true, $this, // public properties and methods
- {
- val: val,
- bind: bind,
- unbind: unbind,
- destroy: destroy
- });
- if (init)
- {
- if (init.ahex != null) val('ahex', init);
- else if (init.hex != null) val((init.a != null ? 'a' : '') + 'hex', init.a != null ? { ahex: init.hex + ColorMethods.intToHex(init.a) } : init);
- else if (init.r != null && init.g != null && init.b != null) val('rgb' + (init.a != null ? 'a' : ''), init);
- else if (init.h != null && init.s != null && init.v != null) val('hsv' + (init.a != null ? 'a' : ''), init);
- }
- },
- ColorMethods: // color conversion methods - make public to give use to external scripts
- {
- hexToRgba:
- function(hex)
- {
- hex = this.validateHex(hex);
- if (hex == '') return { r: null, g: null, b: null, a: null };
- var r = '00', g = '00', b = '00', a = '255';
- if (hex.length == 6) hex += 'ff';
- if (hex.length > 6)
- {
- r = hex.substring(0, 2);
- g = hex.substring(2, 4);
- b = hex.substring(4, 6);
- a = hex.substring(6, hex.length);
- }
- else
- {
- if (hex.length > 4)
- {
- r = hex.substring(4, hex.length);
- hex = hex.substring(0, 4);
- }
- if (hex.length > 2)
- {
- g = hex.substring(2, hex.length);
- hex = hex.substring(0, 2);
- }
- if (hex.length > 0) b = hex.substring(0, hex.length);
- }
- return { r: this.hexToInt(r), g: this.hexToInt(g), b: this.hexToInt(b), a: this.hexToInt(a) };
- },
- validateHex:
- function(hex)
- {
- hex = hex.toLowerCase().replace(/[^a-f0-9]/g, '');
- if (hex.length > 8) hex = hex.substring(0, 8);
- return hex;
- },
- rgbaToHex:
- function(rgba)
- {
- return this.intToHex(rgba.r) + this.intToHex(rgba.g) + this.intToHex(rgba.b) + this.intToHex(rgba.a);
- },
- intToHex:
- function(dec)
- {
- var result = (dec | 0).toString(16);
- if (result.length == 1) result = ('0' + result);
- return result.toLowerCase();
- },
- hexToInt:
- function(hex)
- {
- return parseInt(hex, 16);
- },
- rgbToHsv:
- function(rgb)
- {
- var r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255, hsv = { h: 0, s: 0, v: 0 }, min = 0, max = 0, delta;
- if (r >= g && r >= b)
- {
- max = r;
- min = g > b ? b : g;
- }
- else if (g >= b && g >= r)
- {
- max = g;
- min = r > b ? b : r;
- }
- else
- {
- max = b;
- min = g > r ? r : g;
- }
- hsv.v = max;
- hsv.s = max ? (max - min) / max : 0;
- if (!hsv.s) hsv.h = 0;
- else
- {
- delta = max - min;
- if (r == max) hsv.h = (g - b) / delta;
- else if (g == max) hsv.h = 2 + (b - r) / delta;
- else hsv.h = 4 + (r - g) / delta;
- hsv.h = parseInt(hsv.h * 60);
- if (hsv.h < 0) hsv.h += 360;
- }
- hsv.s = (hsv.s * 100) | 0;
- hsv.v = (hsv.v * 100) | 0;
- return hsv;
- },
- hsvToRgb:
- function(hsv)
- {
- var rgb = { r: 0, g: 0, b: 0, a: 100 }, h = hsv.h, s = hsv.s, v = hsv.v;
- if (s == 0)
- {
- if (v == 0) rgb.r = rgb.g = rgb.b = 0;
- else rgb.r = rgb.g = rgb.b = (v * 255 / 100) | 0;
- }
- else
- {
- if (h == 360) h = 0;
- h /= 60;
- s = s / 100;
- v = v / 100;
- var i = h | 0,
- f = h - i,
- p = v * (1 - s),
- q = v * (1 - (s * f)),
- t = v * (1 - (s * (1 - f)));
- switch (i)
- {
- case 0:
- rgb.r = v;
- rgb.g = t;
- rgb.b = p;
- break;
- case 1:
- rgb.r = q;
- rgb.g = v;
- rgb.b = p;
- break;
- case 2:
- rgb.r = p;
- rgb.g = v;
- rgb.b = t;
- break;
- case 3:
- rgb.r = p;
- rgb.g = q;
- rgb.b = v;
- break;
- case 4:
- rgb.r = t;
- rgb.g = p;
- rgb.b = v;
- break;
- case 5:
- rgb.r = v;
- rgb.g = p;
- rgb.b = q;
- break;
- }
- rgb.r = (rgb.r * 255) | 0;
- rgb.g = (rgb.g * 255) | 0;
- rgb.b = (rgb.b * 255) | 0;
- }
- return rgb;
- }
- }
- };
- var Color = $.jPicker.Color, List = $.jPicker.List, ColorMethods = $.jPicker.ColorMethods; // local copies for YUI compressor
- $.fn.jPicker =
- function(options)
- {
- var $arguments = arguments;
- return this.each(
- function()
- {
- var $this = this, settings = $.extend(true, {}, $.fn.jPicker.defaults, options); // local copies for YUI compressor
- if ($($this).get(0).nodeName.toLowerCase() == 'input') // Add color picker icon if binding to an input element and bind the events to the input
- {
- $.extend(true, settings,
- {
- window:
- {
- bindToInput: true,
- expandable: true,
- input: $($this)
- }
- });
- if($($this).val()=='')
- {
- settings.color.active = new Color({ hex: null });
- settings.color.current = new Color({ hex: null });
- }
- else if (ColorMethods.validateHex($($this).val()))
- {
- settings.color.active = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
- settings.color.current = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
- }
- }
- if (settings.window.expandable)
- $($this).after('');
- else settings.window.liveUpdate = false; // Basic control binding for inline use - You will need to override the liveCallback or commitCallback function to retrieve results
- var isLessThanIE7 = parseFloat(navigator.appVersion.split('MSIE')[1]) < 7 && document.body.filters, // needed to run the AlphaImageLoader function for IE6
- container = null,
- colorMapDiv = null,
- colorBarDiv = null,
- colorMapL1 = null, // different layers of colorMap and colorBar
- colorMapL2 = null,
- colorMapL3 = null,
- colorBarL1 = null,
- colorBarL2 = null,
- colorBarL3 = null,
- colorBarL4 = null,
- colorBarL5 = null,
- colorBarL6 = null,
- colorMap = null, // color maps
- colorBar = null,
- colorPicker = null,
- elementStartX = null, // Used to record the starting css positions for dragging the control
- elementStartY = null,
- pageStartX = null, // Used to record the mousedown coordinates for dragging the control
- pageStartY = null,
- activePreview = null, // color boxes above the radio buttons
- currentPreview = null,
- okButton = null,
- cancelButton = null,
- grid = null, // preset colors grid
- iconColor = null, // iconColor for popup icon
- iconAlpha = null, // iconAlpha for popup icon
- iconImage = null, // iconImage popup icon
- moveBar = null, // drag bar
- setColorMode = // set color mode and update visuals for the new color mode
- function(colorMode)
- {
- var active = color.active, // local copies for YUI compressor
- clientPath = images.clientPath,
- hex = active.val('hex'),
- rgbMap,
- rgbBar;
- settings.color.mode = colorMode;
- switch (colorMode)
- {
- case 'h':
- setTimeout(
- function()
- {
- setBG.call($this, colorMapDiv, 'transparent');
- setImgLoc.call($this, colorMapL1, 0);
- setAlpha.call($this, colorMapL1, 100);
- setImgLoc.call($this, colorMapL2, 260);
- setAlpha.call($this, colorMapL2, 100);
- setBG.call($this, colorBarDiv, 'transparent');
- setImgLoc.call($this, colorBarL1, 0);
- setAlpha.call($this, colorBarL1, 100);
- setImgLoc.call($this, colorBarL2, 260);
- setAlpha.call($this, colorBarL2, 100);
- setImgLoc.call($this, colorBarL3, 260);
- setAlpha.call($this, colorBarL3, 100);
- setImgLoc.call($this, colorBarL4, 260);
- setAlpha.call($this, colorBarL4, 100);
- setImgLoc.call($this, colorBarL6, 260);
- setAlpha.call($this, colorBarL6, 100);
- }, 0);
- colorMap.range('all', { minX: 0, maxX: 100, minY: 0, maxY: 100 });
- colorBar.range('rangeY', { minY: 0, maxY: 360 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('s'), y: 100 - active.val('v') }, colorMap);
- colorBar.val('y', 360 - active.val('h'), colorBar);
- break;
- case 's':
- setTimeout(
- function()
- {
- setBG.call($this, colorMapDiv, 'transparent');
- setImgLoc.call($this, colorMapL1, -260);
- setImgLoc.call($this, colorMapL2, -520);
- setImgLoc.call($this, colorBarL1, -260);
- setImgLoc.call($this, colorBarL2, -520);
- setImgLoc.call($this, colorBarL6, 260);
- setAlpha.call($this, colorBarL6, 100);
- }, 0);
- colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
- colorBar.range('rangeY', { minY: 0, maxY: 100 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap);
- colorBar.val('y', 100 - active.val('s'), colorBar);
- break;
- case 'v':
- setTimeout(
- function()
- {
- setBG.call($this, colorMapDiv, '000000');
- setImgLoc.call($this, colorMapL1, -780);
- setImgLoc.call($this, colorMapL2, 260);
- setBG.call($this, colorBarDiv, hex);
- setImgLoc.call($this, colorBarL1, -520);
- setImgLoc.call($this, colorBarL2, 260);
- setAlpha.call($this, colorBarL2, 100);
- setImgLoc.call($this, colorBarL6, 260);
- setAlpha.call($this, colorBarL6, 100);
- }, 0);
- colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
- colorBar.range('rangeY', { minY: 0, maxY: 100 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('s') }, colorMap);
- colorBar.val('y', 100 - active.val('v'), colorBar);
- break;
- case 'r':
- rgbMap = -1040;
- rgbBar = -780;
- colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
- colorBar.range('rangeY', { minY: 0, maxY: 255 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('g') }, colorMap);
- colorBar.val('y', 255 - active.val('r'), colorBar);
- break;
- case 'g':
- rgbMap = -1560;
- rgbBar = -1820;
- colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
- colorBar.range('rangeY', { minY: 0, maxY: 255 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('r') }, colorMap);
- colorBar.val('y', 255 - active.val('g'), colorBar);
- break;
- case 'b':
- rgbMap = -2080;
- rgbBar = -2860;
- colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
- colorBar.range('rangeY', { minY: 0, maxY: 255 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('r'), y: 255 - active.val('g') }, colorMap);
- colorBar.val('y', 255 - active.val('b'), colorBar);
- break;
- case 'a':
- setTimeout(
- function()
- {
- setBG.call($this, colorMapDiv, 'transparent');
- setImgLoc.call($this, colorMapL1, -260);
- setImgLoc.call($this, colorMapL2, -520);
- setImgLoc.call($this, colorBarL1, 260);
- setImgLoc.call($this, colorBarL2, 260);
- setAlpha.call($this, colorBarL2, 100);
- setImgLoc.call($this, colorBarL6, 0);
- setAlpha.call($this, colorBarL6, 100);
- }, 0);
- colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
- colorBar.range('rangeY', { minY: 0, maxY: 255 });
- if (active.val('ahex') == null) break;
- colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap);
- colorBar.val('y', 255 - active.val('a'), colorBar);
- break;
- default:
- throw ('Invalid Mode');
- break;
- }
- switch (colorMode)
- {
- case 'h':
- break;
- case 's':
- case 'v':
- case 'a':
- setTimeout(
- function()
- {
- setAlpha.call($this, colorMapL1, 100);
- setAlpha.call($this, colorBarL1, 100);
- setImgLoc.call($this, colorBarL3, 260);
- setAlpha.call($this, colorBarL3, 100);
- setImgLoc.call($this, colorBarL4, 260);
- setAlpha.call($this, colorBarL4, 100);
- }, 0);
- break;
- case 'r':
- case 'g':
- case 'b':
- setTimeout(
- function()
- {
- setBG.call($this, colorMapDiv, 'transparent');
- setBG.call($this, colorBarDiv, 'transparent');
- setAlpha.call($this, colorBarL1, 100);
- setAlpha.call($this, colorMapL1, 100);
- setImgLoc.call($this, colorMapL1, rgbMap);
- setImgLoc.call($this, colorMapL2, rgbMap - 260);
- setImgLoc.call($this, colorBarL1, rgbBar - 780);
- setImgLoc.call($this, colorBarL2, rgbBar - 520);
- setImgLoc.call($this, colorBarL3, rgbBar);
- setImgLoc.call($this, colorBarL4, rgbBar - 260);
- setImgLoc.call($this, colorBarL6, 260);
- setAlpha.call($this, colorBarL6, 100);
- }, 0);
- break;
- }
- if (active.val('ahex') == null) return;
- activeColorChanged.call($this, active);
- },
- activeColorChanged = // Update color when user changes text values
- function(ui, context)
- {
- if (context == null || (context != colorBar && context != colorMap)) positionMapAndBarArrows.call($this, ui, context);
- setTimeout(
- function()
- {
- updatePreview.call($this, ui);
- updateMapVisuals.call($this, ui);
- updateBarVisuals.call($this, ui);
- }, 0);
- },
- mapValueChanged = // user has dragged the ColorMap pointer
- function(ui, context)
- {
- var active = color.active;
- if (context != colorMap && active.val() == null) return;
- var xy = ui.val('all');
- switch (settings.color.mode)
- {
- case 'h':
- active.val('sv', { s: xy.x, v: 100 - xy.y }, context);
- break;
- case 's':
- case 'a':
- active.val('hv', { h: xy.x, v: 100 - xy.y }, context);
- break;
- case 'v':
- active.val('hs', { h: xy.x, s: 100 - xy.y }, context);
- break;
- case 'r':
- active.val('gb', { g: 255 - xy.y, b: xy.x }, context);
- break;
- case 'g':
- active.val('rb', { r: 255 - xy.y, b: xy.x }, context);
- break;
- case 'b':
- active.val('rg', { r: xy.x, g: 255 - xy.y }, context);
- break;
- }
- },
- colorBarValueChanged = // user has dragged the ColorBar slider
- function(ui, context)
- {
- var active = color.active;
- if (context != colorBar && active.val() == null) return;
- switch (settings.color.mode)
- {
- case 'h':
- active.val('h', { h: 360 - ui.val('y') }, context);
- break;
- case 's':
- active.val('s', { s: 100 - ui.val('y') }, context);
- break;
- case 'v':
- active.val('v', { v: 100 - ui.val('y') }, context);
- break;
- case 'r':
- active.val('r', { r: 255 - ui.val('y') }, context);
- break;
- case 'g':
- active.val('g', { g: 255 - ui.val('y') }, context);
- break;
- case 'b':
- active.val('b', { b: 255 - ui.val('y') }, context);
- break;
- case 'a':
- active.val('a', 255 - ui.val('y'), context);
- break;
- }
- },
- positionMapAndBarArrows = // position map and bar arrows to match current color
- function(ui, context)
- {
- if (context != colorMap)
- {
- switch (settings.color.mode)
- {
- case 'h':
- var sv = ui.val('sv');
- colorMap.val('xy', { x: sv != null ? sv.s : 100, y: 100 - (sv != null ? sv.v : 100) }, context);
- break;
- case 's':
- case 'a':
- var hv = ui.val('hv');
- colorMap.val('xy', { x: hv && hv.h || 0, y: 100 - (hv != null ? hv.v : 100) }, context);
- break;
- case 'v':
- var hs = ui.val('hs');
- colorMap.val('xy', { x: hs && hs.h || 0, y: 100 - (hs != null ? hs.s : 100) }, context);
- break;
- case 'r':
- var bg = ui.val('bg');
- colorMap.val('xy', { x: bg && bg.b || 0, y: 255 - (bg && bg.g || 0) }, context);
- break;
- case 'g':
- var br = ui.val('br');
- colorMap.val('xy', { x: br && br.b || 0, y: 255 - (br && br.r || 0) }, context);
- break;
- case 'b':
- var rg = ui.val('rg');
- colorMap.val('xy', { x: rg && rg.r || 0, y: 255 - (rg && rg.g || 0) }, context);
- break;
- }
- }
- if (context != colorBar)
- {
- switch (settings.color.mode)
- {
- case 'h':
- colorBar.val('y', 360 - (ui.val('h') || 0), context);
- break;
- case 's':
- var s = ui.val('s');
- colorBar.val('y', 100 - (s != null ? s : 100), context);
- break;
- case 'v':
- var v = ui.val('v');
- colorBar.val('y', 100 - (v != null ? v : 100), context);
- break;
- case 'r':
- colorBar.val('y', 255 - (ui.val('r') || 0), context);
- break;
- case 'g':
- colorBar.val('y', 255 - (ui.val('g') || 0), context);
- break;
- case 'b':
- colorBar.val('y', 255 - (ui.val('b') || 0), context);
- break;
- case 'a':
- var a = ui.val('a');
- colorBar.val('y', 255 - (a != null ? a : 255), context);
- break;
- }
- }
- },
- updatePreview =
- function(ui)
- {
- try
- {
- var all = ui.val('all');
- activePreview.css({ backgroundColor: all && '#' + all.hex || 'transparent' });
- setAlpha.call($this, activePreview, all && Math.precision((all.a * 100) / 255, 4) || 0);
- }
- catch (e) { }
- },
- updateMapVisuals =
- function(ui)
- {
- switch (settings.color.mode)
- {
- case 'h':
- setBG.call($this, colorMapDiv, new Color({ h: ui.val('h') || 0, s: 100, v: 100 }).val('hex'));
- break;
- case 's':
- case 'a':
- var s = ui.val('s');
- setAlpha.call($this, colorMapL2, 100 - (s != null ? s : 100));
- break;
- case 'v':
- var v = ui.val('v');
- setAlpha.call($this, colorMapL1, v != null ? v : 100);
- break;
- case 'r':
- setAlpha.call($this, colorMapL2, Math.precision((ui.val('r') || 0) / 255 * 100, 4));
- break;
- case 'g':
- setAlpha.call($this, colorMapL2, Math.precision((ui.val('g') || 0) / 255 * 100, 4));
- break;
- case 'b':
- setAlpha.call($this, colorMapL2, Math.precision((ui.val('b') || 0) / 255 * 100));
- break;
- }
- var a = ui.val('a');
- setAlpha.call($this, colorMapL3, Math.precision(((255 - (a || 0)) * 100) / 255, 4));
- },
- updateBarVisuals =
- function(ui)
- {
- switch (settings.color.mode)
- {
- case 'h':
- var a = ui.val('a');
- setAlpha.call($this, colorBarL5, Math.precision(((255 - (a || 0)) * 100) / 255, 4));
- break;
- case 's':
- var hva = ui.val('hva'),
- saturatedColor = new Color({ h: hva && hva.h || 0, s: 100, v: hva != null ? hva.v : 100 });
- setBG.call($this, colorBarDiv, saturatedColor.val('hex'));
- setAlpha.call($this, colorBarL2, 100 - (hva != null ? hva.v : 100));
- setAlpha.call($this, colorBarL5, Math.precision(((255 - (hva && hva.a || 0)) * 100) / 255, 4));
- break;
- case 'v':
- var hsa = ui.val('hsa'),
- valueColor = new Color({ h: hsa && hsa.h || 0, s: hsa != null ? hsa.s : 100, v: 100 });
- setBG.call($this, colorBarDiv, valueColor.val('hex'));
- setAlpha.call($this, colorBarL5, Math.precision(((255 - (hsa && hsa.a || 0)) * 100) / 255, 4));
- break;
- case 'r':
- case 'g':
- case 'b':
- var hValue = 0, vValue = 0, rgba = ui.val('rgba');
- if (settings.color.mode == 'r')
- {
- hValue = rgba && rgba.b || 0;
- vValue = rgba && rgba.g || 0;
- }
- else if (settings.color.mode == 'g')
- {
- hValue = rgba && rgba.b || 0;
- vValue = rgba && rgba.r || 0;
- }
- else if (settings.color.mode == 'b')
- {
- hValue = rgba && rgba.r || 0;
- vValue = rgba && rgba.g || 0;
- }
- var middle = vValue > hValue ? hValue : vValue;
- setAlpha.call($this, colorBarL2, hValue > vValue ? Math.precision(((hValue - vValue) / (255 - vValue)) * 100, 4) : 0);
- setAlpha.call($this, colorBarL3, vValue > hValue ? Math.precision(((vValue - hValue) / (255 - hValue)) * 100, 4) : 0);
- setAlpha.call($this, colorBarL4, Math.precision((middle / 255) * 100, 4));
- setAlpha.call($this, colorBarL5, Math.precision(((255 - (rgba && rgba.a || 0)) * 100) / 255, 4));
- break;
- case 'a':
- var a = ui.val('a');
- setBG.call($this, colorBarDiv, ui.val('hex') || '000000');
- setAlpha.call($this, colorBarL5, a != null ? 0 : 100);
- setAlpha.call($this, colorBarL6, a != null ? 100 : 0);
- break;
- }
- },
- setBG =
- function(el, c)
- {
- el.css({ backgroundColor: c && c.length == 6 && '#' + c || 'transparent' });
- },
- setImg =
- function(img, src)
- {
- if (isLessThanIE7 && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1))
- {
- img.attr('pngSrc', src);
- img.css({ backgroundImage: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' });
- }
- else img.css({ backgroundImage: 'url(\'' + src + '\')' });
- },
- setImgLoc =
- function(img, y)
- {
- img.css({ top: y + 'px' });
- },
- setAlpha =
- function(obj, alpha)
- {
- obj.css({ visibility: alpha > 0 ? 'visible' : 'hidden' });
- if (alpha > 0 && alpha < 100)
- {
- if (isLessThanIE7)
- {
- var src = obj.attr('pngSrc');
- if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1))
- obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\') progid:DXImageTransform.Microsoft.Alpha(opacity=' + alpha + ')' });
- else obj.css({ opacity: Math.precision(alpha / 100, 4) });
- }
- else obj.css({ opacity: Math.precision(alpha / 100, 4) });
- }
- else if (alpha == 0 || alpha == 100)
- {
- if (isLessThanIE7)
- {
- var src = obj.attr('pngSrc');
- if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1))
- obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' });
- else obj.css({ opacity: '' });
- }
- else obj.css({ opacity: '' });
- }
- },
- revertColor = // revert color to original color when opened
- function()
- {
- color.active.val('ahex', color.current.val('ahex'));
- },
- commitColor = // commit the color changes
- function()
- {
- color.current.val('ahex', color.active.val('ahex'));
- },
- radioClicked =
- function(e)
- {
- $(this).parents('tbody:first').find('input:radio[value!="'+e.target.value+'"]').removeAttr('checked');
- setColorMode.call($this, e.target.value);
- },
- currentClicked =
- function()
- {
- revertColor.call($this);
- },
- cancelClicked =
- function()
- {
- revertColor.call($this);
- settings.window.expandable && hide.call($this);
- $.isFunction(cancelCallback) && cancelCallback.call($this, color.active, cancelButton);
- },
- okClicked =
- function()
- {
- commitColor.call($this);
- settings.window.expandable && hide.call($this);
- $.isFunction(commitCallback) && commitCallback.call($this, color.active, okButton);
- },
- iconImageClicked =
- function()
- {
- show.call($this);
- },
- currentColorChanged =
- function(ui, context)
- {
- var hex = ui.val('hex');
- currentPreview.css({ backgroundColor: hex && '#' + hex || 'transparent' });
- setAlpha.call($this, currentPreview, Math.precision(((ui.val('a') || 0) * 100) / 255, 4));
- },
- expandableColorChanged =
- function(ui, context)
- {
- var hex = ui.val('hex');
- var va = ui.val('va');
- iconColor.css({ backgroundColor: hex && '#' + hex || 'transparent' });
- setAlpha.call($this, iconAlpha, Math.precision(((255 - (va && va.a || 0)) * 100) / 255, 4));
- if (settings.window.bindToInput&&settings.window.updateInputColor)
- settings.window.input.css(
- {
- backgroundColor: hex && '#' + hex || 'transparent',
- color: va == null || va.v > 75 ? '#000000' : '#ffffff'
- });
- },
- moveBarMouseDown =
- function(e)
- {
- var element = settings.window.element, // local copies for YUI compressor
- page = settings.window.page;
- elementStartX = parseInt(container.css('left'));
- elementStartY = parseInt(container.css('top'));
- pageStartX = e.pageX;
- pageStartY = e.pageY;
- // bind events to document to move window - we will unbind these on mouseup
- $(document).bind('mousemove', documentMouseMove).bind('mouseup', documentMouseUp);
- e.preventDefault(); // prevent attempted dragging of the column
- },
- documentMouseMove =
- function(e)
- {
- container.css({ left: elementStartX - (pageStartX - e.pageX) + 'px', top: elementStartY - (pageStartY - e.pageY) + 'px' });
- if (settings.window.expandable && !$.support.boxModel) container.prev().css({ left: container.css("left"), top: container.css("top") });
- e.stopPropagation();
- e.preventDefault();
- return false;
- },
- documentMouseUp =
- function(e)
- {
- $(document).unbind('mousemove', documentMouseMove).unbind('mouseup', documentMouseUp);
- e.stopPropagation();
- e.preventDefault();
- return false;
- },
- quickPickClicked =
- function(e)
- {
- e.preventDefault();
- e.stopPropagation();
- color.active.val('ahex', $(this).attr('title') || null, e.target);
- return false;
- },
- commitCallback = $.isFunction($arguments[1]) && $arguments[1] || null,
- liveCallback = $.isFunction($arguments[2]) && $arguments[2] || null,
- cancelCallback = $.isFunction($arguments[3]) && $arguments[3] || null,
- show =
- function()
- {
- color.current.val('ahex', color.active.val('ahex'));
- var attachIFrame = function()
- {
- if (!settings.window.expandable || $.support.boxModel) return;
- var table = container.find('table:first');
- container.before('');
- container.prev().css({ width: table.width(), height: container.height(), opacity: 0, position: 'absolute', left: container.css("left"), top: container.css("top") });
- };
- if (settings.window.expandable)
- {
- $(document.body).children('div.jPicker.Container').css({zIndex:10});
- container.css({zIndex:20});
- }
- switch (settings.window.effects.type)
- {
- case 'fade':
- container.fadeIn(settings.window.effects.speed.show, attachIFrame);
- break;
- case 'slide':
- container.slideDown(settings.window.effects.speed.show, attachIFrame);
- break;
- case 'show':
- default:
- container.show(settings.window.effects.speed.show, attachIFrame);
- break;
- }
- },
- hide =
- function()
- {
- var removeIFrame = function()
- {
- if (settings.window.expandable) container.css({ zIndex: 10 });
- if (!settings.window.expandable || $.support.boxModel) return;
- container.prev().remove();
- };
- switch (settings.window.effects.type)
- {
- case 'fade':
- container.fadeOut(settings.window.effects.speed.hide, removeIFrame);
- break;
- case 'slide':
- container.slideUp(settings.window.effects.speed.hide, removeIFrame);
- break;
- case 'show':
- default:
- container.hide(settings.window.effects.speed.hide, removeIFrame);
- break;
- }
- },
- initialize =
- function()
- {
- var win = settings.window,
- popup = win.expandable ? $($this).next().find('.Container:first') : null;
- container = win.expandable ? $('') : $($this);
- container.addClass('jPicker Container');
- if (win.expandable) container.hide();
- container.get(0).onselectstart = function(event){ if (event.target.nodeName.toLowerCase() !== 'input') return false; };
- // inject html source code - we are using a single table for this control - I know tables are considered bad, but it takes care of equal height columns and
- // this control really is tabular data, so I believe it is the right move
- var all = color.active.val('all');
- if (win.alphaPrecision < 0) win.alphaPrecision = 0;
- else if (win.alphaPrecision > 2) win.alphaPrecision = 2;
- var controlHtml='
' + (win.expandable ? '
' : '') + '
' + (win.title || localization.text.title) + '
' + localization.text.newColor + '
' + localization.text.currentColor + '
°
%
%
' + (win.alphaSupport ? '' : ' ') + '
' + (win.alphaSupport ? ' %' : ' ') + '
' + (win.alphaSupport ? '
' : ' ') + '
';
- if (win.expandable)
- {
- container.html(controlHtml);
- if($(document.body).children('div.jPicker.Container').length==0)$(document.body).prepend(container);
- else $(document.body).children('div.jPicker.Container:last').after(container);
- container.mousedown(
- function()
- {
- $(document.body).children('div.jPicker.Container').css({zIndex:10});
- container.css({zIndex:20});
- });
- container.css( // positions must be set and display set to absolute before source code injection or IE will size the container to fit the window
- {
- left:
- win.position.x == 'left' ? (popup.offset().left - 530 - (win.position.y == 'center' ? 25 : 0)) + 'px' :
- win.position.x == 'center' ? (popup.offset().left - 260) + 'px' :
- win.position.x == 'right' ? (popup.offset().left - 10 + (win.position.y == 'center' ? 25 : 0)) + 'px' :
- win.position.x == 'screenCenter' ? (($(document).width() >> 1) - 260) + 'px' : (popup.offset().left + parseInt(win.position.x)) + 'px',
- position: 'absolute',
- top: win.position.y == 'top' ? (popup.offset().top - 312) + 'px' :
- win.position.y == 'center' ? (popup.offset().top - 156) + 'px' :
- win.position.y == 'bottom' ? (popup.offset().top + 25) + 'px' : (popup.offset().top + parseInt(win.position.y)) + 'px'
- });
- }
- else
- {
- container = $($this);
- container.html(controlHtml);
- }
- // initialize the objects to the source code just injected
- var tbody = container.find('tbody:first');
- colorMapDiv = tbody.find('div.Map:first');
- colorBarDiv = tbody.find('div.Bar:first');
- var MapMaps = colorMapDiv.find('span'),
- BarMaps = colorBarDiv.find('span');
- colorMapL1 = MapMaps.filter('.Map1:first');
- colorMapL2 = MapMaps.filter('.Map2:first');
- colorMapL3 = MapMaps.filter('.Map3:first');
- colorBarL1 = BarMaps.filter('.Map1:first');
- colorBarL2 = BarMaps.filter('.Map2:first');
- colorBarL3 = BarMaps.filter('.Map3:first');
- colorBarL4 = BarMaps.filter('.Map4:first');
- colorBarL5 = BarMaps.filter('.Map5:first');
- colorBarL6 = BarMaps.filter('.Map6:first');
- // create color pickers and maps
- colorMap = new Slider(colorMapDiv,
- {
- map:
- {
- width: images.colorMap.width,
- height: images.colorMap.height
- },
- arrow:
- {
- image: images.clientPath + images.colorMap.arrow.file,
- width: images.colorMap.arrow.width,
- height: images.colorMap.arrow.height
- }
- });
- colorMap.bind(mapValueChanged);
- colorBar = new Slider(colorBarDiv,
- {
- map:
- {
- width: images.colorBar.width,
- height: images.colorBar.height
- },
- arrow:
- {
- image: images.clientPath + images.colorBar.arrow.file,
- width: images.colorBar.arrow.width,
- height: images.colorBar.arrow.height
- }
- });
- colorBar.bind(colorBarValueChanged);
- colorPicker = new ColorValuePicker(tbody, color.active, win.expandable && win.bindToInput ? win.input : null, win.alphaPrecision);
- var hex = all != null ? all.hex : null,
- preview = tbody.find('.Preview'),
- button = tbody.find('.Button');
- activePreview = preview.find('.Active:first').css({ backgroundColor: hex && '#' + hex || 'transparent' });
- currentPreview = preview.find('.Current:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }).bind('click', currentClicked);
- setAlpha.call($this, currentPreview, Math.precision(color.current.val('a') * 100) / 255, 4);
- okButton = button.find('.Ok:first').bind('click', okClicked);
- cancelButton = button.find('.Cancel:first').bind('click', cancelClicked);
- grid = button.find('.Grid:first');
- setTimeout(
- function()
- {
- setImg.call($this, colorMapL1, images.clientPath + 'Maps.png');
- setImg.call($this, colorMapL2, images.clientPath + 'Maps.png');
- setImg.call($this, colorMapL3, images.clientPath + 'map-opacity.png');
- setImg.call($this, colorBarL1, images.clientPath + 'Bars.png');
- setImg.call($this, colorBarL2, images.clientPath + 'Bars.png');
- setImg.call($this, colorBarL3, images.clientPath + 'Bars.png');
- setImg.call($this, colorBarL4, images.clientPath + 'Bars.png');
- setImg.call($this, colorBarL5, images.clientPath + 'bar-opacity.png');
- setImg.call($this, colorBarL6, images.clientPath + 'AlphaBar.png');
- setImg.call($this, preview.find('div:first'), images.clientPath + 'preview-opacity.png');
- }, 0);
- tbody.find('td.Radio input').bind('click', radioClicked);
- // initialize quick list
- if (color.quickList && color.quickList.length > 0)
- {
- var html = '';
- for (i = 0; i < color.quickList.length; i++)
- {
- /* if default colors are hex strings, change them to color objects */
- if ((typeof (color.quickList[i])).toString().toLowerCase() == 'string') color.quickList[i] = new Color({ hex: color.quickList[i] });
- var alpha = color.quickList[i].val('a');
- var ahex = color.quickList[i].val('ahex');
- if (!win.alphaSupport && ahex) ahex = ahex.substring(0, 6) + 'ff';
- var quickHex = color.quickList[i].val('hex');
- html+='';
- }
- setImg.call($this, grid, images.clientPath + 'bar-opacity.png');
- grid.html(html);
- grid.find('.QuickColor').click(quickPickClicked);
- }
- setColorMode.call($this, settings.color.mode);
- color.active.bind(activeColorChanged);
- $.isFunction(liveCallback) && color.active.bind(liveCallback);
- color.current.bind(currentColorChanged);
- // bind to input
- if (win.expandable)
- {
- $this.icon = popup.parents('.Icon:first');
- iconColor = $this.icon.find('.Color:first').css({ backgroundColor: hex && '#' + hex || 'transparent' });
- iconAlpha = $this.icon.find('.Alpha:first');
- setImg.call($this, iconAlpha, images.clientPath + 'bar-opacity.png');
- setAlpha.call($this, iconAlpha, Math.precision(((255 - (all != null ? all.a : 0)) * 100) / 255, 4));
- iconImage = $this.icon.find('.Image:first').css(
- {
- backgroundImage: 'url(\'' + images.clientPath + images.picker.file + '\')'
- }).bind('click', iconImageClicked);
- if (win.bindToInput&&win.updateInputColor)
- win.input.css(
- {
- backgroundColor: hex && '#' + hex || 'transparent',
- color: all == null || all.v > 75 ? '#000000' : '#ffffff'
- });
- moveBar = tbody.find('.Move:first').bind('mousedown', moveBarMouseDown);
- color.active.bind(expandableColorChanged);
- }
- else show.call($this);
- },
- destroy =
- function()
- {
- container.find('td.Radio input').unbind('click', radioClicked);
- currentPreview.unbind('click', currentClicked);
- cancelButton.unbind('click', cancelClicked);
- okButton.unbind('click', okClicked);
- if (settings.window.expandable)
- {
- iconImage.unbind('click', iconImageClicked);
- moveBar.unbind('mousedown', moveBarMouseDown);
- $this.icon = null;
- }
- container.find('.QuickColor').unbind('click', quickPickClicked);
- colorMapDiv = null;
- colorBarDiv = null;
- colorMapL1 = null;
- colorMapL2 = null;
- colorMapL3 = null;
- colorBarL1 = null;
- colorBarL2 = null;
- colorBarL3 = null;
- colorBarL4 = null;
- colorBarL5 = null;
- colorBarL6 = null;
- colorMap.destroy();
- colorMap = null;
- colorBar.destroy();
- colorBar = null;
- colorPicker.destroy();
- colorPicker = null;
- activePreview = null;
- currentPreview = null;
- okButton = null;
- cancelButton = null;
- grid = null;
- commitCallback = null;
- cancelCallback = null;
- liveCallback = null;
- container.remove();
- for (i = 0; i < List.length; i++) if (List[i] == $this) List.splice(i, 1);
- },
- images = settings.images, // local copies for YUI compressor
- localization = settings.localization,
- color =
- {
- active: (typeof(settings.color.active)).toString().toLowerCase() == 'string' ? new Color({ ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex') }),
- current: (typeof(settings.color.active)).toString().toLowerCase() == 'string' ? new Color({ ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex') }),
- quickList: settings.color.quickList
- };
- $.extend(true, $this, // public properties, methods, and callbacks
- {
- commitCallback: commitCallback, // commitCallback function can be overridden to return the selected color to a method you specify when the user clicks "OK"
- liveCallback: liveCallback, // liveCallback function can be overridden to return the selected color to a method you specify in live mode (continuous update)
- cancelCallback: cancelCallback, // cancelCallback function can be overridden to a method you specify when the user clicks "Cancel"
- color: color,
- show: show,
- hide: hide,
- destroy: destroy // destroys this control entirely, removing all events and objects, and removing itself from the List
- });
- List.push($this);
- setTimeout(
- function()
- {
- initialize.call($this);
- }, 0);
- });
- };
- $.fn.jPicker.defaults = /* jPicker defaults - you can change anything in this section (such as the clientPath to your images) without fear of breaking the program */
- {
- window:
- {
- title: null, /* any title for the jPicker window itself - displays "Drag Markers To Pick A Color" if left null */
- effects:
- {
- type: 'slide', /* effect used to show/hide an expandable picker. Acceptable values "slide", "show", "fade" */
- speed:
- {
- show: 'slow', /* duration of "show" effect. Acceptable values are "fast", "slow", or time in ms */
- hide: 'fast' /* duration of "hide" effect. Acceptable values are "fast", "slow", or time in ms */
- }
- },
- position:
- {
- x: 'screenCenter', /* acceptable values "left", "center", "right", "screenCenter", or relative px value */
- y: 'top' /* acceptable values "top", "bottom", "center", or relative px value */
- },
- expandable: false, /* default to large static picker - set to true to make an expandable picker (small icon with popup) - set automatically when binded to input element */
- liveUpdate: true, /* set false if you want the user to have to click "OK" before the binded input box updates values (always "true" for expandable picker) */
- alphaSupport: false, /* set to true to enable alpha picking */
- alphaPrecision: 0, /* set decimal precision for alpha percentage display - hex codes do not map directly to percentage integers - range 0-2 */
- updateInputColor: true /* set to false to prevent binded input colors from changing */
- },
- color:
- {
- mode: 'h', /* acceptabled values "h" (hue), "s" (saturation), "v" (value), "r" (red), "g" (green), "b" (blue), "a" (alpha) */
- active: new Color({ ahex: '#ffcc00ff' }), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */
- quickList: /* the quick pick color list */
- [
- new Color({ h: 360, s: 33, v: 100 }), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */
- new Color({ h: 360, s: 66, v: 100 }),
- new Color({ h: 360, s: 100, v: 100 }),
- new Color({ h: 360, s: 100, v: 75 }),
- new Color({ h: 360, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 100 }),
- new Color({ h: 30, s: 33, v: 100 }),
- new Color({ h: 30, s: 66, v: 100 }),
- new Color({ h: 30, s: 100, v: 100 }),
- new Color({ h: 30, s: 100, v: 75 }),
- new Color({ h: 30, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 90 }),
- new Color({ h: 60, s: 33, v: 100 }),
- new Color({ h: 60, s: 66, v: 100 }),
- new Color({ h: 60, s: 100, v: 100 }),
- new Color({ h: 60, s: 100, v: 75 }),
- new Color({ h: 60, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 80 }),
- new Color({ h: 90, s: 33, v: 100 }),
- new Color({ h: 90, s: 66, v: 100 }),
- new Color({ h: 90, s: 100, v: 100 }),
- new Color({ h: 90, s: 100, v: 75 }),
- new Color({ h: 90, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 70 }),
- new Color({ h: 120, s: 33, v: 100 }),
- new Color({ h: 120, s: 66, v: 100 }),
- new Color({ h: 120, s: 100, v: 100 }),
- new Color({ h: 120, s: 100, v: 75 }),
- new Color({ h: 120, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 60 }),
- new Color({ h: 150, s: 33, v: 100 }),
- new Color({ h: 150, s: 66, v: 100 }),
- new Color({ h: 150, s: 100, v: 100 }),
- new Color({ h: 150, s: 100, v: 75 }),
- new Color({ h: 150, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 50 }),
- new Color({ h: 180, s: 33, v: 100 }),
- new Color({ h: 180, s: 66, v: 100 }),
- new Color({ h: 180, s: 100, v: 100 }),
- new Color({ h: 180, s: 100, v: 75 }),
- new Color({ h: 180, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 40 }),
- new Color({ h: 210, s: 33, v: 100 }),
- new Color({ h: 210, s: 66, v: 100 }),
- new Color({ h: 210, s: 100, v: 100 }),
- new Color({ h: 210, s: 100, v: 75 }),
- new Color({ h: 210, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 30 }),
- new Color({ h: 240, s: 33, v: 100 }),
- new Color({ h: 240, s: 66, v: 100 }),
- new Color({ h: 240, s: 100, v: 100 }),
- new Color({ h: 240, s: 100, v: 75 }),
- new Color({ h: 240, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 20 }),
- new Color({ h: 270, s: 33, v: 100 }),
- new Color({ h: 270, s: 66, v: 100 }),
- new Color({ h: 270, s: 100, v: 100 }),
- new Color({ h: 270, s: 100, v: 75 }),
- new Color({ h: 270, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 10 }),
- new Color({ h: 300, s: 33, v: 100 }),
- new Color({ h: 300, s: 66, v: 100 }),
- new Color({ h: 300, s: 100, v: 100 }),
- new Color({ h: 300, s: 100, v: 75 }),
- new Color({ h: 300, s: 100, v: 50 }),
- new Color({ h: 180, s: 0, v: 0 }),
- new Color({ h: 330, s: 33, v: 100 }),
- new Color({ h: 330, s: 66, v: 100 }),
- new Color({ h: 330, s: 100, v: 100 }),
- new Color({ h: 330, s: 100, v: 75 }),
- new Color({ h: 330, s: 100, v: 50 }),
- new Color()
- ]
- },
- images:
- {
- clientPath: '/jPicker/images/', /* Path to image files */
- colorMap:
- {
- width: 256,
- height: 256,
- arrow:
- {
- file: 'mappoint.gif', /* ColorMap arrow icon */
- width: 15,
- height: 15
- }
- },
- colorBar:
- {
- width: 20,
- height: 256,
- arrow:
- {
- file: 'rangearrows.gif', /* ColorBar arrow icon */
- width: 20,
- height: 7
- }
- },
- picker:
- {
- file: 'picker.gif', /* Color Picker icon */
- width: 25,
- height: 24
- }
- },
- localization: /* alter these to change the text presented by the picker (e.g. different language) */
- {
- text:
- {
- title: 'Drag Markers To Pick A Color',
- newColor: 'new',
- currentColor: 'current',
- ok: 'OK',
- cancel: 'Cancel'
- },
- tooltips:
- {
- colors:
- {
- newColor: 'New Color - Press “OK” To Commit',
- currentColor: 'Click To Revert To Original Color'
- },
- buttons:
- {
- ok: 'Commit To This Color Selection',
- cancel: 'Cancel And Revert To Original Color'
- },
- hue:
- {
- radio: 'Set To “Hue” Color Mode',
- textbox: 'Enter A “Hue” Value (0-360°)'
- },
- saturation:
- {
- radio: 'Set To “Saturation” Color Mode',
- textbox: 'Enter A “Saturation” Value (0-100%)'
- },
- value:
- {
- radio: 'Set To “Value” Color Mode',
- textbox: 'Enter A “Value” Value (0-100%)'
- },
- red:
- {
- radio: 'Set To “Red” Color Mode',
- textbox: 'Enter A “Red” Value (0-255)'
- },
- green:
- {
- radio: 'Set To “Green” Color Mode',
- textbox: 'Enter A “Green” Value (0-255)'
- },
- blue:
- {
- radio: 'Set To “Blue” Color Mode',
- textbox: 'Enter A “Blue” Value (0-255)'
- },
- alpha:
- {
- radio: 'Set To “Alpha” Color Mode',
- textbox: 'Enter A “Alpha” Value (0-100)'
- },
- hex:
- {
- textbox: 'Enter A “Hex” Color Value (#000000-#ffffff)',
- alpha: 'Enter A “Alpha” Value (#00-#ff)'
- }
- }
- }
- };
-})(jQuery, '1.1.6');
diff --git a/api/js/jquery/jpicker/jpicker.js b/api/js/jquery/jpicker/jpicker.js
deleted file mode 100644
index beb1b4079d..0000000000
--- a/api/js/jquery/jpicker/jpicker.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(e,a){Math.precision=function(j,h){if(h===undefined){h=0}return Math.round(j*Math.pow(10,h))/Math.pow(10,h)};var d=function(z,k){var o=this,j=z.find("img:first"),F=0,E=100,w=100,D=0,C=100,v=100,s=0,p=0,n,q,u=new Array(),l=function(y){for(var x=0;xL){K=L}}if(x<0){x=0}else{if(x>y){x=y}}J.call(o,"xy",{x:((K/L)*w)+F,y:((x/y)*v)+D})},r=function(){var L=0,x=0,N=z.w,K=z.h,M=j.w,y=j.h;setTimeout(function(){if(w>0){if(s==E){L=N}else{L=((s/w)*N)|0}}if(v>0){if(p==C){x=K}else{x=((p/v)*K)|0}}if(M>=N){L=(N>>1)-(M>>1)}else{L-=M>>1}if(y>=K){x=(K>>1)-(y>>1)}else{x-=y>>1}j.css({left:L+"px",top:x+"px"})},0)},J=function(x,K,y){var O=K!==undefined;if(!O){if(x===undefined||x==null){x="xy"}switch(x.toLowerCase()){case"x":return s;case"y":return p;case"xy":default:return{x:s,y:p}}}if(y!=null&&y==o){return}var N=false,M,L;if(x==null){x="xy"}switch(x.toLowerCase()){case"x":M=K&&(K.x&&K.x|0||K|0)||0;break;case"y":L=K&&(K.y&&K.y|0||K|0)||0;break;case"xy":default:M=K&&K.x&&K.x|0||0;L=K&&K.y&&K.y|0||0;break}if(M!=null){if(ME){M=E}}if(s!=M){s=M;N=true}}if(L!=null){if(LC){L=C}}if(p!=L){p=L;N=true}}N&&l.call(o,y||o)},t=function(x,L){var P=L!==undefined;if(!P){if(x===undefined||x==null){x="all"}switch(x.toLowerCase()){case"minx":return F;case"maxx":return E;case"rangex":return{minX:F,maxX:E,rangeX:w};case"miny":return D;case"maxy":return C;case"rangey":return{minY:D,maxY:C,rangeY:v};case"all":default:return{minX:F,maxX:E,rangeX:w,minY:D,maxY:C,rangeY:v}}}var O=false,N,K,M,y;if(x==null){x="all"}switch(x.toLowerCase()){case"minx":N=L&&(L.minX&&L.minX|0||L|0)||0;break;case"maxx":K=L&&(L.maxX&&L.maxX|0||L|0)||0;break;case"rangex":N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;break;case"miny":M=L&&(L.minY&&L.minY|0||L|0)||0;break;case"maxy":y=L&&(L.maxY&&L.maxY|0||L|0)||0;break;case"rangey":M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break;case"all":default:N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break}if(N!=null&&F!=N){F=N;w=E-F}if(K!=null&&E!=K){E=K;w=E-F}if(M!=null&&D!=M){D=M;v=C-D}if(y!=null&&C!=y){C=y;v=C-D}},I=function(x){if(e.isFunction(x)){u.push(x)}},m=function(y){if(!e.isFunction(y)){return}var x;while((x=e.inArray(y,u))!=-1){u.splice(x,1)}},G=function(){e(document).unbind("mouseup",B).unbind("mousemove",h);z.unbind("mousedown",H);z=null;j=null;u=null};e.extend(true,o,{val:J,range:t,bind:I,unbind:m,destroy:G});j.src=k.arrow&&k.arrow.image;j.w=k.arrow&&k.arrow.width||j.width();j.h=k.arrow&&k.arrow.height||j.height();z.w=k.map&&k.map.width||z.width();z.h=k.map&&k.map.height||z.height();z.bind("mousedown",H);I.call(o,r)},b=function(u,z,k,y){var q=this,l=u.find("td.Text input"),r=l.eq(3),v=l.eq(4),h=l.eq(5),o=l.length>7?l.eq(6):null,n=l.eq(0),p=l.eq(1),x=l.eq(2),s=l.eq(l.length>7?7:6),B=l.length>7?l.eq(8):null,C=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):switch(E.keyCode){case 38:r.val(j.call(q,(r.val()<<0)+1,0,255));z.val("r",r.val(),E.target);return false;case 40:r.val(j.call(q,(r.val()<<0)-1,0,255));z.val("r",r.val(),E.target);return false}break;case v.get(0):switch(E.keyCode){case 38:v.val(j.call(q,(v.val()<<0)+1,0,255));z.val("g",v.val(),E.target);return false;case 40:v.val(j.call(q,(v.val()<<0)-1,0,255));z.val("g",v.val(),E.target);return false}break;case h.get(0):switch(E.keyCode){case 38:h.val(j.call(q,(h.val()<<0)+1,0,255));z.val("b",h.val(),E.target);return false;case 40:h.val(j.call(q,(h.val()<<0)-1,0,255));z.val("b",h.val(),E.target);return false}break;case o&&o.get(0):switch(E.keyCode){case 38:o.val(j.call(q,parseFloat(o.val())+1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false;case 40:o.val(j.call(q,parseFloat(o.val())-1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false}break;case n.get(0):switch(E.keyCode){case 38:n.val(j.call(q,(n.val()<<0)+1,0,360));z.val("h",n.val(),E.target);return false;case 40:n.val(j.call(q,(n.val()<<0)-1,0,360));z.val("h",n.val(),E.target);return false}break;case p.get(0):switch(E.keyCode){case 38:p.val(j.call(q,(p.val()<<0)+1,0,100));z.val("s",p.val(),E.target);return false;case 40:p.val(j.call(q,(p.val()<<0)-1,0,100));z.val("s",p.val(),E.target);return false}break;case x.get(0):switch(E.keyCode){case 38:x.val(j.call(q,(x.val()<<0)+1,0,100));z.val("v",x.val(),E.target);return false;case 40:x.val(j.call(q,(x.val()<<0)-1,0,100));z.val("v",x.val(),E.target);return false}break}},w=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):r.val(j.call(q,r.val(),0,255));z.val("r",r.val(),E.target);break;case v.get(0):v.val(j.call(q,v.val(),0,255));z.val("g",v.val(),E.target);break;case h.get(0):h.val(j.call(q,h.val(),0,255));z.val("b",h.val(),E.target);break;case o&&o.get(0):o.val(j.call(q,o.val(),0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);break;case n.get(0):n.val(j.call(q,n.val(),0,360));z.val("h",n.val(),E.target);break;case p.get(0):p.val(j.call(q,p.val(),0,100));z.val("s",p.val(),E.target);break;case x.get(0):x.val(j.call(q,x.val(),0,100));z.val("v",x.val(),E.target);break;case s.get(0):s.val(s.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));k&&k.val(s.val());z.val("hex",s.val()!=""?s.val():null,E.target);break;case k&&k.get(0):k.val(k.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));s.val(k.val());z.val("hex",k.val()!=""?k.val():null,E.target);break;case B&&B.get(0):B.val(B.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2));z.val("a",B.val()!=null?parseInt(B.val(),16):null,E.target);break}},A=function(E){if(z.val()!=null){switch(E.target){case r.get(0):r.val(z.val("r"));break;case v.get(0):v.val(z.val("g"));break;case h.get(0):h.val(z.val("b"));break;case o&&o.get(0):o.val(Math.precision((z.val("a")*100)/255,y));break;case n.get(0):n.val(z.val("h"));break;case p.get(0):p.val(z.val("s"));break;case x.get(0):x.val(z.val("v"));break;case s.get(0):case k&&k.get(0):s.val(z.val("hex"));k&&k.val(z.val("hex"));break;case B&&B.get(0):B.val(z.val("ahex").substring(6));break}}},t=function(E){switch(E.keyCode){case 9:case 16:case 29:case 37:case 39:return false;case"c".charCodeAt():case"v".charCodeAt():if(E.ctrlKey){return false}}return true},j=function(G,F,E){if(G==""||isNaN(G)){return F}if(G>E){return E}if(G255){s.r=255}}if(j!=s.r){j=s.r;v=true}break;case"g":if(C){continue}E=true;s.g=G&&G.g&&G.g|0||G&&G|0||0;if(s.g<0){s.g=0}else{if(s.g>255){s.g=255}}if(o!=s.g){o=s.g;v=true}break;case"b":if(C){continue}E=true;s.b=G&&G.b&&G.b|0||G&&G|0||0;if(s.b<0){s.b=0}else{if(s.b>255){s.b=255}}if(t!=s.b){t=s.b;v=true}break;case"a":s.a=G&&G.a!=null?G.a|0:G!=null?G|0:255;if(s.a<0){s.a=0}else{if(s.a>255){s.a=255}}if(u!=s.a){u=s.a;v=true}break;case"h":if(E){continue}C=true;s.h=G&&G.h&&G.h|0||G&&G|0||0;if(s.h<0){s.h=0}else{if(s.h>360){s.h=360}}if(n!=s.h){n=s.h;v=true}break;case"s":if(E){continue}C=true;s.s=G&&G.s!=null?G.s|0:G!=null?G|0:100;if(s.s<0){s.s=0}else{if(s.s>100){s.s=100}}if(A!=s.s){A=s.s;v=true}break;case"v":if(E){continue}C=true;s.v=G&&G.v!=null?G.v|0:G!=null?G|0:100;if(s.v<0){s.v=0}else{if(s.v>100){s.v=100}}if(x!=s.v){x=s.v;v=true}break}}if(v){if(E){j=j||0;o=o||0;t=t||0;var D=g.rgbToHsv({r:j,g:o,b:t});n=D.h;A=D.s;x=D.v}else{if(C){n=n||0;A=A!=null?A:100;x=x!=null?x:100;var D=g.hsvToRgb({h:n,s:A,v:x});j=D.r;o=D.g;t=D.b}}u=u!=null?u:255;m.call(q,r||q)}break}},p=function(h){if(e.isFunction(h)){k.push(h)}},y=function(r){if(!e.isFunction(r)){return}var h;while((h=e.inArray(r,k))!=-1){k.splice(h,1)}},w=function(){k=null};e.extend(true,q,{val:l,bind:p,unbind:y,destroy:w});if(z){if(z.ahex!=null){l("ahex",z)}else{if(z.hex!=null){l((z.a!=null?"a":"")+"hex",z.a!=null?{ahex:z.hex+g.intToHex(z.a)}:z)}else{if(z.r!=null&&z.g!=null&&z.b!=null){l("rgb"+(z.a!=null?"a":""),z)}else{if(z.h!=null&&z.s!=null&&z.v!=null){l("hsv"+(z.a!=null?"a":""),z)}}}}}},ColorMethods:{hexToRgba:function(m){m=this.validateHex(m);if(m==""){return{r:null,g:null,b:null,a:null}}var l="00",k="00",h="00",j="255";if(m.length==6){m+="ff"}if(m.length>6){l=m.substring(0,2);k=m.substring(2,4);h=m.substring(4,6);j=m.substring(6,m.length)}else{if(m.length>4){l=m.substring(4,m.length);m=m.substring(0,4)}if(m.length>2){k=m.substring(2,m.length);m=m.substring(0,2)}if(m.length>0){h=m.substring(0,m.length)}}return{r:this.hexToInt(l),g:this.hexToInt(k),b:this.hexToInt(h),a:this.hexToInt(j)}},validateHex:function(h){h=h.toLowerCase().replace(/[^a-f0-9]/g,"");if(h.length>8){h=h.substring(0,8)}return h},rgbaToHex:function(h){return this.intToHex(h.r)+this.intToHex(h.g)+this.intToHex(h.b)+this.intToHex(h.a)},intToHex:function(j){var h=(j|0).toString(16);if(h.length==1){h=("0"+h)}return h.toLowerCase()},hexToInt:function(h){return parseInt(h,16)},rgbToHsv:function(l){var o=l.r/255,n=l.g/255,j=l.b/255,k={h:0,s:0,v:0},m=0,h=0,p;if(o>=n&&o>=j){h=o;m=n>j?j:n}else{if(n>=j&&n>=o){h=n;m=o>j?j:o}else{h=j;m=n>o?o:n}}k.v=h;k.s=h?(h-m)/h:0;if(!k.s){k.h=0}else{p=h-m;if(o==h){k.h=(n-j)/p}else{if(n==h){k.h=2+(j-o)/p}else{k.h=4+(o-n)/p}}k.h=parseInt(k.h*60);if(k.h<0){k.h+=360}}k.s=(k.s*100)|0;k.v=(k.v*100)|0;return k},hsvToRgb:function(n){var r={r:0,g:0,b:0,a:100},m=n.h,x=n.s,u=n.v;if(x==0){if(u==0){r.r=r.g=r.b=0}else{r.r=r.g=r.b=(u*255/100)|0}}else{if(m==360){m=0}m/=60;x=x/100;u=u/100;var l=m|0,o=m-l,k=u*(1-x),j=u*(1-(x*o)),w=u*(1-(x*(1-o)));switch(l){case 0:r.r=u;r.g=w;r.b=k;break;case 1:r.r=j;r.g=u;r.b=k;break;case 2:r.r=k;r.g=u;r.b=w;break;case 3:r.r=k;r.g=j;r.b=u;break;case 4:r.r=w;r.g=k;r.b=u;break;case 5:r.r=u;r.g=k;r.b=j;break}r.r=(r.r*255)|0;r.g=(r.g*255)|0;r.b=(r.b*255)|0}return r}}};var f=e.jPicker.Color,c=e.jPicker.List,g=e.jPicker.ColorMethods;e.fn.jPicker=function(j){var h=arguments;return this.each(function(){var w=this,av=e.extend(true,{},e.fn.jPicker.defaults,j);if(e(w).get(0).nodeName.toLowerCase()=="input"){e.extend(true,av,{window:{bindToInput:true,expandable:true,input:e(w)}});if(e(w).val()==""){av.color.active=new f({hex:null});av.color.current=new f({hex:null})}else{if(g.validateHex(e(w).val())){av.color.active=new f({hex:e(w).val(),a:av.color.active.val("a")});av.color.current=new f({hex:e(w).val(),a:av.color.active.val("a")})}}}if(av.window.expandable){e(w).after('')}else{av.window.liveUpdate=false}var Q=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,R=null,l=null,s=null,au=null,at=null,ar=null,P=null,O=null,N=null,M=null,L=null,K=null,D=null,U=null,aw=null,J=null,I=null,am=null,ai=null,E=null,an=null,ah=null,X=null,ab=null,aq=null,r=null,C=null,u=null,ag=function(aB){var aD=G.active,aE=n.clientPath,aA=aD.val("hex"),aC,az;av.color.mode=aB;switch(aB){case"h":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,0);Y.call(w,au,100);x.call(w,at,260);Y.call(w,at,100);y.call(w,s,"transparent");x.call(w,P,0);Y.call(w,P,100);x.call(w,O,260);Y.call(w,O,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:100,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:360});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("s"),y:100-aD.val("v")},D);U.val("y",360-aD.val("h"),U);break;case"s":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,-260);x.call(w,O,-520);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",100-aD.val("s"),U);break;case"v":setTimeout(function(){y.call(w,l,"000000");x.call(w,au,-780);x.call(w,at,260);y.call(w,s,aA);x.call(w,P,-520);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("s")},D);U.val("y",100-aD.val("v"),U);break;case"r":aC=-1040;az=-780;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("g")},D);U.val("y",255-aD.val("r"),U);break;case"g":aC=-1560;az=-1820;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("r")},D);U.val("y",255-aD.val("g"),U);break;case"b":aC=-2080;az=-2860;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("r"),y:255-aD.val("g")},D);U.val("y",255-aD.val("b"),U);break;case"a":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,260);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,0);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",255-aD.val("a"),U);break;default:throw ("Invalid Mode");break}switch(aB){case"h":break;case"s":case"v":case"a":setTimeout(function(){Y.call(w,au,100);Y.call(w,P,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100)},0);break;case"r":case"g":case"b":setTimeout(function(){y.call(w,l,"transparent");y.call(w,s,"transparent");Y.call(w,P,100);Y.call(w,au,100);x.call(w,au,aC);x.call(w,at,aC-260);x.call(w,P,az-780);x.call(w,O,az-520);x.call(w,N,az);x.call(w,M,az-260);x.call(w,K,260);Y.call(w,K,100)},0);break}if(aD.val("ahex")==null){return}aj.call(w,aD)},aj=function(aA,az){if(az==null||(az!=U&&az!=D)){v.call(w,aA,az)}setTimeout(function(){ay.call(w,aA);al.call(w,aA);W.call(w,aA)},0)},z=function(aA,az){var aC=G.active;if(az!=D&&aC.val()==null){return}var aB=aA.val("all");switch(av.color.mode){case"h":aC.val("sv",{s:aB.x,v:100-aB.y},az);break;case"s":case"a":aC.val("hv",{h:aB.x,v:100-aB.y},az);break;case"v":aC.val("hs",{h:aB.x,s:100-aB.y},az);break;case"r":aC.val("gb",{g:255-aB.y,b:aB.x},az);break;case"g":aC.val("rb",{r:255-aB.y,b:aB.x},az);break;case"b":aC.val("rg",{r:aB.x,g:255-aB.y},az);break}},ac=function(aA,az){var aB=G.active;if(az!=U&&aB.val()==null){return}switch(av.color.mode){case"h":aB.val("h",{h:360-aA.val("y")},az);break;case"s":aB.val("s",{s:100-aA.val("y")},az);break;case"v":aB.val("v",{v:100-aA.val("y")},az);break;case"r":aB.val("r",{r:255-aA.val("y")},az);break;case"g":aB.val("g",{g:255-aA.val("y")},az);break;case"b":aB.val("b",{b:255-aA.val("y")},az);break;case"a":aB.val("a",255-aA.val("y"),az);break}},v=function(aC,az){if(az!=D){switch(av.color.mode){case"h":var aH=aC.val("sv");D.val("xy",{x:aH!=null?aH.s:100,y:100-(aH!=null?aH.v:100)},az);break;case"s":case"a":var aB=aC.val("hv");D.val("xy",{x:aB&&aB.h||0,y:100-(aB!=null?aB.v:100)},az);break;case"v":var aE=aC.val("hs");D.val("xy",{x:aE&&aE.h||0,y:100-(aE!=null?aE.s:100)},az);break;case"r":var aA=aC.val("bg");D.val("xy",{x:aA&&aA.b||0,y:255-(aA&&aA.g||0)},az);break;case"g":var aI=aC.val("br");D.val("xy",{x:aI&&aI.b||0,y:255-(aI&&aI.r||0)},az);break;case"b":var aG=aC.val("rg");D.val("xy",{x:aG&&aG.r||0,y:255-(aG&&aG.g||0)},az);break}}if(az!=U){switch(av.color.mode){case"h":U.val("y",360-(aC.val("h")||0),az);break;case"s":var aJ=aC.val("s");U.val("y",100-(aJ!=null?aJ:100),az);break;case"v":var aF=aC.val("v");U.val("y",100-(aF!=null?aF:100),az);break;case"r":U.val("y",255-(aC.val("r")||0),az);break;case"g":U.val("y",255-(aC.val("g")||0),az);break;case"b":U.val("y",255-(aC.val("b")||0),az);break;case"a":var aD=aC.val("a");U.val("y",255-(aD!=null?aD:255),az);break}}},ay=function(aA){try{var az=aA.val("all");E.css({backgroundColor:az&&"#"+az.hex||"transparent"});Y.call(w,E,az&&Math.precision((az.a*100)/255,4)||0)}catch(aB){}},al=function(aC){switch(av.color.mode){case"h":y.call(w,l,new f({h:aC.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var aB=aC.val("s");Y.call(w,at,100-(aB!=null?aB:100));break;case"v":var aA=aC.val("v");Y.call(w,au,aA!=null?aA:100);break;case"r":Y.call(w,at,Math.precision((aC.val("r")||0)/255*100,4));break;case"g":Y.call(w,at,Math.precision((aC.val("g")||0)/255*100,4));break;case"b":Y.call(w,at,Math.precision((aC.val("b")||0)/255*100));break}var az=aC.val("a");Y.call(w,ar,Math.precision(((255-(az||0))*100)/255,4))},W=function(aF){switch(av.color.mode){case"h":var aH=aF.val("a");Y.call(w,L,Math.precision(((255-(aH||0))*100)/255,4));break;case"s":var aA=aF.val("hva"),aB=new f({h:aA&&aA.h||0,s:100,v:aA!=null?aA.v:100});y.call(w,s,aB.val("hex"));Y.call(w,O,100-(aA!=null?aA.v:100));Y.call(w,L,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));break;case"v":var aC=aF.val("hsa"),aE=new f({h:aC&&aC.h||0,s:aC!=null?aC.s:100,v:100});y.call(w,s,aE.val("hex"));Y.call(w,L,Math.precision(((255-(aC&&aC.a||0))*100)/255,4));break;case"r":case"g":case"b":var aD=0,aG=0,az=aF.val("rgba");if(av.color.mode=="r"){aD=az&&az.b||0;aG=az&&az.g||0}else{if(av.color.mode=="g"){aD=az&&az.b||0;aG=az&&az.r||0}else{if(av.color.mode=="b"){aD=az&&az.r||0;aG=az&&az.g||0}}}var aI=aG>aD?aD:aG;Y.call(w,O,aD>aG?Math.precision(((aD-aG)/(255-aG))*100,4):0);Y.call(w,N,aG>aD?Math.precision(((aG-aD)/(255-aD))*100,4):0);Y.call(w,M,Math.precision((aI/255)*100,4));Y.call(w,L,Math.precision(((255-(az&&az.a||0))*100)/255,4));break;case"a":var aH=aF.val("a");y.call(w,s,aF.val("hex")||"000000");Y.call(w,L,aH!=null?0:100);Y.call(w,K,aH!=null?100:0);break}},y=function(az,aA){az.css({backgroundColor:aA&&aA.length==6&&"#"+aA||"transparent"})},t=function(az,aA){if(Q&&(aA.indexOf("AlphaBar.png")!=-1||aA.indexOf("Bars.png")!=-1||aA.indexOf("Maps.png")!=-1)){az.attr("pngSrc",aA);az.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aA+"', sizingMethod='scale')"})}else{az.css({backgroundImage:"url('"+aA+"')"})}},x=function(az,aA){az.css({top:aA+"px"})},Y=function(aA,az){aA.css({visibility:az>0?"visible":"hidden"});if(az>0&&az<100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+az+")"})}else{aA.css({opacity:Math.precision(az/100,4)})}}else{aA.css({opacity:Math.precision(az/100,4)})}}else{if(az==0||az==100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale')"})}else{aA.css({opacity:""})}}else{aA.css({opacity:""})}}}},B=function(){G.active.val("ahex",G.current.val("ahex"))},T=function(){G.current.val("ahex",G.active.val("ahex"))},A=function(az){e(this).parents("tbody:first").find('input:radio[value!="'+az.target.value+'"]').removeAttr("checked");ag.call(w,az.target.value)},Z=function(){B.call(w)},q=function(){B.call(w);av.window.expandable&&ao.call(w);e.isFunction(ax)&&ax.call(w,G.active,X)},m=function(){T.call(w);av.window.expandable&&ao.call(w);e.isFunction(ae)&&ae.call(w,G.active,ah)},af=function(){V.call(w)},ap=function(aB,az){var aA=aB.val("hex");an.css({backgroundColor:aA&&"#"+aA||"transparent"});Y.call(w,an,Math.precision(((aB.val("a")||0)*100)/255,4))},H=function(aC,az){var aB=aC.val("hex");var aA=aC.val("va");aq.css({backgroundColor:aB&&"#"+aB||"transparent"});Y.call(w,r,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));if(av.window.bindToInput&&av.window.updateInputColor){av.window.input.css({backgroundColor:aB&&"#"+aB||"transparent",color:aA==null||aA.v>75?"#000000":"#ffffff"})}},S=function(aB){var az=av.window.element,aA=av.window.page;J=parseInt(R.css("left"));I=parseInt(R.css("top"));am=aB.pageX;ai=aB.pageY;e(document).bind("mousemove",k).bind("mouseup",p);aB.preventDefault()},k=function(az){R.css({left:J-(am-az.pageX)+"px",top:I-(ai-az.pageY)+"px"});if(av.window.expandable&&!e.support.boxModel){R.prev().css({left:R.css("left"),top:R.css("top")})}az.stopPropagation();az.preventDefault();return false},p=function(az){e(document).unbind("mousemove",k).unbind("mouseup",p);az.stopPropagation();az.preventDefault();return false},F=function(az){az.preventDefault();az.stopPropagation();G.active.val("ahex",e(this).attr("title")||null,az.target);return false},ae=e.isFunction(h[1])&&h[1]||null,ad=e.isFunction(h[2])&&h[2]||null,ax=e.isFunction(h[3])&&h[3]||null,V=function(){G.current.val("ahex",G.active.val("ahex"));var az=function(){if(!av.window.expandable||e.support.boxModel){return}var aA=R.find("table:first");R.before("");R.prev().css({width:aA.width(),height:R.height(),opacity:0,position:"absolute",left:R.css("left"),top:R.css("top")})};if(av.window.expandable){e(document.body).children("div.jPicker.Container").css({zIndex:10});R.css({zIndex:20})}switch(av.window.effects.type){case"fade":R.fadeIn(av.window.effects.speed.show,az);break;case"slide":R.slideDown(av.window.effects.speed.show,az);break;case"show":default:R.show(av.window.effects.speed.show,az);break}},ao=function(){var az=function(){if(av.window.expandable){R.css({zIndex:10})}if(!av.window.expandable||e.support.boxModel){return}R.prev().remove()};switch(av.window.effects.type){case"fade":R.fadeOut(av.window.effects.speed.hide,az);break;case"slide":R.slideUp(av.window.effects.speed.hide,az);break;case"show":default:R.hide(av.window.effects.speed.hide,az);break}},o=function(){var aG=av.window,az=aG.expandable?e(w).next().find(".Container:first"):null;R=aG.expandable?e(""):e(w);R.addClass("jPicker Container");if(aG.expandable){R.hide()}R.get(0).onselectstart=function(aN){if(aN.target.nodeName.toLowerCase()!=="input"){return false}};var aJ=G.active.val("all");if(aG.alphaPrecision<0){aG.alphaPrecision=0}else{if(aG.alphaPrecision>2){aG.alphaPrecision=2}}var aK='