Вход Регистрация
Файл: InstantSocial/uploud/components/users/js/jpicker/jpicker-1.1.6.js
Строк: 2492
<?php

/*
 * 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(valueprecision)
    {
      if (
precision === undefinedprecision 0;
      return 
Math.round(value Math.pow(10precision)) / Math.pow(10precision);
    };
  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(baroptions)
      {
        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,
          
0,
          
0,
          
offset,
          
timeout,
          
changeEvents = new Array(),
          
fireChangeEvents =
            function(
context)
            {
              for (var 
0changeEvents.lengthi++) changeEvents[i].call($this$thiscontext);
            },
          
mouseDown // bind the mousedown to the bar not the arrow for quick snapping to the clicked location
            
function(e)
            {
              var 
off bar.offset();
              
offset = { loff.left 0toff.top };
              
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($thise);
                }, 
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($thise);
                }, 
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 0locX 0;
              else if (
locX barWlocX barW;
              if (
locY 0locY 0;
              else if (
locY barHlocY barH;
              
val.call($this'xy', { x: ((locX barW) * rangeX) + minXy: ((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 (== maxXarrowOffsetX barW;
                    else 
arrowOffsetX = ((rangeX) * barW) | 0;
                  }
                  if (
rangeY 0// range is greater than zero
                  
{
                    
// constrain to bounds
                    
if (== maxYarrowOffsetY barH;
                    else 
arrowOffsetY = ((rangeY) * barH) | 0;
                  }
                  
// if arrow width is greater than bar width, center arrow and prevent horizontal dragging
                  
if (arrowW >= barWarrowOffsetX = (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 >= barHarrowOffsetY = (barH >> 1) - (arrowH >> 1);
                  else 
arrowOffsetY -= arrowH >> 1;
                  
// set the arrow position based on these offsets
                  
arrow.css({ leftarrowOffsetX 'px'toparrowOffsetY 'px' });
                }, 
0);
            },
          
val =
            function(
namevaluecontext)
            {
              var 
set value !== undefined;
              if (!
set)
              {
                if (
name === undefined || name == nullname 'xy';
                switch (
name.toLowerCase())
                {
                  case 
'x': return x;
                  case 
'y': return y;
                  case 
'xy':
                  default: return { 
xxy};
                }
              }
              if (
context != null && context == $this) return;
              var 
changed false,
                  
newX,
                  
newY;
              if (
name == nullname 'xy';
              switch (
name.toLowerCase())
              {
                case 
'x':
                  
newX value && (value.&& value.|| value 0) || 0;
                  break;
                case 
'y':
                  
newY value && (value.&& value.|| value 0) || 0;
                  break;
                case 
'xy':
                default:
                  
newX value && value.&& value.|| 0;
                  
newY value && value.&& value.|| 0;
                  break;
              }
              if (
newX != null)
              {
                if (
newX minXnewX minX;
                else if (
newX maxXnewX maxX;
                if (
!= newX)
                {
                  
newX;
                  
changed true;
                }
              }
              if (
newY != null)
              {
                if (
newY minYnewY minY;
                else if (
newY maxYnewY maxY;
                if (
!= newY)
                {
                  
newY;
                  
changed true;
                }
              }
              
changed && fireChangeEvents.call($thiscontext || $this);
            },
          
range =
            function (
namevalue)
            {
              var 
set value !== undefined;
              if (!
set)
              {
                if (
name === undefined || name == nullname 'all';
                switch (
name.toLowerCase())
                {
                  case 
'minx': return minX;
                  case 
'maxx': return maxX;
                  case 
'rangex': return { minXminXmaxXmaxXrangeXrangeX };
                  case 
'miny': return minY;
                  case 
'maxy': return maxY;
                  case 
'rangey': return { minYminYmaxYmaxYrangeYrangeY };
                  case 
'all':
                  default: return { 
minXminXmaxXmaxXrangeXrangeXminYminYmaxYmaxYrangeYrangeY };
                }
              }
              var 
changed false,
                  
newMinX,
                  
newMaxX,
                  
newMinY,
                  
newMaxY;
              if (
name == nullname 'all';
              switch (
name.toLowerCase())
              {
                case 
'minx':
                  
newMinX value && (value.minX && value.minX || value 0) || 0;
                  break;
                case 
'maxx':
                  
newMaxX value && (value.maxX && value.maxX || value 0) || 0;
                  break;
                case 
'rangex':
                  
newMinX value && value.minX && value.minX || 0;
                  
newMaxX value && value.maxX && value.maxX || 0;
                  break;
                case 
'miny':
                  
newMinY value && (value.minY && value.minY || value 0) || 0;
                  break;
                case 
'maxy':
                  
newMaxY value && (value.maxY && value.maxY || value 0) || 0;
                  break;
                case 
'rangey':
                  
newMinY value && value.minY && value.minY || 0;
                  
newMaxY value && value.maxY && value.maxY || 0;
                  break;
                case 
'all':
                default:
                  
newMinX value && value.minX && value.minX || 0;
                  
newMaxX value && value.maxX && value.maxX || 0;
                  
newMinY value && value.minY && value.minY || 0;
                  
newMaxY value && value.maxY && value.maxY || 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 ((
= $.inArray(callbackchangeEvents)) != -1changeEvents.splice(i1);
            },
          
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
          
{
            
valval,
            
rangerange,
            
bindbind,
            
unbindunbind,
            
destroydestroy
          
});
        
// initialize this control
        
arrow.src options.arrow && options.arrow.image;
        
arrow.options.arrow && options.arrow.width || arrow.width();
        
arrow.options.arrow && options.arrow.height || arrow.height();
        
bar.options.map && options.map.width || bar.width();
        
bar.options.map && options.map.height || bar.height();
        
// bind mousedown event
        
bar.bind('mousedown'mouseDown);
        
bind.call($thisdraw);
      },
    
ColorValuePicker // controls for all the input elements for the typing in color values
      
function(pickercolorbindedHexalphaPrecision)
      {
        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 inputs.eq(6) : null,
          
hue inputs.eq(0),
          
saturation inputs.eq(1),
          
value inputs.eq(2),
          
hex inputs.eq(inputs.length 6),
          
ahex inputs.length 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) + 10255));
                      
color.val('r'red.val(), e.target);
                      return 
false;
                    case 
40:
                      
red.val(setValueInRange.call($this, (red.val() << 0) - 10255));
                      
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) + 10255));
                      
color.val('g'green.val(), e.target);
                      return 
false;
                    case 
40:
                      
green.val(setValueInRange.call($this, (green.val() << 0) - 10255));
                      
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) + 10255));
                      
color.val('b'blue.val(), e.target);
                      return 
false;
                    case 
40:
                      
blue.val(setValueInRange.call($this, (blue.val() << 0) - 10255));
                      
color.val('b'blue.val(), e.target);
                      return 
false;
                  }
                  break;
                case 
alpha && alpha.get(0):
                  switch (
e.keyCode)
                  {
                    case 
38:
                      
alpha.val(setValueInRange.call($thisparseFloat(alpha.val()) + 10100));
                      
color.val('a'Math.precision((alpha.val() * 255) / 100alphaPrecision), e.target);
                      return 
false;
                    case 
40:
                      
alpha.val(setValueInRange.call($thisparseFloat(alpha.val()) - 10100));
                      
color.val('a'Math.precision((alpha.val() * 255) / 100alphaPrecision), e.target);
                      return 
false;
                  }
                  break;
                case 
hue.get(0):
                  switch (
e.keyCode)
                  {
                    case 
38:
                      
hue.val(setValueInRange.call($this, (hue.val() << 0) + 10360));
                      
color.val('h'hue.val(), e.target);
                      return 
false;
                    case 
40:
                      
hue.val(setValueInRange.call($this, (hue.val() << 0) - 10360));
                      
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) + 10100));
                      
color.val('s'saturation.val(), e.target);
                      return 
false;
                    case 
40:
                      
saturation.val(setValueInRange.call($this, (saturation.val() << 0) - 10100));
                      
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) + 10100));
                      
color.val('v'value.val(), e.target);
                      return 
false;
                    case 
40:
                      
value.val(setValueInRange.call($this, (value.val() << 0) - 10100));
                      
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($thisred.val(), 0255));
                  
color.val('r'red.val(), e.target);
                  break;
                case 
green.get(0):
                  
green.val(setValueInRange.call($thisgreen.val(), 0255));
                  
color.val('g'green.val(), e.target);
                  break;
                case 
blue.get(0):
                  
blue.val(setValueInRange.call($thisblue.val(), 0255));
                  
color.val('b'blue.val(), e.target);
                  break;
                case 
alpha && alpha.get(0):
                  
alpha.val(setValueInRange.call($thisalpha.val(), 0100));
                  
color.val('a'Math.precision((alpha.val() * 255) / 100alphaPrecision), e.target);
                  break;
                case 
hue.get(0):
                  
hue.val(setValueInRange.call($thishue.val(), 0360));
                  
color.val('h'hue.val(), e.target);
                  break;
                case 
saturation.get(0):
                  
saturation.val(setValueInRange.call($thissaturation.val(), 0100));
                  
color.val('s'saturation.val(), e.target);
                  break;
                case 
value.get(0):
                  
value.val(setValueInRange.call($thisvalue.val(), 0100));
                  
color.val('v'value.val(), e.target);
                  break;
                case 
hex.get(0):
                  
hex.val(hex.val().replace(/[^a-fA-F0-9]/g'').toLowerCase().substring(06));
                  
bindedHex && bindedHex.val(hex.val());
                  
color.val('hex'hex.val() != '' hex.val() : nulle.target);
                  break;
                case 
bindedHex && bindedHex.get(0):
                  
bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g'').toLowerCase().substring(06));
                  
hex.val(bindedHex.val());
                  
color.val('hex'bindedHex.val() != '' bindedHex.val() : nulle.target);
                  break;
                case 
ahex && ahex.get(0):
                  
ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g'').toLowerCase().substring(02));
                  
color.val('a'ahex.val() != null parseInt(ahex.val(), 16) : nulle.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) / 255alphaPrecision)); 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(valueminmax)
            {
              if (
value == '' || isNaN(value)) return min;
              if (
value max) return max;
              if (
value min) return min;
              return 
value;
            },
          
colorChanged =
            function(
uicontext)
            {
              var 
all ui.val('all');
              if (
context != red.get(0)) red.val(all != null all.'');
              if (
context != green.get(0)) green.val(all != null all.'');
              if (
context != blue.get(0)) blue.val(all != null all.'');
              if (
alpha && context != alpha.get(0)) alpha.val(all != null Math.precision((all.100) / 255alphaPrecision) : '');
              if (
context != hue.get(0)) hue.val(all != null all.'');
              if (
context != saturation.get(0)) saturation.val(all != null all.'');
              if (
context != value.get(0)) value.val(all != null all.'');
              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
          
{
            
destroydestroy
          
});
        
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 
0changeEvents.lengthi++) changeEvents[i].call($this$thiscontext);
              },
            
val =
              function(
namevaluecontext)
              {
                var 
set value !== undefined;
                if (!
set)
                {
                  if (
name === undefined || name == null || name == ''name 'all';
                  if (
== null) return null;
                  switch (
name.toLowerCase())
                  {
                    case 
'ahex': return ColorMethods.rgbaToHex({ rrggbba});
                    case 
'hex': return val('ahex').substring(06);
                    case 
'all': return { rrggbbaahhssvvhexval.call($this'hex'), ahexval.call($this'ahex') };
                    default:
                      var 
ret={};
                      for (var 
0name.lengthi++)
                      {
                        switch (
name.charAt(i))
                        {
                          case 
'r':
                            if (
name.length == 1ret r;
                            else 
ret.r;
                            break;
                          case 
'g':
                            if (
name.length == 1ret g;
                            else 
ret.g;
                            break;
                          case 
'b':
                            if (
name.length == 1ret b;
                            else 
ret.b;
                            break;
                          case 
'a':
                            if (
name.length == 1ret a;
                            else 
ret.a;
                            break;
                          case 
'h':
                            if (
name.length == 1ret h;
                            else 
ret.h;
                            break;
                          case 
's':
                            if (
name.length == 1ret s;
                            else 
ret.s;
                            break;
                          case 
'v':
                            if (
name.length == 1ret v;
                            else 
ret.v;
                            break;
                        }
                      }
                      return 
ret == {} ? val.call($this'all') : ret;
                      break;
                  }
                }
                if (
context != null && context == $this) return;
                var 
changed false;
                if (
name == nullname '';
                if (
value == null)
                {
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  if (
!= null)
                  {
                    
null;
                    
changed true;
                  }
                  
changed && fireChangeEvents.call($thiscontext || $this);
                  return;
                }
                switch (
name.toLowerCase())
                {
                  case 
'ahex':
                  case 
'hex':
                    var 
ret ColorMethods.hexToRgba(value && (value.ahex || value.hex) || value || '00000000');
                    
val.call($this'rgba', { rret.rgret.gbret.baname == 'ahex' ret.!= null 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 falsehsv false;
                    if (
value.!== undefined && !name.indexOf('r') == -1name += 'r';
                    if (
value.!== undefined && !name.indexOf('g') == -1name += 'g';
                    if (
value.!== undefined && !name.indexOf('b') == -1name += 'b';
                    if (
value.!== undefined && !name.indexOf('a') == -1name += 'a';
                    if (
value.!== undefined && !name.indexOf('h') == -1name += 'h';
                    if (
value.!== undefined && !name.indexOf('s') == -1name += 's';
                    if (
value.!== undefined && !name.indexOf('v') == -1name += 'v';
                    for (var 
0name.lengthi++)
                    {
                      switch (
name.charAt(i))
                      {
                        case 
'r':
                          if (
hsv) continue;
                          
rgb true;
                          
newV.value && value.&& value.|| value && value || 0;
                          if (
newV.0newV.0;
                          else if (
newV.255newV.255;
                          if (
!= newV.r)
                          {
                            
newV.r;
                            
changed true;
                          }
                          break;
                        case 
'g':
                          if (
hsv) continue;
                          
rgb true;
                          
newV.value && value.&& value.|| value && value || 0;
                          if (
newV.0newV.0;
                          else if (
newV.255newV.255;
                          if (
!= newV.g)
                          {
                            
newV.g;
                            
changed true;
                          }
                          break;
                        case 
'b':
                          if (
hsv) continue;
                          
rgb true;
                          
newV.value && value.&& value.|| value && value || 0;
                          if (
newV.0newV.0;
                          else if (
newV.255newV.255;
                          if (
!= newV.b)
                          {
                            
newV.b;
                            
changed true;
                          }
                          break;
                        case 
'a':
                          
newV.value && value.!= null value.value != null value 255;
                          if (
newV.0newV.0;
                          else if (
newV.255newV.255;
                          if (
!= newV.a)
                          {
                            
newV.a;
                            
changed true;
                          }
                          break;
                        case 
'h':
                          if (
rgb) continue;
                          
hsv true;
                          
newV.value && value.&& value.|| value && value || 0;
                          if (
newV.0newV.0;
                          else if (
newV.360newV.360;
                          if (
!= newV.h)
                          {
                            
newV.h;
                            
changed true;
                          }
                          break;
                        case 
's':
                          if (
rgb) continue;
                          
hsv true;
                          
newV.value && value.!= null value.value != null value 100;
                          if (
newV.0newV.0;
                          else if (
newV.100newV.100;
                          if (
!= newV.s)
                          {
                            
newV.s;
                            
changed true;
                          }
                          break;
                        case 
'v':
                          if (
rgb) continue;
                          
hsv true;
                          
newV.value && value.!= null value.value != null value 100;
                          if (
newV.0newV.0;
                          else if (
newV.100newV.100;
                          if (
!= newV.v)
                          {
                            
newV.v;
                            
changed true;
                          }
                          break;
                      }
                    }
                    if (
changed)
                    {
                      if (
rgb)
                      {
                        
|| 0;
                        
|| 0;
                        
|| 0;
                        var 
ret ColorMethods.rgbToHsv({ rrggb});
                        
ret.h;
                        
ret.s;
                        
ret.v;
                      }
                      else if (
hsv)
                      {
                        
|| 0;
                        
!= null 100;
                        
!= null 100;
                        var 
ret ColorMethods.hsvToRgb({ hhssv});
                        
ret.r;
                        
ret.g;
                        
ret.b;
                      }
                      
!= null 255;
                      
fireChangeEvents.call($thiscontext || $this);
                    }
                    break;
                }
              },
            
bind =
              function(
callback)
              {
                if ($.
isFunction(callback)) changeEvents.push(callback);
              },
            
unbind =
              function(
callback)
              {
                if (!$.
isFunction(callback)) return;
                var 
i;
                while ((
= $.inArray(callbackchangeEvents)) != -1changeEvents.splice(i1);
              },
            
destroy =
              function()
              {
                
changeEvents null;
              }
          $.
extend(true$this// public properties and methods
            
{
              
valval,
              
bindbind,
              
unbindunbind,
              
destroydestroy
            
});
          if (
init)
          {
            if (
init.ahex != nullval('ahex'init);
            else if (
init.hex != nullval((init.!= null 'a' '') + 'hex'init.!= null ? { ahexinit.hex ColorMethods.intToHex(init.a) } : init);
            else if (
init.!= null && init.!= null && init.!= nullval('rgb' + (init.!= null 'a' ''), init);
            else if (
init.!= null && init.!= null && init.!= nullval('hsv' + (init.!= 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 { rnullgnullbnullanull };
              var 
'00''00''00''255';
              if (
hex.length == 6hex += 'ff';
              if (
hex.length 6)
              {
                
hex.substring(02);
                
hex.substring(24);
                
hex.substring(46);
                
hex.substring(6hex.length);
              }
              else
              {
                if (
hex.length 4)
                {
                  
hex.substring(4hex.length);
                  
hex hex.substring(04);
                }
                if (
hex.length 2)
                {
                  
hex.substring(2hex.length);
                  
hex hex.substring(02);
                }
                if (
hex.length 0hex.substring(0hex.length);
              }
              return { 
rthis.hexToInt(r), gthis.hexToInt(g), bthis.hexToInt(b), athis.hexToInt(a) };
            },
          
validateHex:
            function(
hex)
            {
              
hex hex.toLowerCase().replace(/[^a-f0-9]/g'');
              if (
hex.length 8hex hex.substring(08);
              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 == 1result = ('0' result);
              return 
result.toLowerCase();
            },
          
hexToInt:
            function(
hex)
            {
              return 
parseInt(hex16);
            },
          
rgbToHsv:
            function(
rgb)
            {
              var 
rgb.255rgb.255rgb.255hsv = { h0s0v}, min 0max 0delta;
              if (
>= && >= b)
              {
                
max r;
                
min g;
              }
              else if (
>= && >= r)
              {
                
max g;
                
min r;
              }
              else
              {
                
max b;
                
min g;
              }
              
hsv.max;
              
hsv.max ? (max min) / max 0;
              if (!
hsv.shsv.0;
              else
              {
                
delta max min;
                if (
== maxhsv.= (b) / delta;
                else if (
== maxhsv.+ (r) / delta;
                else 
hsv.+ (g) / delta;
                
hsv.parseInt(hsv.60);
                if (
hsv.0hsv.+= 360;
              }
              
hsv.= (hsv.100) | 0;
              
hsv.= (hsv.100) | 0;
              return 
hsv;
            },
          
hsvToRgb:
            function(
hsv)
            {
              var 
rgb = { r0g0b0a100 }, hsv.hhsv.shsv.v;
              if (
== 0)
              {
                if (
== 0rgb.rgb.rgb.0;
                else 
rgb.rgb.rgb.= (255 100) | 0;
              }
              else
              {
                if (
== 3600;
                
/= 60;
                
100;
                
100;
                var 
0,
                    
i,
                    
* (s),
                    
* (- (f)),
                    
* (- (* (f)));
                switch (
i)
                {
                  case 
0:
                    
rgb.v;
                    
rgb.t;
                    
rgb.p;
                    break;
                  case 
1:
                    
rgb.q;
                    
rgb.v;
                    
rgb.p;
                    break;
                  case 
2:
                    
rgb.p;
                    
rgb.v;
                    
rgb.t;
                    break;
                  case 
3:
                    
rgb.p;
                    
rgb.q;
                    
rgb.v;
                    break;
                  case 
4:
                    
rgb.t;
                    
rgb.p;
                    
rgb.v;
                    break;
                  case 
5:
                    
rgb.v;
                    
rgb.p;
                    
rgb.q;
                    break;
                }
                
rgb.= (rgb.255) | 0;
                
rgb.= (rgb.255) | 0;
                
rgb.= (rgb.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 thissettings = $.extend(true, {}, $.fn.jPicker.defaultsoptions); // 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(truesettings,
              {
                
window:
                {
                  
bindToInputtrue,
                  
expandabletrue,
                  
input: $($this)
                }
              });
            if($(
$this).val()=='')
            {
              
settings.color.active = new Color({ hexnull });
              
settings.color.current = new Color({ hexnull });
            }
            else if (
ColorMethods.validateHex($($this).val()))
            {
              
settings.color.active = new Color({ hex: $($this).val(), asettings.color.active.val('a') });
              
settings.color.current = new Color({ hex: $($this).val(), asettings.color.active.val('a') });
            }
          }
          if (
settings.window.expandable)
            $(
$this).after('<span class="jPicker"><span class="Icon"><span class="Color">&nbsp;</span><span class="Alpha">&nbsp;</span><span class="Image" title="Click To Open Color Picker">&nbsp;</span><span class="Container">&nbsp;</span></span></span>');
          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]) < && 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($thiscolorMapDiv'transparent');
                        
setImgLoc.call($thiscolorMapL10);
                        
setAlpha.call($thiscolorMapL1100);
                        
setImgLoc.call($thiscolorMapL2260);
                        
setAlpha.call($thiscolorMapL2100);
                        
setBG.call($thiscolorBarDiv'transparent');
                        
setImgLoc.call($thiscolorBarL10);
                        
setAlpha.call($thiscolorBarL1100);
                        
setImgLoc.call($thiscolorBarL2260);
                        
setAlpha.call($thiscolorBarL2100);
                        
setImgLoc.call($thiscolorBarL3260);
                        
setAlpha.call($thiscolorBarL3100);
                        
setImgLoc.call($thiscolorBarL4260);
                        
setAlpha.call($thiscolorBarL4100);
                        
setImgLoc.call($thiscolorBarL6260);
                        
setAlpha.call($thiscolorBarL6100);
                      }, 
0);
                    
colorMap.range('all', { minX0maxX100minY0maxY100 });
                    
colorBar.range('rangeY', { minY0maxY360 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('s'), y100 active.val('v') }, colorMap);
                    
colorBar.val('y'360 active.val('h'), colorBar);
                    break;
                  case 
's':
                    
setTimeout(
                      function()
                      {
                        
setBG.call($thiscolorMapDiv'transparent');
                        
setImgLoc.call($thiscolorMapL1, -260);
                        
setImgLoc.call($thiscolorMapL2, -520);
                        
setImgLoc.call($thiscolorBarL1, -260);
                        
setImgLoc.call($thiscolorBarL2, -520);
                        
setImgLoc.call($thiscolorBarL6260);
                        
setAlpha.call($thiscolorBarL6100);
                      }, 
0);
                    
colorMap.range('all', { minX0maxX360minY0maxY100 });
                    
colorBar.range('rangeY', { minY0maxY100 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('h'), y100 active.val('v') }, colorMap);
                    
colorBar.val('y'100 active.val('s'), colorBar);
                    break;
                  case 
'v':
                    
setTimeout(
                      function()
                      {
                        
setBG.call($thiscolorMapDiv'000000');
                        
setImgLoc.call($thiscolorMapL1, -780);
                        
setImgLoc.call($thiscolorMapL2260);
                        
setBG.call($thiscolorBarDivhex);
                        
setImgLoc.call($thiscolorBarL1, -520);
                        
setImgLoc.call($thiscolorBarL2260);
                        
setAlpha.call($thiscolorBarL2100);
                        
setImgLoc.call($thiscolorBarL6260);
                        
setAlpha.call($thiscolorBarL6100);
                      }, 
0);
                    
colorMap.range('all', { minX0maxX360minY0maxY100 });
                    
colorBar.range('rangeY', { minY0maxY100 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('h'), y100 active.val('s') }, colorMap);
                    
colorBar.val('y'100 active.val('v'), colorBar);
                    break;
                  case 
'r':
                    
rgbMap = -1040;
                    
rgbBar = -780;
                    
colorMap.range('all', { minX0maxX255minY0maxY255 });
                    
colorBar.range('rangeY', { minY0maxY255 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('b'), y255 active.val('g') }, colorMap);
                    
colorBar.val('y'255 active.val('r'), colorBar);
                    break;
                  case 
'g':
                    
rgbMap = -1560;
                    
rgbBar = -1820;
                    
colorMap.range('all', { minX0maxX255minY0maxY255 });
                    
colorBar.range('rangeY', { minY0maxY255 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('b'), y255 active.val('r') }, colorMap);
                    
colorBar.val('y'255 active.val('g'), colorBar);
                    break;
                  case 
'b':
                    
rgbMap = -2080;
                    
rgbBar = -2860;
                    
colorMap.range('all', { minX0maxX255minY0maxY255 });
                    
colorBar.range('rangeY', { minY0maxY255 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('r'), y255 active.val('g') }, colorMap);
                    
colorBar.val('y'255 active.val('b'), colorBar);
                    break;
                  case 
'a':
                    
setTimeout(
                      function()
                      {
                        
setBG.call($thiscolorMapDiv'transparent');
                        
setImgLoc.call($thiscolorMapL1, -260);
                        
setImgLoc.call($thiscolorMapL2, -520);
                        
setImgLoc.call($thiscolorBarL1260);
                        
setImgLoc.call($thiscolorBarL2260);
                        
setAlpha.call($thiscolorBarL2100);
                        
setImgLoc.call($thiscolorBarL60);
                        
setAlpha.call($thiscolorBarL6100);
                      }, 
0);
                    
colorMap.range('all', { minX0maxX360minY0maxY100 });
                    
colorBar.range('rangeY', { minY0maxY255 });
                    if (
active.val('ahex') == null) break;
                    
colorMap.val('xy', { xactive.val('h'), y100 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($thiscolorMapL1100);
                        
setAlpha.call($thiscolorBarL1100);
                        
setImgLoc.call($thiscolorBarL3260);
                        
setAlpha.call($thiscolorBarL3100);
                        
setImgLoc.call($thiscolorBarL4260);
                        
setAlpha.call($thiscolorBarL4100);
                      }, 
0);
                    break;
                  case 
'r':
                  case 
'g':
                  case 
'b':
                    
setTimeout(
                      function()
                      {
                        
setBG.call($thiscolorMapDiv'transparent');
                        
setBG.call($thiscolorBarDiv'transparent');
                        
setAlpha.call($thiscolorBarL1100);
                        
setAlpha.call($thiscolorMapL1100);
                        
setImgLoc.call($thiscolorMapL1rgbMap);
                        
setImgLoc.call($thiscolorMapL2rgbMap 260);
                        
setImgLoc.call($thiscolorBarL1rgbBar 780);
                        
setImgLoc.call($thiscolorBarL2rgbBar 520);
                        
setImgLoc.call($thiscolorBarL3rgbBar);
                        
setImgLoc.call($thiscolorBarL4rgbBar 260);
                        
setImgLoc.call($thiscolorBarL6260);
                        
setAlpha.call($thiscolorBarL6100);
                      }, 
0);
                    break;
                }
                if (
active.val('ahex') == null) return;
                
activeColorChanged.call($thisactive);
              },
            
activeColorChanged // Update color when user changes text values
              
function(uicontext)
              {
                if (
context == null || (context != colorBar && context != colorMap)) positionMapAndBarArrows.call($thisuicontext);
                
setTimeout(
                  function()
                  {
                    
updatePreview.call($thisui);
                    
updateMapVisuals.call($thisui);
                    
updateBarVisuals.call($thisui);
                  }, 
0);
              },
            
mapValueChanged // user has dragged the ColorMap pointer
              
function(uicontext)
              {
                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', { sxy.xv100 xy.}, context);
                    break;
                  case 
's':
                  case 
'a':
                    
active.val('hv', { hxy.xv100 xy.}, context);
                    break;
                  case 
'v':
                    
active.val('hs', { hxy.xs100 xy.}, context);
                    break;
                  case 
'r':
                    
active.val('gb', { g255 xy.ybxy.}, context);
                    break;
                  case 
'g':
                    
active.val('rb', { r255 xy.ybxy.}, context);
                    break;
                  case 
'b':
                    
active.val('rg', { rxy.xg255 xy.}, context);
                    break;
                }
              },
            
colorBarValueChanged // user has dragged the ColorBar slider
              
function(uicontext)
              {
                var 
active color.active;
                if (
context != colorBar && active.val() == null) return;
                switch (
settings.color.mode)
                {
                  case 
'h':
                    
active.val('h', { h360 ui.val('y') }, context);
                    break;
                  case 
's':
                    
active.val('s', { s100 ui.val('y') }, context);
                    break;
                  case 
'v':
                    
active.val('v', { v100 ui.val('y') }, context);
                    break;
                  case 
'r':
                    
active.val('r', { r255 ui.val('y') }, context);
                    break;
                  case 
'g':
                    
active.val('g', { g255 ui.val('y') }, context);
                    break;
                  case 
'b':
                    
active.val('b', { b255 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(uicontext)
              {
                if (
context != colorMap)
                {
                  switch (
settings.color.mode)
                  {
                    case 
'h':
                      var 
sv ui.val('sv');
                      
colorMap.val('xy', { xsv != null sv.100y100 - (sv != null sv.100) }, context);
                      break;
                    case 
's':
                    case 
'a':
                      var 
hv ui.val('hv');
                      
colorMap.val('xy', { xhv && hv.|| 0y100 - (hv != null hv.100) }, context);
                      break;
                    case 
'v':
                      var 
hs ui.val('hs');
                      
colorMap.val('xy', { xhs && hs.|| 0y100 - (hs != null hs.100) }, context);
                      break;
                    case 
'r':
                      var 
bg ui.val('bg');
                      
colorMap.val('xy', { xbg && bg.|| 0y255 - (bg && bg.|| 0) }, context);
                      break;
                    case 
'g':
                      var 
br ui.val('br');
                      
colorMap.val('xy', { xbr && br.|| 0y255 - (br && br.|| 0) }, context);
                      break;
                    case 
'b':
                      var 
rg ui.val('rg');
                      
colorMap.val('xy', { xrg && rg.|| 0y255 - (rg && rg.|| 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 
ui.val('s');
                      
colorBar.val('y'100 - (!= null 100), context);
                      break;
                    case 
'v':
                      var 
ui.val('v');
                      
colorBar.val('y'100 - (!= null 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 
ui.val('a');
                      
colorBar.val('y'255 - (!= null 255), context);
                      break;
                  }
                }
              },
            
updatePreview =
              function(
ui)
              {
                try
                {
                  var 
all ui.val('all');
                  
activePreview.css({ backgroundColorall && '#' all.hex || 'transparent' });
                  
setAlpha.call($thisactivePreviewall && Math.precision((all.100) / 2554) || 0);
                }
                catch (
e) { }
              },
            
updateMapVisuals =
              function(
ui)
              {
                switch (
settings.color.mode)
                {
                  case 
'h':
                    
setBG.call($thiscolorMapDiv, new Color({ hui.val('h') || 0s100v100 }).val('hex'));
                    break;
                  case 
's':
                  case 
'a':
                    var 
ui.val('s');
                    
setAlpha.call($thiscolorMapL2100 - (!= null 100));
                    break;
                  case 
'v':
                    var 
ui.val('v');
                    
setAlpha.call($thiscolorMapL1!= null 100);
                    break;
                  case 
'r':
                    
setAlpha.call($thiscolorMapL2Math.precision((ui.val('r') || 0) / 255 1004));
                    break;
                  case 
'g':
                    
setAlpha.call($thiscolorMapL2Math.precision((ui.val('g') || 0) / 255 1004));
                    break;
                  case 
'b':
                    
setAlpha.call($thiscolorMapL2Math.precision((ui.val('b') || 0) / 255 100));
                    break;
                }
                var 
ui.val('a');
                
setAlpha.call($thiscolorMapL3Math.precision(((255 - (|| 0)) * 100) / 2554));
              },
            
updateBarVisuals =
              function(
ui)
              {
                switch (
settings.color.mode)
                {
                  case 
'h':
                    var 
ui.val('a');
                    
setAlpha.call($thiscolorBarL5Math.precision(((255 - (|| 0)) * 100) / 2554));
                    break;
                  case 
's':
                    var 
hva ui.val('hva'),
                        
saturatedColor = new Color({ hhva && hva.|| 0s100vhva != null hva.100 });
                    
setBG.call($thiscolorBarDivsaturatedColor.val('hex'));
                    
setAlpha.call($thiscolorBarL2100 - (hva != null hva.100));
                    
setAlpha.call($thiscolorBarL5Math.precision(((255 - (hva && hva.|| 0)) * 100) / 2554));
                    break;
                  case 
'v':
                    var 
hsa ui.val('hsa'),
                        
valueColor = new Color({ hhsa && hsa.|| 0shsa != null hsa.100v100 });
                    
setBG.call($thiscolorBarDivvalueColor.val('hex'));
                    
setAlpha.call($thiscolorBarL5Math.precision(((255 - (hsa && hsa.|| 0)) * 100) / 2554));
                    break;
                  case 
'r':
                  case 
'g':
                  case 
'b':
                    var 
hValue 0vValue 0rgba ui.val('rgba');
                    if (
settings.color.mode == 'r')
                    {
                      
hValue rgba && rgba.|| 0;
                      
vValue rgba && rgba.|| 0;
                    }
                    else if (
settings.color.mode == 'g')
                    {
                      
hValue rgba && rgba.|| 0;
                      
vValue rgba && rgba.|| 0;
                    }
                    else if (
settings.color.mode == 'b')
                    {
                      
hValue rgba && rgba.|| 0;
                      
vValue rgba && rgba.|| 0;
                    }
                    var 
middle vValue hValue hValue vValue;
                    
setAlpha.call($thiscolorBarL2hValue vValue Math.precision(((hValue vValue) / (255 vValue)) * 1004) : 0);
                    
setAlpha.call($thiscolorBarL3vValue hValue Math.precision(((vValue hValue) / (255 hValue)) * 1004) : 0);
                    
setAlpha.call($thiscolorBarL4Math.precision((middle 255) * 1004));
                    
setAlpha.call($thiscolorBarL5Math.precision(((255 - (rgba && rgba.|| 0)) * 100) / 2554));
                    break;
                  case 
'a':
                    var 
ui.val('a');
                    
setBG.call($thiscolorBarDivui.val('hex') || '000000');
                    
setAlpha.call($thiscolorBarL5!= null 100);
                    
setAlpha.call($thiscolorBarL6!= null 100 0);
                    break;
                }
              },
            
setBG =
              function(
elc)
              {
                
el.css({ backgroundColor&& c.length == && '#' || 'transparent' });
              },
            
setImg =
              function(
imgsrc)
              {
                if (
isLessThanIE7 && (src.indexOf('AlphaBar.png') != -|| src.indexOf('Bars.png') != -|| 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(
imgy)
              {
                
img.css({ top'px' });
              },
            
setAlpha =
              function(
objalpha)
              {
                
obj.css({ visibilityalpha 'visible' 'hidden' });
                if (
alpha && alpha 100)
                {
                  if (
isLessThanIE7)
                  {
                    var 
src obj.attr('pngSrc');
                    if (
src != null && (src.indexOf('AlphaBar.png') != -|| src.indexOf('Bars.png') != -|| 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({ opacityMath.precision(alpha 1004) });
                  }
                  else 
obj.css({ opacityMath.precision(alpha 1004) });
                }
                else if (
alpha == || alpha == 100)
                {
                  if (
isLessThanIE7)
                  {
                    var 
src obj.attr('pngSrc');
                    if (
src != null && (src.indexOf('AlphaBar.png') != -|| src.indexOf('Bars.png') != -|| 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($thise.target.value);
              },
            
currentClicked =
              function()
              {
                
revertColor.call($this);
              },
            
cancelClicked =
              function()
              {
                
revertColor.call($this);
                
settings.window.expandable && hide.call($this);
                $.
isFunction(cancelCallback) && cancelCallback.call($thiscolor.activecancelButton);
              },
            
okClicked =
              function()
              {
                
commitColor.call($this);
                
settings.window.expandable && hide.call($this);
                $.
isFunction(commitCallback) && commitCallback.call($thiscolor.activeokButton);
              },
            
iconImageClicked =
              function()
              {
                
show.call($this);
              },
            
currentColorChanged =
              function(
uicontext)
              {
                var 
hex ui.val('hex');
                
currentPreview.css({ backgroundColorhex && '#' hex || 'transparent' });
                
setAlpha.call($thiscurrentPreviewMath.precision(((ui.val('a') || 0) * 100) / 2554));
              },
            
expandableColorChanged =
              function(
uicontext)
              {
                var 
hex ui.val('hex');
                var 
va ui.val('va');
                
iconColor.css({ backgroundColorhex && '#' hex || 'transparent' });
                
setAlpha.call($thisiconAlphaMath.precision(((255 - (va && va.|| 0)) * 100) / 2554));
                if (
settings.window.bindToInput&&settings.window.updateInputColor)
                  
settings.window.input.css(
                    {
                      
backgroundColorhex && '#' hex || 'transparent',
                      
colorva == null || va.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({ leftelementStartX - (pageStartX e.pageX) + 'px'topelementStartY - (pageStartY e.pageY) + 'px' });
                if (
settings.window.expandable && !$.support.boxModelcontainer.prev().css({ leftcontainer.css("left"), topcontainer.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') || nulle.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('<iframe/>');
                    
container.prev().css({ widthtable.width(), heightcontainer.height(), opacity0position'absolute'leftcontainer.css("left"), topcontainer.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.showattachIFrame);
                    break;
                  case 
'slide':
                    
container.slideDown(settings.window.effects.speed.showattachIFrame);
                    break;
                  case 
'show':
                  default:
                    
container.show(settings.window.effects.speed.showattachIFrame);
                    break;
                }
              },
            
hide =
              function()
              {
                var 
removeIFrame = function()
                  {
                    if (
settings.window.expandablecontainer.css({ zIndex10 });
                    if (!
settings.window.expandable || $.support.boxModel) return;
                    
container.prev().remove();
                  };
                switch (
settings.window.effects.type)
                {
                  case 
'fade':
                    
container.fadeOut(settings.window.effects.speed.hideremoveIFrame);
                    break;
                  case 
'slide':
                    
container.slideUp(settings.window.effects.speed.hideremoveIFrame);
                    break;
                  case 
'show':
                  default:
                    
container.hide(settings.window.effects.speed.hideremoveIFrame);
                    break;
                }
              },
            
initialize =
              function()
              {
                var 
win settings.window,
                    
popup win.expandable ? $($this).next().find('.Container:first') : null;
                
container win.expandable ? $('<div/>') : $($this);
                
container.addClass('jPicker Container');
                if (
win.expandablecontainer.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 0win.alphaPrecision 0;
                else if (
win.alphaPrecision 2win.alphaPrecision 2;
                var 
controlHtml='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>' + (win.expandable '<tr><td class="Move" colspan="5">&nbsp;</td></tr>' '') + '<tr><td rowspan="9"><h2 class="Title">' + (win.title || localization.text.title) + '</h2><div class="Map"><span class="Map1">&nbsp;</span><span class="Map2">&nbsp;</span><span class="Map3">&nbsp;</span><img src="' images.clientPath images.colorMap.arrow.file '" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1">&nbsp;</span><span class="Map2">&nbsp;</span><span class="Map3">&nbsp;</span><span class="Map4">&nbsp;</span><span class="Map5">&nbsp;</span><span class="Map6">&nbsp;</span><img src="' images.clientPath images.colorBar.arrow.file '" class="Arrow"/></div></td><td colspan="2" class="Preview">' localization.text.newColor '<div><span class="Active" title="' localization.tooltips.colors.newColor '">&nbsp;</span><span class="Current" title="' localization.tooltips.colors.currentColor '">&nbsp;</span></div>' localization.text.currentColor '</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="' localization.text.ok '" title="' localization.tooltips.buttons.ok '"/><input type="button" class="Cancel" value="' localization.text.cancel '" title="' localization.tooltips.buttons.cancel '"/><hr/><div class="Grid">&nbsp;</div></td></tr><tr class="Hue"><td class="Radio"><label title="' localization.tooltips.hue.radio '"><input type="radio" value="h"' + (settings.color.mode == 'h' ' checked="checked"' '') + '/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.hue.textbox '"/>&nbsp;&deg;</td></tr><tr class="Saturation"><td class="Radio"><label title="' localization.tooltips.saturation.radio '"><input type="radio" value="s"' + (settings.color.mode == 's' ' checked="checked"' '') + '/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.saturation.textbox '"/>&nbsp;%</td></tr><tr class="Value"><td class="Radio"><label title="' localization.tooltips.value.radio '"><input type="radio" value="v"' + (settings.color.mode == 'v' ' checked="checked"' '') + '/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.value.textbox '"/>&nbsp;%<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="' localization.tooltips.red.radio '"><input type="radio" value="r"' + (settings.color.mode == 'r' ' checked="checked"' '') + '/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.red.textbox '"/></td></tr><tr class="Green"><td class="Radio"><label title="' localization.tooltips.green.radio '"><input type="radio" value="g"' + (settings.color.mode == 'g' ' checked="checked"' '') + '/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.green.textbox '"/></td></tr><tr class="Blue"><td class="Radio"><label title="' localization.tooltips.blue.radio '"><input type="radio" value="b"' + (settings.color.mode == 'b' ' checked="checked"' '') + '/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null all.'') + '" title="' localization.tooltips.blue.textbox '"/></td></tr><tr class="Alpha"><td class="Radio">' + (win.alphaSupport '<label title="' localization.tooltips.alpha.radio '"><input type="radio" value="a"' + (settings.color.mode == 'a' ' checked="checked"' '') + '/>A:</label>' '&nbsp;') + '</td><td class="Text">' + (win.alphaSupport '<input type="text" maxlength="' + (win.alphaPrecision) + '" value="' + (all != null Math.precision((all.100) / 255win.alphaPrecision) : '') + '" title="' localization.tooltips.alpha.textbox '"/>&nbsp;%' '&nbsp;') + '</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="' localization.tooltips.hex.textbox '">#:<input type="text" maxlength="6" class="Hex" value="' + (all != null all.hex '') + '"/></label>' + (win.alphaSupport '<input type="text" maxlength="2" class="AHex" value="' + (all != null all.ahex.substring(6) : '') + '" title="' localization.tooltips.hex.alpha '"/></td>' '&nbsp;') + '</tr></tbody></table>';
                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.== 'left' ? (popup.offset().left 530 - (win.position.== 'center' 25 0)) + 'px' :
                        
win.position.== 'center' ? (popup.offset().left 260) + 'px' :
                        
win.position.== 'right' ? (popup.offset().left 10 + (win.position.== 'center' 25 0)) + 'px' :
                        
win.position.== 'screenCenter' ? (($(document).width() >> 1) - 260) + 'px' : (popup.offset().left parseInt(win.position.x)) + 'px',
                      
position'absolute',
                      
topwin.position.== 'top' ? (popup.offset().top 312) + 'px' :
                           
win.position.== 'center' ? (popup.offset().top 156) + 'px' :
                           
win.position.== '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:
                    {
                      
widthimages.colorMap.width,
                      
heightimages.colorMap.height
                    
},
                    
arrow:
                    {
                      
imageimages.clientPath images.colorMap.arrow.file,
                      
widthimages.colorMap.arrow.width,
                      
heightimages.colorMap.arrow.height
                    
}
                  });
                
colorMap.bind(mapValueChanged);
                
colorBar = new Slider(colorBarDiv,
                  {
                    
map:
                    {
                      
widthimages.colorBar.width,
                      
heightimages.colorBar.height
                    
},
                    
arrow:
                    {
                      
imageimages.clientPath images.colorBar.arrow.file,
                      
widthimages.colorBar.arrow.width,
                      
heightimages.colorBar.arrow.height
                    
}
                  });
                
colorBar.bind(colorBarValueChanged);
                
colorPicker = new ColorValuePicker(tbodycolor.activewin.expandable && win.bindToInput win.input nullwin.alphaPrecision);
                var 
hex all != null all.hex null,
                    
preview tbody.find('.Preview'),
                    
button tbody.find('.Button');
                
activePreview preview.find('.Active:first').css({ backgroundColorhex && '#' hex || 'transparent' });
                
currentPreview preview.find('.Current:first').css({ backgroundColorhex && '#' hex || 'transparent' }).bind('click'currentClicked);
                
setAlpha.call($thiscurrentPreviewMath.precision(color.current.val('a') * 100) / 2554);
                
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($thiscolorMapL1images.clientPath 'Maps.png');
                    
setImg.call($thiscolorMapL2images.clientPath 'Maps.png');
                    
setImg.call($thiscolorMapL3images.clientPath 'map-opacity.png');
                    
setImg.call($thiscolorBarL1images.clientPath 'Bars.png');
                    
setImg.call($thiscolorBarL2images.clientPath 'Bars.png');
                    
setImg.call($thiscolorBarL3images.clientPath 'Bars.png');
                    
setImg.call($thiscolorBarL4images.clientPath 'Bars.png');
                    
setImg.call($thiscolorBarL5images.clientPath 'bar-opacity.png');
                    
setImg.call($thiscolorBarL6images.clientPath 'AlphaBar.png');
                    
setImg.call($thispreview.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 (
0color.quickList.lengthi++)
                  {
                    
/* if default colors are hex strings, change them to color objects */
                    
if ((typeof (color.quickList[i])).toString().toLowerCase() == 'string'color.quickList[i] = new Color({ hexcolor.quickList[i] });
                    var 
alpha color.quickList[i].val('a');
                    var 
ahex color.quickList[i].val('ahex');
                    if (!
win.alphaSupport && ahexahex ahex.substring(06) + 'ff';
                    var 
quickHex color.quickList[i].val('hex');
                    
html+='<span class="QuickColor"' + (ahex && ' title="#' ahex '"' || '') + ' style="background-color:' + (quickHex && '#' quickHex || '') + ';' + (quickHex '' 'background-image:url(' images.clientPath 'NoColor.png)') + (win.alphaSupport && alpha && alpha 255 ';opacity:' Math.precision(alpha 2554) + ';filter:Alpha(opacity=' Math.precision(alpha 2.554) + ')' '') + '">&nbsp;</span>';
                  }
                  
setImg.call($thisgridimages.clientPath 'bar-opacity.png');
                  
grid.html(html);
                  
grid.find('.QuickColor').click(quickPickClicked);
                }
                
setColorMode.call($thissettings.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({ backgroundColorhex && '#' hex || 'transparent' });
                  
iconAlpha $this.icon.find('.Alpha:first');
                  
setImg.call($thisiconAlphaimages.clientPath 'bar-opacity.png');
                  
setAlpha.call($thisiconAlphaMath.precision(((255 - (all != null all.0)) * 100) / 2554));
                  
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(
                      {
                        
backgroundColorhex && '#' hex || 'transparent',
                        
colorall == null || all.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.html('');
                for (
0< List.lengthi++) if (List[i] == $this) List.splice(i1);
              },
            
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(06) + 'ff' settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(06) + '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(06) + 'ff' settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(06) + 'ff' settings.color.active.val('ahex') }),
                
quickListsettings.color.quickList
              
};
          $.
extend(true$this// public properties, methods, and callbacks
            
{
              
commitCallbackcommitCallback// commitCallback function can be overridden to return the selected color to a method you specify when the user clicks "OK"
              
liveCallbackliveCallback// liveCallback function can be overridden to return the selected color to a method you specify in live mode (continuous update)
              
cancelCallbackcancelCallback// cancelCallback function can be overridden to a method you specify when the user clicks "Cancel"
              
colorcolor,
              
showshow,
              
hidehide,
              
destroydestroy // 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:
        {
          
titlenull/* 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 */
          
},
          
expandablefalse/* default to large static picker - set to true to make an expandable picker (small icon with popup) - set automatically when binded to input element */
          
liveUpdatetrue/* set false if you want the user to have to click "OK" before the binded input box updates values (always "true" for expandable picker) */
          
alphaSupportfalse/* set to true to enable alpha picking */
          
alphaPrecision0/* set decimal precision for alpha percentage display - hex codes do not map directly to percentage integers - range 0-2 */
          
updateInputColortrue /* 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({ h360s33v100 }), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */
              
new Color({ h360s66v100 }),
              new 
Color({ h360s100v100 }),
              new 
Color({ h360s100v75 }),
              new 
Color({ h360s100v50 }),
              new 
Color({ h180s0v100 }),
              new 
Color({ h30s33v100 }),
              new 
Color({ h30s66v100 }),
              new 
Color({ h30s100v100 }),
              new 
Color({ h30s100v75 }),
              new 
Color({ h30s100v50 }),
              new 
Color({ h180s0v90 }),
              new 
Color({ h60s33v100 }),
              new 
Color({ h60s66v100 }),
              new 
Color({ h60s100v100 }),
              new 
Color({ h60s100v75 }),
              new 
Color({ h60s100v50 }),
              new 
Color({ h180s0v80 }),
              new 
Color({ h90s33v100 }),
              new 
Color({ h90s66v100 }),
              new 
Color({ h90s100v100 }),
              new 
Color({ h90s100v75 }),
              new 
Color({ h90s100v50 }),
              new 
Color({ h180s0v70 }),
              new 
Color({ h120s33v100 }),
              new 
Color({ h120s66v100 }),
              new 
Color({ h120s100v100 }),
              new 
Color({ h120s100v75 }),
              new 
Color({ h120s100v50 }),
              new 
Color({ h180s0v60 }),
              new 
Color({ h150s33v100 }),
              new 
Color({ h150s66v100 }),
              new 
Color({ h150s100v100 }),
              new 
Color({ h150s100v75 }),
              new 
Color({ h150s100v50 }),
              new 
Color({ h180s0v50 }),
              new 
Color({ h180s33v100 }),
              new 
Color({ h180s66v100 }),
              new 
Color({ h180s100v100 }),
              new 
Color({ h180s100v75 }),
              new 
Color({ h180s100v50 }),
              new 
Color({ h180s0v40 }),
              new 
Color({ h210s33v100 }),
              new 
Color({ h210s66v100 }),
              new 
Color({ h210s100v100 }),
              new 
Color({ h210s100v75 }),
              new 
Color({ h210s100v50 }),
              new 
Color({ h180s0v30 }),
              new 
Color({ h240s33v100 }),
              new 
Color({ h240s66v100 }),
              new 
Color({ h240s100v100 }),
              new 
Color({ h240s100v75 }),
              new 
Color({ h240s100v50 }),
              new 
Color({ h180s0v20 }),
              new 
Color({ h270s33v100 }),
              new 
Color({ h270s66v100 }),
              new 
Color({ h270s100v100 }),
              new 
Color({ h270s100v75 }),
              new 
Color({ h270s100v50 }),
              new 
Color({ h180s0v10 }),
              new 
Color({ h300s33v100 }),
              new 
Color({ h300s66v100 }),
              new 
Color({ h300s100v100 }),
              new 
Color({ h300s100v75 }),
              new 
Color({ h300s100v50 }),
              new 
Color({ h180s0v}),
              new 
Color({ h330s33v100 }),
              new 
Color({ h330s66v100 }),
              new 
Color({ h330s100v100 }),
              new 
Color({ h330s100v75 }),
              new 
Color({ h330s100v50 }),
              new 
Color()
            ]
        },
      
images:
        {
          
clientPath'/jPicker/images/'/* Path to image files */
          
colorMap:
          {
            
width256,
            
height256,
            
arrow:
            {
              
file'mappoint.gif'/* ColorMap arrow icon */
              
width15,
              
height15
            
}
          },
          
colorBar:
          {
            
width20,
            
height256,
            
arrow:
            {
              
file'rangearrows.gif'/* ColorBar arrow icon */
              
width20,
              
height7
            
}
          },
          
picker:
          {
            
file'picker.gif'/* Color Picker icon */
            
width25,
            
height24
          
}
        },
      
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 &ldquo;OK&rdquo; 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 &ldquo;Hue&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Hue&rdquo; Value (0-360&deg;)'
            
},
            
saturation:
            {
              
radio'Set To &ldquo;Saturation&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Saturation&rdquo; Value (0-100%)'
            
},
            
value:
            {
              
radio'Set To &ldquo;Value&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Value&rdquo; Value (0-100%)'
            
},
            
red:
            {
              
radio'Set To &ldquo;Red&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Red&rdquo; Value (0-255)'
            
},
            
green:
            {
              
radio'Set To &ldquo;Green&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Green&rdquo; Value (0-255)'
            
},
            
blue:
            {
              
radio'Set To &ldquo;Blue&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Blue&rdquo; Value (0-255)'
            
},
            
alpha:
            {
              
radio'Set To &ldquo;Alpha&rdquo; Color Mode',
              
textbox'Enter A &ldquo;Alpha&rdquo; Value (0-100)'
            
},
            
hex:
            {
              
textbox'Enter A &ldquo;Hex&rdquo; Color Value (#000000-#ffffff)',
              
alpha'Enter A &ldquo;Alpha&rdquo; Value (#00-#ff)'
            
}
          }
        }
    };
})(
jQuery'1.1.6');
?>
Онлайн: 0
Реклама