Version Description
- custom-contact-forms.php - Style options added, color picker added, success popover styling bugs fixed
- custom-contact-forms-db.php - Style format changed, new style fields added to tables
- Lots of javascript files
- Lots of images for the colorpicker
Download this release
Release Info
Developer | tlovett1 |
Plugin | Custom Contact Forms |
Version | 3.5.1 |
Comparing to | |
See all releases |
Code changes from version 3.5.0 to 3.5.1
- css/colorpicker.css +161 -0
- css/custom-contact-forms-admin.css +40 -3
- css/custom-contact-forms.css +21 -14
- custom-contact-forms-db.php +13 -6
- custom-contact-forms-widget.php +2 -1
- custom-contact-forms.php +105 -59
- images/blank.gif +0 -0
- images/colorpicker_background.png +0 -0
- images/colorpicker_hex.png +0 -0
- images/colorpicker_hsb_b.png +0 -0
- images/colorpicker_hsb_h.png +0 -0
- images/colorpicker_hsb_s.png +0 -0
- images/colorpicker_indic.gif +0 -0
- images/colorpicker_overlay.png +0 -0
- images/colorpicker_rgb_b.png +0 -0
- images/colorpicker_rgb_g.png +0 -0
- images/colorpicker_rgb_r.png +0 -0
- images/colorpicker_select.gif +0 -0
- images/colorpicker_submit.png +0 -0
- images/custom_background.png +0 -0
- images/custom_hex.png +0 -0
- images/custom_hsb_b.png +0 -0
- images/custom_hsb_h.png +0 -0
- images/custom_hsb_s.png +0 -0
- images/custom_indic.gif +0 -0
- images/custom_rgb_b.png +0 -0
- images/custom_rgb_g.png +0 -0
- images/custom_rgb_r.png +0 -0
- images/custom_submit.png +0 -0
- images/select.png +0 -0
- images/select2.png +0 -0
- images/slider.png +0 -0
- js/colorpicker.js +484 -0
- js/custom-contact-forms-admin.js +4 -0
- js/custom-contact-forms.js +1 -1
- js/eye.js +34 -0
- js/layout.js +45 -0
- js/utils.js +252 -0
- readme.txt +76 -71
css/colorpicker.css
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.colorpicker {
|
2 |
+
width: 356px;
|
3 |
+
height: 176px;
|
4 |
+
overflow: hidden;
|
5 |
+
position: absolute;
|
6 |
+
background: url(../images/colorpicker_background.png);
|
7 |
+
font-family: Arial, Helvetica, sans-serif;
|
8 |
+
display: none;
|
9 |
+
}
|
10 |
+
.colorpicker_color {
|
11 |
+
width: 150px;
|
12 |
+
height: 150px;
|
13 |
+
left: 14px;
|
14 |
+
top: 13px;
|
15 |
+
position: absolute;
|
16 |
+
background: #f00;
|
17 |
+
overflow: hidden;
|
18 |
+
cursor: crosshair;
|
19 |
+
}
|
20 |
+
.colorpicker_color div {
|
21 |
+
position: absolute;
|
22 |
+
top: 0;
|
23 |
+
left: 0;
|
24 |
+
width: 150px;
|
25 |
+
height: 150px;
|
26 |
+
background: url(../images/colorpicker_overlay.png);
|
27 |
+
}
|
28 |
+
.colorpicker_color div div {
|
29 |
+
position: absolute;
|
30 |
+
top: 0;
|
31 |
+
left: 0;
|
32 |
+
width: 11px;
|
33 |
+
height: 11px;
|
34 |
+
overflow: hidden;
|
35 |
+
background: url(../images/colorpicker_select.gif);
|
36 |
+
margin: -5px 0 0 -5px;
|
37 |
+
}
|
38 |
+
.colorpicker_hue {
|
39 |
+
position: absolute;
|
40 |
+
top: 13px;
|
41 |
+
left: 171px;
|
42 |
+
width: 35px;
|
43 |
+
height: 150px;
|
44 |
+
cursor: n-resize;
|
45 |
+
}
|
46 |
+
.colorpicker_hue div {
|
47 |
+
position: absolute;
|
48 |
+
width: 35px;
|
49 |
+
height: 9px;
|
50 |
+
overflow: hidden;
|
51 |
+
background: url(../images/colorpicker_indic.gif) left top;
|
52 |
+
margin: -4px 0 0 0;
|
53 |
+
left: 0px;
|
54 |
+
}
|
55 |
+
.colorpicker_new_color {
|
56 |
+
position: absolute;
|
57 |
+
width: 60px;
|
58 |
+
height: 30px;
|
59 |
+
left: 213px;
|
60 |
+
top: 13px;
|
61 |
+
background: #f00;
|
62 |
+
}
|
63 |
+
.colorpicker_current_color {
|
64 |
+
position: absolute;
|
65 |
+
width: 60px;
|
66 |
+
height: 30px;
|
67 |
+
left: 283px;
|
68 |
+
top: 13px;
|
69 |
+
background: #f00;
|
70 |
+
}
|
71 |
+
.colorpicker input {
|
72 |
+
background-color: transparent;
|
73 |
+
border: 1px solid transparent;
|
74 |
+
position: absolute;
|
75 |
+
font-size: 10px;
|
76 |
+
font-family: Arial, Helvetica, sans-serif;
|
77 |
+
color: #898989;
|
78 |
+
top: 4px;
|
79 |
+
right: 11px;
|
80 |
+
text-align: right;
|
81 |
+
margin: 0;
|
82 |
+
padding: 0;
|
83 |
+
height: 11px;
|
84 |
+
}
|
85 |
+
.colorpicker_hex {
|
86 |
+
position: absolute;
|
87 |
+
width: 72px;
|
88 |
+
height: 22px;
|
89 |
+
background: url(../images/colorpicker_hex.png) top;
|
90 |
+
left: 212px;
|
91 |
+
top: 142px;
|
92 |
+
}
|
93 |
+
.colorpicker_hex input {
|
94 |
+
right: 6px;
|
95 |
+
}
|
96 |
+
.colorpicker_field {
|
97 |
+
height: 22px;
|
98 |
+
width: 62px;
|
99 |
+
background-position: top;
|
100 |
+
position: absolute;
|
101 |
+
}
|
102 |
+
.colorpicker_field span {
|
103 |
+
position: absolute;
|
104 |
+
width: 12px;
|
105 |
+
height: 22px;
|
106 |
+
overflow: hidden;
|
107 |
+
top: 0;
|
108 |
+
right: 0;
|
109 |
+
cursor: n-resize;
|
110 |
+
}
|
111 |
+
.colorpicker_rgb_r {
|
112 |
+
background-image: url(../images/colorpicker_rgb_r.png);
|
113 |
+
top: 52px;
|
114 |
+
left: 212px;
|
115 |
+
}
|
116 |
+
.colorpicker_rgb_g {
|
117 |
+
background-image: url(../images/colorpicker_rgb_g.png);
|
118 |
+
top: 82px;
|
119 |
+
left: 212px;
|
120 |
+
}
|
121 |
+
.colorpicker_rgb_b {
|
122 |
+
background-image: url(../images/colorpicker_rgb_b.png);
|
123 |
+
top: 112px;
|
124 |
+
left: 212px;
|
125 |
+
}
|
126 |
+
.colorpicker_hsb_h {
|
127 |
+
background-image: url(../images/colorpicker_hsb_h.png);
|
128 |
+
top: 52px;
|
129 |
+
left: 282px;
|
130 |
+
}
|
131 |
+
.colorpicker_hsb_s {
|
132 |
+
background-image: url(../images/colorpicker_hsb_s.png);
|
133 |
+
top: 82px;
|
134 |
+
left: 282px;
|
135 |
+
}
|
136 |
+
.colorpicker_hsb_b {
|
137 |
+
background-image: url(../images/colorpicker_hsb_b.png);
|
138 |
+
top: 112px;
|
139 |
+
left: 282px;
|
140 |
+
}
|
141 |
+
.colorpicker_submit {
|
142 |
+
position: absolute;
|
143 |
+
width: 22px;
|
144 |
+
height: 22px;
|
145 |
+
background: url(../images/colorpicker_submit.png) top;
|
146 |
+
left: 322px;
|
147 |
+
top: 142px;
|
148 |
+
overflow: hidden;
|
149 |
+
}
|
150 |
+
.colorpicker_focus {
|
151 |
+
background-position: center;
|
152 |
+
}
|
153 |
+
.colorpicker_hex.colorpicker_focus {
|
154 |
+
background-position: bottom;
|
155 |
+
}
|
156 |
+
.colorpicker_submit.colorpicker_focus {
|
157 |
+
background-position: bottom;
|
158 |
+
}
|
159 |
+
.colorpicker_slider {
|
160 |
+
background-position: bottom;
|
161 |
+
}
|
css/custom-contact-forms-admin.css
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
#customcontactforms-admin #instructions {
|
23 |
float:left;
|
24 |
clear:none;
|
25 |
-
width:
|
26 |
margin:20px 1em 1em 1em;
|
27 |
}
|
28 |
#customcontactforms-admin #contact-author {
|
@@ -126,7 +126,7 @@
|
|
126 |
#customcontactforms-admin #field-options .evenrow-field-options { background-color:#f9f9f9; }
|
127 |
#customcontactforms-admin #general-settings label { font-weight:bold; }
|
128 |
#customcontactforms-admin #style-example {
|
129 |
-
background:url(images/style-example.gif) no-repeat top left;
|
130 |
width:405px;
|
131 |
height:135px;
|
132 |
padding-left:20px;
|
@@ -134,7 +134,7 @@
|
|
134 |
border:0;
|
135 |
}
|
136 |
#customcontactforms-admin #success-popover-example {
|
137 |
-
background:url(images/success-popover-example.gif) no-repeat top left;
|
138 |
width:405px;
|
139 |
height:135px;
|
140 |
padding-left:20px;
|
@@ -253,4 +253,41 @@
|
|
253 |
}
|
254 |
#customcontactforms-admin #plugin-nav li.last {
|
255 |
border-right:none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
}
|
22 |
#customcontactforms-admin #instructions {
|
23 |
float:left;
|
24 |
clear:none;
|
25 |
+
width:436px;
|
26 |
margin:20px 1em 1em 1em;
|
27 |
}
|
28 |
#customcontactforms-admin #contact-author {
|
126 |
#customcontactforms-admin #field-options .evenrow-field-options { background-color:#f9f9f9; }
|
127 |
#customcontactforms-admin #general-settings label { font-weight:bold; }
|
128 |
#customcontactforms-admin #style-example {
|
129 |
+
background:url(../images/style-example.gif) no-repeat top left;
|
130 |
width:405px;
|
131 |
height:135px;
|
132 |
padding-left:20px;
|
134 |
border:0;
|
135 |
}
|
136 |
#customcontactforms-admin #success-popover-example {
|
137 |
+
background:url(../images/success-popover-example.gif) no-repeat top left;
|
138 |
width:405px;
|
139 |
height:135px;
|
140 |
padding-left:20px;
|
253 |
}
|
254 |
#customcontactforms-admin #plugin-nav li.last {
|
255 |
border-right:none;
|
256 |
+
}
|
257 |
+
/* CCF Install Popover -------------------------------- */
|
258 |
+
#ccf-install-popover {
|
259 |
+
display:none;
|
260 |
+
border: 9px solid #efefef;
|
261 |
+
border-spacing:0;
|
262 |
+
width:680px;
|
263 |
+
height:400px;
|
264 |
+
padding:0px;
|
265 |
+
margin:0;
|
266 |
+
-moz-border-radius:10px;
|
267 |
+
-khtml-border-radius:10px;
|
268 |
+
-webkit-border-radius:10px;
|
269 |
+
border-radius:15px;
|
270 |
+
position:fixed;
|
271 |
+
left:30%;
|
272 |
+
background-color:white;
|
273 |
+
top:20px;
|
274 |
+
}
|
275 |
+
#ccf-install-popover div {
|
276 |
+
background-color:#efefef;
|
277 |
+
padding:9px 9px 9px 20px;
|
278 |
+
margin:0 0 15px 0px;
|
279 |
+
height:1.3em;
|
280 |
+
}
|
281 |
+
#ccf-install-popover div h5 {
|
282 |
+
text-align:left;
|
283 |
+
float:left;
|
284 |
+
margin:0;
|
285 |
+
font-size:1.5em;
|
286 |
+
font-weight:bold;
|
287 |
+
}
|
288 |
+
#ccf-install-popover p { padding:8px; clear:both; font-size:1.1em; text-align:center; }
|
289 |
+
#ccf-install-popover div a.close {
|
290 |
+
float:right;
|
291 |
+
display:block;
|
292 |
+
font-size:12px;
|
293 |
}
|
css/custom-contact-forms.css
CHANGED
@@ -89,27 +89,34 @@ form.customcontactform-sidebar div select { width:auto; }
|
|
89 |
height:200px;
|
90 |
padding:0px;
|
91 |
margin:0;
|
92 |
-
-moz-border-radius:
|
93 |
-
-khtml-border-radius:
|
94 |
-
-webkit-border-radius:
|
95 |
-
border-radius:
|
96 |
position:fixed;
|
97 |
left:30%;
|
98 |
background-color:white;
|
99 |
top:30%;
|
100 |
}
|
101 |
-
|
102 |
-
|
103 |
-
background-color:#efefef; margin:0 0 15px 0px;
|
104 |
-
text-align:left;
|
105 |
padding:9px 9px 9px 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
font-size:1.5em;
|
107 |
font-weight:bold;
|
108 |
}
|
109 |
-
#ccf-form-success p { padding:8px; font-size:1.1em; text-align:center; }
|
110 |
-
#ccf-form-success a.close {
|
111 |
-
|
112 |
-
|
113 |
-
font-size:
|
114 |
-
|
|
|
115 |
}
|
89 |
height:200px;
|
90 |
padding:0px;
|
91 |
margin:0;
|
92 |
+
-moz-border-radius:10px;
|
93 |
+
-khtml-border-radius:10px;
|
94 |
+
-webkit-border-radius:10px;
|
95 |
+
border-radius:15px;
|
96 |
position:fixed;
|
97 |
left:30%;
|
98 |
background-color:white;
|
99 |
top:30%;
|
100 |
}
|
101 |
+
#ccf-form-success div {
|
102 |
+
background-color:#efefef;
|
|
|
|
|
103 |
padding:9px 9px 9px 20px;
|
104 |
+
margin:0 0 15px 0px;
|
105 |
+
height:1.3em;
|
106 |
+
}
|
107 |
+
#ccf-form-success div h5 {
|
108 |
+
text-align:left;
|
109 |
+
float:left;
|
110 |
+
margin:0;
|
111 |
+
padding:0;
|
112 |
font-size:1.5em;
|
113 |
font-weight:bold;
|
114 |
}
|
115 |
+
#ccf-form-success p { padding:8px; margin:0; clear:both; font-size:1.1em; text-align:center; }
|
116 |
+
#ccf-form-success div a.close {
|
117 |
+
float:right;
|
118 |
+
display:block;
|
119 |
+
font-size:12px;
|
120 |
+
margin:0;
|
121 |
+
padding:0;
|
122 |
}
|
custom-contact-forms-db.php
CHANGED
@@ -98,7 +98,7 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
98 |
}
|
99 |
|
100 |
function formatStyle($style) {
|
101 |
-
return str_replace(';', '', $style);
|
102 |
}
|
103 |
|
104 |
function updateTables() {
|
@@ -131,17 +131,22 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
131 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `textarea_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
|
132 |
if (!$this->columnExists('success_popover_bordercolor', $this->styles_table))
|
133 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
|
134 |
-
|
135 |
if (!$this->columnExists('dropdown_width', $this->styles_table))
|
136 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
if (!$this->columnExists('field_instructions', $this->fields_table))
|
139 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_instructions` TEXT NOT NULL");
|
140 |
if (!$this->columnExists('field_options', $this->fields_table))
|
141 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_options` VARCHAR( 300 ) NOT NULL");
|
142 |
if (!$this->columnExists('field_required', $this->fields_table))
|
143 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_required` INT( 1 ) NOT NULL DEFAULT '0'");
|
144 |
-
|
145 |
}
|
146 |
|
147 |
function insertFixedFields() {
|
@@ -271,8 +276,10 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
271 |
if (!empty($test) and $test->id != $sid) // if style_slug is different then make sure it is unique
|
272 |
return false;
|
273 |
$style[style_slug] = $this->formatSlug($style[style_slug]);
|
274 |
-
$style
|
275 |
-
|
|
|
|
|
276 |
$wpdb->update($this->styles_table, $style, array('id' => $sid));
|
277 |
return true;
|
278 |
}
|
98 |
}
|
99 |
|
100 |
function formatStyle($style) {
|
101 |
+
return str_replace('#', '', str_replace(';', '', $style));
|
102 |
}
|
103 |
|
104 |
function updateTables() {
|
131 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `textarea_backgroundcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
|
132 |
if (!$this->columnExists('success_popover_bordercolor', $this->styles_table))
|
133 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_bordercolor` VARCHAR( 20 ) NOT NULL DEFAULT '#efefef'");
|
|
|
134 |
if (!$this->columnExists('dropdown_width', $this->styles_table))
|
135 |
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
|
136 |
+
if (!$this->columnExists('success_popover_fontsize', $this->styles_table))
|
137 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
|
138 |
+
if (!$this->columnExists('success_popover_title_fontsize', $this->styles_table))
|
139 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
|
140 |
+
if (!$this->columnExists('success_popover_fontcolor', $this->styles_table))
|
141 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333'");
|
142 |
+
if (!$this->columnExists('success_popover_title_fontcolor', $this->styles_table))
|
143 |
+
$wpdb->query("ALTER TABLE `" . $this->styles_table . "` ADD `success_popover_title_fontcolor` VARCHAR( 20 ) NOT NULL DEFAULT '#333333'");
|
144 |
if (!$this->columnExists('field_instructions', $this->fields_table))
|
145 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_instructions` TEXT NOT NULL");
|
146 |
if (!$this->columnExists('field_options', $this->fields_table))
|
147 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_options` VARCHAR( 300 ) NOT NULL");
|
148 |
if (!$this->columnExists('field_required', $this->fields_table))
|
149 |
$wpdb->query("ALTER TABLE `" . $this->fields_table . "` ADD `field_required` INT( 1 ) NOT NULL DEFAULT '0'");
|
|
|
150 |
}
|
151 |
|
152 |
function insertFixedFields() {
|
276 |
if (!empty($test) and $test->id != $sid) // if style_slug is different then make sure it is unique
|
277 |
return false;
|
278 |
$style[style_slug] = $this->formatSlug($style[style_slug]);
|
279 |
+
foreach ($style as $key => $value) {
|
280 |
+
if ($key != 'style_slug')
|
281 |
+
$style[$key] = $this->formatStyle($this->encodeOption($value));
|
282 |
+
}
|
283 |
$wpdb->update($this->styles_table, $style, array('id' => $sid));
|
284 |
return true;
|
285 |
}
|
custom-contact-forms-widget.php
CHANGED
@@ -39,7 +39,7 @@ if (!class_exists('CustomContactFormsWidget')) {
|
|
39 |
$form_id = esc_attr($instance['form_id']);
|
40 |
?>
|
41 |
<p><label for="<?php echo $this->get_field_id('form_id'); ?>">
|
42 |
-
Choose a Form
|
43 |
<select id="<?php echo $this->get_field_id('form_id'); ?>" name="<?php echo $this->get_field_name('form_id'); ?>">
|
44 |
<?php
|
45 |
foreach ($forms as $form) {
|
@@ -50,6 +50,7 @@ if (!class_exists('CustomContactFormsWidget')) {
|
|
50 |
?>
|
51 |
</select>
|
52 |
</label></p>
|
|
|
53 |
<?php
|
54 |
}
|
55 |
}
|
39 |
$form_id = esc_attr($instance['form_id']);
|
40 |
?>
|
41 |
<p><label for="<?php echo $this->get_field_id('form_id'); ?>">
|
42 |
+
Choose a Form:<br />
|
43 |
<select id="<?php echo $this->get_field_id('form_id'); ?>" name="<?php echo $this->get_field_name('form_id'); ?>">
|
44 |
<?php
|
45 |
foreach ($forms as $form) {
|
50 |
?>
|
51 |
</select>
|
52 |
</label></p>
|
53 |
+
<p><a href="options-general.php?page=custom-contact-forms#create-forms">Create a Form</a></p>
|
54 |
<?php
|
55 |
}
|
56 |
}
|
custom-contact-forms.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form. <a href="options-general.php?page=custom-contact-forms">Settings</a>
|
6 |
-
Version: 3.5.
|
7 |
Author: Taylor Lovett
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
*/
|
@@ -28,7 +28,7 @@ if (!class_exists('CustomContactForms')) {
|
|
28 |
class CustomContactForms extends CustomContactFormsDB {
|
29 |
var $adminOptionsName = 'customContactFormsAdminOptions';
|
30 |
var $widgetOptionsName = 'widget_customContactForms';
|
31 |
-
var $version = '
|
32 |
var $form_errors;
|
33 |
var $error_return;
|
34 |
var $gets;
|
@@ -48,6 +48,9 @@ if (!class_exists('CustomContactForms')) {
|
|
48 |
}
|
49 |
|
50 |
function activatePlugin() {
|
|
|
|
|
|
|
51 |
parent::createTables();
|
52 |
parent::updateTables();
|
53 |
parent::insertFixedFields();
|
@@ -56,7 +59,8 @@ if (!class_exists('CustomContactForms')) {
|
|
56 |
function getAdminOptions() {
|
57 |
$admin_email = get_option('admin_email');
|
58 |
$customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_form_subject' => 'Someone Filled Out Your Contact Form!',
|
59 |
-
'remember_field_values' => 0, 'author_link' => 1, 'enable_widget_tooltips' => 1, 'wp_mail_function' => 1, 'form_success_message_title' => 'Form Success!', 'form_success_message' => 'Thank you for filling out our web form. We will get back to you ASAP.', 'enable_jquery' => 1, 'code_type' => 'XHTML'
|
|
|
60 |
$customcontactOptions = get_option($this->adminOptionsName);
|
61 |
if (!empty($customcontactOptions)) {
|
62 |
foreach ($customcontactOptions as $key => $option)
|
@@ -67,7 +71,6 @@ if (!class_exists('CustomContactForms')) {
|
|
67 |
}
|
68 |
function init() {
|
69 |
$this->storeGets();
|
70 |
-
$this->getAdminOptions();
|
71 |
if (!is_admin()) {
|
72 |
$this->startSession();
|
73 |
$this->processForms();
|
@@ -86,12 +89,18 @@ if (!class_exists('CustomContactForms')) {
|
|
86 |
function insertBackEndStyles() {
|
87 |
wp_register_style('CCFStandardsCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-standards.css');
|
88 |
wp_register_style('CCFAdminCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-admin.css');
|
|
|
89 |
wp_enqueue_style('CCFStandardsCSS');
|
90 |
wp_enqueue_style('CCFAdminCSS');
|
|
|
91 |
}
|
92 |
|
93 |
function insertAdminScripts() {
|
94 |
wp_enqueue_script('ccf-main', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'/*, 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-dialog'*/), '1.0');
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
function insertFrontEndScripts() {
|
@@ -127,8 +136,22 @@ if (!class_exists('CustomContactForms')) {
|
|
127 |
return $this->form_errors;
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
function printAdminPage() {
|
131 |
$admin_options = $this->getAdminOptions();
|
|
|
|
|
132 |
if ($_POST[form_create]) {
|
133 |
parent::insertForm($_POST[form]);
|
134 |
} elseif ($_POST[field_create]) {
|
@@ -540,9 +563,9 @@ if (!class_exists('CustomContactForms')) {
|
|
540 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
|
541 |
<div class="create-field-options-header">Create a Field Option</div>
|
542 |
<ul id="create-field-options">
|
543 |
-
<li><label for="option[option_slug]"
|
544 |
(Used to identify this option, solely for admin purposes; must be unique, and contain only letters, numbers, and underscores. Example: "slug_one")</li>
|
545 |
-
<li><label for="option[option_label]"
|
546 |
(This is what is shown to the user in the dropdown or radio field. Example:)</li>
|
547 |
<li><label for="option[option_value]">Option Value:</label> <input type="text" name="option[option_value]" /><br />
|
548 |
(This is the actual value of the option which isn't shown to the user. This can be the same thing as the label. An example pairing of label => value is: "The color green" => "green" or "Yes" => "1".)</li>
|
@@ -781,7 +804,7 @@ if (!class_exists('CustomContactForms')) {
|
|
781 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
782 |
<ul class="style_left">
|
783 |
<li>
|
784 |
-
<label for="style_slug"
|
785 |
<input type="text" maxlength="30" class="width75" name="style[style_slug]" />
|
786 |
(Must be unique)</li>
|
787 |
<li>
|
@@ -790,8 +813,8 @@ if (!class_exists('CustomContactForms')) {
|
|
790 |
(ex: 10pt, 10px, 1em)</li>
|
791 |
<li>
|
792 |
<label for="title_fontcolor">Title Font Color:</label>
|
793 |
-
<input type="text" maxlength="20" value="
|
794 |
-
(ex:
|
795 |
<li>
|
796 |
<label for="label_width">Label Width:</label>
|
797 |
<input type="text" maxlength="20" value="110px" class="width75" name="style[label_width]" />
|
@@ -802,8 +825,8 @@ if (!class_exists('CustomContactForms')) {
|
|
802 |
(ex: 10px, 10pt, 1em)</li>
|
803 |
<li>
|
804 |
<label for="label_fontcolor">Label Font Color:</label>
|
805 |
-
<input type="text" maxlength="20" value="
|
806 |
-
(ex:
|
807 |
<li>
|
808 |
<label for="input_width">Text Field Width:</label>
|
809 |
<input type="text" maxlength="20" value="200px" class="width75" name="style[input_width]" />
|
@@ -822,8 +845,8 @@ if (!class_exists('CustomContactForms')) {
|
|
822 |
(ex: 10px, 10pt, 1em</li>
|
823 |
<li>
|
824 |
<label for="field_fontcolor">Field Font Color:</label>
|
825 |
-
<input type="text" maxlength="20" value="
|
826 |
-
(ex:
|
827 |
<li>
|
828 |
<label for="field_borderstyle">Field Border Style:</label>
|
829 |
<select class="width75" name="style[field_borderstyle]"><?php echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options); ?></select>
|
@@ -838,14 +861,21 @@ if (!class_exists('CustomContactForms')) {
|
|
838 |
(ex: 5px or 1em)</li>
|
839 |
<li>
|
840 |
<label for="textarea_backgroundcolor">Textarea Background Color:</label>
|
841 |
-
<input type="text" maxlength="20" value="
|
842 |
-
(ex:
|
843 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
844 |
</ul>
|
845 |
<ul class="style_right">
|
846 |
<li>
|
847 |
<label for="input_width">Field Border Color:</label>
|
848 |
-
<input type="text" maxlength="20" value="
|
849 |
(ex: 100px or 100%)</li>
|
850 |
<li>
|
851 |
<label for="form_borderstyle">Form Border Style:</label>
|
@@ -853,8 +883,8 @@ if (!class_exists('CustomContactForms')) {
|
|
853 |
</li>
|
854 |
<li>
|
855 |
<label for="form_bordercolor">Form Border Color:</label>
|
856 |
-
<input type="text" maxlength="20" value="
|
857 |
-
(ex:
|
858 |
<li>
|
859 |
<label for="form_borderwidth">Form Border Width:</label>
|
860 |
<input type="text" maxlength="20" value="1px" class="width75" name="style[form_borderwidth]" />
|
@@ -881,12 +911,12 @@ if (!class_exists('CustomContactForms')) {
|
|
881 |
(ex: 10px, 10pt, 1em</li>
|
882 |
<li>
|
883 |
<label for="submit_fontcolor">Button Font Color:</label>
|
884 |
-
<input type="text" maxlength="20" value="
|
885 |
-
(ex:
|
886 |
<li>
|
887 |
<label for="field_backgroundcolor">Field Background Color:</label>
|
888 |
-
<input type="text" maxlength="20" value="
|
889 |
-
(ex:
|
890 |
<li>
|
891 |
<label for="form_padding">Form Padding:</label>
|
892 |
<input type="text" maxlength="20" value="5px" class="width75" name="style[form_padding]" />
|
@@ -901,8 +931,16 @@ if (!class_exists('CustomContactForms')) {
|
|
901 |
(ex: 30px, 20%, or auto)</li>
|
902 |
<li>
|
903 |
<label for="success_popover_bordercolor">Success Popover Border Color:</label>
|
904 |
-
<input type="text" maxlength="20" value="
|
905 |
-
(ex:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
906 |
<li>
|
907 |
<input type="submit" value="Create Style" name="style_create" />
|
908 |
</li>
|
@@ -930,12 +968,12 @@ if (!class_exists('CustomContactForms')) {
|
|
930 |
?>
|
931 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
932 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
933 |
-
<td><label
|
934 |
<label>Font Family:</label><input type="text" maxlength="20" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
|
935 |
-
<label>Textarea Background<br />Color:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="style[textarea_backgroundcolor]" /><br />
|
936 |
-
<label>Success Popover<br />Border Color:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_bordercolor; ?>" name="style[success_popover_bordercolor]" /><br />
|
937 |
<input type="submit" class="submit-styles" name="style_edit" value="Update Style" /><br />
|
938 |
-
<input type="submit" class="submit-styles
|
939 |
</td>
|
940 |
|
941 |
<td>
|
@@ -943,15 +981,16 @@ if (!class_exists('CustomContactForms')) {
|
|
943 |
<label>Text Field Width:</label><input type="text" maxlength="20" value="<?php echo $style->input_width; ?>" name="style[input_width]" /><br />
|
944 |
<label>Textarea Width:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_width; ?>" name="style[textarea_width]" /><br />
|
945 |
<label>Textarea Height:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="style[textarea_height]" /><br />
|
946 |
-
<label>Dropdown Width:</label><input type="text" maxlength="20" value="<?php echo $style->dropdown_width; ?>" name="style[dropdown_width]" />
|
947 |
-
<label>Label Margin:</label><input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="style[label_margin]" />
|
948 |
</td>
|
949 |
<td>
|
950 |
<label>Label Width:</label><input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="style[label_width]" /><br />
|
951 |
<label>Button Width:</label><input type="text" maxlength="20" value="<?php echo $style->submit_width; ?>" name="style[submit_width]" /><br />
|
952 |
<label>Button Height:</label><input type="text" maxlength="20" value="<?php echo $style->submit_height; ?>" name="style[submit_height]" /><br />
|
953 |
-
<label>Field Background Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
|
954 |
<label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
|
|
|
955 |
</td>
|
956 |
|
957 |
<td>
|
@@ -960,21 +999,24 @@ if (!class_exists('CustomContactForms')) {
|
|
960 |
<label>Field Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="style[field_fontsize]" /><br />
|
961 |
<label>Button Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="style[submit_fontsize]" /><br />
|
962 |
<label>Form Padding:</label><input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="style[form_padding]" /><br />
|
|
|
963 |
</td>
|
964 |
|
965 |
<td>
|
966 |
-
<label>Title Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->title_fontcolor; ?>" name="style[title_fontcolor]" /><br />
|
967 |
-
<label>Label Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->label_fontcolor; ?>" name="style[label_fontcolor]" /><br />
|
968 |
-
<label>Field Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontcolor; ?>" name="style[field_fontcolor]" /><br />
|
969 |
-
<label>Button Font Color:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="style[submit_fontcolor]" /><br />
|
970 |
<label>Form Margin:</label><input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="style[form_margin]" /><br />
|
|
|
971 |
</td>
|
972 |
|
973 |
<td><label>Form Border Style:</label><select name="style[form_borderstyle]"><?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?></select><br />
|
974 |
<label>Form Border Width:</label><input type="text" maxlength="20" value="<?php echo $style->form_borderwidth; ?>" name="style[form_borderwidth]" /><br />
|
975 |
-
<label>Form Border Color:</label><input type="text" maxlength="20" value="<?php echo $style->form_bordercolor; ?>" name="style[form_bordercolor]" /><br />
|
976 |
-
<label>Field Border Color:</label><input type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" />
|
977 |
-
<label>Field Border Style:</label><select name="style[field_borderstyle]"><?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?></select
|
|
|
978 |
<input name="sid" type="hidden" value="<?php echo $style->id; ?>" />
|
979 |
</td>
|
980 |
|
@@ -1147,8 +1189,7 @@ the field names you want required by commas. Remember to use underscores instead
|
|
1147 |
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
|
1148 |
return false;
|
1149 |
}
|
1150 |
-
}
|
1151 |
-
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {
|
1152 |
$domain_array = explode(".", $email_array[1]);
|
1153 |
if (sizeof($domain_array) < 2) return false;
|
1154 |
for ($i = 0; $i < sizeof($domain_array); $i++) {
|
@@ -1182,9 +1223,10 @@ the field names you want required by commas. Remember to use underscores instead
|
|
1182 |
$field = parent::selectField($field_id, '');
|
1183 |
$req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
|
1184 |
$req_long = ($field->field_required == 1) ? ' (required)' : '';
|
1185 |
-
$input_id = 'id="'.parent::decodeOption($field->field_slug, 1, 1).'"';
|
1186 |
$field_value = parent::decodeOption($field->field_value, 1, 1);
|
1187 |
-
$instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="tooltip-field"';
|
|
|
1188 |
if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
|
1189 |
if ($_SESSION[fields][$field->field_slug]) {
|
1190 |
if ($admin_options[remember_field_values] == 1)
|
@@ -1221,7 +1263,7 @@ the field names you want required by commas. Remember to use underscores instead
|
|
1221 |
foreach ($options as $option_id) {
|
1222 |
$option = parent::selectFieldOption($option_id);
|
1223 |
$option_sel = ($field->field_value == $option->option_slug) ? ' checked="checked"' : '';
|
1224 |
-
$field_options .= '<input'.$option_sel.' type="radio" '.$instructions.' name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.parent::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.parent::decodeOption($field->field_slug, 1, 1).'">' . parent::decodeOption($option->option_label, 1, 1) . '</label>' . "\n";
|
1225 |
}
|
1226 |
$field_label = (!empty($field->field_label)) ? '<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>' : '';
|
1227 |
if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
|
@@ -1233,17 +1275,18 @@ the field names you want required by commas. Remember to use underscores instead
|
|
1233 |
|
1234 |
if ($form->form_style != 0) {
|
1235 |
$form_styles .= '<style type="text/css">' . "\n";
|
1236 |
-
$form_styles .= '#' . $form_id . " { width: ".$style->form_width."; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." "
|
1237 |
$form_styles .= '#' . $form_id . " div { margin-bottom:6px }\n";
|
1238 |
-
$form_styles .= '#' . $form_id . "
|
1239 |
-
$form_styles .= '#' . $form_id . "
|
|
|
|
|
1240 |
$form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }";
|
1241 |
$form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
|
1242 |
-
$form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { color
|
1243 |
$form_styles .= '#' . $form_id . " select { width:".$style->dropdown_width."; }\n";
|
1244 |
-
|
1245 |
-
$form_styles .= '#' . $form_id . "
|
1246 |
-
$form_styles .= '#' . $form_id . " textarea { color:".$style->field_fontcolor."; width:".$style->textarea_width."; margin:0; background-color:".$style->textarea_backgroundcolor."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." ".$style->field_bordercolor."; } \n";
|
1247 |
$form_styles .= '</style>' . "\n";
|
1248 |
}
|
1249 |
|
@@ -1292,17 +1335,23 @@ the field names you want required by commas. Remember to use underscores instead
|
|
1292 |
?>
|
1293 |
<style type="text/css">
|
1294 |
<!--
|
1295 |
-
#ccf-form-success { border-color
|
1296 |
-
#ccf-form-success
|
|
|
|
|
|
|
1297 |
-->
|
1298 |
</style>
|
1299 |
<?php
|
1300 |
}
|
1301 |
?>
|
1302 |
<div id="ccf-form-success">
|
1303 |
-
<
|
|
|
|
|
|
|
1304 |
<p><?php echo $success_message; ?></p>
|
1305 |
-
|
1306 |
</div>
|
1307 |
|
1308 |
<?php
|
@@ -1438,8 +1487,5 @@ if (isset($customcontact)) {
|
|
1438 |
add_filter('the_content', array(&$customcontact, 'contentFilter'));
|
1439 |
add_action('widgets_init', 'CCFWidgetInit');
|
1440 |
add_action('admin_menu', 'CustomContactForms_ap');
|
1441 |
-
}
|
1442 |
-
//add_action('wp_footer', array(&$customcontact, 'insertFormSuccessCode'), 1);
|
1443 |
-
|
1444 |
-
|
1445 |
?>
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form. <a href="options-general.php?page=custom-contact-forms">Settings</a>
|
6 |
+
Version: 3.5.1
|
7 |
Author: Taylor Lovett
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
*/
|
28 |
class CustomContactForms extends CustomContactFormsDB {
|
29 |
var $adminOptionsName = 'customContactFormsAdminOptions';
|
30 |
var $widgetOptionsName = 'widget_customContactForms';
|
31 |
+
var $version = '3.5.1';
|
32 |
var $form_errors;
|
33 |
var $error_return;
|
34 |
var $gets;
|
48 |
}
|
49 |
|
50 |
function activatePlugin() {
|
51 |
+
$admin_options = $this->getAdminOptions();
|
52 |
+
$admin_options[show_install_popover] = 1;
|
53 |
+
update_option($this->adminOptionsName, $admin_options);
|
54 |
parent::createTables();
|
55 |
parent::updateTables();
|
56 |
parent::insertFixedFields();
|
59 |
function getAdminOptions() {
|
60 |
$admin_email = get_option('admin_email');
|
61 |
$customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_form_subject' => 'Someone Filled Out Your Contact Form!',
|
62 |
+
'remember_field_values' => 0, 'author_link' => 1, 'enable_widget_tooltips' => 1, 'wp_mail_function' => 1, 'form_success_message_title' => 'Form Success!', 'form_success_message' => 'Thank you for filling out our web form. We will get back to you ASAP.', 'enable_jquery' => 1, 'code_type' => 'XHTML',
|
63 |
+
'show_install_popover' => 0); // default general settings
|
64 |
$customcontactOptions = get_option($this->adminOptionsName);
|
65 |
if (!empty($customcontactOptions)) {
|
66 |
foreach ($customcontactOptions as $key => $option)
|
71 |
}
|
72 |
function init() {
|
73 |
$this->storeGets();
|
|
|
74 |
if (!is_admin()) {
|
75 |
$this->startSession();
|
76 |
$this->processForms();
|
89 |
function insertBackEndStyles() {
|
90 |
wp_register_style('CCFStandardsCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-standards.css');
|
91 |
wp_register_style('CCFAdminCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/custom-contact-forms-admin.css');
|
92 |
+
wp_register_style('CCFColorPickerCSS', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/css/colorpicker.css');
|
93 |
wp_enqueue_style('CCFStandardsCSS');
|
94 |
wp_enqueue_style('CCFAdminCSS');
|
95 |
+
wp_enqueue_style('CCFColorPickerCSS');
|
96 |
}
|
97 |
|
98 |
function insertAdminScripts() {
|
99 |
wp_enqueue_script('ccf-main', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms-admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'/*, 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-dialog'*/), '1.0');
|
100 |
+
wp_enqueue_script('ccf-colorpicker', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/colorpicker.js');
|
101 |
+
wp_enqueue_script('ccf-eye', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/eye.js');
|
102 |
+
wp_enqueue_script('ccf-utils', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/utils.js');
|
103 |
+
wp_enqueue_script('ccf-layout', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/layout.js?ver=1.0.2');
|
104 |
}
|
105 |
|
106 |
function insertFrontEndScripts() {
|
136 |
return $this->form_errors;
|
137 |
}
|
138 |
|
139 |
+
function insertInstallPopover() {
|
140 |
+
?>
|
141 |
+
<div id="ccf-install-popover">
|
142 |
+
<div>
|
143 |
+
<h5>Welcome to Custom Contact Forms</h5>
|
144 |
+
<a href="javascript:void(0)" class="close">[close]</a>
|
145 |
+
</div>
|
146 |
+
<p>herrro!</p>
|
147 |
+
</div>
|
148 |
+
<?php
|
149 |
+
}
|
150 |
+
|
151 |
function printAdminPage() {
|
152 |
$admin_options = $this->getAdminOptions();
|
153 |
+
//if ($admin_options[show_install_popover] == 1)
|
154 |
+
//add_action('admin_footer', array(&$this, 'insertInstallPopover'));
|
155 |
if ($_POST[form_create]) {
|
156 |
parent::insertForm($_POST[form]);
|
157 |
} elseif ($_POST[field_create]) {
|
563 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>">
|
564 |
<div class="create-field-options-header">Create a Field Option</div>
|
565 |
<ul id="create-field-options">
|
566 |
+
<li><label for="option[option_slug]">* Option Slug:</label> <input maxlength="20" type="text" name="option[option_slug]" /><br />
|
567 |
(Used to identify this option, solely for admin purposes; must be unique, and contain only letters, numbers, and underscores. Example: "slug_one")</li>
|
568 |
+
<li><label for="option[option_label]">* Option Label:</label> <input type="text" name="option[option_label]" /><br />
|
569 |
(This is what is shown to the user in the dropdown or radio field. Example:)</li>
|
570 |
<li><label for="option[option_value]">Option Value:</label> <input type="text" name="option[option_value]" /><br />
|
571 |
(This is the actual value of the option which isn't shown to the user. This can be the same thing as the label. An example pairing of label => value is: "The color green" => "green" or "Yes" => "1".)</li>
|
804 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
805 |
<ul class="style_left">
|
806 |
<li>
|
807 |
+
<label for="style_slug">* Style Slug:</label>
|
808 |
<input type="text" maxlength="30" class="width75" name="style[style_slug]" />
|
809 |
(Must be unique)</li>
|
810 |
<li>
|
813 |
(ex: 10pt, 10px, 1em)</li>
|
814 |
<li>
|
815 |
<label for="title_fontcolor">Title Font Color:</label>
|
816 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[title_fontcolor]" />
|
817 |
+
(ex: FF0000)</li>
|
818 |
<li>
|
819 |
<label for="label_width">Label Width:</label>
|
820 |
<input type="text" maxlength="20" value="110px" class="width75" name="style[label_width]" />
|
825 |
(ex: 10px, 10pt, 1em)</li>
|
826 |
<li>
|
827 |
<label for="label_fontcolor">Label Font Color:</label>
|
828 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[label_fontcolor]" />
|
829 |
+
(ex: FF0000)</li>
|
830 |
<li>
|
831 |
<label for="input_width">Text Field Width:</label>
|
832 |
<input type="text" maxlength="20" value="200px" class="width75" name="style[input_width]" />
|
845 |
(ex: 10px, 10pt, 1em</li>
|
846 |
<li>
|
847 |
<label for="field_fontcolor">Field Font Color:</label>
|
848 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[field_fontcolor]" />
|
849 |
+
(ex: 333333)</li>
|
850 |
<li>
|
851 |
<label for="field_borderstyle">Field Border Style:</label>
|
852 |
<select class="width75" name="style[field_borderstyle]"><?php echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options); ?></select>
|
861 |
(ex: 5px or 1em)</li>
|
862 |
<li>
|
863 |
<label for="textarea_backgroundcolor">Textarea Background Color:</label>
|
864 |
+
<input type="text" maxlength="20" value="ffffff" class="width75 colorfield" name="style[textarea_backgroundcolor]" />
|
865 |
+
(ex: FF0000)</li>
|
866 |
+
<li>
|
867 |
+
<label for="success_popover_fontcolor">Success Popover Font Color:</label>
|
868 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[success_popover_fontcolor]" />
|
869 |
+
(ex: 333333)</li>
|
870 |
+
<li>
|
871 |
+
<label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
|
872 |
+
<input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
|
873 |
+
(ex: 12px, 1em, 100%)</li>
|
874 |
</ul>
|
875 |
<ul class="style_right">
|
876 |
<li>
|
877 |
<label for="input_width">Field Border Color:</label>
|
878 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[field_bordercolor]" />
|
879 |
(ex: 100px or 100%)</li>
|
880 |
<li>
|
881 |
<label for="form_borderstyle">Form Border Style:</label>
|
883 |
</li>
|
884 |
<li>
|
885 |
<label for="form_bordercolor">Form Border Color:</label>
|
886 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[form_bordercolor]" />
|
887 |
+
(ex: 000000)</li>
|
888 |
<li>
|
889 |
<label for="form_borderwidth">Form Border Width:</label>
|
890 |
<input type="text" maxlength="20" value="1px" class="width75" name="style[form_borderwidth]" />
|
911 |
(ex: 10px, 10pt, 1em</li>
|
912 |
<li>
|
913 |
<label for="submit_fontcolor">Button Font Color:</label>
|
914 |
+
<input type="text" maxlength="20" value="333333" class="width75 colorfield" name="style[submit_fontcolor]" />
|
915 |
+
(ex: FF0000)</li>
|
916 |
<li>
|
917 |
<label for="field_backgroundcolor">Field Background Color:</label>
|
918 |
+
<input type="text" maxlength="20" value="efefef" class="width75 colorfield" name="style[field_backgroundcolor]" />
|
919 |
+
(ex: FF0000)</li>
|
920 |
<li>
|
921 |
<label for="form_padding">Form Padding:</label>
|
922 |
<input type="text" maxlength="20" value="5px" class="width75" name="style[form_padding]" />
|
931 |
(ex: 30px, 20%, or auto)</li>
|
932 |
<li>
|
933 |
<label for="success_popover_bordercolor">Success Popover Border Color:</label>
|
934 |
+
<input type="text" maxlength="20" value="efefef" class="width75 colorfield" name="style[success_popover_bordercolor]" />
|
935 |
+
(ex: FF0000)</li>
|
936 |
+
<li>
|
937 |
+
<label for="success_popover_fontsize">Success Popover Font Size:</label>
|
938 |
+
<input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_fontsize]" />
|
939 |
+
(ex: 12px, 1em, 100%)</li>
|
940 |
+
<li>
|
941 |
+
<label for="success_popover_title_fontsize">Success Popover Title Font Size:</label>
|
942 |
+
<input type="text" maxlength="20" value="12px" class="width75" name="style[success_popover_title_fontsize]" />
|
943 |
+
(ex: 12px, 1em, 100%)</li>
|
944 |
<li>
|
945 |
<input type="submit" value="Create Style" name="style_create" />
|
946 |
</li>
|
968 |
?>
|
969 |
<tr class="<?php if ($i % 2 == 0) echo 'evenrow'; ?>">
|
970 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
971 |
+
<td><label>* Slug:</label> <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="style[style_slug]" /><br />
|
972 |
<label>Font Family:</label><input type="text" maxlength="20" value="<?php echo $style->form_fontfamily; ?>" name="style[form_fontfamily]" /><br />
|
973 |
+
<label>Textarea Background<br />Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="style[textarea_backgroundcolor]" /><br />
|
974 |
+
<label>Success Popover<br />Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_bordercolor; ?>" name="style[success_popover_bordercolor]" /><br />
|
975 |
<input type="submit" class="submit-styles" name="style_edit" value="Update Style" /><br />
|
976 |
+
<input type="submit" class="submit-styles delete_button" name="style_delete" value="Delete Style" />
|
977 |
</td>
|
978 |
|
979 |
<td>
|
981 |
<label>Text Field Width:</label><input type="text" maxlength="20" value="<?php echo $style->input_width; ?>" name="style[input_width]" /><br />
|
982 |
<label>Textarea Width:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_width; ?>" name="style[textarea_width]" /><br />
|
983 |
<label>Textarea Height:</label><input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="style[textarea_height]" /><br />
|
984 |
+
<label>Dropdown Width:</label><input type="text" maxlength="20" value="<?php echo $style->dropdown_width; ?>" name="style[dropdown_width]" /><br />
|
985 |
+
<label>Label Margin:</label><input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="style[label_margin]" /><br />
|
986 |
</td>
|
987 |
<td>
|
988 |
<label>Label Width:</label><input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="style[label_width]" /><br />
|
989 |
<label>Button Width:</label><input type="text" maxlength="20" value="<?php echo $style->submit_width; ?>" name="style[submit_width]" /><br />
|
990 |
<label>Button Height:</label><input type="text" maxlength="20" value="<?php echo $style->submit_height; ?>" name="style[submit_height]" /><br />
|
991 |
+
<label>Field Background Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="style[field_backgroundcolor]" /><br />
|
992 |
<label>Title Margin:</label><input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="style[title_margin]" /><br />
|
993 |
+
<label>Success Popover<br />Title Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontsize; ?>" name="style[success_popover_title_fontsize]" />
|
994 |
</td>
|
995 |
|
996 |
<td>
|
999 |
<label>Field Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="style[field_fontsize]" /><br />
|
1000 |
<label>Button Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="style[submit_fontsize]" /><br />
|
1001 |
<label>Form Padding:</label><input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="style[form_padding]" /><br />
|
1002 |
+
<label>Success Popover<br />Font Size:</label><input type="text" maxlength="20" value="<?php echo $style->success_popover_fontsize; ?>" name="style[success_popover_fontsize]" />
|
1003 |
</td>
|
1004 |
|
1005 |
<td>
|
1006 |
+
<label>Title Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->title_fontcolor; ?>" name="style[title_fontcolor]" /><br />
|
1007 |
+
<label>Label Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->label_fontcolor; ?>" name="style[label_fontcolor]" /><br />
|
1008 |
+
<label>Field Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_fontcolor; ?>" name="style[field_fontcolor]" /><br />
|
1009 |
+
<label>Button Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="style[submit_fontcolor]" /><br />
|
1010 |
<label>Form Margin:</label><input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="style[form_margin]" /><br />
|
1011 |
+
<label>Success Popover<br />Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_fontcolor; ?>" name="style[success_popover_fontcolor]" /><br />
|
1012 |
</td>
|
1013 |
|
1014 |
<td><label>Form Border Style:</label><select name="style[form_borderstyle]"><?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?></select><br />
|
1015 |
<label>Form Border Width:</label><input type="text" maxlength="20" value="<?php echo $style->form_borderwidth; ?>" name="style[form_borderwidth]" /><br />
|
1016 |
+
<label>Form Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->form_bordercolor; ?>" name="style[form_bordercolor]" /><br />
|
1017 |
+
<label>Field Border Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="style[field_bordercolor]" /><br />
|
1018 |
+
<label>Field Border Style:</label><select name="style[field_borderstyle]"><?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?></select><br />
|
1019 |
+
<label>Success Popover<br />Title Font Color:</label><input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontcolor; ?>" name="style[success_popover_title_fontcolor]" /><br />
|
1020 |
<input name="sid" type="hidden" value="<?php echo $style->id; ?>" />
|
1021 |
</td>
|
1022 |
|
1189 |
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
|
1190 |
return false;
|
1191 |
}
|
1192 |
+
} if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {
|
|
|
1193 |
$domain_array = explode(".", $email_array[1]);
|
1194 |
if (sizeof($domain_array) < 2) return false;
|
1195 |
for ($i = 0; $i < sizeof($domain_array); $i++) {
|
1223 |
$field = parent::selectField($field_id, '');
|
1224 |
$req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
|
1225 |
$req_long = ($field->field_required == 1) ? ' (required)' : '';
|
1226 |
+
$input_id = 'id="'.parent::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
|
1227 |
$field_value = parent::decodeOption($field->field_value, 1, 1);
|
1228 |
+
$instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" class="ccf-tooltip-field"';
|
1229 |
+
//if ($is_sidebar && $admin_options[enable_widget_tooltips] == 0) $instructions = '';
|
1230 |
if ($admin_options[enable_widget_tooltips] == 0 && $is_sidebar) $instructions = '';
|
1231 |
if ($_SESSION[fields][$field->field_slug]) {
|
1232 |
if ($admin_options[remember_field_values] == 1)
|
1263 |
foreach ($options as $option_id) {
|
1264 |
$option = parent::selectFieldOption($option_id);
|
1265 |
$option_sel = ($field->field_value == $option->option_slug) ? ' checked="checked"' : '';
|
1266 |
+
$field_options .= '<div><input'.$option_sel.' type="radio" '.$instructions.' name="'.parent::decodeOption($field->field_slug, 1, 1).'" value="'.parent::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.parent::decodeOption($field->field_slug, 1, 1).'">' . parent::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
|
1267 |
}
|
1268 |
$field_label = (!empty($field->field_label)) ? '<label for="'.parent::decodeOption($field->field_slug, 1, 1).'">'. $req .parent::decodeOption($field->field_label, 1, 1).'</label>' : '';
|
1269 |
if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
|
1275 |
|
1276 |
if ($form->form_style != 0) {
|
1277 |
$form_styles .= '<style type="text/css">' . "\n";
|
1278 |
+
$form_styles .= '#' . $form_id . " { width: ".$style->form_width."; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." #".parent::formatStyle($style->form_bordercolor)."; font-family:".$style->form_fontfamily."; }\n";
|
1279 |
$form_styles .= '#' . $form_id . " div { margin-bottom:6px }\n";
|
1280 |
+
$form_styles .= '#' . $form_id . " div div { margin:0; padding:0; }\n";
|
1281 |
+
$form_styles .= '#' . $form_id . " h4 { padding:0; margin:".$style->title_margin." ".$style->title_margin." ".$style->title_margin." 0; color:#".parent::formatStyle($style->title_fontcolor)."; font-size:".$style->title_fontsize."; } \n";
|
1282 |
+
$form_styles .= '#' . $form_id . " label { padding:0; margin:".$style->label_margin." ".$style->label_margin." ".$style->label_margin." 0; display:block; color:#".parent::formatStyle($style->label_fontcolor)."; width:".$style->label_width."; font-size:".$style->label_fontsize."; } \n";
|
1283 |
+
$form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }";
|
1284 |
$form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }";
|
1285 |
$form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
|
1286 |
+
$form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { color:#".parent::formatStyle($style->field_fontcolor)."; margin:0; width:".$style->input_width."; font-size:".$style->field_fontsize."; background-color:#".parent::formatStyle($style->field_backgroundcolor)."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
|
1287 |
$form_styles .= '#' . $form_id . " select { width:".$style->dropdown_width."; }\n";
|
1288 |
+
$form_styles .= '#' . $form_id . " .submit { color:#".parent::formatStyle($style->submit_fontcolor)."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
|
1289 |
+
$form_styles .= '#' . $form_id . " textarea { color:#".parent::formatStyle($style->field_fontcolor)."; width:".$style->textarea_width."; margin:0; background-color:#".parent::formatStyle($style->textarea_backgroundcolor)."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
|
|
|
1290 |
$form_styles .= '</style>' . "\n";
|
1291 |
}
|
1292 |
|
1335 |
?>
|
1336 |
<style type="text/css">
|
1337 |
<!--
|
1338 |
+
#ccf-form-success { border-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
|
1339 |
+
#ccf-form-success div { background-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
|
1340 |
+
#ccf-form-success div h5 { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; font-size:<?php echo $style->success_popover_title_fontsize; ?>; }
|
1341 |
+
#ccf-form-success div a { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; }
|
1342 |
+
#ccf-form-success p { font-size:<?php echo $style->success_popover_fontsize; ?>; color:#<?php echo parent::formatStyle($style->success_popover_fontcolor); ?>; }
|
1343 |
-->
|
1344 |
</style>
|
1345 |
<?php
|
1346 |
}
|
1347 |
?>
|
1348 |
<div id="ccf-form-success">
|
1349 |
+
<div>
|
1350 |
+
<h5><?php echo $success_title; ?></h5>
|
1351 |
+
<a href="javascript:void(0)" class="close">[close]</a>
|
1352 |
+
</div>
|
1353 |
<p><?php echo $success_message; ?></p>
|
1354 |
+
|
1355 |
</div>
|
1356 |
|
1357 |
<?php
|
1487 |
add_filter('the_content', array(&$customcontact, 'contentFilter'));
|
1488 |
add_action('widgets_init', 'CCFWidgetInit');
|
1489 |
add_action('admin_menu', 'CustomContactForms_ap');
|
1490 |
+
}
|
|
|
|
|
|
|
1491 |
?>
|
images/blank.gif
ADDED
Binary file
|
images/colorpicker_background.png
ADDED
Binary file
|
images/colorpicker_hex.png
ADDED
Binary file
|
images/colorpicker_hsb_b.png
ADDED
Binary file
|
images/colorpicker_hsb_h.png
ADDED
Binary file
|
images/colorpicker_hsb_s.png
ADDED
Binary file
|
images/colorpicker_indic.gif
ADDED
Binary file
|
images/colorpicker_overlay.png
ADDED
Binary file
|
images/colorpicker_rgb_b.png
ADDED
Binary file
|
images/colorpicker_rgb_g.png
ADDED
Binary file
|
images/colorpicker_rgb_r.png
ADDED
Binary file
|
images/colorpicker_select.gif
ADDED
Binary file
|
images/colorpicker_submit.png
ADDED
Binary file
|
images/custom_background.png
ADDED
Binary file
|
images/custom_hex.png
ADDED
Binary file
|
images/custom_hsb_b.png
ADDED
Binary file
|
images/custom_hsb_h.png
ADDED
Binary file
|
images/custom_hsb_s.png
ADDED
Binary file
|
images/custom_indic.gif
ADDED
Binary file
|
images/custom_rgb_b.png
ADDED
Binary file
|
images/custom_rgb_g.png
ADDED
Binary file
|
images/custom_rgb_r.png
ADDED
Binary file
|
images/custom_submit.png
ADDED
Binary file
|
images/select.png
ADDED
Binary file
|
images/select2.png
ADDED
Binary file
|
images/slider.png
ADDED
Binary file
|
js/colorpicker.js
ADDED
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* Color picker
|
4 |
+
* Author: Stefan Petre www.eyecon.ro
|
5 |
+
*
|
6 |
+
* Dual licensed under the MIT and GPL licenses
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
(function ($) {
|
10 |
+
var ColorPicker = function () {
|
11 |
+
var
|
12 |
+
ids = {},
|
13 |
+
inAction,
|
14 |
+
charMin = 65,
|
15 |
+
visible,
|
16 |
+
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
17 |
+
defaults = {
|
18 |
+
eventName: 'click',
|
19 |
+
onShow: function () {},
|
20 |
+
onBeforeShow: function(){},
|
21 |
+
onHide: function () {},
|
22 |
+
onChange: function () {},
|
23 |
+
onSubmit: function () {},
|
24 |
+
color: 'ff0000',
|
25 |
+
livePreview: true,
|
26 |
+
flat: false
|
27 |
+
},
|
28 |
+
fillRGBFields = function (hsb, cal) {
|
29 |
+
var rgb = HSBToRGB(hsb);
|
30 |
+
$(cal).data('colorpicker').fields
|
31 |
+
.eq(1).val(rgb.r).end()
|
32 |
+
.eq(2).val(rgb.g).end()
|
33 |
+
.eq(3).val(rgb.b).end();
|
34 |
+
},
|
35 |
+
fillHSBFields = function (hsb, cal) {
|
36 |
+
$(cal).data('colorpicker').fields
|
37 |
+
.eq(4).val(hsb.h).end()
|
38 |
+
.eq(5).val(hsb.s).end()
|
39 |
+
.eq(6).val(hsb.b).end();
|
40 |
+
},
|
41 |
+
fillHexFields = function (hsb, cal) {
|
42 |
+
$(cal).data('colorpicker').fields
|
43 |
+
.eq(0).val(HSBToHex(hsb)).end();
|
44 |
+
},
|
45 |
+
setSelector = function (hsb, cal) {
|
46 |
+
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
47 |
+
$(cal).data('colorpicker').selectorIndic.css({
|
48 |
+
left: parseInt(150 * hsb.s/100, 10),
|
49 |
+
top: parseInt(150 * (100-hsb.b)/100, 10)
|
50 |
+
});
|
51 |
+
},
|
52 |
+
setHue = function (hsb, cal) {
|
53 |
+
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
54 |
+
},
|
55 |
+
setCurrentColor = function (hsb, cal) {
|
56 |
+
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
57 |
+
},
|
58 |
+
setNewColor = function (hsb, cal) {
|
59 |
+
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
60 |
+
},
|
61 |
+
keyDown = function (ev) {
|
62 |
+
var pressedKey = ev.charCode || ev.keyCode || -1;
|
63 |
+
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
var cal = $(this).parent().parent();
|
67 |
+
if (cal.data('colorpicker').livePreview === true) {
|
68 |
+
change.apply(this);
|
69 |
+
}
|
70 |
+
},
|
71 |
+
change = function (ev) {
|
72 |
+
var cal = $(this).parent().parent(), col;
|
73 |
+
if (this.parentNode.className.indexOf('_hex') > 0) {
|
74 |
+
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
75 |
+
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
76 |
+
cal.data('colorpicker').color = col = fixHSB({
|
77 |
+
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
78 |
+
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
79 |
+
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
80 |
+
});
|
81 |
+
} else {
|
82 |
+
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
83 |
+
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
84 |
+
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
85 |
+
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
86 |
+
}));
|
87 |
+
}
|
88 |
+
if (ev) {
|
89 |
+
fillRGBFields(col, cal.get(0));
|
90 |
+
fillHexFields(col, cal.get(0));
|
91 |
+
fillHSBFields(col, cal.get(0));
|
92 |
+
}
|
93 |
+
setSelector(col, cal.get(0));
|
94 |
+
setHue(col, cal.get(0));
|
95 |
+
setNewColor(col, cal.get(0));
|
96 |
+
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
97 |
+
},
|
98 |
+
blur = function (ev) {
|
99 |
+
var cal = $(this).parent().parent();
|
100 |
+
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
101 |
+
},
|
102 |
+
focus = function () {
|
103 |
+
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
104 |
+
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
105 |
+
$(this).parent().addClass('colorpicker_focus');
|
106 |
+
},
|
107 |
+
downIncrement = function (ev) {
|
108 |
+
var field = $(this).parent().find('input').focus();
|
109 |
+
var current = {
|
110 |
+
el: $(this).parent().addClass('colorpicker_slider'),
|
111 |
+
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
112 |
+
y: ev.pageY,
|
113 |
+
field: field,
|
114 |
+
val: parseInt(field.val(), 10),
|
115 |
+
preview: $(this).parent().parent().data('colorpicker').livePreview
|
116 |
+
};
|
117 |
+
$(document).bind('mouseup', current, upIncrement);
|
118 |
+
$(document).bind('mousemove', current, moveIncrement);
|
119 |
+
},
|
120 |
+
moveIncrement = function (ev) {
|
121 |
+
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
122 |
+
if (ev.data.preview) {
|
123 |
+
change.apply(ev.data.field.get(0), [true]);
|
124 |
+
}
|
125 |
+
return false;
|
126 |
+
},
|
127 |
+
upIncrement = function (ev) {
|
128 |
+
change.apply(ev.data.field.get(0), [true]);
|
129 |
+
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
130 |
+
$(document).unbind('mouseup', upIncrement);
|
131 |
+
$(document).unbind('mousemove', moveIncrement);
|
132 |
+
return false;
|
133 |
+
},
|
134 |
+
downHue = function (ev) {
|
135 |
+
var current = {
|
136 |
+
cal: $(this).parent(),
|
137 |
+
y: $(this).offset().top
|
138 |
+
};
|
139 |
+
current.preview = current.cal.data('colorpicker').livePreview;
|
140 |
+
$(document).bind('mouseup', current, upHue);
|
141 |
+
$(document).bind('mousemove', current, moveHue);
|
142 |
+
},
|
143 |
+
moveHue = function (ev) {
|
144 |
+
change.apply(
|
145 |
+
ev.data.cal.data('colorpicker')
|
146 |
+
.fields
|
147 |
+
.eq(4)
|
148 |
+
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
149 |
+
.get(0),
|
150 |
+
[ev.data.preview]
|
151 |
+
);
|
152 |
+
return false;
|
153 |
+
},
|
154 |
+
upHue = function (ev) {
|
155 |
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
156 |
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
157 |
+
$(document).unbind('mouseup', upHue);
|
158 |
+
$(document).unbind('mousemove', moveHue);
|
159 |
+
return false;
|
160 |
+
},
|
161 |
+
downSelector = function (ev) {
|
162 |
+
var current = {
|
163 |
+
cal: $(this).parent(),
|
164 |
+
pos: $(this).offset()
|
165 |
+
};
|
166 |
+
current.preview = current.cal.data('colorpicker').livePreview;
|
167 |
+
$(document).bind('mouseup', current, upSelector);
|
168 |
+
$(document).bind('mousemove', current, moveSelector);
|
169 |
+
},
|
170 |
+
moveSelector = function (ev) {
|
171 |
+
change.apply(
|
172 |
+
ev.data.cal.data('colorpicker')
|
173 |
+
.fields
|
174 |
+
.eq(6)
|
175 |
+
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
176 |
+
.end()
|
177 |
+
.eq(5)
|
178 |
+
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
179 |
+
.get(0),
|
180 |
+
[ev.data.preview]
|
181 |
+
);
|
182 |
+
return false;
|
183 |
+
},
|
184 |
+
upSelector = function (ev) {
|
185 |
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
186 |
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
187 |
+
$(document).unbind('mouseup', upSelector);
|
188 |
+
$(document).unbind('mousemove', moveSelector);
|
189 |
+
return false;
|
190 |
+
},
|
191 |
+
enterSubmit = function (ev) {
|
192 |
+
$(this).addClass('colorpicker_focus');
|
193 |
+
},
|
194 |
+
leaveSubmit = function (ev) {
|
195 |
+
$(this).removeClass('colorpicker_focus');
|
196 |
+
},
|
197 |
+
clickSubmit = function (ev) {
|
198 |
+
var cal = $(this).parent();
|
199 |
+
var col = cal.data('colorpicker').color;
|
200 |
+
cal.data('colorpicker').origColor = col;
|
201 |
+
setCurrentColor(col, cal.get(0));
|
202 |
+
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
203 |
+
},
|
204 |
+
show = function (ev) {
|
205 |
+
var cal = $('#' + $(this).data('colorpickerId'));
|
206 |
+
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
207 |
+
var pos = $(this).offset();
|
208 |
+
var viewPort = getViewport();
|
209 |
+
var top = pos.top + this.offsetHeight;
|
210 |
+
var left = pos.left;
|
211 |
+
if (top + 176 > viewPort.t + viewPort.h) {
|
212 |
+
top -= this.offsetHeight + 176;
|
213 |
+
}
|
214 |
+
if (left + 356 > viewPort.l + viewPort.w) {
|
215 |
+
left -= 356;
|
216 |
+
}
|
217 |
+
cal.css({left: left + 'px', top: top + 'px'});
|
218 |
+
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
219 |
+
cal.show();
|
220 |
+
}
|
221 |
+
$(document).bind('mousedown', {cal: cal}, hide);
|
222 |
+
return false;
|
223 |
+
},
|
224 |
+
hide = function (ev) {
|
225 |
+
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
226 |
+
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
227 |
+
ev.data.cal.hide();
|
228 |
+
}
|
229 |
+
$(document).unbind('mousedown', hide);
|
230 |
+
}
|
231 |
+
},
|
232 |
+
isChildOf = function(parentEl, el, container) {
|
233 |
+
if (parentEl == el) {
|
234 |
+
return true;
|
235 |
+
}
|
236 |
+
if (parentEl.contains) {
|
237 |
+
return parentEl.contains(el);
|
238 |
+
}
|
239 |
+
if ( parentEl.compareDocumentPosition ) {
|
240 |
+
return !!(parentEl.compareDocumentPosition(el) & 16);
|
241 |
+
}
|
242 |
+
var prEl = el.parentNode;
|
243 |
+
while(prEl && prEl != container) {
|
244 |
+
if (prEl == parentEl)
|
245 |
+
return true;
|
246 |
+
prEl = prEl.parentNode;
|
247 |
+
}
|
248 |
+
return false;
|
249 |
+
},
|
250 |
+
getViewport = function () {
|
251 |
+
var m = document.compatMode == 'CSS1Compat';
|
252 |
+
return {
|
253 |
+
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
254 |
+
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
255 |
+
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
256 |
+
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
257 |
+
};
|
258 |
+
},
|
259 |
+
fixHSB = function (hsb) {
|
260 |
+
return {
|
261 |
+
h: Math.min(360, Math.max(0, hsb.h)),
|
262 |
+
s: Math.min(100, Math.max(0, hsb.s)),
|
263 |
+
b: Math.min(100, Math.max(0, hsb.b))
|
264 |
+
};
|
265 |
+
},
|
266 |
+
fixRGB = function (rgb) {
|
267 |
+
return {
|
268 |
+
r: Math.min(255, Math.max(0, rgb.r)),
|
269 |
+
g: Math.min(255, Math.max(0, rgb.g)),
|
270 |
+
b: Math.min(255, Math.max(0, rgb.b))
|
271 |
+
};
|
272 |
+
},
|
273 |
+
fixHex = function (hex) {
|
274 |
+
var len = 6 - hex.length;
|
275 |
+
if (len > 0) {
|
276 |
+
var o = [];
|
277 |
+
for (var i=0; i<len; i++) {
|
278 |
+
o.push('0');
|
279 |
+
}
|
280 |
+
o.push(hex);
|
281 |
+
hex = o.join('');
|
282 |
+
}
|
283 |
+
return hex;
|
284 |
+
},
|
285 |
+
HexToRGB = function (hex) {
|
286 |
+
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
287 |
+
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
288 |
+
},
|
289 |
+
HexToHSB = function (hex) {
|
290 |
+
return RGBToHSB(HexToRGB(hex));
|
291 |
+
},
|
292 |
+
RGBToHSB = function (rgb) {
|
293 |
+
var hsb = {
|
294 |
+
h: 0,
|
295 |
+
s: 0,
|
296 |
+
b: 0
|
297 |
+
};
|
298 |
+
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
299 |
+
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
300 |
+
var delta = max - min;
|
301 |
+
hsb.b = max;
|
302 |
+
if (max != 0) {
|
303 |
+
|
304 |
+
}
|
305 |
+
hsb.s = max != 0 ? 255 * delta / max : 0;
|
306 |
+
if (hsb.s != 0) {
|
307 |
+
if (rgb.r == max) {
|
308 |
+
hsb.h = (rgb.g - rgb.b) / delta;
|
309 |
+
} else if (rgb.g == max) {
|
310 |
+
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
311 |
+
} else {
|
312 |
+
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
313 |
+
}
|
314 |
+
} else {
|
315 |
+
hsb.h = -1;
|
316 |
+
}
|
317 |
+
hsb.h *= 60;
|
318 |
+
if (hsb.h < 0) {
|
319 |
+
hsb.h += 360;
|
320 |
+
}
|
321 |
+
hsb.s *= 100/255;
|
322 |
+
hsb.b *= 100/255;
|
323 |
+
return hsb;
|
324 |
+
},
|
325 |
+
HSBToRGB = function (hsb) {
|
326 |
+
var rgb = {};
|
327 |
+
var h = Math.round(hsb.h);
|
328 |
+
var s = Math.round(hsb.s*255/100);
|
329 |
+
var v = Math.round(hsb.b*255/100);
|
330 |
+
if(s == 0) {
|
331 |
+
rgb.r = rgb.g = rgb.b = v;
|
332 |
+
} else {
|
333 |
+
var t1 = v;
|
334 |
+
var t2 = (255-s)*v/255;
|
335 |
+
var t3 = (t1-t2)*(h%60)/60;
|
336 |
+
if(h==360) h = 0;
|
337 |
+
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
338 |
+
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
339 |
+
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
340 |
+
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
341 |
+
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
342 |
+
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
343 |
+
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
344 |
+
}
|
345 |
+
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
346 |
+
},
|
347 |
+
RGBToHex = function (rgb) {
|
348 |
+
var hex = [
|
349 |
+
rgb.r.toString(16),
|
350 |
+
rgb.g.toString(16),
|
351 |
+
rgb.b.toString(16)
|
352 |
+
];
|
353 |
+
$.each(hex, function (nr, val) {
|
354 |
+
if (val.length == 1) {
|
355 |
+
hex[nr] = '0' + val;
|
356 |
+
}
|
357 |
+
});
|
358 |
+
return hex.join('');
|
359 |
+
},
|
360 |
+
HSBToHex = function (hsb) {
|
361 |
+
return RGBToHex(HSBToRGB(hsb));
|
362 |
+
},
|
363 |
+
restoreOriginal = function () {
|
364 |
+
var cal = $(this).parent();
|
365 |
+
var col = cal.data('colorpicker').origColor;
|
366 |
+
cal.data('colorpicker').color = col;
|
367 |
+
fillRGBFields(col, cal.get(0));
|
368 |
+
fillHexFields(col, cal.get(0));
|
369 |
+
fillHSBFields(col, cal.get(0));
|
370 |
+
setSelector(col, cal.get(0));
|
371 |
+
setHue(col, cal.get(0));
|
372 |
+
setNewColor(col, cal.get(0));
|
373 |
+
};
|
374 |
+
return {
|
375 |
+
init: function (opt) {
|
376 |
+
opt = $.extend({}, defaults, opt||{});
|
377 |
+
if (typeof opt.color == 'string') {
|
378 |
+
opt.color = HexToHSB(opt.color);
|
379 |
+
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
380 |
+
opt.color = RGBToHSB(opt.color);
|
381 |
+
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
382 |
+
opt.color = fixHSB(opt.color);
|
383 |
+
} else {
|
384 |
+
return this;
|
385 |
+
}
|
386 |
+
return this.each(function () {
|
387 |
+
if (!$(this).data('colorpickerId')) {
|
388 |
+
var options = $.extend({}, opt);
|
389 |
+
options.origColor = opt.color;
|
390 |
+
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
391 |
+
$(this).data('colorpickerId', id);
|
392 |
+
var cal = $(tpl).attr('id', id);
|
393 |
+
if (options.flat) {
|
394 |
+
cal.appendTo(this).show();
|
395 |
+
} else {
|
396 |
+
cal.appendTo(document.body);
|
397 |
+
}
|
398 |
+
options.fields = cal
|
399 |
+
.find('input')
|
400 |
+
.bind('keyup', keyDown)
|
401 |
+
.bind('change', change)
|
402 |
+
.bind('blur', blur)
|
403 |
+
.bind('focus', focus);
|
404 |
+
cal
|
405 |
+
.find('span').bind('mousedown', downIncrement).end()
|
406 |
+
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
|
407 |
+
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
408 |
+
options.selectorIndic = options.selector.find('div div');
|
409 |
+
options.el = this;
|
410 |
+
options.hue = cal.find('div.colorpicker_hue div');
|
411 |
+
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
412 |
+
options.newColor = cal.find('div.colorpicker_new_color');
|
413 |
+
options.currentColor = cal.find('div.colorpicker_current_color');
|
414 |
+
cal.data('colorpicker', options);
|
415 |
+
cal.find('div.colorpicker_submit')
|
416 |
+
.bind('mouseenter', enterSubmit)
|
417 |
+
.bind('mouseleave', leaveSubmit)
|
418 |
+
.bind('click', clickSubmit);
|
419 |
+
fillRGBFields(options.color, cal.get(0));
|
420 |
+
fillHSBFields(options.color, cal.get(0));
|
421 |
+
fillHexFields(options.color, cal.get(0));
|
422 |
+
setHue(options.color, cal.get(0));
|
423 |
+
setSelector(options.color, cal.get(0));
|
424 |
+
setCurrentColor(options.color, cal.get(0));
|
425 |
+
setNewColor(options.color, cal.get(0));
|
426 |
+
if (options.flat) {
|
427 |
+
cal.css({
|
428 |
+
position: 'relative',
|
429 |
+
display: 'block'
|
430 |
+
});
|
431 |
+
} else {
|
432 |
+
$(this).bind(options.eventName, show);
|
433 |
+
}
|
434 |
+
}
|
435 |
+
});
|
436 |
+
},
|
437 |
+
showPicker: function() {
|
438 |
+
return this.each( function () {
|
439 |
+
if ($(this).data('colorpickerId')) {
|
440 |
+
show.apply(this);
|
441 |
+
}
|
442 |
+
});
|
443 |
+
},
|
444 |
+
hidePicker: function() {
|
445 |
+
return this.each( function () {
|
446 |
+
if ($(this).data('colorpickerId')) {
|
447 |
+
$('#' + $(this).data('colorpickerId')).hide();
|
448 |
+
}
|
449 |
+
});
|
450 |
+
},
|
451 |
+
setColor: function(col) {
|
452 |
+
if (typeof col == 'string') {
|
453 |
+
col = HexToHSB(col);
|
454 |
+
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
455 |
+
col = RGBToHSB(col);
|
456 |
+
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
457 |
+
col = fixHSB(col);
|
458 |
+
} else {
|
459 |
+
return this;
|
460 |
+
}
|
461 |
+
return this.each(function(){
|
462 |
+
if ($(this).data('colorpickerId')) {
|
463 |
+
var cal = $('#' + $(this).data('colorpickerId'));
|
464 |
+
cal.data('colorpicker').color = col;
|
465 |
+
cal.data('colorpicker').origColor = col;
|
466 |
+
fillRGBFields(col, cal.get(0));
|
467 |
+
fillHSBFields(col, cal.get(0));
|
468 |
+
fillHexFields(col, cal.get(0));
|
469 |
+
setHue(col, cal.get(0));
|
470 |
+
setSelector(col, cal.get(0));
|
471 |
+
setCurrentColor(col, cal.get(0));
|
472 |
+
setNewColor(col, cal.get(0));
|
473 |
+
}
|
474 |
+
});
|
475 |
+
}
|
476 |
+
};
|
477 |
+
}();
|
478 |
+
$.fn.extend({
|
479 |
+
ColorPicker: ColorPicker.init,
|
480 |
+
ColorPickerHide: ColorPicker.hidePicker,
|
481 |
+
ColorPickerShow: ColorPicker.showPicker,
|
482 |
+
ColorPickerSetColor: ColorPicker.setColor
|
483 |
+
});
|
484 |
+
})(jQuery)
|
js/custom-contact-forms-admin.js
CHANGED
@@ -36,4 +36,8 @@ $j(document).ready(function(){
|
|
36 |
.find(".fields-extra-options:first")
|
37 |
.toggle();
|
38 |
});
|
|
|
|
|
|
|
|
|
39 |
});
|
36 |
.find(".fields-extra-options:first")
|
37 |
.toggle();
|
38 |
});
|
39 |
+
$j("#ccf-install-popover").delay(500).fadeIn('slow');
|
40 |
+
$j("#ccf-install-popover .close").click(function() {
|
41 |
+
$j("#ccf-install-popover").fadeOut();
|
42 |
+
});
|
43 |
});
|
js/custom-contact-forms.js
CHANGED
@@ -29,7 +29,7 @@ $j(document).ready(function(){
|
|
29 |
|
30 |
});
|
31 |
|
32 |
-
$j(".
|
33 |
position: "center right",
|
34 |
offset: [-2, 10],
|
35 |
effect: "fade",
|
29 |
|
30 |
});
|
31 |
|
32 |
+
$j(".ccf-tooltip-field").tooltip({
|
33 |
position: "center right",
|
34 |
offset: [-2, 10],
|
35 |
effect: "fade",
|
js/eye.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* Zoomimage
|
4 |
+
* Author: Stefan Petre www.eyecon.ro
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
(function($){
|
8 |
+
var EYE = window.EYE = function() {
|
9 |
+
var _registered = {
|
10 |
+
init: []
|
11 |
+
};
|
12 |
+
return {
|
13 |
+
init: function() {
|
14 |
+
$.each(_registered.init, function(nr, fn){
|
15 |
+
fn.call();
|
16 |
+
});
|
17 |
+
},
|
18 |
+
extend: function(prop) {
|
19 |
+
for (var i in prop) {
|
20 |
+
if (prop[i] != undefined) {
|
21 |
+
this[i] = prop[i];
|
22 |
+
}
|
23 |
+
}
|
24 |
+
},
|
25 |
+
register: function(fn, type) {
|
26 |
+
if (!_registered[type]) {
|
27 |
+
_registered[type] = [];
|
28 |
+
}
|
29 |
+
_registered[type].push(fn);
|
30 |
+
}
|
31 |
+
};
|
32 |
+
}();
|
33 |
+
$(EYE.init);
|
34 |
+
})(jQuery);
|
js/layout.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($){
|
2 |
+
var initLayout = function() {
|
3 |
+
var hash = window.location.hash.replace('#', '');
|
4 |
+
var currentTab = $('ul.navigationTabs a')
|
5 |
+
.bind('click', showTab)
|
6 |
+
.filter('a[rel=' + hash + ']');
|
7 |
+
if (currentTab.size() == 0) {
|
8 |
+
currentTab = $('ul.navigationTabs a:first');
|
9 |
+
}
|
10 |
+
showTab.apply(currentTab.get(0));
|
11 |
+
$('#colorpickerHolder2>div').css('position', 'absolute');
|
12 |
+
var widt = false;
|
13 |
+
$('#colorSelector2').bind('click', function() {
|
14 |
+
$('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
|
15 |
+
widt = !widt;
|
16 |
+
});
|
17 |
+
$('.colorfield').ColorPicker({
|
18 |
+
onSubmit: function(hsb, hex, rgb, el) {
|
19 |
+
$(el).val(hex);
|
20 |
+
$(el).ColorPickerHide();
|
21 |
+
},
|
22 |
+
onBeforeShow: function () {
|
23 |
+
$(this).ColorPickerSetColor(this.value);
|
24 |
+
}
|
25 |
+
})
|
26 |
+
.bind('keyup', function(){
|
27 |
+
$(this).ColorPickerSetColor(this.value);
|
28 |
+
});
|
29 |
+
};
|
30 |
+
|
31 |
+
var showTab = function(e) {
|
32 |
+
var tabIndex = $('ul.navigationTabs a')
|
33 |
+
.removeClass('active')
|
34 |
+
.index(this);
|
35 |
+
$(this)
|
36 |
+
.addClass('active')
|
37 |
+
.blur();
|
38 |
+
$('div.tab')
|
39 |
+
.hide()
|
40 |
+
.eq(tabIndex)
|
41 |
+
.show();
|
42 |
+
};
|
43 |
+
|
44 |
+
EYE.register(initLayout, 'init');
|
45 |
+
})(jQuery)
|
js/utils.js
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* Utilities
|
4 |
+
* Author: Stefan Petre www.eyecon.ro
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
(function($) {
|
8 |
+
EYE.extend({
|
9 |
+
getPosition : function(e, forceIt)
|
10 |
+
{
|
11 |
+
var x = 0;
|
12 |
+
var y = 0;
|
13 |
+
var es = e.style;
|
14 |
+
var restoreStyles = false;
|
15 |
+
if (forceIt && jQuery.curCSS(e,'display') == 'none') {
|
16 |
+
var oldVisibility = es.visibility;
|
17 |
+
var oldPosition = es.position;
|
18 |
+
restoreStyles = true;
|
19 |
+
es.visibility = 'hidden';
|
20 |
+
es.display = 'block';
|
21 |
+
es.position = 'absolute';
|
22 |
+
}
|
23 |
+
var el = e;
|
24 |
+
if (el.getBoundingClientRect) { // IE
|
25 |
+
var box = el.getBoundingClientRect();
|
26 |
+
x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
|
27 |
+
y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
|
28 |
+
} else {
|
29 |
+
x = el.offsetLeft;
|
30 |
+
y = el.offsetTop;
|
31 |
+
el = el.offsetParent;
|
32 |
+
if (e != el) {
|
33 |
+
while (el) {
|
34 |
+
x += el.offsetLeft;
|
35 |
+
y += el.offsetTop;
|
36 |
+
el = el.offsetParent;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
|
40 |
+
x -= document.body.offsetLeft;
|
41 |
+
y -= document.body.offsetTop;
|
42 |
+
}
|
43 |
+
el = e.parentNode;
|
44 |
+
while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
|
45 |
+
{
|
46 |
+
if (jQuery.curCSS(el, 'display') != 'inline') {
|
47 |
+
x -= el.scrollLeft;
|
48 |
+
y -= el.scrollTop;
|
49 |
+
}
|
50 |
+
el = el.parentNode;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
if (restoreStyles == true) {
|
54 |
+
es.display = 'none';
|
55 |
+
es.position = oldPosition;
|
56 |
+
es.visibility = oldVisibility;
|
57 |
+
}
|
58 |
+
return {x:x, y:y};
|
59 |
+
},
|
60 |
+
getSize : function(e)
|
61 |
+
{
|
62 |
+
var w = parseInt(jQuery.curCSS(e,'width'), 10);
|
63 |
+
var h = parseInt(jQuery.curCSS(e,'height'), 10);
|
64 |
+
var wb = 0;
|
65 |
+
var hb = 0;
|
66 |
+
if (jQuery.curCSS(e, 'display') != 'none') {
|
67 |
+
wb = e.offsetWidth;
|
68 |
+
hb = e.offsetHeight;
|
69 |
+
} else {
|
70 |
+
var es = e.style;
|
71 |
+
var oldVisibility = es.visibility;
|
72 |
+
var oldPosition = es.position;
|
73 |
+
es.visibility = 'hidden';
|
74 |
+
es.display = 'block';
|
75 |
+
es.position = 'absolute';
|
76 |
+
wb = e.offsetWidth;
|
77 |
+
hb = e.offsetHeight;
|
78 |
+
es.display = 'none';
|
79 |
+
es.position = oldPosition;
|
80 |
+
es.visibility = oldVisibility;
|
81 |
+
}
|
82 |
+
return {w:w, h:h, wb:wb, hb:hb};
|
83 |
+
},
|
84 |
+
getClient : function(e)
|
85 |
+
{
|
86 |
+
var h, w;
|
87 |
+
if (e) {
|
88 |
+
w = e.clientWidth;
|
89 |
+
h = e.clientHeight;
|
90 |
+
} else {
|
91 |
+
var de = document.documentElement;
|
92 |
+
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
|
93 |
+
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
|
94 |
+
}
|
95 |
+
return {w:w,h:h};
|
96 |
+
},
|
97 |
+
getScroll : function (e)
|
98 |
+
{
|
99 |
+
var t=0, l=0, w=0, h=0, iw=0, ih=0;
|
100 |
+
if (e && e.nodeName.toLowerCase() != 'body') {
|
101 |
+
t = e.scrollTop;
|
102 |
+
l = e.scrollLeft;
|
103 |
+
w = e.scrollWidth;
|
104 |
+
h = e.scrollHeight;
|
105 |
+
} else {
|
106 |
+
if (document.documentElement) {
|
107 |
+
t = document.documentElement.scrollTop;
|
108 |
+
l = document.documentElement.scrollLeft;
|
109 |
+
w = document.documentElement.scrollWidth;
|
110 |
+
h = document.documentElement.scrollHeight;
|
111 |
+
} else if (document.body) {
|
112 |
+
t = document.body.scrollTop;
|
113 |
+
l = document.body.scrollLeft;
|
114 |
+
w = document.body.scrollWidth;
|
115 |
+
h = document.body.scrollHeight;
|
116 |
+
}
|
117 |
+
if (typeof pageYOffset != 'undefined') {
|
118 |
+
t = pageYOffset;
|
119 |
+
l = pageXOffset;
|
120 |
+
}
|
121 |
+
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
|
122 |
+
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
|
123 |
+
}
|
124 |
+
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
|
125 |
+
},
|
126 |
+
getMargins : function(e, toInteger)
|
127 |
+
{
|
128 |
+
var t = jQuery.curCSS(e,'marginTop') || '';
|
129 |
+
var r = jQuery.curCSS(e,'marginRight') || '';
|
130 |
+
var b = jQuery.curCSS(e,'marginBottom') || '';
|
131 |
+
var l = jQuery.curCSS(e,'marginLeft') || '';
|
132 |
+
if (toInteger)
|
133 |
+
return {
|
134 |
+
t: parseInt(t, 10)||0,
|
135 |
+
r: parseInt(r, 10)||0,
|
136 |
+
b: parseInt(b, 10)||0,
|
137 |
+
l: parseInt(l, 10)
|
138 |
+
};
|
139 |
+
else
|
140 |
+
return {t: t, r: r, b: b, l: l};
|
141 |
+
},
|
142 |
+
getPadding : function(e, toInteger)
|
143 |
+
{
|
144 |
+
var t = jQuery.curCSS(e,'paddingTop') || '';
|
145 |
+
var r = jQuery.curCSS(e,'paddingRight') || '';
|
146 |
+
var b = jQuery.curCSS(e,'paddingBottom') || '';
|
147 |
+
var l = jQuery.curCSS(e,'paddingLeft') || '';
|
148 |
+
if (toInteger)
|
149 |
+
return {
|
150 |
+
t: parseInt(t, 10)||0,
|
151 |
+
r: parseInt(r, 10)||0,
|
152 |
+
b: parseInt(b, 10)||0,
|
153 |
+
l: parseInt(l, 10)
|
154 |
+
};
|
155 |
+
else
|
156 |
+
return {t: t, r: r, b: b, l: l};
|
157 |
+
},
|
158 |
+
getBorder : function(e, toInteger)
|
159 |
+
{
|
160 |
+
var t = jQuery.curCSS(e,'borderTopWidth') || '';
|
161 |
+
var r = jQuery.curCSS(e,'borderRightWidth') || '';
|
162 |
+
var b = jQuery.curCSS(e,'borderBottomWidth') || '';
|
163 |
+
var l = jQuery.curCSS(e,'borderLeftWidth') || '';
|
164 |
+
if (toInteger)
|
165 |
+
return {
|
166 |
+
t: parseInt(t, 10)||0,
|
167 |
+
r: parseInt(r, 10)||0,
|
168 |
+
b: parseInt(b, 10)||0,
|
169 |
+
l: parseInt(l, 10)||0
|
170 |
+
};
|
171 |
+
else
|
172 |
+
return {t: t, r: r, b: b, l: l};
|
173 |
+
},
|
174 |
+
traverseDOM : function(nodeEl, func)
|
175 |
+
{
|
176 |
+
func(nodeEl);
|
177 |
+
nodeEl = nodeEl.firstChild;
|
178 |
+
while(nodeEl){
|
179 |
+
EYE.traverseDOM(nodeEl, func);
|
180 |
+
nodeEl = nodeEl.nextSibling;
|
181 |
+
}
|
182 |
+
},
|
183 |
+
getInnerWidth : function(el, scroll) {
|
184 |
+
var offsetW = el.offsetWidth;
|
185 |
+
return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
|
186 |
+
},
|
187 |
+
getInnerHeight : function(el, scroll) {
|
188 |
+
var offsetH = el.offsetHeight;
|
189 |
+
return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
|
190 |
+
},
|
191 |
+
getExtraWidth : function(el) {
|
192 |
+
if($.boxModel)
|
193 |
+
return (parseInt($.curCSS(el, 'paddingLeft'))||0)
|
194 |
+
+ (parseInt($.curCSS(el, 'paddingRight'))||0)
|
195 |
+
+ (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
|
196 |
+
+ (parseInt($.curCSS(el, 'borderRightWidth'))||0);
|
197 |
+
return 0;
|
198 |
+
},
|
199 |
+
getExtraHeight : function(el) {
|
200 |
+
if($.boxModel)
|
201 |
+
return (parseInt($.curCSS(el, 'paddingTop'))||0)
|
202 |
+
+ (parseInt($.curCSS(el, 'paddingBottom'))||0)
|
203 |
+
+ (parseInt($.curCSS(el, 'borderTopWidth'))||0)
|
204 |
+
+ (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
|
205 |
+
return 0;
|
206 |
+
},
|
207 |
+
isChildOf: function(parentEl, el, container) {
|
208 |
+
if (parentEl == el) {
|
209 |
+
return true;
|
210 |
+
}
|
211 |
+
if (!el || !el.nodeType || el.nodeType != 1) {
|
212 |
+
return false;
|
213 |
+
}
|
214 |
+
if (parentEl.contains && !$.browser.safari) {
|
215 |
+
return parentEl.contains(el);
|
216 |
+
}
|
217 |
+
if ( parentEl.compareDocumentPosition ) {
|
218 |
+
return !!(parentEl.compareDocumentPosition(el) & 16);
|
219 |
+
}
|
220 |
+
var prEl = el.parentNode;
|
221 |
+
while(prEl && prEl != container) {
|
222 |
+
if (prEl == parentEl)
|
223 |
+
return true;
|
224 |
+
prEl = prEl.parentNode;
|
225 |
+
}
|
226 |
+
return false;
|
227 |
+
},
|
228 |
+
centerEl : function(el, axis)
|
229 |
+
{
|
230 |
+
var clientScroll = EYE.getScroll();
|
231 |
+
var size = EYE.getSize(el);
|
232 |
+
if (!axis || axis == 'vertically')
|
233 |
+
$(el).css(
|
234 |
+
{
|
235 |
+
top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
|
236 |
+
}
|
237 |
+
);
|
238 |
+
if (!axis || axis == 'horizontally')
|
239 |
+
$(el).css(
|
240 |
+
{
|
241 |
+
left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
|
242 |
+
}
|
243 |
+
);
|
244 |
+
}
|
245 |
+
});
|
246 |
+
if (!$.easing.easeout) {
|
247 |
+
$.easing.easeout = function(p, n, firstNum, delta, duration) {
|
248 |
+
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
|
249 |
+
};
|
250 |
+
}
|
251 |
+
|
252 |
+
})(jQuery);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.taylorlovett.com
|
|
4 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
5 |
Requires at least: 2.8.1
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 3.5.
|
8 |
|
9 |
Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
|
10 |
|
@@ -16,7 +16,6 @@ Special Features:
|
|
16 |
------------------
|
17 |
|
18 |
* The most customizable form plugin for Wordpress, guaranteed
|
19 |
-
* __Latency problem fixed. Script loads quickly because tables are only checked on plugin activation.__
|
20 |
* Create __unlimited__ forms
|
21 |
* Create __unlimited__ fields
|
22 |
* Required Fields (New!)
|
@@ -69,99 +68,105 @@ I respond to emails same-day!
|
|
69 |
Popover forms will be added in September 2010.
|
70 |
|
71 |
== Screenshots ==
|
72 |
-
Visit http://www.taylorlovett.com/wordpress-plugins for screenshots.
|
73 |
|
74 |
== Changelog ==
|
75 |
|
76 |
-
=
|
77 |
-
*
|
|
|
|
|
|
|
78 |
|
79 |
-
=
|
80 |
-
* custom-contact-forms.
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
-
=
|
83 |
-
* custom-contact-forms
|
84 |
-
* custom-contact-forms.php -
|
85 |
-
* custom-contact-forms.css -
|
86 |
-
* custom-contact-forms-images.php - Image handling class added
|
87 |
-
* image.php, images/ - Image for captcha displaying
|
88 |
|
89 |
-
=
|
90 |
-
* custom-contact-forms.
|
91 |
-
* custom-contact-forms.php - Admin option added to remember field values
|
92 |
|
93 |
-
=
|
94 |
-
* custom-contact-forms
|
95 |
|
96 |
-
=
|
97 |
-
* custom-contact-forms.php -
|
98 |
-
* custom-contact-forms-db.php -
|
|
|
99 |
|
100 |
-
=
|
101 |
-
* custom-contact-forms.php -
|
102 |
|
103 |
-
=
|
104 |
-
* custom-contact-forms.php -
|
105 |
-
* custom-contact-forms-css.php - CSS bug corrected
|
106 |
|
107 |
-
= 2.
|
108 |
-
* custom-contact-forms.php -
|
109 |
-
* custom-contact-forms.css
|
110 |
-
* custom-contact-forms-db.php
|
111 |
|
112 |
-
= 2.0
|
113 |
-
* custom-contact-forms.php -
|
114 |
-
* custom-contact-forms
|
115 |
|
116 |
-
= 2.0
|
117 |
-
* custom-contact-forms.php -
|
118 |
-
*
|
|
|
119 |
|
120 |
= 2.0.3 =
|
121 |
* custom-contact-forms.php - custom style checkbox display:block error fixed
|
122 |
* custom-contact-forms.css - li's converted to p's
|
123 |
|
124 |
-
= 2.
|
125 |
-
* custom-contact-forms.php -
|
126 |
-
*
|
127 |
-
* custom-contact-forms-db.php - New fixed field added
|
128 |
|
129 |
-
= 2.
|
130 |
-
* custom-contact-forms.php -
|
131 |
-
* custom-contact-forms.
|
132 |
|
133 |
-
= 2.
|
134 |
-
* custom-contact-forms.php -
|
135 |
-
* custom-contact-forms.css
|
136 |
-
* custom-contact-forms-db.php
|
137 |
|
138 |
-
=
|
139 |
-
* custom-contact-forms.php -
|
|
|
140 |
|
141 |
-
=
|
142 |
-
* custom-contact-forms.php -
|
143 |
|
144 |
-
=
|
145 |
-
* custom-contact-forms.php -
|
146 |
-
* custom-contact-forms-db.php -
|
147 |
-
* custom-contact-forms.css - New styles added and old ones modified
|
148 |
|
149 |
-
=
|
150 |
-
* custom-contact-forms.php -
|
151 |
|
152 |
-
=
|
153 |
-
* custom-contact-forms.
|
|
|
154 |
|
155 |
-
=
|
156 |
-
* custom-contact-forms.php -
|
157 |
-
* custom-contact-forms
|
158 |
-
* custom-contact-forms.css -
|
|
|
|
|
159 |
|
160 |
-
=
|
161 |
-
* custom-contact-forms.
|
162 |
-
|
163 |
-
|
164 |
-
*
|
165 |
-
* css/custom-contact-forms.css - Form styles reorganized
|
166 |
-
* css/custom-contact-forms-standards.css - Form styles reorganized
|
167 |
-
* css/custom-contact-forms-admin.css - Form styles reorganized
|
4 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
5 |
Requires at least: 2.8.1
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 3.5.1
|
8 |
|
9 |
Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
|
10 |
|
16 |
------------------
|
17 |
|
18 |
* The most customizable form plugin for Wordpress, guaranteed
|
|
|
19 |
* Create __unlimited__ forms
|
20 |
* Create __unlimited__ fields
|
21 |
* Required Fields (New!)
|
68 |
Popover forms will be added in September 2010.
|
69 |
|
70 |
== Screenshots ==
|
71 |
+
Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now all the screenshots are from Version 1, thus are quite out-dated. Install the plugin to see what it looks like. You won't regret it. I promise!
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 3.5.1 =
|
76 |
+
* custom-contact-forms.php - Style options added, color picker added, success popover styling bugs fixed
|
77 |
+
* custom-contact-forms-db.php - Style format changed, new style fields added to tables
|
78 |
+
* Lots of javascript files
|
79 |
+
* Lots of images for the colorpicker
|
80 |
|
81 |
+
= 3.5.0 =
|
82 |
+
* custom-contact-forms.php - Radio and dropdowns added via the field option manager
|
83 |
+
* custom-contact-forms-mailer.php - Email body changed
|
84 |
+
* custom-contact-forms-db.php - Field option methods added
|
85 |
+
* custom-contact-forms.css - Form styles reorganized, file removed
|
86 |
+
* css/custom-contact-forms.css - Form styles reorganized
|
87 |
+
* css/custom-contact-forms-standards.css - Form styles reorganized
|
88 |
+
* css/custom-contact-forms-admin.css - Form styles reorganized
|
89 |
|
90 |
+
= 3.1.0 =
|
91 |
+
* custom-contact-forms.php - Success message title, disable jquery, choose between xhmtl and html, and more
|
92 |
+
* custom-contact-forms-db.php - Success message title added
|
93 |
+
* custom-contact-forms.css - Form styles rewritten
|
|
|
|
|
94 |
|
95 |
+
= 3.0.2 =
|
96 |
+
* custom-contact-forms.php - Bugs fixed
|
|
|
97 |
|
98 |
+
= 3.0.1 =
|
99 |
+
* custom-contact-forms.php - Php tags added to theme form display code
|
100 |
|
101 |
+
= 3.0.0 =
|
102 |
+
* custom-contact-forms.php - Required fields, admin panel changed, style manager bugs fixed, custom html feature added, much more
|
103 |
+
* custom-contact-forms-db.php - New functions added and old ones fixed
|
104 |
+
* custom-contact-forms.css - New styles added and old ones modified
|
105 |
|
106 |
+
= 2.2.5 =
|
107 |
+
* custom-contact-forms.php - Fixed field insert bug fixed
|
108 |
|
109 |
+
= 2.2.4 =
|
110 |
+
* custom-contact-forms.php - Textarea field instruction bug fixed
|
|
|
111 |
|
112 |
+
= 2.2.3 =
|
113 |
+
* custom-contact-forms.php - Remember fields bug fixed, init rearranged, field instructions
|
114 |
+
* custom-contact-forms.css
|
115 |
+
* custom-contact-forms-db.php
|
116 |
|
117 |
+
= 2.2.0 =
|
118 |
+
* custom-contact-forms.php - Plugin nav, hide plugin author link, bug reporting, suggest a feature
|
119 |
+
* custom-contact-forms.css - New styles added and style bugs fixed
|
120 |
|
121 |
+
= 2.1.0 =
|
122 |
+
* custom-contact-forms.php - New fixed field added, plugin news, bug fixes
|
123 |
+
* custom-contact-forms.css - New styles added and style bugs fixed
|
124 |
+
* custom-contact-forms-db.php - New fixed field added
|
125 |
|
126 |
= 2.0.3 =
|
127 |
* custom-contact-forms.php - custom style checkbox display:block error fixed
|
128 |
* custom-contact-forms.css - li's converted to p's
|
129 |
|
130 |
+
= 2.0.2 =
|
131 |
+
* custom-contact-forms.php - Form li's changed to p's
|
132 |
+
* images/ - folder readded to correct captcha error
|
|
|
133 |
|
134 |
+
= 2.0.1 =
|
135 |
+
* custom-contact-forms.php - Duplicate form slug bug fixed, default style values added, stripslahses on form messages
|
136 |
+
* custom-contact-forms-db.php - default style values added
|
137 |
|
138 |
+
= 2.0.0 =
|
139 |
+
* custom-contact-forms.php - Style manager added
|
140 |
+
* custom-contact-forms.css - style manager styles added
|
141 |
+
* custom-contact-forms-db.php - Style manager db functions added
|
142 |
|
143 |
+
= 1.2.1 =
|
144 |
+
* custom-contact-forms.php - Upgrade options changed
|
145 |
+
* custom-contact-forms-css.php - CSS bug corrected
|
146 |
|
147 |
+
= 1.2.0 =
|
148 |
+
* custom-contact-forms.php - Option to update to Custom Contact Forms Pro
|
149 |
|
150 |
+
= 1.1.3 =
|
151 |
+
* custom-contact-forms.php - Captcha label bug fixed
|
152 |
+
* custom-contact-forms-db.php - Default captcha label changed
|
|
|
153 |
|
154 |
+
= 1.1.2 =
|
155 |
+
* custom-contact-forms-db.php - create_tables function edited to work for Wordpress MU due to error in wp-admin/includes/upgrade.php
|
156 |
|
157 |
+
= 1.1.1 =
|
158 |
+
* custom-contact-forms.css - Label styles changed
|
159 |
+
* custom-contact-forms.php - Admin option added to remember field values
|
160 |
|
161 |
+
= 1.1.0 =
|
162 |
+
* custom-contact-forms-db.php - Table upgrade functions added
|
163 |
+
* custom-contact-forms.php - New functions for error handling and captcha
|
164 |
+
* custom-contact-forms.css - Forms restyled
|
165 |
+
* custom-contact-forms-images.php - Image handling class added
|
166 |
+
* image.php, images/ - Image for captcha displaying
|
167 |
|
168 |
+
= 1.0.1 =
|
169 |
+
* custom-contact-forms.css - Form style changes
|
170 |
+
|
171 |
+
= 1.0.0 =
|
172 |
+
* Plugin Release
|
|
|
|
|
|