yui-rails-asset 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (398) hide show
  1. data/LICENSE +21 -0
  2. data/README +17 -0
  3. data/lib/yui/rails.rb +29 -0
  4. data/lib/yui/rails/engine.rb +10 -0
  5. data/lib/yui/rails/version.rb +6 -0
  6. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-debug.js +1396 -0
  7. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-min.js +23 -0
  8. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation.js +1392 -0
  9. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/ajax-loader.gif +0 -0
  10. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/asc.gif +0 -0
  11. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/autocomplete.css +7 -0
  12. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-h.png +0 -0
  13. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-v.png +0 -0
  14. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-h.png +0 -0
  15. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-v.png +0 -0
  16. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-h.gif +0 -0
  17. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-v.gif +0 -0
  18. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/blankimage.png +0 -0
  19. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/button.css +7 -0
  20. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/calendar.css +8 -0
  21. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/carousel.css +7 -0
  22. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check0.gif +0 -0
  23. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check1.gif +0 -0
  24. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check2.gif +0 -0
  25. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/colorpicker.css +7 -0
  26. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/container.css +7 -0
  27. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/datatable.css +8 -0
  28. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/desc.gif +0 -0
  29. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-dn.png +0 -0
  30. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-up.png +0 -0
  31. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-knob.gif +0 -0
  32. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite-active.gif +0 -0
  33. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite.gif +0 -0
  34. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor.css +10 -0
  35. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/header_background.png +0 -0
  36. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/hue_bg.png +0 -0
  37. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/imagecropper.css +7 -0
  38. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout.css +7 -0
  39. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout_sprite.png +0 -0
  40. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/loading.gif +0 -0
  41. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/logger.css +7 -0
  42. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
  43. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow.png +0 -0
  44. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu.css +7 -0
  45. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
  46. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
  47. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox.png +0 -0
  48. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
  49. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator.png +0 -0
  50. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
  51. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/paginator.css +7 -0
  52. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/picker_mask.png +0 -0
  53. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/profilerviewer.css +7 -0
  54. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/progressbar.css +7 -0
  55. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/resize.css +7 -0
  56. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/simpleeditor.css +10 -0
  57. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/skin.css +36 -0
  58. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/slider.css +7 -0
  59. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-active.png +0 -0
  60. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-disabled.png +0 -0
  61. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-focus.png +0 -0
  62. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-hover.png +0 -0
  63. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow.png +0 -0
  64. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.png +0 -0
  65. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.psd +0 -0
  66. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/tabview.css +8 -0
  67. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-loading.gif +0 -0
  68. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-sprite.gif +0 -0
  69. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview.css +7 -0
  70. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/wait.gif +0 -0
  71. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/yuitest.css +7 -0
  72. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/autocomplete-core.css +7 -0
  73. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete-skin.css +57 -0
  74. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css +7 -0
  75. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-debug.js +3009 -0
  76. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-min.js +12 -0
  77. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete.js +2966 -0
  78. data/vendor/assets/javascripts/yui-2.8.1/build/base/base-min.css +7 -0
  79. data/vendor/assets/javascripts/yui-2.8.1/build/base/base.css +131 -0
  80. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/button-core.css +44 -0
  81. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button-skin.css +219 -0
  82. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button.css +7 -0
  83. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
  84. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow.png +0 -0
  85. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-active.png +0 -0
  86. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-disabled.png +0 -0
  87. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-focus.png +0 -0
  88. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-hover.png +0 -0
  89. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow.png +0 -0
  90. data/vendor/assets/javascripts/yui-2.8.1/build/button/button-debug.js +4694 -0
  91. data/vendor/assets/javascripts/yui-2.8.1/build/button/button-min.js +11 -0
  92. data/vendor/assets/javascripts/yui-2.8.1/build/button/button.js +4633 -0
  93. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar-core.css +132 -0
  94. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar.css +320 -0
  95. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calgrad.png +0 -0
  96. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/callt.gif +0 -0
  97. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calrt.gif +0 -0
  98. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calx.gif +0 -0
  99. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar-skin.css +361 -0
  100. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar.css +8 -0
  101. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-debug.js +7324 -0
  102. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-min.js +18 -0
  103. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar.js +7294 -0
  104. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/ajax-loader.gif +0 -0
  105. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/carousel-core.css +88 -0
  106. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/ajax-loader.gif +0 -0
  107. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel-skin.css +142 -0
  108. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel.css +7 -0
  109. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-debug.js +4390 -0
  110. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-min.js +12 -0
  111. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel.js +4349 -0
  112. data/vendor/assets/javascripts/yui-2.8.1/build/charts/assets/charts.swf +0 -0
  113. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-debug.js +2061 -0
  114. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-min.js +9 -0
  115. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts.js +2060 -0
  116. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/colorpicker-core.css +6 -0
  117. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/hue_thumb.png +0 -0
  118. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_mask.png +0 -0
  119. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_thumb.png +0 -0
  120. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker-skin.css +105 -0
  121. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker.css +7 -0
  122. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/hue_bg.png +0 -0
  123. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/picker_mask.png +0 -0
  124. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-debug.js +1783 -0
  125. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-min.js +9 -0
  126. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker.js +1763 -0
  127. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-debug.js +1576 -0
  128. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-min.js +9 -0
  129. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.js +1546 -0
  130. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.swf +0 -0
  131. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-debug.js +980 -0
  132. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-min.js +8 -0
  133. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core.js +957 -0
  134. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/alrt16_1.gif +0 -0
  135. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/blck16_1.gif +0 -0
  136. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/close12_1.gif +0 -0
  137. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container-core.css +176 -0
  138. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container.css +324 -0
  139. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/hlp16_1.gif +0 -0
  140. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/info16_1.gif +0 -0
  141. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container-skin.css +242 -0
  142. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container.css +7 -0
  143. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/tip16_1.gif +0 -0
  144. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/warn16_1.gif +0 -0
  145. data/vendor/assets/javascripts/yui-2.8.1/build/container/container-debug.js +9076 -0
  146. data/vendor/assets/javascripts/yui-2.8.1/build/container/container-min.js +19 -0
  147. data/vendor/assets/javascripts/yui-2.8.1/build/container/container.js +9052 -0
  148. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-debug.js +5136 -0
  149. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-min.js +14 -0
  150. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core.js +5126 -0
  151. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-debug.js +482 -0
  152. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-min.js +7 -0
  153. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie.js +482 -0
  154. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-debug.js +3067 -0
  155. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-min.js +12 -0
  156. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource.js +2996 -0
  157. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable-core.css +93 -0
  158. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable.css +49 -0
  159. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable-skin.css +240 -0
  160. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable.css +8 -0
  161. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-dn.png +0 -0
  162. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-up.png +0 -0
  163. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-debug.js +17360 -0
  164. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-min.js +29 -0
  165. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable.js +17122 -0
  166. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-debug.js +408 -0
  167. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-min.js +7 -0
  168. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath.js +408 -0
  169. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-debug.js +1872 -0
  170. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-min.js +9 -0
  171. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom.js +1832 -0
  172. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-debug.js +3710 -0
  173. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-min.js +10 -0
  174. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop.js +3601 -0
  175. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/editor-core.css +602 -0
  176. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/simpleeditor-core.css +602 -0
  177. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/blankimage.png +0 -0
  178. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-knob.gif +0 -0
  179. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-skin.css +711 -0
  180. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite-active.gif +0 -0
  181. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite.gif +0 -0
  182. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor.css +10 -0
  183. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor-skin.css +711 -0
  184. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor.css +10 -0
  185. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-debug.js +9557 -0
  186. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-min.js +30 -0
  187. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor.js +9447 -0
  188. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-debug.js +7493 -0
  189. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-min.js +24 -0
  190. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor.js +7406 -0
  191. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-debug.js +141 -0
  192. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-min.js +7 -0
  193. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate.js +138 -0
  194. data/vendor/assets/javascripts/yui-2.8.1/build/element/element-debug.js +1106 -0
  195. data/vendor/assets/javascripts/yui-2.8.1/build/element/element-min.js +8 -0
  196. data/vendor/assets/javascripts/yui-2.8.1/build/element/element.js +1090 -0
  197. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-debug.js +283 -0
  198. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-min.js +7 -0
  199. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate.js +281 -0
  200. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-debug.js +219 -0
  201. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-min.js +7 -0
  202. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter.js +219 -0
  203. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-debug.js +622 -0
  204. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-min.js +7 -0
  205. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate.js +622 -0
  206. data/vendor/assets/javascripts/yui-2.8.1/build/event/event-debug.js +2524 -0
  207. data/vendor/assets/javascripts/yui-2.8.1/build/event/event-min.js +11 -0
  208. data/vendor/assets/javascripts/yui-2.8.1/build/event/event.js +2500 -0
  209. data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts-min.css +7 -0
  210. data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts.css +56 -0
  211. data/vendor/assets/javascripts/yui-2.8.1/build/get/get-debug.js +773 -0
  212. data/vendor/assets/javascripts/yui-2.8.1/build/get/get-min.js +7 -0
  213. data/vendor/assets/javascripts/yui-2.8.1/build/get/get.js +755 -0
  214. data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids-min.css +7 -0
  215. data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids.css +467 -0
  216. data/vendor/assets/javascripts/yui-2.8.1/build/history/assets/blank.html +1 -0
  217. data/vendor/assets/javascripts/yui-2.8.1/build/history/history-debug.js +808 -0
  218. data/vendor/assets/javascripts/yui-2.8.1/build/history/history-min.js +7 -0
  219. data/vendor/assets/javascripts/yui-2.8.1/build/history/history.js +808 -0
  220. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/imagecropper-core.css +33 -0
  221. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper-skin.css +16 -0
  222. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper.css +7 -0
  223. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-debug.js +907 -0
  224. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-min.js +8 -0
  225. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper.js +889 -0
  226. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-debug.js +487 -0
  227. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-min.js +7 -0
  228. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader.js +481 -0
  229. data/vendor/assets/javascripts/yui-2.8.1/build/json/json-debug.js +538 -0
  230. data/vendor/assets/javascripts/yui-2.8.1/build/json/json-min.js +7 -0
  231. data/vendor/assets/javascripts/yui-2.8.1/build/json/json.js +538 -0
  232. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/layout-core.css +158 -0
  233. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout-skin.css +207 -0
  234. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout.css +7 -0
  235. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout_sprite.png +0 -0
  236. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-debug.js +2305 -0
  237. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-min.js +11 -0
  238. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout.js +2290 -0
  239. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger-core.css +7 -0
  240. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger.css +57 -0
  241. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger-skin.css +55 -0
  242. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger.css +7 -0
  243. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-debug.js +2104 -0
  244. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-min.js +9 -0
  245. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger.js +2104 -0
  246. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu-core.css +242 -0
  247. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu.css +503 -0
  248. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow.png +0 -0
  249. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow_disabled.png +0 -0
  250. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow.png +0 -0
  251. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow_disabled.png +0 -0
  252. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator.png +0 -0
  253. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_disabled.png +0 -0
  254. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_selected.png +0 -0
  255. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox.png +0 -0
  256. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_disabled.png +0 -0
  257. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_selected.png +0 -0
  258. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator.png +0 -0
  259. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_disabled.png +0 -0
  260. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_selected.png +0 -0
  261. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu-skin.css +339 -0
  262. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu.css +7 -0
  263. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
  264. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
  265. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox.png +0 -0
  266. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
  267. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator.png +0 -0
  268. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
  269. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-debug.js +9870 -0
  270. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-min.js +16 -0
  271. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu.js +9823 -0
  272. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/paginator-core.css +6 -0
  273. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator-skin.css +78 -0
  274. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator.css +7 -0
  275. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-debug.js +2393 -0
  276. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-min.js +10 -0
  277. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator.js +2393 -0
  278. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-debug.js +557 -0
  279. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-min.js +7 -0
  280. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler.js +557 -0
  281. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/profilerviewer-core.css +6 -0
  282. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/asc.gif +0 -0
  283. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/desc.gif +0 -0
  284. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/header_background.png +0 -0
  285. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css +167 -0
  286. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer.css +7 -0
  287. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/wait.gif +0 -0
  288. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-debug.js +1229 -0
  289. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-min.js +9 -0
  290. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer.js +1192 -0
  291. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/progressbar-core.css +85 -0
  292. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-h.png +0 -0
  293. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-v.png +0 -0
  294. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-h.png +0 -0
  295. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-v.png +0 -0
  296. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar-skin.css +56 -0
  297. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar.css +7 -0
  298. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-debug.js +691 -0
  299. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-min.js +8 -0
  300. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar.js +677 -0
  301. data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts-grids/reset-fonts-grids.css +7 -0
  302. data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts/reset-fonts.css +7 -0
  303. data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset-min.css +7 -0
  304. data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset.css +142 -0
  305. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/resize-core.css +173 -0
  306. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/layout_sprite.png +0 -0
  307. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize-skin.css +142 -0
  308. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize.css +7 -0
  309. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-debug.js +1749 -0
  310. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-min.js +10 -0
  311. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize.js +1689 -0
  312. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-debug.js +651 -0
  313. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-min.js +8 -0
  314. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector.js +644 -0
  315. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-fader.gif +0 -0
  316. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-h.gif +0 -0
  317. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v-e.gif +0 -0
  318. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v.gif +0 -0
  319. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/left-thumb.png +0 -0
  320. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/right-thumb.png +0 -0
  321. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-h.gif +0 -0
  322. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-v.gif +0 -0
  323. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider-skin.css +24 -0
  324. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider.css +7 -0
  325. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-core.css +17 -0
  326. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-skin.css +20 -0
  327. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-bar.gif +0 -0
  328. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-e.gif +0 -0
  329. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-fader.gif +0 -0
  330. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-n.gif +0 -0
  331. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-s.gif +0 -0
  332. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-w.gif +0 -0
  333. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-debug.js +2114 -0
  334. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-min.js +9 -0
  335. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider.js +2068 -0
  336. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-debug.js +1185 -0
  337. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-min.js +8 -0
  338. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage.js +1183 -0
  339. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-debug.js +648 -0
  340. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-min.js +7 -0
  341. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet.js +645 -0
  342. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-debug.js +269 -0
  343. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-min.js +7 -0
  344. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf.js +268 -0
  345. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-debug.js +93 -0
  346. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-min.js +7 -0
  347. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect.js +93 -0
  348. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swf.js +238 -0
  349. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-debug.js +470 -0
  350. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-min.js +7 -0
  351. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.js +453 -0
  352. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.swf +0 -0
  353. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/border_tabs.css +54 -0
  354. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/loading.gif +0 -0
  355. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skin-sam.css +77 -0
  356. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview-skin.css +186 -0
  357. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview.css +8 -0
  358. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview-core.css +133 -0
  359. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview.css +77 -0
  360. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-debug.js +995 -0
  361. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-min.js +8 -0
  362. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview.js +987 -0
  363. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check0.gif +0 -0
  364. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check1.gif +0 -0
  365. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check2.gif +0 -0
  366. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/loading.gif +0 -0
  367. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-loading.gif +0 -0
  368. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-skin.css +249 -0
  369. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-sprite.gif +0 -0
  370. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview.css +7 -0
  371. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/treeview-core.css +6 -0
  372. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-debug.js +4058 -0
  373. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-min.js +12 -0
  374. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview.js +3989 -0
  375. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/assets/uploader.swf +0 -0
  376. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-debug.js +1072 -0
  377. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-min.js +15 -0
  378. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader.js +1069 -0
  379. data/vendor/assets/javascripts/yui-2.8.1/build/utilities/utilities.js +39 -0
  380. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo-dom-event/yahoo-dom-event.js +14 -0
  381. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-debug.js +1075 -0
  382. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-min.js +7 -0
  383. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo.js +1075 -0
  384. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader-dom-event/yuiloader-dom-event.js +17 -0
  385. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-debug.js +3879 -0
  386. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-min.js +10 -0
  387. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader.js +3879 -0
  388. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest-skin.css +7 -0
  389. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest.css +7 -0
  390. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/testlogger.css +7 -0
  391. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/yuitest-core.css +7 -0
  392. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-debug.js +2741 -0
  393. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-min.js +10 -0
  394. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest.js +2741 -0
  395. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-debug.js +1976 -0
  396. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-min.js +9 -0
  397. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core.js +1976 -0
  398. metadata +470 -0
@@ -0,0 +1,9 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 2.8.1
6
+ */
7
+ YAHOO.util.Color=function(){var A="0",B=YAHOO.lang.isArray,C=YAHOO.lang.isNumber;return{real2dec:function(D){return Math.min(255,Math.round(D*256));},hsv2rgb:function(H,O,M){if(B(H)){return this.hsv2rgb.call(this,H[0],H[1],H[2]);}var D,I,L,G=Math.floor((H/60)%6),J=(H/60)-G,F=M*(1-O),E=M*(1-J*O),N=M*(1-(1-J)*O),K;switch(G){case 0:D=M;I=N;L=F;break;case 1:D=E;I=M;L=F;break;case 2:D=F;I=M;L=N;break;case 3:D=F;I=E;L=M;break;case 4:D=N;I=F;L=M;break;case 5:D=M;I=F;L=E;break;}K=this.real2dec;return[K(D),K(I),K(L)];},rgb2hsv:function(D,H,I){if(B(D)){return this.rgb2hsv.apply(this,D);}D/=255;H/=255;I/=255;var G,L,E=Math.min(Math.min(D,H),I),J=Math.max(Math.max(D,H),I),K=J-E,F;switch(J){case E:G=0;break;case D:G=60*(H-I)/K;if(H<I){G+=360;}break;case H:G=(60*(I-D)/K)+120;break;case I:G=(60*(D-H)/K)+240;break;}L=(J===0)?0:1-(E/J);F=[Math.round(G),L,J];return F;},rgb2hex:function(F,E,D){if(B(F)){return this.rgb2hex.apply(this,F);}var G=this.dec2hex;return G(F)+G(E)+G(D);},dec2hex:function(D){D=parseInt(D,10)|0;D=(D>255||D<0)?0:D;return(A+D.toString(16)).slice(-2).toUpperCase();},hex2dec:function(D){return parseInt(D,16);},hex2rgb:function(D){var E=this.hex2dec;return[E(D.slice(0,2)),E(D.slice(2,4)),E(D.slice(4,6))];},websafe:function(F,E,D){if(B(F)){return this.websafe.apply(this,F);}var G=function(H){if(C(H)){H=Math.min(Math.max(0,H),255);var I,J;for(I=0;I<256;I=I+51){J=I+51;if(H>=I&&H<=J){return(H-I>25)?J:I;}}}return H;};return[G(F),G(E),G(D)];}};}();(function(){var J=0,F=YAHOO.util,C=YAHOO.lang,D=YAHOO.widget.Slider,B=F.Color,E=F.Dom,I=F.Event,A=C.substitute,H="yui-picker";function G(L,K){J=J+1;K=K||{};if(arguments.length===1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element||null;}if(!L&&!K.element){L=this._createHostElement(K);}G.superclass.constructor.call(this,L,K);this.initPicker();}YAHOO.extend(G,YAHOO.util.Element,{ID:{R:H+"-r",R_HEX:H+"-rhex",G:H+"-g",G_HEX:H+"-ghex",B:H+"-b",B_HEX:H+"-bhex",H:H+"-h",S:H+"-s",V:H+"-v",PICKER_BG:H+"-bg",PICKER_THUMB:H+"-thumb",HUE_BG:H+"-hue-bg",HUE_THUMB:H+"-hue-thumb",HEX:H+"-hex",SWATCH:H+"-swatch",WEBSAFE_SWATCH:H+"-websafe-swatch",CONTROLS:H+"-controls",RGB_CONTROLS:H+"-rgb-controls",HSV_CONTROLS:H+"-hsv-controls",HEX_CONTROLS:H+"-hex-controls",HEX_SUMMARY:H+"-hex-summary",CONTROLS_LABEL:H+"-controls-label"},TXT:{ILLEGAL_HEX:"Illegal hex value entered",SHOW_CONTROLS:"Show color details",HIDE_CONTROLS:"Hide color details",CURRENT_COLOR:"Currently selected color: {rgb}",CLOSEST_WEBSAFE:"Closest websafe color: {rgb}. Click to select.",R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"},IMAGE:{PICKER_THUMB:"../../build/colorpicker/assets/picker_thumb.png",HUE_THUMB:"../../build/colorpicker/assets/hue_thumb.png"},DEFAULT:{PICKER_SIZE:180},OPT:{HUE:"hue",SATURATION:"saturation",VALUE:"value",RED:"red",GREEN:"green",BLUE:"blue",HSV:"hsv",RGB:"rgb",WEBSAFE:"websafe",HEX:"hex",PICKER_SIZE:"pickersize",SHOW_CONTROLS:"showcontrols",SHOW_RGB_CONTROLS:"showrgbcontrols",SHOW_HSV_CONTROLS:"showhsvcontrols",SHOW_HEX_CONTROLS:"showhexcontrols",SHOW_HEX_SUMMARY:"showhexsummary",SHOW_WEBSAFE:"showwebsafe",CONTAINER:"container",IDS:"ids",ELEMENTS:"elements",TXT:"txt",IMAGES:"images",ANIMATE:"animate"},skipAnim:true,_createHostElement:function(){var K=document.createElement("div");if(this.CSS.BASE){K.className=this.CSS.BASE;}return K;},_updateHueSlider:function(){var K=this.get(this.OPT.PICKER_SIZE),L=this.get(this.OPT.HUE);L=K-Math.round(L/360*K);if(L===K){L=0;}this.hueSlider.setValue(L,this.skipAnim);},_updatePickerSlider:function(){var L=this.get(this.OPT.PICKER_SIZE),M=this.get(this.OPT.SATURATION),K=this.get(this.OPT.VALUE);M=Math.round(M*L/100);K=Math.round(L-(K*L/100));this.pickerSlider.setRegionValue(M,K,this.skipAnim);},_updateSliders:function(){this._updateHueSlider();this._updatePickerSlider();},setValue:function(L,K){K=(K)||false;this.set(this.OPT.RGB,L,K);this._updateSliders();},hueSlider:null,pickerSlider:null,_getH:function(){var K=this.get(this.OPT.PICKER_SIZE),L=(K-this.hueSlider.getValue())/K;L=Math.round(L*360);return(L===360)?0:L;},_getS:function(){return this.pickerSlider.getXValue()/this.get(this.OPT.PICKER_SIZE);},_getV:function(){var K=this.get(this.OPT.PICKER_SIZE);return(K-this.pickerSlider.getYValue())/K;},_updateSwatch:function(){var M=this.get(this.OPT.RGB),O=this.get(this.OPT.WEBSAFE),N=this.getElement(this.ID.SWATCH),L=M.join(","),K=this.get(this.OPT.TXT);E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CURRENT_COLOR,{"rgb":"#"+this.get(this.OPT.HEX)});N=this.getElement(this.ID.WEBSAFE_SWATCH);L=O.join(",");E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CLOSEST_WEBSAFE,{"rgb":"#"+B.rgb2hex(O)});},_getValuesFromSliders:function(){this.set(this.OPT.RGB,B.hsv2rgb(this._getH(),this._getS(),this._getV()));},_updateFormFields:function(){this.getElement(this.ID.H).value=this.get(this.OPT.HUE);this.getElement(this.ID.S).value=this.get(this.OPT.SATURATION);this.getElement(this.ID.V).value=this.get(this.OPT.VALUE);this.getElement(this.ID.R).value=this.get(this.OPT.RED);this.getElement(this.ID.R_HEX).innerHTML=B.dec2hex(this.get(this.OPT.RED));this.getElement(this.ID.G).value=this.get(this.OPT.GREEN);this.getElement(this.ID.G_HEX).innerHTML=B.dec2hex(this.get(this.OPT.GREEN));this.getElement(this.ID.B).value=this.get(this.OPT.BLUE);this.getElement(this.ID.B_HEX).innerHTML=B.dec2hex(this.get(this.OPT.BLUE));this.getElement(this.ID.HEX).value=this.get(this.OPT.HEX);},_onHueSliderChange:function(N){var L=this._getH(),K=B.hsv2rgb(L,1,1),M="rgb("+K.join(",")+")";this.set(this.OPT.HUE,L,true);E.setStyle(this.getElement(this.ID.PICKER_BG),"background-color",M);if(this.hueSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders();}this._updateFormFields();this._updateSwatch();},_onPickerSliderChange:function(M){var L=this._getS(),K=this._getV();this.set(this.OPT.SATURATION,Math.round(L*100),true);this.set(this.OPT.VALUE,Math.round(K*100),true);if(this.pickerSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders();
8
+ }this._updateFormFields();this._updateSwatch();},_getCommand:function(K){var L=I.getCharCode(K);if(L===38){return 3;}else{if(L===13){return 6;}else{if(L===40){return 4;}else{if(L>=48&&L<=57){return 1;}else{if(L>=97&&L<=102){return 2;}else{if(L>=65&&L<=70){return 2;}else{if("8, 9, 13, 27, 37, 39".indexOf(L)>-1||K.ctrlKey||K.metaKey){return 5;}else{return 0;}}}}}}}},_useFieldValue:function(L,K,N){var M=K.value;if(N!==this.OPT.HEX){M=parseInt(M,10);}if(M!==this.get(N)){this.set(N,M);}},_rgbFieldKeypress:function(M,K,O){var N=this._getCommand(M),L=(M.shiftKey)?10:1;switch(N){case 6:this._useFieldValue.apply(this,arguments);break;case 3:this.set(O,Math.min(this.get(O)+L,255));this._updateFormFields();break;case 4:this.set(O,Math.max(this.get(O)-L,0));this._updateFormFields();break;default:}},_hexFieldKeypress:function(L,K,N){var M=this._getCommand(L);if(M===6){this._useFieldValue.apply(this,arguments);}},_hexOnly:function(L,K){var M=this._getCommand(L);switch(M){case 6:case 5:case 1:break;case 2:if(K!==true){break;}default:I.stopEvent(L);return false;}},_numbersOnly:function(K){return this._hexOnly(K,true);},getElement:function(K){return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[K]];},_createElements:function(){var N,M,P,O,L,K=this.get(this.OPT.IDS),Q=this.get(this.OPT.TXT),S=this.get(this.OPT.IMAGES),R=function(U,V){var W=document.createElement(U);if(V){C.augmentObject(W,V,true);}return W;},T=function(U,V){var W=C.merge({autocomplete:"off",value:"0",size:3,maxlength:3},V);W.name=W.id;return new R(U,W);};L=this.get("element");N=new R("div",{id:K[this.ID.PICKER_BG],className:"yui-picker-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.PICKER_THUMB],className:"yui-picker-thumb"});P=new R("img",{src:S.PICKER_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HUE_BG],className:"yui-picker-hue-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.HUE_THUMB],className:"yui-picker-hue-thumb"});P=new R("img",{src:S.HUE_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.CONTROLS],className:"yui-picker-controls"});L.appendChild(N);L=N;N=new R("div",{className:"hd"});M=new R("a",{id:K[this.ID.CONTROLS_LABEL],href:"#"});N.appendChild(M);L.appendChild(N);N=new R("div",{className:"bd"});L.appendChild(N);L=N;N=new R("ul",{id:K[this.ID.RGB_CONTROLS],className:"yui-picker-rgb-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.R+" "));O=new T("input",{id:K[this.ID.R],className:"yui-picker-r"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.G+" "));O=new T("input",{id:K[this.ID.G],className:"yui-picker-g"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.B+" "));O=new T("input",{id:K[this.ID.B],className:"yui-picker-b"});M.appendChild(O);N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HSV_CONTROLS],className:"yui-picker-hsv-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.H+" "));O=new T("input",{id:K[this.ID.H],className:"yui-picker-h"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.DEG));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.S+" "));O=new T("input",{id:K[this.ID.S],className:"yui-picker-s"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.V+" "));O=new T("input",{id:K[this.ID.V],className:"yui-picker-v"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HEX_SUMMARY],className:"yui-picker-hex_summary"});M=new R("li",{id:K[this.ID.R_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.G_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.B_HEX]});N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HEX_CONTROLS],className:"yui-picker-hex-controls"});N.appendChild(document.createTextNode(Q.HEX+" "));M=new T("input",{id:K[this.ID.HEX],className:"yui-picker-hex",size:6,maxlength:6});N.appendChild(M);L.appendChild(N);L=this.get("element");N=new R("div",{id:K[this.ID.SWATCH],className:"yui-picker-swatch"});L.appendChild(N);N=new R("div",{id:K[this.ID.WEBSAFE_SWATCH],className:"yui-picker-websafe-swatch"});L.appendChild(N);},_attachRGBHSV:function(L,K){I.on(this.getElement(L),"keydown",function(N,M){M._rgbFieldKeypress(N,this,K);},this);I.on(this.getElement(L),"keypress",this._numbersOnly,this,true);I.on(this.getElement(L),"blur",function(N,M){M._useFieldValue(N,this,K);},this);},_updateRGB:function(){var K=[this.get(this.OPT.RED),this.get(this.OPT.GREEN),this.get(this.OPT.BLUE)];this.set(this.OPT.RGB,K);this._updateSliders();},_initElements:function(){var O=this.OPT,N=this.get(O.IDS),L=this.get(O.ELEMENTS),K,M,P;for(K in this.ID){if(C.hasOwnProperty(this.ID,K)){N[this.ID[K]]=N[K];}}M=E.get(N[this.ID.PICKER_BG]);if(!M){this._createElements();}else{}for(K in N){if(C.hasOwnProperty(N,K)){M=E.get(N[K]);P=E.generateId(M);N[K]=P;N[N[K]]=P;L[P]=M;}}},initPicker:function(){this._initSliders();this._bindUI();this.syncUI(true);},_initSliders:function(){var K=this.ID,L=this.get(this.OPT.PICKER_SIZE);this.hueSlider=D.getVertSlider(this.getElement(K.HUE_BG),this.getElement(K.HUE_THUMB),0,L);this.pickerSlider=D.getSliderRegion(this.getElement(K.PICKER_BG),this.getElement(K.PICKER_THUMB),0,L,0,L);this.set(this.OPT.ANIMATE,this.get(this.OPT.ANIMATE));},_bindUI:function(){var K=this.ID,L=this.OPT;this.hueSlider.subscribe("change",this._onHueSliderChange,this,true);this.pickerSlider.subscribe("change",this._onPickerSliderChange,this,true);I.on(this.getElement(K.WEBSAFE_SWATCH),"click",function(M){this.setValue(this.get(L.WEBSAFE));},this,true);I.on(this.getElement(K.CONTROLS_LABEL),"click",function(M){this.set(L.SHOW_CONTROLS,!this.get(L.SHOW_CONTROLS));I.preventDefault(M);},this,true);this._attachRGBHSV(K.R,L.RED);this._attachRGBHSV(K.G,L.GREEN);this._attachRGBHSV(K.B,L.BLUE);this._attachRGBHSV(K.H,L.HUE);
9
+ this._attachRGBHSV(K.S,L.SATURATION);this._attachRGBHSV(K.V,L.VALUE);I.on(this.getElement(K.HEX),"keydown",function(N,M){M._hexFieldKeypress(N,this,L.HEX);},this);I.on(this.getElement(this.ID.HEX),"keypress",this._hexOnly,this,true);I.on(this.getElement(this.ID.HEX),"blur",function(N,M){M._useFieldValue(N,this,L.HEX);},this);},syncUI:function(K){this.skipAnim=K;this._updateRGB();this.skipAnim=false;},_updateRGBFromHSV:function(){var L=[this.get(this.OPT.HUE),this.get(this.OPT.SATURATION)/100,this.get(this.OPT.VALUE)/100],K=B.hsv2rgb(L);this.set(this.OPT.RGB,K);this._updateSliders();},_updateHex:function(){var N=this.get(this.OPT.HEX),K=N.length,O,M,L;if(K===3){O=N.split("");for(M=0;M<K;M=M+1){O[M]=O[M]+O[M];}N=O.join("");}if(N.length!==6){return false;}L=B.hex2rgb(N);this.setValue(L);},_hideShowEl:function(M,K){var L=(C.isString(M)?this.getElement(M):M);E.setStyle(L,"display",(K)?"":"none");},initAttributes:function(K){K=K||{};G.superclass.initAttributes.call(this,K);this.setAttributeConfig(this.OPT.PICKER_SIZE,{value:K.size||this.DEFAULT.PICKER_SIZE});this.setAttributeConfig(this.OPT.HUE,{value:K.hue||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.SATURATION,{value:K.saturation||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.VALUE,{value:C.isNumber(K.value)?K.value:100,validator:C.isNumber});this.setAttributeConfig(this.OPT.RED,{value:C.isNumber(K.red)?K.red:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.GREEN,{value:C.isNumber(K.green)?K.green:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.BLUE,{value:C.isNumber(K.blue)?K.blue:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.HEX,{value:K.hex||"FFFFFF",validator:C.isString});this.setAttributeConfig(this.OPT.RGB,{value:K.rgb||[255,255,255],method:function(O){this.set(this.OPT.RED,O[0],true);this.set(this.OPT.GREEN,O[1],true);this.set(this.OPT.BLUE,O[2],true);var Q=B.websafe(O),P=B.rgb2hex(O),N=B.rgb2hsv(O);this.set(this.OPT.WEBSAFE,Q,true);this.set(this.OPT.HEX,P,true);if(N[1]){this.set(this.OPT.HUE,N[0],true);}this.set(this.OPT.SATURATION,Math.round(N[1]*100),true);this.set(this.OPT.VALUE,Math.round(N[2]*100),true);},readonly:true});this.setAttributeConfig(this.OPT.CONTAINER,{value:null,method:function(N){if(N){N.showEvent.subscribe(function(){this.pickerSlider.focus();},this,true);}}});this.setAttributeConfig(this.OPT.WEBSAFE,{value:K.websafe||[255,255,255]});var M=K.ids||C.merge({},this.ID),L;if(!K.ids&&J>1){for(L in M){if(C.hasOwnProperty(M,L)){M[L]=M[L]+J;}}}this.setAttributeConfig(this.OPT.IDS,{value:M,writeonce:true});this.setAttributeConfig(this.OPT.TXT,{value:K.txt||this.TXT,writeonce:true});this.setAttributeConfig(this.OPT.IMAGES,{value:K.images||this.IMAGE,writeonce:true});this.setAttributeConfig(this.OPT.ELEMENTS,{value:{},readonly:true});this.setAttributeConfig(this.OPT.SHOW_CONTROLS,{value:C.isBoolean(K.showcontrols)?K.showcontrols:true,method:function(N){var O=E.getElementsByClassName("bd","div",this.getElement(this.ID.CONTROLS))[0];this._hideShowEl(O,N);this.getElement(this.ID.CONTROLS_LABEL).innerHTML=(N)?this.get(this.OPT.TXT).HIDE_CONTROLS:this.get(this.OPT.TXT).SHOW_CONTROLS;}});this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS,{value:C.isBoolean(K.showrgbcontrols)?K.showrgbcontrols:true,method:function(N){this._hideShowEl(this.ID.RGB_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS,{value:C.isBoolean(K.showhsvcontrols)?K.showhsvcontrols:false,method:function(N){this._hideShowEl(this.ID.HSV_CONTROLS,N);if(N&&this.get(this.OPT.SHOW_HEX_SUMMARY)){this.set(this.OPT.SHOW_HEX_SUMMARY,false);}}});this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS,{value:C.isBoolean(K.showhexcontrols)?K.showhexcontrols:false,method:function(N){this._hideShowEl(this.ID.HEX_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_WEBSAFE,{value:C.isBoolean(K.showwebsafe)?K.showwebsafe:true,method:function(N){this._hideShowEl(this.ID.WEBSAFE_SWATCH,N);}});this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY,{value:C.isBoolean(K.showhexsummary)?K.showhexsummary:true,method:function(N){this._hideShowEl(this.ID.HEX_SUMMARY,N);if(N&&this.get(this.OPT.SHOW_HSV_CONTROLS)){this.set(this.OPT.SHOW_HSV_CONTROLS,false);}}});this.setAttributeConfig(this.OPT.ANIMATE,{value:C.isBoolean(K.animate)?K.animate:true,method:function(N){if(this.pickerSlider){this.pickerSlider.animate=N;this.hueSlider.animate=N;}}});this.on(this.OPT.HUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.SATURATION+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.VALUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.RED+"Change",this._updateRGB,this,true);this.on(this.OPT.GREEN+"Change",this._updateRGB,this,true);this.on(this.OPT.BLUE+"Change",this._updateRGB,this,true);this.on(this.OPT.HEX+"Change",this._updateHex,this,true);this._initElements();}});YAHOO.widget.ColorPicker=G;})();YAHOO.register("colorpicker",YAHOO.widget.ColorPicker,{version:"2.8.1",build:"19"});
@@ -0,0 +1,1763 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 2.8.1
6
+ */
7
+ /**
8
+ * Provides color conversion and validation utils
9
+ * @class YAHOO.util.Color
10
+ * @namespace YAHOO.util
11
+ */
12
+ YAHOO.util.Color = function() {
13
+
14
+ var ZERO = "0",
15
+ isArray = YAHOO.lang.isArray,
16
+ isNumber = YAHOO.lang.isNumber;
17
+
18
+ return {
19
+
20
+ /**
21
+ * Converts 0-1 to 0-255
22
+ * @method real2dec
23
+ * @param n {float} the number to convert
24
+ * @return {int} a number 0-255
25
+ */
26
+ real2dec: function(n) {
27
+ return Math.min(255, Math.round(n*256));
28
+ },
29
+
30
+ /**
31
+ * Converts HSV (h[0-360], s[0-1]), v[0-1] to RGB [255,255,255]
32
+ * @method hsv2rgb
33
+ * @param h {int|[int, float, float]} the hue, or an
34
+ * array containing all three parameters
35
+ * @param s {float} the saturation
36
+ * @param v {float} the value/brightness
37
+ * @return {[int, int, int]} the red, green, blue values in
38
+ * decimal.
39
+ */
40
+ hsv2rgb: function(h, s, v) {
41
+
42
+ if (isArray(h)) {
43
+ return this.hsv2rgb.call(this, h[0], h[1], h[2]);
44
+ }
45
+
46
+ var r, g, b,
47
+ i = Math.floor((h/60)%6),
48
+ f = (h/60)-i,
49
+ p = v*(1-s),
50
+ q = v*(1-f*s),
51
+ t = v*(1-(1-f)*s),
52
+ fn;
53
+
54
+ switch (i) {
55
+ case 0: r=v; g=t; b=p; break;
56
+ case 1: r=q; g=v; b=p; break;
57
+ case 2: r=p; g=v; b=t; break;
58
+ case 3: r=p; g=q; b=v; break;
59
+ case 4: r=t; g=p; b=v; break;
60
+ case 5: r=v; g=p; b=q; break;
61
+ }
62
+
63
+ fn=this.real2dec;
64
+
65
+ return [fn(r), fn(g), fn(b)];
66
+ },
67
+
68
+ /**
69
+ * Converts to RGB [255,255,255] to HSV (h[0-360], s[0-1]), v[0-1]
70
+ * @method rgb2hsv
71
+ * @param r {int|[int, int, int]} the red value, or an
72
+ * array containing all three parameters
73
+ * @param g {int} the green value
74
+ * @param b {int} the blue value
75
+ * @return {[int, float, float]} the value converted to hsv
76
+ */
77
+ rgb2hsv: function(r, g, b) {
78
+
79
+ if (isArray(r)) {
80
+ return this.rgb2hsv.apply(this, r);
81
+ }
82
+
83
+ r /= 255;
84
+ g /= 255;
85
+ b /= 255;
86
+
87
+ var h,s,
88
+ min = Math.min(Math.min(r,g),b),
89
+ max = Math.max(Math.max(r,g),b),
90
+ delta = max-min,
91
+ hsv;
92
+
93
+ switch (max) {
94
+ case min: h=0; break;
95
+ case r: h=60*(g-b)/delta;
96
+ if (g<b) {
97
+ h+=360;
98
+ }
99
+ break;
100
+ case g: h=(60*(b-r)/delta)+120; break;
101
+ case b: h=(60*(r-g)/delta)+240; break;
102
+ }
103
+
104
+ s = (max === 0) ? 0 : 1-(min/max);
105
+
106
+ hsv = [Math.round(h), s, max];
107
+
108
+ return hsv;
109
+ },
110
+
111
+ /**
112
+ * Converts decimal rgb values into a hex string
113
+ * 255,255,255 -> FFFFFF
114
+ * @method rgb2hex
115
+ * @param r {int|[int, int, int]} the red value, or an
116
+ * array containing all three parameters
117
+ * @param g {int} the green value
118
+ * @param b {int} the blue value
119
+ * @return {string} the hex string
120
+ */
121
+ rgb2hex: function(r, g, b) {
122
+ if (isArray(r)) {
123
+ return this.rgb2hex.apply(this, r);
124
+ }
125
+
126
+ var f=this.dec2hex;
127
+ return f(r) + f(g) + f(b);
128
+ },
129
+
130
+ /**
131
+ * Converts an int 0...255 to hex pair 00...FF
132
+ * @method dec2hex
133
+ * @param n {int} the number to convert
134
+ * @return {string} the hex equivalent
135
+ */
136
+ dec2hex: function(n) {
137
+ n = parseInt(n,10)|0;
138
+ n = (n > 255 || n < 0) ? 0 : n;
139
+
140
+ return (ZERO+n.toString(16)).slice(-2).toUpperCase();
141
+ },
142
+
143
+ /**
144
+ * Converts a hex pair 00...FF to an int 0...255
145
+ * @method hex2dec
146
+ * @param str {string} the hex pair to convert
147
+ * @return {int} the decimal
148
+ */
149
+ hex2dec: function(str) {
150
+ return parseInt(str,16);
151
+ },
152
+
153
+ /**
154
+ * Converts a hex string to rgb
155
+ * @method hex2rgb
156
+ * @param str {string} the hex string
157
+ * @return {[int, int, int]} an array containing the rgb values
158
+ */
159
+ hex2rgb: function(s) {
160
+ var f = this.hex2dec;
161
+ return [f(s.slice(0, 2)), f(s.slice(2, 4)), f(s.slice(4, 6))];
162
+ },
163
+
164
+ /**
165
+ * Returns the closest websafe color to the supplied rgb value.
166
+ * @method websafe
167
+ * @param r {int|[int, int, int]} the red value, or an
168
+ * array containing all three parameters
169
+ * @param g {int} the green value
170
+ * @param b {int} the blue value
171
+ * @return {[int, int, int]} an array containing the closes
172
+ * websafe rgb colors.
173
+ */
174
+ websafe: function(r, g, b) {
175
+
176
+ if (isArray(r)) {
177
+ return this.websafe.apply(this, r);
178
+ }
179
+
180
+ // returns the closest match [0, 51, 102, 153, 204, 255]
181
+ var f = function(v) {
182
+ if (isNumber(v)) {
183
+ v = Math.min(Math.max(0, v), 255);
184
+ var i, next;
185
+ for (i=0; i<256; i=i+51) {
186
+ next = i+51;
187
+ if (v >= i && v <= next) {
188
+ return (v-i > 25) ? next : i;
189
+ }
190
+ }
191
+ }
192
+
193
+ return v;
194
+ };
195
+
196
+ return [f(r), f(g), f(b)];
197
+ }
198
+ };
199
+ }();
200
+
201
+
202
+ /**
203
+ * The colorpicker module provides a widget for selecting colors
204
+ * @module colorpicker
205
+ * @requires yahoo, dom, event, element, slider
206
+ */
207
+ (function() {
208
+
209
+ var _pickercount = 0,
210
+ util = YAHOO.util,
211
+ lang = YAHOO.lang,
212
+ Slider = YAHOO.widget.Slider,
213
+ Color = util.Color,
214
+ Dom = util.Dom,
215
+ Event = util.Event,
216
+ sub = lang.substitute,
217
+
218
+ b = "yui-picker";
219
+
220
+
221
+ /**
222
+ * A widget to select colors
223
+ * @namespace YAHOO.widget
224
+ * @class YAHOO.widget.ColorPicker
225
+ * @extends YAHOO.util.Element
226
+ * @constructor
227
+ * @param {HTMLElement | String | Object} el(optional) The html
228
+ * element that represents the colorpicker, or the attribute object to use.
229
+ * An element will be created if none provided.
230
+ * @param {Object} attr (optional) A key map of the colorpicker's
231
+ * initial attributes. Ignored if first arg is attributes object.
232
+ */
233
+ function ColorPicker(el, attr) {
234
+ _pickercount = _pickercount + 1;
235
+ attr = attr || {};
236
+ if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
237
+ attr = el; // treat first arg as attr object
238
+ el = attr.element || null;
239
+ }
240
+
241
+ if (!el && !attr.element) { // create if we dont have one
242
+ el = this._createHostElement(attr);
243
+ }
244
+
245
+ ColorPicker.superclass.constructor.call(this, el, attr);
246
+
247
+ this.initPicker();
248
+ }
249
+
250
+ YAHOO.extend(ColorPicker, YAHOO.util.Element, {
251
+
252
+ /**
253
+ * The element ids used by this control
254
+ * @property ID
255
+ * @final
256
+ */
257
+ ID : {
258
+
259
+ /**
260
+ * The id for the "red" form field
261
+ * @property ID.R
262
+ * @type String
263
+ * @final
264
+ * @default yui-picker-r
265
+ */
266
+ R: b + "-r",
267
+
268
+ /**
269
+ * The id for the "red" hex pair output
270
+ * @property ID.R_HEX
271
+ * @type String
272
+ * @final
273
+ * @default yui-picker-rhex
274
+ */
275
+ R_HEX: b + "-rhex",
276
+
277
+ /**
278
+ * The id for the "green" form field
279
+ * @property ID.G
280
+ * @type String
281
+ * @final
282
+ * @default yui-picker-g
283
+ */
284
+ G: b + "-g",
285
+
286
+ /**
287
+ * The id for the "green" hex pair output
288
+ * @property ID.G_HEX
289
+ * @type String
290
+ * @final
291
+ * @default yui-picker-ghex
292
+ */
293
+ G_HEX: b + "-ghex",
294
+
295
+
296
+ /**
297
+ * The id for the "blue" form field
298
+ * @property ID.B
299
+ * @type String
300
+ * @final
301
+ * @default yui-picker-b
302
+ */
303
+ B: b + "-b",
304
+
305
+ /**
306
+ * The id for the "blue" hex pair output
307
+ * @property ID.B_HEX
308
+ * @type String
309
+ * @final
310
+ * @default yui-picker-bhex
311
+ */
312
+ B_HEX: b + "-bhex",
313
+
314
+ /**
315
+ * The id for the "hue" form field
316
+ * @property ID.H
317
+ * @type String
318
+ * @final
319
+ * @default yui-picker-h
320
+ */
321
+ H: b + "-h",
322
+
323
+ /**
324
+ * The id for the "saturation" form field
325
+ * @property ID.S
326
+ * @type String
327
+ * @final
328
+ * @default yui-picker-s
329
+ */
330
+ S: b + "-s",
331
+
332
+ /**
333
+ * The id for the "value" form field
334
+ * @property ID.V
335
+ * @type String
336
+ * @final
337
+ * @default yui-picker-v
338
+ */
339
+ V: b + "-v",
340
+
341
+ /**
342
+ * The id for the picker region slider
343
+ * @property ID.PICKER_BG
344
+ * @type String
345
+ * @final
346
+ * @default yui-picker-bg
347
+ */
348
+ PICKER_BG: b + "-bg",
349
+
350
+ /**
351
+ * The id for the picker region thumb
352
+ * @property ID.PICKER_THUMB
353
+ * @type String
354
+ * @final
355
+ * @default yui-picker-thumb
356
+ */
357
+ PICKER_THUMB: b + "-thumb",
358
+
359
+ /**
360
+ * The id for the hue slider
361
+ * @property ID.HUE_BG
362
+ * @type String
363
+ * @final
364
+ * @default yui-picker-hue-bg
365
+ */
366
+ HUE_BG: b + "-hue-bg",
367
+
368
+ /**
369
+ * The id for the hue thumb
370
+ * @property ID.HUE_THUMB
371
+ * @type String
372
+ * @final
373
+ * @default yui-picker-hue-thumb
374
+ */
375
+ HUE_THUMB: b + "-hue-thumb",
376
+
377
+ /**
378
+ * The id for the hex value form field
379
+ * @property ID.HEX
380
+ * @type String
381
+ * @final
382
+ * @default yui-picker-hex
383
+ */
384
+ HEX: b + "-hex",
385
+
386
+ /**
387
+ * The id for the color swatch
388
+ * @property ID.SWATCH
389
+ * @type String
390
+ * @final
391
+ * @default yui-picker-swatch
392
+ */
393
+ SWATCH: b + "-swatch",
394
+
395
+ /**
396
+ * The id for the websafe color swatch
397
+ * @property ID.WEBSAFE_SWATCH
398
+ * @type String
399
+ * @final
400
+ * @default yui-picker-websafe-swatch
401
+ */
402
+ WEBSAFE_SWATCH: b + "-websafe-swatch",
403
+
404
+ /**
405
+ * The id for the control details
406
+ * @property ID.CONTROLS
407
+ * @final
408
+ * @default yui-picker-controls
409
+ */
410
+ CONTROLS: b + "-controls",
411
+
412
+ /**
413
+ * The id for the rgb controls
414
+ * @property ID.RGB_CONTROLS
415
+ * @final
416
+ * @default yui-picker-rgb-controls
417
+ */
418
+ RGB_CONTROLS: b + "-rgb-controls",
419
+
420
+ /**
421
+ * The id for the hsv controls
422
+ * @property ID.HSV_CONTROLS
423
+ * @final
424
+ * @default yui-picker-hsv-controls
425
+ */
426
+ HSV_CONTROLS: b + "-hsv-controls",
427
+
428
+ /**
429
+ * The id for the hsv controls
430
+ * @property ID.HEX_CONTROLS
431
+ * @final
432
+ * @default yui-picker-hex-controls
433
+ */
434
+ HEX_CONTROLS: b + "-hex-controls",
435
+
436
+ /**
437
+ * The id for the hex summary
438
+ * @property ID.HEX_SUMMARY
439
+ * @final
440
+ * @default yui-picker-hex-summary
441
+ */
442
+ HEX_SUMMARY: b + "-hex-summary",
443
+
444
+ /**
445
+ * The id for the controls section header
446
+ * @property ID.CONTROLS_LABEL
447
+ * @final
448
+ * @default yui-picker-controls-label
449
+ */
450
+ CONTROLS_LABEL: b + "-controls-label"
451
+ },
452
+
453
+ /**
454
+ * Constants for any script-generated messages. The values here
455
+ * are the default messages. They can be updated by providing
456
+ * the complete list to the constructor for the "txt" attribute.
457
+ * @property TXT
458
+ * @final
459
+ */
460
+ TXT : {
461
+ ILLEGAL_HEX: "Illegal hex value entered",
462
+ SHOW_CONTROLS: "Show color details",
463
+ HIDE_CONTROLS: "Hide color details",
464
+ CURRENT_COLOR: "Currently selected color: {rgb}",
465
+ CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.",
466
+ R: "R",
467
+ G: "G",
468
+ B: "B",
469
+ H: "H",
470
+ S: "S",
471
+ V: "V",
472
+ HEX: "#",
473
+ DEG: "\u00B0",
474
+ PERCENT: "%"
475
+ },
476
+
477
+ /**
478
+ * Constants for the default image locations for img tags that are
479
+ * generated by the control. They can be modified by passing the
480
+ * complete list to the contructor for the "images" attribute
481
+ * @property IMAGE
482
+ * @final
483
+ */
484
+ IMAGE : {
485
+ PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png",
486
+ HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png"
487
+ },
488
+
489
+ /**
490
+ * Constants for the control's default default values
491
+ * @property DEFAULT
492
+ * @final
493
+ */
494
+ DEFAULT : {
495
+ PICKER_SIZE: 180
496
+ },
497
+
498
+ /**
499
+ * Constants for the control's configuration attributes
500
+ * @property OPT
501
+ * @final
502
+ */
503
+ OPT : {
504
+ HUE : "hue",
505
+ SATURATION : "saturation",
506
+ VALUE : "value",
507
+ RED : "red",
508
+ GREEN : "green",
509
+ BLUE : "blue",
510
+ HSV : "hsv",
511
+ RGB : "rgb",
512
+ WEBSAFE : "websafe",
513
+ HEX : "hex",
514
+ PICKER_SIZE : "pickersize",
515
+ SHOW_CONTROLS : "showcontrols",
516
+ SHOW_RGB_CONTROLS : "showrgbcontrols",
517
+ SHOW_HSV_CONTROLS : "showhsvcontrols",
518
+ SHOW_HEX_CONTROLS : "showhexcontrols",
519
+ SHOW_HEX_SUMMARY : "showhexsummary",
520
+ SHOW_WEBSAFE : "showwebsafe",
521
+ CONTAINER : "container",
522
+ IDS : "ids",
523
+ ELEMENTS : "elements",
524
+ TXT : "txt",
525
+ IMAGES : "images",
526
+ ANIMATE : "animate"
527
+ },
528
+
529
+ /**
530
+ * Flag to allow individual UI updates to forego animation if available.
531
+ * True during construction for initial thumb placement. Set to false
532
+ * after that.
533
+ *
534
+ * @property skipAnim
535
+ * @type Boolean
536
+ * @default true
537
+ */
538
+ skipAnim : true,
539
+
540
+ /**
541
+ * Creates the host element if it doesn't exist
542
+ * @method _createHostElement
543
+ * @protected
544
+ */
545
+ _createHostElement : function () {
546
+ var el = document.createElement('div');
547
+
548
+ if (this.CSS.BASE) {
549
+ el.className = this.CSS.BASE;
550
+ }
551
+
552
+ return el;
553
+ },
554
+
555
+ /**
556
+ * Moves the hue slider into the position dictated by the current state
557
+ * of the control
558
+ * @method _updateHueSlider
559
+ * @protected
560
+ */
561
+ _updateHueSlider : function() {
562
+ var size = this.get(this.OPT.PICKER_SIZE),
563
+ h = this.get(this.OPT.HUE);
564
+
565
+ h = size - Math.round(h / 360 * size);
566
+
567
+ // 0 is at the top and bottom of the hue slider. Always go to
568
+ // the top so we don't end up sending the thumb to the bottom
569
+ // when the value didn't actually change (e.g., a conversion
570
+ // produced 360 instead of 0 and the value was already 0).
571
+ if (h === size) {
572
+ h = 0;
573
+ }
574
+
575
+ this.hueSlider.setValue(h, this.skipAnim);
576
+ },
577
+
578
+ /**
579
+ * Moves the picker slider into the position dictated by the current state
580
+ * of the control
581
+ * @method _updatePickerSlider
582
+ * @protected
583
+ */
584
+ _updatePickerSlider : function() {
585
+ var size = this.get(this.OPT.PICKER_SIZE),
586
+ s = this.get(this.OPT.SATURATION),
587
+ v = this.get(this.OPT.VALUE);
588
+
589
+ s = Math.round(s * size / 100);
590
+ v = Math.round(size - (v * size / 100));
591
+
592
+
593
+ this.pickerSlider.setRegionValue(s, v, this.skipAnim);
594
+ },
595
+
596
+ /**
597
+ * Moves the sliders into the position dictated by the current state
598
+ * of the control
599
+ * @method _updateSliders
600
+ * @protected
601
+ */
602
+ _updateSliders : function() {
603
+ this._updateHueSlider();
604
+ this._updatePickerSlider();
605
+ },
606
+
607
+ /**
608
+ * Sets the control to the specified rgb value and
609
+ * moves the sliders to the proper positions
610
+ * @method setValue
611
+ * @param rgb {[int, int, int]} the rgb value
612
+ * @param silent {boolean} whether or not to fire the change event
613
+ */
614
+ setValue : function(rgb, silent) {
615
+ silent = (silent) || false;
616
+ this.set(this.OPT.RGB, rgb, silent);
617
+ this._updateSliders();
618
+ },
619
+
620
+ /**
621
+ * The hue slider
622
+ * @property hueSlider
623
+ * @type YAHOO.widget.Slider
624
+ */
625
+ hueSlider : null,
626
+
627
+ /**
628
+ * The picker region
629
+ * @property pickerSlider
630
+ * @type YAHOO.widget.Slider
631
+ */
632
+ pickerSlider : null,
633
+
634
+ /**
635
+ * Translates the slider value into hue, int[0,359]
636
+ * @method _getH
637
+ * @protected
638
+ * @return {int} the hue from 0 to 359
639
+ */
640
+ _getH : function() {
641
+ var size = this.get(this.OPT.PICKER_SIZE),
642
+ h = (size - this.hueSlider.getValue()) / size;
643
+ h = Math.round(h*360);
644
+ return (h === 360) ? 0 : h;
645
+ },
646
+
647
+ /**
648
+ * Translates the slider value into saturation, int[0,1], left to right
649
+ * @method _getS
650
+ * @protected
651
+ * @return {int} the saturation from 0 to 1
652
+ */
653
+ _getS : function() {
654
+ return this.pickerSlider.getXValue() / this.get(this.OPT.PICKER_SIZE);
655
+ },
656
+
657
+ /**
658
+ * Translates the slider value into value/brightness, int[0,1], top
659
+ * to bottom
660
+ * @method _getV
661
+ * @protected
662
+ * @return {int} the value from 0 to 1
663
+ */
664
+ _getV : function() {
665
+ var size = this.get(this.OPT.PICKER_SIZE);
666
+ return (size - this.pickerSlider.getYValue()) / size;
667
+ },
668
+
669
+ /**
670
+ * Updates the background of the swatch with the current rbg value.
671
+ * Also updates the websafe swatch to the closest websafe color
672
+ * @method _updateSwatch
673
+ * @protected
674
+ */
675
+ _updateSwatch : function() {
676
+ var rgb = this.get(this.OPT.RGB),
677
+ websafe = this.get(this.OPT.WEBSAFE),
678
+ el = this.getElement(this.ID.SWATCH),
679
+ color = rgb.join(","),
680
+ txt = this.get(this.OPT.TXT);
681
+
682
+ Dom.setStyle(el, "background-color", "rgb(" + color + ")");
683
+ el.title = sub(txt.CURRENT_COLOR, {
684
+ "rgb": "#" + this.get(this.OPT.HEX)
685
+ });
686
+
687
+
688
+ el = this.getElement(this.ID.WEBSAFE_SWATCH);
689
+ color = websafe.join(",");
690
+
691
+ Dom.setStyle(el, "background-color", "rgb(" + color + ")");
692
+ el.title = sub(txt.CLOSEST_WEBSAFE, {
693
+ "rgb": "#" + Color.rgb2hex(websafe)
694
+ });
695
+
696
+ },
697
+
698
+ /**
699
+ * Reads the sliders and converts the values to RGB, updating the
700
+ * internal state for all the individual form fields
701
+ * @method _getValuesFromSliders
702
+ * @protected
703
+ */
704
+ _getValuesFromSliders : function() {
705
+ this.set(this.OPT.RGB, Color.hsv2rgb(this._getH(), this._getS(), this._getV()));
706
+ },
707
+
708
+ /**
709
+ * Updates the form field controls with the state data contained
710
+ * in the control.
711
+ * @method _updateFormFields
712
+ * @protected
713
+ */
714
+ _updateFormFields : function() {
715
+ this.getElement(this.ID.H).value = this.get(this.OPT.HUE);
716
+ this.getElement(this.ID.S).value = this.get(this.OPT.SATURATION);
717
+ this.getElement(this.ID.V).value = this.get(this.OPT.VALUE);
718
+ this.getElement(this.ID.R).value = this.get(this.OPT.RED);
719
+ this.getElement(this.ID.R_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.RED));
720
+ this.getElement(this.ID.G).value = this.get(this.OPT.GREEN);
721
+ this.getElement(this.ID.G_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.GREEN));
722
+ this.getElement(this.ID.B).value = this.get(this.OPT.BLUE);
723
+ this.getElement(this.ID.B_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.BLUE));
724
+ this.getElement(this.ID.HEX).value = this.get(this.OPT.HEX);
725
+ },
726
+
727
+ /**
728
+ * Event handler for the hue slider.
729
+ * @method _onHueSliderChange
730
+ * @param newOffset {int} pixels from the start position
731
+ * @protected
732
+ */
733
+ _onHueSliderChange : function(newOffset) {
734
+
735
+ var h = this._getH(),
736
+ rgb = Color.hsv2rgb(h, 1, 1),
737
+ styleDef = "rgb(" + rgb.join(",") + ")";
738
+
739
+ this.set(this.OPT.HUE, h, true);
740
+
741
+ // set picker background to the hue
742
+ Dom.setStyle(this.getElement(this.ID.PICKER_BG), "background-color", styleDef);
743
+
744
+ if (this.hueSlider.valueChangeSource !== Slider.SOURCE_SET_VALUE) {
745
+ this._getValuesFromSliders();
746
+ }
747
+
748
+ this._updateFormFields();
749
+ this._updateSwatch();
750
+ },
751
+
752
+ /**
753
+ * Event handler for the picker slider, which controls the
754
+ * saturation and value/brightness.
755
+ * @method _onPickerSliderChange
756
+ * @param newOffset {{x: int, y: int}} x/y pixels from the start position
757
+ * @protected
758
+ */
759
+ _onPickerSliderChange : function(newOffset) {
760
+
761
+ var s=this._getS(), v=this._getV();
762
+ this.set(this.OPT.SATURATION, Math.round(s*100), true);
763
+ this.set(this.OPT.VALUE, Math.round(v*100), true);
764
+
765
+ if (this.pickerSlider.valueChangeSource !== Slider.SOURCE_SET_VALUE) {
766
+ this._getValuesFromSliders();
767
+ }
768
+
769
+ this._updateFormFields();
770
+ this._updateSwatch();
771
+ },
772
+
773
+
774
+ /**
775
+ * Key map to well-known commands for txt field input
776
+ * @method _getCommand
777
+ * @param e {Event} the keypress or keydown event
778
+ * @return {int} a command code
779
+ * <ul>
780
+ * <li>0 = not a number, letter in range, or special key</li>
781
+ * <li>1 = number</li>
782
+ * <li>2 = a-fA-F</li>
783
+ * <li>3 = increment (up arrow)</li>
784
+ * <li>4 = decrement (down arrow)</li>
785
+ * <li>5 = special key (tab, delete, return, escape, left, right)</li>
786
+ * <li>6 = return</li>
787
+ * </ul>
788
+ * @protected
789
+ */
790
+ _getCommand : function(e) {
791
+ var c = Event.getCharCode(e);
792
+
793
+ //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
794
+
795
+ // special keys
796
+ if (c === 38) { // up arrow
797
+ return 3;
798
+ } else if (c === 13) { // return
799
+ return 6;
800
+ } else if (c === 40) { // down array
801
+ return 4;
802
+ } else if (c >= 48 && c<=57) { // 0-9
803
+ return 1;
804
+ } else if (c >= 97 && c<=102) { // a-f
805
+ return 2;
806
+ } else if (c >= 65 && c<=70) { // A-F
807
+ return 2;
808
+ //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
809
+ // (c >= 112 && c <=123)) { // including F-keys
810
+ // tab, delete, return, escape, left, right or ctrl/meta sequences
811
+ } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 ||
812
+ e.ctrlKey || e.metaKey) { // special chars
813
+ return 5;
814
+ } else { // something we probably don't want
815
+ return 0;
816
+ }
817
+ },
818
+
819
+ /**
820
+ * Use the value of the text field to update the control
821
+ * @method _useFieldValue
822
+ * @param e {Event} an event
823
+ * @param el {HTMLElement} the field
824
+ * @param prop {string} the key to the linked property
825
+ * @protected
826
+ */
827
+ _useFieldValue : function(e, el, prop) {
828
+ var val = el.value;
829
+
830
+ if (prop !== this.OPT.HEX) {
831
+ val = parseInt(val, 10);
832
+ }
833
+
834
+ if (val !== this.get(prop)) {
835
+ this.set(prop, val);
836
+ }
837
+ },
838
+
839
+ /**
840
+ * Handle keypress on one of the rgb or hsv fields.
841
+ * @method _rgbFieldKeypress
842
+ * @param e {Event} the keypress event
843
+ * @param el {HTMLElement} the field
844
+ * @param prop {string} the key to the linked property
845
+ * @protected
846
+ */
847
+ _rgbFieldKeypress : function(e, el, prop) {
848
+ var command = this._getCommand(e),
849
+ inc = (e.shiftKey) ? 10 : 1;
850
+ switch (command) {
851
+ case 6: // return, update the value
852
+ this._useFieldValue.apply(this, arguments);
853
+ break;
854
+
855
+ case 3: // up arrow, increment
856
+ this.set(prop, Math.min(this.get(prop)+inc, 255));
857
+ this._updateFormFields();
858
+ //Event.stopEvent(e);
859
+ break;
860
+ case 4: // down arrow, decrement
861
+ this.set(prop, Math.max(this.get(prop)-inc, 0));
862
+ this._updateFormFields();
863
+ //Event.stopEvent(e);
864
+ break;
865
+
866
+ default:
867
+ }
868
+
869
+ },
870
+
871
+ /**
872
+ * Handle keydown on the hex field
873
+ * @method _hexFieldKeypress
874
+ * @param e {Event} the keypress event
875
+ * @param el {HTMLElement} the field
876
+ * @param prop {string} the key to the linked property
877
+ * @protected
878
+ */
879
+ _hexFieldKeypress : function(e, el, prop) {
880
+ var command = this._getCommand(e);
881
+ if (command === 6) { // return, update the value
882
+ this._useFieldValue.apply(this, arguments);
883
+ }
884
+ },
885
+
886
+ /**
887
+ * Allows numbers and special chars, and by default allows a-f.
888
+ * Used for the hex field keypress handler.
889
+ * @method _hexOnly
890
+ * @param e {Event} the event
891
+ * @param numbersOnly omits a-f if set to true
892
+ * @protected
893
+ * @return {boolean} false if we are canceling the event
894
+ */
895
+ _hexOnly : function(e, numbersOnly) {
896
+ var command = this._getCommand(e);
897
+ switch (command) {
898
+ case 6: // return
899
+ case 5: // special char
900
+ case 1: // number
901
+ break;
902
+ case 2: // hex char (a-f)
903
+ if (numbersOnly !== true) {
904
+ break;
905
+ }
906
+
907
+ // fallthrough is intentional
908
+
909
+ default: // prevent alpha and punctuation
910
+ Event.stopEvent(e);
911
+ return false;
912
+ }
913
+ },
914
+
915
+ /**
916
+ * Allows numbers and special chars only. Used for the
917
+ * rgb and hsv fields keypress handler.
918
+ * @method _numbersOnly
919
+ * @param e {Event} the event
920
+ * @protected
921
+ * @return {boolean} false if we are canceling the event
922
+ */
923
+ _numbersOnly : function(e) {
924
+ return this._hexOnly(e, true);
925
+ },
926
+
927
+ /**
928
+ * Returns the element reference that is saved. The id can be either
929
+ * the element id, or the key for this id in the "id" config attribute.
930
+ * For instance, the host element id can be obtained by passing its
931
+ * id (default: "yui_picker") or by its key "YUI_PICKER".
932
+ * @param id {string} the element id, or key
933
+ * @return {HTMLElement} a reference to the element
934
+ */
935
+ getElement : function(id) {
936
+ return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]];
937
+ },
938
+
939
+ _createElements : function() {
940
+ var el, child, img, fld, p,
941
+ ids = this.get(this.OPT.IDS),
942
+ txt = this.get(this.OPT.TXT),
943
+ images = this.get(this.OPT.IMAGES),
944
+ Elem = function(type, o) {
945
+ var n = document.createElement(type);
946
+ if (o) {
947
+ lang.augmentObject(n, o, true);
948
+ }
949
+ return n;
950
+ },
951
+ RGBElem = function(type, obj) {
952
+ var o = lang.merge({
953
+ //type: "txt",
954
+ autocomplete: "off",
955
+ value: "0",
956
+ size: 3,
957
+ maxlength: 3
958
+ }, obj);
959
+
960
+ o.name = o.id;
961
+ return new Elem(type, o);
962
+ };
963
+
964
+ p = this.get("element");
965
+
966
+ // Picker slider (S and V) ---------------------------------------------
967
+
968
+ el = new Elem("div", {
969
+ id: ids[this.ID.PICKER_BG],
970
+ className: "yui-picker-bg",
971
+ tabIndex: -1,
972
+ hideFocus: true
973
+ });
974
+
975
+ child = new Elem("div", {
976
+ id: ids[this.ID.PICKER_THUMB],
977
+ className: "yui-picker-thumb"
978
+ });
979
+
980
+ img = new Elem("img", {
981
+ src: images.PICKER_THUMB
982
+ });
983
+
984
+ child.appendChild(img);
985
+ el.appendChild(child);
986
+ p.appendChild(el);
987
+
988
+ // Hue slider ---------------------------------------------
989
+ el = new Elem("div", {
990
+ id: ids[this.ID.HUE_BG],
991
+ className: "yui-picker-hue-bg",
992
+ tabIndex: -1,
993
+ hideFocus: true
994
+ });
995
+
996
+ child = new Elem("div", {
997
+ id: ids[this.ID.HUE_THUMB],
998
+ className: "yui-picker-hue-thumb"
999
+ });
1000
+
1001
+ img = new Elem("img", {
1002
+ src: images.HUE_THUMB
1003
+ });
1004
+
1005
+ child.appendChild(img);
1006
+ el.appendChild(child);
1007
+ p.appendChild(el);
1008
+
1009
+
1010
+ // controls ---------------------------------------------
1011
+
1012
+ el = new Elem("div", {
1013
+ id: ids[this.ID.CONTROLS],
1014
+ className: "yui-picker-controls"
1015
+ });
1016
+
1017
+ p.appendChild(el);
1018
+ p = el;
1019
+
1020
+ // controls header
1021
+ el = new Elem("div", {
1022
+ className: "hd"
1023
+ });
1024
+
1025
+ child = new Elem("a", {
1026
+ id: ids[this.ID.CONTROLS_LABEL],
1027
+ //className: "yui-picker-controls-label",
1028
+ href: "#"
1029
+ });
1030
+ el.appendChild(child);
1031
+ p.appendChild(el);
1032
+
1033
+ // bd
1034
+ el = new Elem("div", {
1035
+ className: "bd"
1036
+ });
1037
+
1038
+ p.appendChild(el);
1039
+ p = el;
1040
+
1041
+ // rgb
1042
+ el = new Elem("ul", {
1043
+ id: ids[this.ID.RGB_CONTROLS],
1044
+ className: "yui-picker-rgb-controls"
1045
+ });
1046
+
1047
+ child = new Elem("li");
1048
+ child.appendChild(document.createTextNode(txt.R + " "));
1049
+
1050
+ fld = new RGBElem("input", {
1051
+ id: ids[this.ID.R],
1052
+ className: "yui-picker-r"
1053
+ });
1054
+
1055
+ child.appendChild(fld);
1056
+ el.appendChild(child);
1057
+
1058
+ child = new Elem("li");
1059
+ child.appendChild(document.createTextNode(txt.G + " "));
1060
+
1061
+ fld = new RGBElem("input", {
1062
+ id: ids[this.ID.G],
1063
+ className: "yui-picker-g"
1064
+ });
1065
+
1066
+ child.appendChild(fld);
1067
+ el.appendChild(child);
1068
+
1069
+ child = new Elem("li");
1070
+ child.appendChild(document.createTextNode(txt.B + " "));
1071
+
1072
+ fld = new RGBElem("input", {
1073
+ id: ids[this.ID.B],
1074
+ className: "yui-picker-b"
1075
+ });
1076
+
1077
+ child.appendChild(fld);
1078
+ el.appendChild(child);
1079
+
1080
+ p.appendChild(el);
1081
+
1082
+ // hsv
1083
+ el = new Elem("ul", {
1084
+ id: ids[this.ID.HSV_CONTROLS],
1085
+ className: "yui-picker-hsv-controls"
1086
+ });
1087
+
1088
+ child = new Elem("li");
1089
+ child.appendChild(document.createTextNode(txt.H + " "));
1090
+
1091
+ fld = new RGBElem("input", {
1092
+ id: ids[this.ID.H],
1093
+ className: "yui-picker-h"
1094
+ });
1095
+
1096
+ child.appendChild(fld);
1097
+ child.appendChild(document.createTextNode(" " + txt.DEG));
1098
+
1099
+ el.appendChild(child);
1100
+
1101
+ child = new Elem("li");
1102
+ child.appendChild(document.createTextNode(txt.S + " "));
1103
+
1104
+ fld = new RGBElem("input", {
1105
+ id: ids[this.ID.S],
1106
+ className: "yui-picker-s"
1107
+ });
1108
+
1109
+ child.appendChild(fld);
1110
+ child.appendChild(document.createTextNode(" " + txt.PERCENT));
1111
+
1112
+ el.appendChild(child);
1113
+
1114
+ child = new Elem("li");
1115
+ child.appendChild(document.createTextNode(txt.V + " "));
1116
+
1117
+ fld = new RGBElem("input", {
1118
+ id: ids[this.ID.V],
1119
+ className: "yui-picker-v"
1120
+ });
1121
+
1122
+ child.appendChild(fld);
1123
+ child.appendChild(document.createTextNode(" " + txt.PERCENT));
1124
+
1125
+ el.appendChild(child);
1126
+ p.appendChild(el);
1127
+
1128
+
1129
+ // hex summary
1130
+
1131
+ el = new Elem("ul", {
1132
+ id: ids[this.ID.HEX_SUMMARY],
1133
+ className: "yui-picker-hex_summary"
1134
+ });
1135
+
1136
+ child = new Elem("li", {
1137
+ id: ids[this.ID.R_HEX]
1138
+ });
1139
+ el.appendChild(child);
1140
+
1141
+ child = new Elem("li", {
1142
+ id: ids[this.ID.G_HEX]
1143
+ });
1144
+ el.appendChild(child);
1145
+
1146
+ child = new Elem("li", {
1147
+ id: ids[this.ID.B_HEX]
1148
+ });
1149
+ el.appendChild(child);
1150
+ p.appendChild(el);
1151
+
1152
+ // hex field
1153
+ el = new Elem("div", {
1154
+ id: ids[this.ID.HEX_CONTROLS],
1155
+ className: "yui-picker-hex-controls"
1156
+ });
1157
+ el.appendChild(document.createTextNode(txt.HEX + " "));
1158
+
1159
+ child = new RGBElem("input", {
1160
+ id: ids[this.ID.HEX],
1161
+ className: "yui-picker-hex",
1162
+ size: 6,
1163
+ maxlength: 6
1164
+ });
1165
+
1166
+ el.appendChild(child);
1167
+ p.appendChild(el);
1168
+
1169
+ p = this.get("element");
1170
+
1171
+ // swatch
1172
+ el = new Elem("div", {
1173
+ id: ids[this.ID.SWATCH],
1174
+ className: "yui-picker-swatch"
1175
+ });
1176
+
1177
+ p.appendChild(el);
1178
+
1179
+ // websafe swatch
1180
+ el = new Elem("div", {
1181
+ id: ids[this.ID.WEBSAFE_SWATCH],
1182
+ className: "yui-picker-websafe-swatch"
1183
+ });
1184
+
1185
+ p.appendChild(el);
1186
+
1187
+ },
1188
+
1189
+ _attachRGBHSV : function(id, config) {
1190
+ Event.on(this.getElement(id), "keydown", function(e, me) {
1191
+ me._rgbFieldKeypress(e, this, config);
1192
+ }, this);
1193
+ Event.on(this.getElement(id), "keypress", this._numbersOnly, this, true);
1194
+ Event.on(this.getElement(id), "blur", function(e, me) {
1195
+ me._useFieldValue(e, this, config);
1196
+ }, this);
1197
+ },
1198
+
1199
+
1200
+ /**
1201
+ * Updates the rgb attribute with the current state of the r,g,b
1202
+ * fields. This is invoked from change listeners on these
1203
+ * attributes to facilitate updating these values from the
1204
+ * individual form fields
1205
+ * @method _updateRGB
1206
+ * @protected
1207
+ */
1208
+ _updateRGB : function() {
1209
+ var rgb = [this.get(this.OPT.RED),
1210
+ this.get(this.OPT.GREEN),
1211
+ this.get(this.OPT.BLUE)];
1212
+
1213
+ this.set(this.OPT.RGB, rgb);
1214
+
1215
+ this._updateSliders();
1216
+ },
1217
+
1218
+ /**
1219
+ * Creates any missing DOM structure.
1220
+ *
1221
+ * @method _initElements
1222
+ * @protected
1223
+ */
1224
+ _initElements : function () {
1225
+ // bind all of our elements
1226
+ var o=this.OPT,
1227
+ ids = this.get(o.IDS),
1228
+ els = this.get(o.ELEMENTS),
1229
+ i, el, id;
1230
+
1231
+ // Add the default value as a key for each element for easier lookup
1232
+ for (i in this.ID) {
1233
+ if (lang.hasOwnProperty(this.ID, i)) {
1234
+ ids[this.ID[i]] = ids[i];
1235
+ }
1236
+ }
1237
+
1238
+ // Check for picker element, if not there, create all of them
1239
+ el = Dom.get(ids[this.ID.PICKER_BG]);
1240
+ if (!el) {
1241
+ this._createElements();
1242
+ } else {
1243
+ }
1244
+
1245
+ for (i in ids) {
1246
+ if (lang.hasOwnProperty(ids, i)) {
1247
+ // look for element
1248
+ el = Dom.get(ids[i]);
1249
+
1250
+ // generate an id if the implementer passed in an element reference,
1251
+ // and the element did not have an id already
1252
+ id = Dom.generateId(el);
1253
+
1254
+ // update the id in case we generated the id
1255
+ ids[i] = id; // key is WEBSAFE_SWATCH
1256
+ ids[ids[i]] = id; // key is websafe_swatch
1257
+
1258
+ // store the dom ref
1259
+ els[id] = el;
1260
+ }
1261
+ }
1262
+
1263
+ },
1264
+
1265
+ /**
1266
+ * Sets the initial state of the sliders
1267
+ * @method initPicker
1268
+ */
1269
+ initPicker : function () {
1270
+ this._initSliders();
1271
+ this._bindUI();
1272
+ this.syncUI(true);
1273
+ },
1274
+
1275
+ /**
1276
+ * Creates the Hue and Value/Saturation Sliders.
1277
+ *
1278
+ * @method _initSliders
1279
+ * @protected
1280
+ */
1281
+ _initSliders : function () {
1282
+ var ID = this.ID,
1283
+ size = this.get(this.OPT.PICKER_SIZE);
1284
+
1285
+
1286
+ this.hueSlider = Slider.getVertSlider(
1287
+ this.getElement(ID.HUE_BG),
1288
+ this.getElement(ID.HUE_THUMB), 0, size);
1289
+
1290
+ this.pickerSlider = Slider.getSliderRegion(
1291
+ this.getElement(ID.PICKER_BG),
1292
+ this.getElement(ID.PICKER_THUMB), 0, size, 0, size);
1293
+
1294
+ // Apply animate attribute configuration
1295
+ this.set(this.OPT.ANIMATE, this.get(this.OPT.ANIMATE));
1296
+ },
1297
+
1298
+ /**
1299
+ * Adds event listeners to Sliders and UI elements. Wires everything
1300
+ * up.
1301
+ *
1302
+ * @method _bindUI
1303
+ * @protected
1304
+ */
1305
+ _bindUI : function () {
1306
+ var ID = this.ID,
1307
+ O = this.OPT;
1308
+
1309
+ this.hueSlider.subscribe("change",
1310
+ this._onHueSliderChange, this, true);
1311
+ this.pickerSlider.subscribe("change",
1312
+ this._onPickerSliderChange, this, true);
1313
+
1314
+ Event.on(this.getElement(ID.WEBSAFE_SWATCH), "click", function(e) {
1315
+ this.setValue(this.get(O.WEBSAFE));
1316
+ }, this, true);
1317
+
1318
+ Event.on(this.getElement(ID.CONTROLS_LABEL), "click", function(e) {
1319
+ this.set(O.SHOW_CONTROLS, !this.get(O.SHOW_CONTROLS));
1320
+ Event.preventDefault(e);
1321
+ }, this, true);
1322
+
1323
+ this._attachRGBHSV(ID.R, O.RED);
1324
+ this._attachRGBHSV(ID.G, O.GREEN);
1325
+ this._attachRGBHSV(ID.B, O.BLUE);
1326
+ this._attachRGBHSV(ID.H, O.HUE);
1327
+ this._attachRGBHSV(ID.S, O.SATURATION);
1328
+ this._attachRGBHSV(ID.V, O.VALUE);
1329
+
1330
+ Event.on(this.getElement(ID.HEX), "keydown", function(e, me) {
1331
+ me._hexFieldKeypress(e, this, O.HEX);
1332
+ }, this);
1333
+
1334
+ Event.on(this.getElement(this.ID.HEX), "keypress",
1335
+ this._hexOnly, this,true);
1336
+ Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
1337
+ me._useFieldValue(e, this, O.HEX);
1338
+ }, this);
1339
+ },
1340
+
1341
+ /**
1342
+ * Wrapper for _updateRGB, but allows setting
1343
+ *
1344
+ * @method syncUI
1345
+ * @param skipAnim {Boolean} Omit Slider animation for this action
1346
+ */
1347
+ syncUI : function (skipAnim) {
1348
+ this.skipAnim = skipAnim;
1349
+ this._updateRGB();
1350
+ this.skipAnim = false;
1351
+ },
1352
+
1353
+
1354
+ /**
1355
+ * Updates the RGB values from the current state of the HSV
1356
+ * values. Executed when the one of the HSV form fields are
1357
+ * updated
1358
+ * _updateRGBFromHSV
1359
+ * @protected
1360
+ */
1361
+ _updateRGBFromHSV : function() {
1362
+ var hsv = [this.get(this.OPT.HUE),
1363
+ this.get(this.OPT.SATURATION)/100,
1364
+ this.get(this.OPT.VALUE)/100],
1365
+ rgb = Color.hsv2rgb(hsv);
1366
+
1367
+ this.set(this.OPT.RGB, rgb);
1368
+
1369
+ this._updateSliders();
1370
+ },
1371
+
1372
+ /**
1373
+ * Parses the hex string to normalize shorthand values, converts
1374
+ * the hex value to rgb and updates the rgb attribute (which
1375
+ * updates the state for all of the other values)
1376
+ * method _updateHex
1377
+ * @protected
1378
+ */
1379
+ _updateHex : function() {
1380
+
1381
+ var hex = this.get(this.OPT.HEX),
1382
+ l = hex.length,
1383
+ c,i,rgb;
1384
+
1385
+ // support #369 -> #336699 shorthand
1386
+ if (l === 3) {
1387
+ c = hex.split("");
1388
+ for (i=0; i<l; i=i+1) {
1389
+ c[i] = c[i] + c[i];
1390
+ }
1391
+
1392
+ hex = c.join("");
1393
+ }
1394
+
1395
+ if (hex.length !== 6) {
1396
+ return false;
1397
+ }
1398
+
1399
+ rgb = Color.hex2rgb(hex);
1400
+
1401
+
1402
+ this.setValue(rgb);
1403
+ },
1404
+
1405
+
1406
+ /**
1407
+ * Returns the cached element reference. If the id is not a string, it
1408
+ * is assumed that it is an element and this is returned.
1409
+ * @param id {string|HTMLElement} the element key, id, or ref
1410
+ * @param on {boolean} hide or show. If true, show
1411
+ * @protected
1412
+ */
1413
+ _hideShowEl : function(id, on) {
1414
+ var el = (lang.isString(id) ? this.getElement(id) : id);
1415
+ Dom.setStyle(el, "display", (on) ? "" : "none");
1416
+ },
1417
+
1418
+
1419
+ /**
1420
+ * Sets up the config attributes and the change listeners for this
1421
+ * properties
1422
+ * @method initAttributes
1423
+ * @param attr An object containing default attribute values
1424
+ */
1425
+ initAttributes : function(attr) {
1426
+
1427
+ attr = attr || {};
1428
+ ColorPicker.superclass.initAttributes.call(this, attr);
1429
+
1430
+ /**
1431
+ * The size of the picker. Trying to change this is not recommended.
1432
+ * @attribute pickersize
1433
+ * @default 180
1434
+ * @type int
1435
+ */
1436
+ this.setAttributeConfig(this.OPT.PICKER_SIZE, {
1437
+ value: attr.size || this.DEFAULT.PICKER_SIZE
1438
+ });
1439
+
1440
+ /**
1441
+ * The current hue value 0-360
1442
+ * @attribute hue
1443
+ * @type int
1444
+ */
1445
+ this.setAttributeConfig(this.OPT.HUE, {
1446
+ value: attr.hue || 0,
1447
+ validator: lang.isNumber
1448
+ });
1449
+
1450
+ /**
1451
+ * The current saturation value 0-100
1452
+ * @attribute saturation
1453
+ * @type int
1454
+ */
1455
+ this.setAttributeConfig(this.OPT.SATURATION, {
1456
+ value: attr.saturation || 0,
1457
+ validator: lang.isNumber
1458
+ });
1459
+
1460
+ /**
1461
+ * The current value/brightness value 0-100
1462
+ * @attribute value
1463
+ * @type int
1464
+ */
1465
+ this.setAttributeConfig(this.OPT.VALUE, {
1466
+ value: lang.isNumber(attr.value) ? attr.value : 100,
1467
+ validator: lang.isNumber
1468
+ });
1469
+
1470
+ /**
1471
+ * The current red value 0-255
1472
+ * @attribute red
1473
+ * @type int
1474
+ */
1475
+ this.setAttributeConfig(this.OPT.RED, {
1476
+ value: lang.isNumber(attr.red) ? attr.red : 255,
1477
+ validator: lang.isNumber
1478
+ });
1479
+
1480
+ /**
1481
+ * The current green value 0-255
1482
+ * @attribute green
1483
+ * @type int
1484
+ */
1485
+ this.setAttributeConfig(this.OPT.GREEN, {
1486
+ value: lang.isNumber(attr.green) ? attr.green : 255,
1487
+ validator: lang.isNumber
1488
+ });
1489
+
1490
+ /**
1491
+ * The current blue value 0-255
1492
+ * @attribute blue
1493
+ * @type int
1494
+ */
1495
+ this.setAttributeConfig(this.OPT.BLUE, {
1496
+ value: lang.isNumber(attr.blue) ? attr.blue : 255,
1497
+ validator: lang.isNumber
1498
+ });
1499
+
1500
+ /**
1501
+ * The current hex value #000000-#FFFFFF, without the #
1502
+ * @attribute hex
1503
+ * @type string
1504
+ */
1505
+ this.setAttributeConfig(this.OPT.HEX, {
1506
+ value: attr.hex || "FFFFFF",
1507
+ validator: lang.isString
1508
+ });
1509
+
1510
+ /**
1511
+ * The current rgb value. Updates the state of all of the
1512
+ * other value fields. Read-only: use setValue to set the
1513
+ * controls rgb value.
1514
+ * @attribute hex
1515
+ * @type [int, int, int]
1516
+ * @readonly
1517
+ */
1518
+ this.setAttributeConfig(this.OPT.RGB, {
1519
+ value: attr.rgb || [255,255,255],
1520
+ method: function(rgb) {
1521
+
1522
+ this.set(this.OPT.RED, rgb[0], true);
1523
+ this.set(this.OPT.GREEN, rgb[1], true);
1524
+ this.set(this.OPT.BLUE, rgb[2], true);
1525
+
1526
+ var websafe = Color.websafe(rgb),
1527
+ hex = Color.rgb2hex(rgb),
1528
+ hsv = Color.rgb2hsv(rgb);
1529
+
1530
+ this.set(this.OPT.WEBSAFE, websafe, true);
1531
+ this.set(this.OPT.HEX, hex, true);
1532
+
1533
+
1534
+
1535
+ // fix bug #1754338 - when saturation is 0, hue is
1536
+ // silently always set to 0, but input field not updated
1537
+ if (hsv[1]) {
1538
+ this.set(this.OPT.HUE, hsv[0], true);
1539
+ }
1540
+ this.set(this.OPT.SATURATION, Math.round(hsv[1]*100), true);
1541
+ this.set(this.OPT.VALUE, Math.round(hsv[2]*100), true);
1542
+ },
1543
+ readonly: true
1544
+ });
1545
+
1546
+ /**
1547
+ * If the color picker will live inside of a container object,
1548
+ * set, provide a reference to it so the control can use the
1549
+ * container's events.
1550
+ * @attribute container
1551
+ * @type YAHOO.widget.Panel
1552
+ */
1553
+ this.setAttributeConfig(this.OPT.CONTAINER, {
1554
+ value: null,
1555
+ method: function(container) {
1556
+ if (container) {
1557
+ // Position can get out of sync when the
1558
+ // control is manipulated while display is
1559
+ // none. Resetting the slider constraints
1560
+ // when it is visible gets the state back in
1561
+ // order.
1562
+ container.showEvent.subscribe(function() {
1563
+ // this.pickerSlider.thumb.resetConstraints();
1564
+ // this.hueSlider.thumb.resetConstraints();
1565
+ this.pickerSlider.focus();
1566
+ }, this, true);
1567
+ }
1568
+ }
1569
+ });
1570
+ /**
1571
+ * The closest current websafe value
1572
+ * @attribute websafe
1573
+ * @type int
1574
+ */
1575
+ this.setAttributeConfig(this.OPT.WEBSAFE, {
1576
+ value: attr.websafe || [255,255,255]
1577
+ });
1578
+
1579
+
1580
+ var ids = attr.ids || lang.merge({}, this.ID), i;
1581
+
1582
+ if (!attr.ids && _pickercount > 1) {
1583
+ for (i in ids) {
1584
+ if (lang.hasOwnProperty(ids, i)) {
1585
+ ids[i] = ids[i] + _pickercount;
1586
+ }
1587
+ }
1588
+ }
1589
+
1590
+
1591
+ /**
1592
+ * A list of element ids and/or element references used by the
1593
+ * control. The default is the this.ID list, and can be customized
1594
+ * by passing a list in the contructor
1595
+ * @attribute ids
1596
+ * @type {referenceid: realid}
1597
+ * @writeonce
1598
+ */
1599
+ this.setAttributeConfig(this.OPT.IDS, {
1600
+ value: ids,
1601
+ writeonce: true
1602
+ });
1603
+
1604
+ /**
1605
+ * A list of txt strings for internationalization. Default
1606
+ * is this.TXT
1607
+ * @attribute txt
1608
+ * @type {key: txt}
1609
+ * @writeonce
1610
+ */
1611
+ this.setAttributeConfig(this.OPT.TXT, {
1612
+ value: attr.txt || this.TXT,
1613
+ writeonce: true
1614
+ });
1615
+
1616
+ /**
1617
+ * The img src default list
1618
+ * is this.IMAGES
1619
+ * @attribute images
1620
+ * @type {key: image}
1621
+ * @writeonce
1622
+ */
1623
+ this.setAttributeConfig(this.OPT.IMAGES, {
1624
+ value: attr.images || this.IMAGE,
1625
+ writeonce: true
1626
+ });
1627
+ /**
1628
+ * The element refs used by this control. Set at initialization
1629
+ * @attribute elements
1630
+ * @type {id: HTMLElement}
1631
+ * @readonly
1632
+ */
1633
+ this.setAttributeConfig(this.OPT.ELEMENTS, {
1634
+ value: {},
1635
+ readonly: true
1636
+ });
1637
+
1638
+ /**
1639
+ * Hide/show the entire set of controls
1640
+ * @attribute showcontrols
1641
+ * @type boolean
1642
+ * @default true
1643
+ */
1644
+ this.setAttributeConfig(this.OPT.SHOW_CONTROLS, {
1645
+ value: lang.isBoolean(attr.showcontrols) ? attr.showcontrols : true,
1646
+ method: function(on) {
1647
+
1648
+ var el = Dom.getElementsByClassName("bd", "div",
1649
+ this.getElement(this.ID.CONTROLS))[0];
1650
+
1651
+ this._hideShowEl(el, on);
1652
+
1653
+ this.getElement(this.ID.CONTROLS_LABEL).innerHTML =
1654
+ (on) ? this.get(this.OPT.TXT).HIDE_CONTROLS :
1655
+ this.get(this.OPT.TXT).SHOW_CONTROLS;
1656
+
1657
+ }
1658
+ });
1659
+
1660
+ /**
1661
+ * Hide/show the rgb controls
1662
+ * @attribute showrgbcontrols
1663
+ * @type boolean
1664
+ * @default true
1665
+ */
1666
+ this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS, {
1667
+ value: lang.isBoolean(attr.showrgbcontrols) ? attr.showrgbcontrols : true,
1668
+ method: function(on) {
1669
+ this._hideShowEl(this.ID.RGB_CONTROLS, on);
1670
+ }
1671
+ });
1672
+
1673
+ /**
1674
+ * Hide/show the hsv controls
1675
+ * @attribute showhsvcontrols
1676
+ * @type boolean
1677
+ * @default false
1678
+ */
1679
+ this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS, {
1680
+ value: lang.isBoolean(attr.showhsvcontrols) ?
1681
+ attr.showhsvcontrols : false,
1682
+ method: function(on) {
1683
+ //Dom.setStyle(this.getElement(this.ID.HSV_CONTROLS), "visibility", (on) ? "" : "hidden");
1684
+ this._hideShowEl(this.ID.HSV_CONTROLS, on);
1685
+
1686
+ // can't show both the hsv controls and the rbg hex summary
1687
+ if (on && this.get(this.OPT.SHOW_HEX_SUMMARY)) {
1688
+ this.set(this.OPT.SHOW_HEX_SUMMARY, false);
1689
+ }
1690
+ }
1691
+ });
1692
+
1693
+ /**
1694
+ * Hide/show the hex controls
1695
+ * @attribute showhexcontrols
1696
+ * @type boolean
1697
+ * @default true
1698
+ */
1699
+ this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS, {
1700
+ value: lang.isBoolean(attr.showhexcontrols) ?
1701
+ attr.showhexcontrols : false,
1702
+ method: function(on) {
1703
+ this._hideShowEl(this.ID.HEX_CONTROLS, on);
1704
+ }
1705
+ });
1706
+
1707
+ /**
1708
+ * Hide/show the websafe swatch
1709
+ * @attribute showwebsafe
1710
+ * @type boolean
1711
+ * @default true
1712
+ */
1713
+ this.setAttributeConfig(this.OPT.SHOW_WEBSAFE, {
1714
+ value: lang.isBoolean(attr.showwebsafe) ? attr.showwebsafe : true,
1715
+ method: function(on) {
1716
+ this._hideShowEl(this.ID.WEBSAFE_SWATCH, on);
1717
+ }
1718
+ });
1719
+
1720
+ /**
1721
+ * Hide/show the hex summary
1722
+ * @attribute showhexsummary
1723
+ * @type boolean
1724
+ * @default true
1725
+ */
1726
+ this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY, {
1727
+ value: lang.isBoolean(attr.showhexsummary) ? attr.showhexsummary : true,
1728
+ method: function(on) {
1729
+ this._hideShowEl(this.ID.HEX_SUMMARY, on);
1730
+
1731
+ // can't show both the hsv controls and the rbg hex summary
1732
+ if (on && this.get(this.OPT.SHOW_HSV_CONTROLS)) {
1733
+ this.set(this.OPT.SHOW_HSV_CONTROLS, false);
1734
+ }
1735
+ }
1736
+ });
1737
+ this.setAttributeConfig(this.OPT.ANIMATE, {
1738
+ value: lang.isBoolean(attr.animate) ? attr.animate : true,
1739
+ method: function(on) {
1740
+ if (this.pickerSlider) {
1741
+ this.pickerSlider.animate = on;
1742
+ this.hueSlider.animate = on;
1743
+ }
1744
+ }
1745
+ });
1746
+
1747
+ this.on(this.OPT.HUE + "Change", this._updateRGBFromHSV, this, true);
1748
+ this.on(this.OPT.SATURATION + "Change", this._updateRGBFromHSV, this, true);
1749
+ this.on(this.OPT.VALUE + "Change", this._updateRGBFromHSV, this, true);
1750
+
1751
+ this.on(this.OPT.RED + "Change", this._updateRGB, this, true);
1752
+ this.on(this.OPT.GREEN + "Change", this._updateRGB, this, true);
1753
+ this.on(this.OPT.BLUE + "Change", this._updateRGB, this, true);
1754
+
1755
+ this.on(this.OPT.HEX + "Change", this._updateHex, this, true);
1756
+
1757
+ this._initElements();
1758
+ }
1759
+ });
1760
+
1761
+ YAHOO.widget.ColorPicker = ColorPicker;
1762
+ })();
1763
+ YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.8.1", build: "19"});