diff --git a/library/colorpicker/css/colorpicker.css b/library/colorpicker/css/colorpicker.css new file mode 100644 index 000000000..05b02b485 --- /dev/null +++ b/library/colorpicker/css/colorpicker.css @@ -0,0 +1,161 @@ +.colorpicker { + width: 356px; + height: 176px; + overflow: hidden; + position: absolute; + background: url(../images/colorpicker_background.png); + font-family: Arial, Helvetica, sans-serif; + display: none; +} +.colorpicker_color { + width: 150px; + height: 150px; + left: 14px; + top: 13px; + position: absolute; + background: #f00; + overflow: hidden; + cursor: crosshair; +} +.colorpicker_color div { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url(../images/colorpicker_overlay.png); +} +.colorpicker_color div div { + position: absolute; + top: 0; + left: 0; + width: 11px; + height: 11px; + overflow: hidden; + background: url(../images/colorpicker_select.gif); + margin: -5px 0 0 -5px; +} +.colorpicker_hue { + position: absolute; + top: 13px; + left: 171px; + width: 35px; + height: 150px; + cursor: n-resize; +} +.colorpicker_hue div { + position: absolute; + width: 35px; + height: 9px; + overflow: hidden; + background: url(../images/colorpicker_indic.gif) left top; + margin: -4px 0 0 0; + left: 0px; +} +.colorpicker_new_color { + position: absolute; + width: 60px; + height: 30px; + left: 213px; + top: 13px; + background: #f00; +} +.colorpicker_current_color { + position: absolute; + width: 60px; + height: 30px; + left: 283px; + top: 13px; + background: #f00; +} +.colorpicker input { + background-color: transparent; + border: 1px solid transparent; + position: absolute; + font-size: 10px; + font-family: Arial, Helvetica, sans-serif; + color: #898989; + top: 4px; + right: 11px; + text-align: right; + margin: 0; + padding: 0; + height: 11px; +} +.colorpicker_hex { + position: absolute; + width: 72px; + height: 22px; + background: url(../images/colorpicker_hex.png) top; + left: 212px; + top: 142px; +} +.colorpicker_hex input { + right: 6px; +} +.colorpicker_field { + height: 22px; + width: 62px; + background-position: top; + position: absolute; +} +.colorpicker_field span { + position: absolute; + width: 12px; + height: 22px; + overflow: hidden; + top: 0; + right: 0; + cursor: n-resize; +} +.colorpicker_rgb_r { + background-image: url(../images/colorpicker_rgb_r.png); + top: 52px; + left: 212px; +} +.colorpicker_rgb_g { + background-image: url(../images/colorpicker_rgb_g.png); + top: 82px; + left: 212px; +} +.colorpicker_rgb_b { + background-image: url(../images/colorpicker_rgb_b.png); + top: 112px; + left: 212px; +} +.colorpicker_hsb_h { + background-image: url(../images/colorpicker_hsb_h.png); + top: 52px; + left: 282px; +} +.colorpicker_hsb_s { + background-image: url(../images/colorpicker_hsb_s.png); + top: 82px; + left: 282px; +} +.colorpicker_hsb_b { + background-image: url(../images/colorpicker_hsb_b.png); + top: 112px; + left: 282px; +} +.colorpicker_submit { + position: absolute; + width: 22px; + height: 22px; + background: url(../images/colorpicker_submit.png) top; + left: 322px; + top: 142px; + overflow: hidden; +} +.colorpicker_focus { + background-position: center; +} +.colorpicker_hex.colorpicker_focus { + background-position: bottom; +} +.colorpicker_submit.colorpicker_focus { + background-position: bottom; +} +.colorpicker_slider { + background-position: bottom; +} diff --git a/library/colorpicker/css/layout.css b/library/colorpicker/css/layout.css new file mode 100644 index 000000000..8b3f00ff3 --- /dev/null +++ b/library/colorpicker/css/layout.css @@ -0,0 +1,218 @@ +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { + margin:0; + padding:0; +} +table { + border-collapse:collapse; + border-spacing:0; +} +fieldset,img { + border:0; +} +address,caption,cite,code,dfn,em,strong,th,var { + font-style:normal; + font-weight:normal; +} +ol,ul { + list-style:none; +} +caption,th { + text-align:left; +} +h1,h2,h3,h4,h5,h6 { + font-size:100%; + font-weight:normal; +} +q:before,q:after { + content:''; +} +abbr,acronym { border:0; +} +html, body { + background-color: #fff; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + line-height: 18px; + color: #52697E; +} +body { + text-align: center; + overflow: auto; +} +.wrapper { + width: 700px; + margin: 0 auto; + text-align: left; +} +h1 { + font-size: 21px; + height: 47px; + line-height: 47px; + text-transform: uppercase; +} +.navigationTabs { + height: 23px; + line-height: 23px; + border-bottom: 1px solid #ccc; +} +.navigationTabs li { + float: left; + height: 23px; + line-height: 23px; + padding-right: 3px; +} +.navigationTabs li a{ + float: left; + dispaly: block; + height: 23px; + line-height: 23px; + padding: 0 10px; + overflow: hidden; + color: #52697E; + background-color: #eee; + position: relative; + text-decoration: none; +} +.navigationTabs li a:hover { + background-color: #f0f0f0; +} +.navigationTabs li a.active { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: 0px solid; +} +.tabsContent { + border: 1px solid #ccc; + border-top: 0px solid; + width: 698px; + overflow: hidden; +} +.tab { + padding: 16px; + display: none; +} +.tab h2 { + font-weight: bold; + font-size: 16px; +} +.tab h3 { + font-weight: bold; + font-size: 14px; + margin-top: 20px; +} +.tab p { + margin-top: 16px; + clear: both; +} +.tab ul { + margin-top: 16px; + list-style: disc; +} +.tab li { + margin: 10px 0 0 35px; +} +.tab a { + color: #8FB0CF; +} +.tab strong { + font-weight: bold; +} +.tab pre { + font-size: 11px; + margin-top: 20px; + width: 668px; + overflow: auto; + clear: both; +} +.tab table { + width: 100%; +} +.tab table td { + padding: 6px 10px 6px 0; + vertical-align: top; +} +.tab dt { + margin-top: 16px; +} + +#colorSelector { + position: relative; + width: 36px; + height: 36px; + background: url(../images/select.png); +} +#colorSelector div { + position: absolute; + top: 3px; + left: 3px; + width: 30px; + height: 30px; + background: url(../images/select.png) center; +} +#colorSelector2 { + position: absolute; + top: 0; + left: 0; + width: 36px; + height: 36px; + background: url(../images/select2.png); +} +#colorSelector2 div { + position: absolute; + top: 4px; + left: 4px; + width: 28px; + height: 28px; + background: url(../images/select2.png) center; +} +#colorpickerHolder2 { + top: 32px; + left: 0; + width: 356px; + height: 0; + overflow: hidden; + position: absolute; +} +#colorpickerHolder2 .colorpicker { + background-image: url(../images/custom_background.png); + position: absolute; + bottom: 0; + left: 0; +} +#colorpickerHolder2 .colorpicker_hue div { + background-image: url(../images/custom_indic.gif); +} +#colorpickerHolder2 .colorpicker_hex { + background-image: url(../images/custom_hex.png); +} +#colorpickerHolder2 .colorpicker_rgb_r { + background-image: url(../images/custom_rgb_r.png); +} +#colorpickerHolder2 .colorpicker_rgb_g { + background-image: url(../images/custom_rgb_g.png); +} +#colorpickerHolder2 .colorpicker_rgb_b { + background-image: url(../images/custom_rgb_b.png); +} +#colorpickerHolder2 .colorpicker_hsb_s { + background-image: url(../images/custom_hsb_s.png); + display: none; +} +#colorpickerHolder2 .colorpicker_hsb_h { + background-image: url(../images/custom_hsb_h.png); + display: none; +} +#colorpickerHolder2 .colorpicker_hsb_b { + background-image: url(../images/custom_hsb_b.png); + display: none; +} +#colorpickerHolder2 .colorpicker_submit { + background-image: url(../images/custom_submit.png); +} +#colorpickerHolder2 .colorpicker input { + color: #778398; +} +#customWidget { + position: relative; + height: 36px; +} diff --git a/library/colorpicker/images/blank.gif b/library/colorpicker/images/blank.gif new file mode 100644 index 000000000..75b945d25 Binary files /dev/null and b/library/colorpicker/images/blank.gif differ diff --git a/library/colorpicker/images/colorpicker_background.png b/library/colorpicker/images/colorpicker_background.png new file mode 100644 index 000000000..8401572f1 Binary files /dev/null and b/library/colorpicker/images/colorpicker_background.png differ diff --git a/library/colorpicker/images/colorpicker_hex.png b/library/colorpicker/images/colorpicker_hex.png new file mode 100644 index 000000000..4e532d7c6 Binary files /dev/null and b/library/colorpicker/images/colorpicker_hex.png differ diff --git a/library/colorpicker/images/colorpicker_hsb_b.png b/library/colorpicker/images/colorpicker_hsb_b.png new file mode 100644 index 000000000..dfac595d0 Binary files /dev/null and b/library/colorpicker/images/colorpicker_hsb_b.png differ diff --git a/library/colorpicker/images/colorpicker_hsb_h.png b/library/colorpicker/images/colorpicker_hsb_h.png new file mode 100644 index 000000000..3977ed9f2 Binary files /dev/null and b/library/colorpicker/images/colorpicker_hsb_h.png differ diff --git a/library/colorpicker/images/colorpicker_hsb_s.png b/library/colorpicker/images/colorpicker_hsb_s.png new file mode 100644 index 000000000..a2a699736 Binary files /dev/null and b/library/colorpicker/images/colorpicker_hsb_s.png differ diff --git a/library/colorpicker/images/colorpicker_indic.gif b/library/colorpicker/images/colorpicker_indic.gif new file mode 100644 index 000000000..f9fa95e28 Binary files /dev/null and b/library/colorpicker/images/colorpicker_indic.gif differ diff --git a/library/colorpicker/images/colorpicker_overlay.png b/library/colorpicker/images/colorpicker_overlay.png new file mode 100644 index 000000000..561cdd9c5 Binary files /dev/null and b/library/colorpicker/images/colorpicker_overlay.png differ diff --git a/library/colorpicker/images/colorpicker_rgb_b.png b/library/colorpicker/images/colorpicker_rgb_b.png new file mode 100644 index 000000000..dfac595d0 Binary files /dev/null and b/library/colorpicker/images/colorpicker_rgb_b.png differ diff --git a/library/colorpicker/images/colorpicker_rgb_g.png b/library/colorpicker/images/colorpicker_rgb_g.png new file mode 100644 index 000000000..72b32760a Binary files /dev/null and b/library/colorpicker/images/colorpicker_rgb_g.png differ diff --git a/library/colorpicker/images/colorpicker_rgb_r.png b/library/colorpicker/images/colorpicker_rgb_r.png new file mode 100644 index 000000000..4855fe03f Binary files /dev/null and b/library/colorpicker/images/colorpicker_rgb_r.png differ diff --git a/library/colorpicker/images/colorpicker_select.gif b/library/colorpicker/images/colorpicker_select.gif new file mode 100644 index 000000000..599f7f13a Binary files /dev/null and b/library/colorpicker/images/colorpicker_select.gif differ diff --git a/library/colorpicker/images/colorpicker_submit.png b/library/colorpicker/images/colorpicker_submit.png new file mode 100644 index 000000000..7f4c0825f Binary files /dev/null and b/library/colorpicker/images/colorpicker_submit.png differ diff --git a/library/colorpicker/images/custom_background.png b/library/colorpicker/images/custom_background.png new file mode 100644 index 000000000..cf55ffdd6 Binary files /dev/null and b/library/colorpicker/images/custom_background.png differ diff --git a/library/colorpicker/images/custom_hex.png b/library/colorpicker/images/custom_hex.png new file mode 100644 index 000000000..888f44449 Binary files /dev/null and b/library/colorpicker/images/custom_hex.png differ diff --git a/library/colorpicker/images/custom_hsb_b.png b/library/colorpicker/images/custom_hsb_b.png new file mode 100644 index 000000000..2f99dae8e Binary files /dev/null and b/library/colorpicker/images/custom_hsb_b.png differ diff --git a/library/colorpicker/images/custom_hsb_h.png b/library/colorpicker/images/custom_hsb_h.png new file mode 100644 index 000000000..a217e9218 Binary files /dev/null and b/library/colorpicker/images/custom_hsb_h.png differ diff --git a/library/colorpicker/images/custom_hsb_s.png b/library/colorpicker/images/custom_hsb_s.png new file mode 100644 index 000000000..7826b4150 Binary files /dev/null and b/library/colorpicker/images/custom_hsb_s.png differ diff --git a/library/colorpicker/images/custom_indic.gif b/library/colorpicker/images/custom_indic.gif new file mode 100644 index 000000000..222fb94cf Binary files /dev/null and b/library/colorpicker/images/custom_indic.gif differ diff --git a/library/colorpicker/images/custom_rgb_b.png b/library/colorpicker/images/custom_rgb_b.png new file mode 100644 index 000000000..80764e5d6 Binary files /dev/null and b/library/colorpicker/images/custom_rgb_b.png differ diff --git a/library/colorpicker/images/custom_rgb_g.png b/library/colorpicker/images/custom_rgb_g.png new file mode 100644 index 000000000..fc9778be1 Binary files /dev/null and b/library/colorpicker/images/custom_rgb_g.png differ diff --git a/library/colorpicker/images/custom_rgb_r.png b/library/colorpicker/images/custom_rgb_r.png new file mode 100644 index 000000000..91b0cd4c5 Binary files /dev/null and b/library/colorpicker/images/custom_rgb_r.png differ diff --git a/library/colorpicker/images/custom_submit.png b/library/colorpicker/images/custom_submit.png new file mode 100644 index 000000000..cd202cd93 Binary files /dev/null and b/library/colorpicker/images/custom_submit.png differ diff --git a/library/colorpicker/images/select.png b/library/colorpicker/images/select.png new file mode 100644 index 000000000..21213bfd5 Binary files /dev/null and b/library/colorpicker/images/select.png differ diff --git a/library/colorpicker/images/select2.png b/library/colorpicker/images/select2.png new file mode 100644 index 000000000..2cd2cabeb Binary files /dev/null and b/library/colorpicker/images/select2.png differ diff --git a/library/colorpicker/images/slider.png b/library/colorpicker/images/slider.png new file mode 100644 index 000000000..8b03da96e Binary files /dev/null and b/library/colorpicker/images/slider.png differ diff --git a/library/colorpicker/index.html b/library/colorpicker/index.html new file mode 100644 index 000000000..e1ad5782d --- /dev/null +++ b/library/colorpicker/index.html @@ -0,0 +1,184 @@ + + +
+ + +A simple component to select color in the same way you select color in Adobe Photoshop
+23.05.2009 - Check Download tab
+Dual licensed under the MIT and GPL licenses.
+Flat mode.
++
++$('#colorpickerHolder').ColorPicker({flat: true}); ++
Custom skin and using flat mode to display the color picker in a custom widget.
+Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.
+ + + +$('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({ + onSubmit: function(hsb, hex, rgb, el) { + $(el).val(hex); + $(el).ColorPickerHide(); + }, + onBeforeShow: function () { + $(this).ColorPickerSetColor(this.value); + } +}) +.bind('keyup', function(){ + $(this).ColorPickerSetColor(this.value); +}); ++
Attached to DOMElement and using callbacks to live preview the color and adding animation.
++
+$('#colorSelector').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + $(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + $(colpkr).fadeOut(500); + return false; + }, + onChange: function (hsb, hex, rgb) { + $('#colorSelector div').css('backgroundColor', '#' + hex); + } +}); ++
colorpicker.zip (73 kb): jQuery, Javscript files, CSS files, images, examples and instructions.
+Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths to images and change colors to fit your site theme.
++<link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" /> +<script type="text/javascript" src="js/colorpicker.js"></script> ++
All you have to do is to select the elements in a jQuery way and call the plugin.
++ $('input').ColorPicker(options); ++
A hash of parameters. All parameters are optional.
+eventName | +string | +The desired event to trigger the colorpicker. Default: 'click' | +
color | +string or hash | +The default color. String for hex color or hash for RGB and HSB ({r:255, r:0, b:0}) . Default: 'ff0000' | +
flat | +boolean | +Whatever if the color picker is appended to the element or triggered by an event. Default false | +
livePreview | +boolean | +Whatever if the color values are filled in the fields while changing values on selector or a field. If false it may improve speed. Default true | +
onShow | +function | +Callback function triggered when the color picker is shown | +
onBeforeShow | +function | +Callback function triggered before the color picker is shown | +
onHide | +function | +Callback function triggered when the color picker is hidden | +
onChange | +function | +Callback function triggered when the color is changed | +
onSubmit | +function | +Callback function triggered when the color it is chosen | +
If you want to set a new color.
+$('input').ColorPickerSetColor(color);+
The 'color' argument is the same format as the option color, string for hex color or hash for RGB and HSB ({r:255, r:0, b:0}).
+