PageRenderTime 62ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/styles-with-shortcodes/options-panel/colorpicker/index.html

https://bitbucket.org/andydahl/5star
HTML | 184 lines | 183 code | 1 blank | 0 comment | 0 complexity | 3ea9c1d2d017e8b47a343fbee948ee12 MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, GPL-3.0, LGPL-3.0, LGPL-2.1, GPL-2.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4. <link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
  5. <link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
  6. <title>ColorPicker - jQuery plugin</title>
  7. <script type="text/javascript" src="js/jquery.js"></script>
  8. <script type="text/javascript" src="js/colorpicker.js"></script>
  9. <script type="text/javascript" src="js/eye.js"></script>
  10. <script type="text/javascript" src="js/utils.js"></script>
  11. <script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
  12. </head>
  13. <body>
  14. <div class="wrapper">
  15. <h1>Color Picker - jQuery plugin</h1>
  16. <ul class="navigationTabs">
  17. <li><a href="#about" rel="about">About</a></li>
  18. <li><a href="#download" rel="download">Download</a></li>
  19. <li><a href="#implement" rel="implement">Implement</a></li>
  20. </ul>
  21. <div class="tabsContent">
  22. <div class="tab">
  23. <h2>About</h2>
  24. <p>A simple component to select color in the same way you select color in Adobe Photoshop</p>
  25. <h3>Last update</h3>
  26. <p>23.05.2009 - Check Download tab</p>
  27. <h3>Features</h3>
  28. <ul>
  29. <li>Flat mode - as element in page</li>
  30. <li>Powerful controls for color selection</li>
  31. <li>Easy to customize the look by changing some images</li>
  32. <li>Fits into the viewport</li>
  33. </ul>
  34. <h3>License</h3>
  35. <p>Dual licensed under the MIT and GPL licenses.</p>
  36. <h3>Examples</h3>
  37. <p>Flat mode.</p>
  38. <p id="colorpickerHolder">
  39. </p>
  40. <pre>
  41. $('#colorpickerHolder').ColorPicker({flat: true});
  42. </pre>
  43. <p>Custom skin and using flat mode to display the color picker in a custom widget.</p>
  44. <div id="customWidget">
  45. <div id="colorSelector2"><div style="background-color: #00ff00"></div></div>
  46. <div id="colorpickerHolder2">
  47. </div>
  48. </div>
  49. <p>Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.</p>
  50. <p><input type="text" maxlength="6" size="6" id="colorpickerField1" class="sws-colorpicker" value="00ff00" /></p>
  51. <p><input type="text" maxlength="6" size="6" id="colorpickerField3" value="0000ff" /></p>
  52. <p><input type="text" maxlength="6" size="6" id="colorpickerField2" value="ff0000" /></p>
  53. <pre>$('.sws-colorpicker').ColorPicker({
  54. onSubmit: function(hsb, hex, rgb, el) {
  55. $(el).val(hex);
  56. $(el).ColorPickerHide();
  57. },
  58. onBeforeShow: function () {
  59. $(this).ColorPickerSetColor(this.value);
  60. }
  61. })
  62. .bind('keyup', function(){
  63. $(this).ColorPickerSetColor(this.value);
  64. });
  65. </pre>
  66. <p>Attached to DOMElement and using callbacks to live preview the color and adding animation.</p>
  67. <p>
  68. <div id="colorSelector"><div style="background-color: #0000ff"></div></div>
  69. </p>
  70. <pre>
  71. $('#colorSelector').ColorPicker({
  72. color: '#0000ff',
  73. onShow: function (colpkr) {
  74. $(colpkr).fadeIn(500);
  75. return false;
  76. },
  77. onHide: function (colpkr) {
  78. $(colpkr).fadeOut(500);
  79. return false;
  80. },
  81. onChange: function (hsb, hex, rgb) {
  82. $('#colorSelector div').css('backgroundColor', '#' + hex);
  83. }
  84. });
  85. </pre>
  86. </div>
  87. <div class="tab">
  88. <h2>Download</h2>
  89. <p><a href="colorpicker.zip">colorpicker.zip (73 kb)</a>: jQuery, Javscript files, CSS files, images, examples and instructions.</p>
  90. <h3>Changelog</h3>
  91. <dl>
  92. <dt>23.05.2009</dt>
  93. <dd>Added: close on color selection example</dd>
  94. <dd>Added: restore original color option</dd>
  95. <dd>Changed: color update on key up event</dd>
  96. <dd>Fixed: colorpicker hide and show methods</dd>
  97. <dd>Fixed: reference to options. Multiple fields with colorpickers is possible now.</dd>
  98. <dd>Fixed: RGB to HSB convertion</dd>
  99. <dt>22.08.2008</dt>
  100. <dd>Fixed bug: where some events were not canceled right on Safari</dd>
  101. <dd>Fixed bug: where teh view port was not detected right on Safari</dd>
  102. <dt>16-07-2008</dt>
  103. <dd>Fixed bug where the letter 'F' could not be typed in the Hex field</dd>
  104. <dd>Fixed bug where the changes on Hex field where not parsed</dd>
  105. <dd>Added new option 'livePreview'</dd>
  106. <dt>08-07-2008</dt>
  107. <dd>Fixed typo in the code, both JavaScript and CSS</dd>
  108. <dd>Changed the cursor for some elements</dd>
  109. <dd>Added new demo explaining how to implement custom skin</dd>
  110. <dt>07.07.2008</dt>
  111. <dd>The first release.</dd>
  112. </dl>
  113. </div>
  114. <div class="tab">
  115. <h2>Implement</h2>
  116. <p>Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths to images and change colors to fit your site theme.</p>
  117. <pre>
  118. &lt;link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" /&gt;
  119. &lt;script type="text/javascript" src="js/colorpicker.js"&gt;&lt;/script&gt;
  120. </pre>
  121. <h3>Invocation code</h3>
  122. <p>All you have to do is to select the elements in a jQuery way and call the plugin.</p>
  123. <pre>
  124. $('input').ColorPicker(options);
  125. </pre>
  126. <h3>Options</h3>
  127. <p>A hash of parameters. All parameters are optional.</p>
  128. <table>
  129. <tr>
  130. <td><strong>eventName</strong></td>
  131. <td>string</td>
  132. <td>The desired event to trigger the colorpicker. Default: 'click'</td>
  133. </tr>
  134. <tr>
  135. <td><strong>color</strong></td>
  136. <td>string or hash</td>
  137. <td>The default color. String for hex color or hash for RGB and HSB ({r:255, r:0, b:0}) . Default: 'ff0000'</td>
  138. </tr>
  139. <tr>
  140. <td><strong>flat</strong></td>
  141. <td>boolean</td>
  142. <td>Whatever if the color picker is appended to the element or triggered by an event. Default false</td>
  143. </tr>
  144. <tr>
  145. <td><strong>livePreview</strong></td>
  146. <td>boolean</td>
  147. <td>Whatever if the color values are filled in the fields while changing values on selector or a field. If false it may improve speed. Default true</td>
  148. </tr>
  149. <tr>
  150. <td><strong>onShow</strong></td>
  151. <td>function</td>
  152. <td>Callback function triggered when the color picker is shown</td>
  153. </tr>
  154. <tr>
  155. <td><strong>onBeforeShow</strong></td>
  156. <td>function</td>
  157. <td>Callback function triggered before the color picker is shown</td>
  158. </tr>
  159. <tr>
  160. <td><strong>onHide</strong></td>
  161. <td>function</td>
  162. <td>Callback function triggered when the color picker is hidden</td>
  163. </tr>
  164. <tr>
  165. <td><strong>onChange</strong></td>
  166. <td>function</td>
  167. <td>Callback function triggered when the color is changed</td>
  168. </tr>
  169. <tr>
  170. <td><strong>onSubmit</strong></td>
  171. <td>function</td>
  172. <td>Callback function triggered when the color it is chosen</td>
  173. </tr>
  174. </table>
  175. <h3>Set color</h3>
  176. <p>If you want to set a new color.</p>
  177. <pre>$('input').ColorPickerSetColor(color);</pre>
  178. <p>The 'color' argument is the same format as the option color, string for hex color or hash for RGB and HSB ({r:255, r:0, b:0}).</p>
  179. </div>
  180. </div>
  181. </div>
  182. </body>
  183. </html>