PluginProbe
Contact Forms by Cimatti / 1.9.2
Contact Forms by Cimatti v1.9.2
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
contact-forms / PFBC / Element / Color.php

Color.php in Contact Forms by Cimatti 1.9.2, at PFBC/Element/Color.php

28 lines 940 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class Element_Color extends Element_Textbox {
3 protected $jQueryOptions;
4
5 public function jQueryDocumentReady() {
6 parent::jQueryDocumentReady();
7
8 if(empty($this->jQueryOptions["onSubmit"]))
9 $this->jQueryOptions["onSubmit"] = 'js:function(hsb, hex, rgb, el) { jQuery(el).val("#" + hex); jQuery(el).ColorPickerHide(); }';
10 if(empty($this->jQueryOptions["onBeforeShow"]))
11 $this->jQueryOptions["onBeforeShow"] = 'js:function() { jQuery(this).ColorPickerSetColor(this.value); }';
12
13 echo 'jQuery("#', $this->attributes["id"], '").ColorPicker(', $this->jQueryOptions(), ').bind("keyup", function() { jQuery(this).ColorPickerSetColor(this.value); });';
14 }
15
16 function getCSSFiles() {
17 return array(
18 $this->form->getResourcesPath() . "/colorpicker/css/colorpicker.css"
19 );
20 }
21
22 function getJSFiles() {
23 return array(
24 $this->form->getResourcesPath() . "/colorpicker/js/colorpicker.js"
25 );
26 }
27 }
28