Commit e4e90cc1 authored by Gabriel Monnerat's avatar Gabriel Monnerat

2010-11-02 gabriel

* The initial commit

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39807 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3dfc17d4
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>colorpicker</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>jquery.colorPicker.css</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string>div.color_picker {\n
height: 16px;\n
width: 16px;\n
padding: 0 !important;\n
border: 1px solid #ccc;\n
background: url(arrow.gif) no-repeat top right;\n
cursor: pointer;\n
line-height: 16px;\n
}\n
\n
div#color_selector {\n
width: 110px;\n
position: absolute;\n
border: 1px solid #598FEF;\n
background-color: #EFEFEF;\n
padding: 2px;\n
}\n
div#color_custom {width: 100%; float:left }\n
div#color_custom label {font-size: 95%; color: #2F2F2F; margin: 5px 2px; width: 25%}\n
div#color_custom input {margin: 5px 2px; padding: 0; font-size: 95%; border: 1px solid #000; width: 65%; }\n
\n
div.color_swatch {\n
height: 12px;\n
width: 12px;\n
border: 1px solid #000;\n
margin: 2px;\n
float: left;\n
cursor: pointer;\n
line-height: 12px;\n
}\n
</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts79962420.93</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>jquery.colorPicker.min.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(c){c.fn.colorPicker=function(){if(this.length>0){buildSelector()}return this.each(function(d){buildPicker(this)})};var a;var b=false;buildPicker=function(d){control=c("<div class=\'color_picker\'>&nbsp;</div>");control.css("background-color",c(d).val());control.bind("click",toggleSelector);c(d).after(control);c(d).hide()};buildSelector=function(){selector=c("<div id=\'color_selector\'></div>");c.each(c.fn.colorPicker.defaultColors,function(d){swatch=c("<div class=\'color_swatch\'>&nbsp;</div>");swatch.css("background-color","#"+this);swatch.bind("click",function(f){changeColor(c(this).css("background-color"))});swatch.bind("mouseover",function(f){c(this).css("border-color","#598FEF");c("input#color_value").val(toHex(c(this).css("background-color")))});swatch.bind("mouseout",function(f){c(this).css("border-color","#000");c("input#color_value").val(toHex(c(a).css("background-color")))});swatch.appendTo(selector)});hex_field=c("<label for=\'color_value\'>Hex</label><input type=\'text\' size=\'8\' id=\'color_value\'/>");hex_field.bind("keydown",function(d){if(d.keyCode==13){changeColor(c(this).val())}if(d.keyCode==27){toggleSelector()}});c("<div id=\'color_custom\'></div>").append(hex_field).appendTo(selector);c("body").append(selector);selector.hide()};checkMouse=function(e){var d="div#color_selector";var f=c(e.target).parents(d).length;if(e.target==c(d)[0]||e.target==a||f>0){return}hideSelector()};hideSelector=function(){var d=c("div#color_selector");c(document).unbind("mousedown",checkMouse);d.hide();b=false};showSelector=function(){var d=c("div#color_selector");d.css({top:c(a).offset().top+(c(a).outerHeight()),left:c(a).offset().left});hexColor=c(a).next("input").val();c("input#color_value").val(hexColor);d.show();c(document).bind("mousedown",checkMouse);b=true};toggleSelector=function(d){a=this;b?hideSelector():showSelector()};changeColor=function(d){if(selectedValue=toHex(d)){c(a).css("background-color",selectedValue);c(a).prev("input").val(selectedValue).change();hideSelector()}};toHex=function(e){if(e.match(/[0-9a-fA-F]{3}$/)||e.match(/[0-9a-fA-F]{6}$/)){e=(e.charAt(0)=="#")?e:("#"+e)}else{if(e.match(/^rgb\\(([0-9]|[1-9][0-9]|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5]),[ ]{0,1}([0-9]|[1-9][0-9]|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5]),[ ]{0,1}([0-9]|[1-9][0-9]|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5])\\)$/)){var j=([parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3)]);var i=function(l){if(l.length<2){for(var k=0,g=2-l.length;k<g;k++){l="0"+l}}return l};if(j.length==3){var h=i(j[0].toString(16)),f=i(j[1].toString(16)),d=i(j[2].toString(16));e="#"+h+f+d}}else{e=false}}return e};c.fn.colorPicker.addColors=function(d){c.fn.colorPicker.defaultColors=c.fn.colorPicker.defaultColors.concat(d)};c.fn.colorPicker.defaultColors=["000000","993300","333300","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","999999","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFFF","99CCFF","FFFFFF"]})(jQuery);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3097</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-11-02 gabriel
* The initial commit
\ No newline at end of file
2010 (c) Nexedi SA
\ No newline at end of file
erp5_jquery
\ No newline at end of file
Easy to implement and simple jQuery component to select color in the same way you select color in GIMP.
\ No newline at end of file
portal_skins/erp5_jquery/plugin/colorpicker
portal_skins/erp5_jquery/plugin/colorpicker/**
\ No newline at end of file
erp5_jquery_plugin_colorpicker
\ No newline at end of file
5.4.7
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment