Version Description
Popover forms will be added in September 2010.
Download this release
Release Info
Developer | tlovett1 |
Plugin | Custom Contact Forms |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- custom-contact-forms-db.php +2 -3
- custom-contact-forms-mailer.php +7 -2
- custom-contact-forms.css +33 -0
- custom-contact-forms.php +61 -19
- js/custom-contact-forms.js +5 -0
- js/{jquery.ui.dialog.js → jquery-ui-1.8.4.custom.js} +751 -0
- js/jquery.bgiframe-2.1.1.js +10 -0
- js/jquery.ui.position.js +233 -0
- js/jquery.ui.widget.js +237 -0
- readme.txt +13 -4
custom-contact-forms-db.php
CHANGED
@@ -115,8 +115,8 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
115 |
}
|
116 |
|
117 |
function insertFixedFields() {
|
118 |
-
$captcha = array('field_slug' => 'captcha', 'field_label' => 'Type the numbers.', 'field_type' => 'Text', 'field_value' => '', '
|
119 |
-
$ishuman = array('field_slug' => 'ishuman', 'field_label' => 'Check if you are human.', 'field_type' => 'Checkbox', 'field_value' => '1', '
|
120 |
$fixedEmail = array('field_slug' => 'fixedEmail', 'field_label' => 'Your Email', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => 'Please enter your email address.');
|
121 |
if (!$this->fieldSlugExists('captcha'))
|
122 |
$this->insertField($captcha);
|
@@ -143,7 +143,6 @@ if (!class_exists('CustomContactFormsDB')) {
|
|
143 |
function insertField($field) {
|
144 |
global $wpdb;
|
145 |
if (empty($field) or empty($field[field_slug]) or $this->fieldSlugExists($this->formatSlug($field[field_slug]))) return false;
|
146 |
-
|
147 |
$field[field_slug] = $this->formatSlug($field[field_slug]);
|
148 |
foreach ($field as $key => $value) {
|
149 |
if ($key != 'field_slug')
|
115 |
}
|
116 |
|
117 |
function insertFixedFields() {
|
118 |
+
$captcha = array('field_slug' => 'captcha', 'field_label' => 'Type the numbers.', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => 'Type the numbers displayed in the image above.');
|
119 |
+
$ishuman = array('field_slug' => 'ishuman', 'field_label' => 'Check if you are human.', 'field_type' => 'Checkbox', 'field_value' => '1', 'field_maxlength' => '0', 'user_field' => 0, 'field_instructions' => 'This helps us prevent spam.');
|
120 |
$fixedEmail = array('field_slug' => 'fixedEmail', 'field_label' => 'Your Email', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => 'Please enter your email address.');
|
121 |
if (!$this->fieldSlugExists('captcha'))
|
122 |
$this->insertField($captcha);
|
143 |
function insertField($field) {
|
144 |
global $wpdb;
|
145 |
if (empty($field) or empty($field[field_slug]) or $this->fieldSlugExists($this->formatSlug($field[field_slug]))) return false;
|
|
|
146 |
$field[field_slug] = $this->formatSlug($field[field_slug]);
|
147 |
foreach ($field as $key => $value) {
|
148 |
if ($key != 'field_slug')
|
custom-contact-forms-mailer.php
CHANGED
@@ -11,12 +11,14 @@ if (!class_exists('CustomContactFormsMailer')) {
|
|
11 |
var $subject;
|
12 |
var $body;
|
13 |
var $headers;
|
|
|
14 |
|
15 |
-
function CustomContactFormsMailer($to, $from, $subject, $body){
|
16 |
$this->to = $to;
|
17 |
$this->from = $from;
|
18 |
$this->subject = $subject;
|
19 |
$this->body = $body;
|
|
|
20 |
}
|
21 |
|
22 |
function send(){
|
@@ -24,7 +26,10 @@ if (!class_exists('CustomContactFormsMailer')) {
|
|
24 |
$this->addHeader('Reply-To: '.$this->from."\r\n");
|
25 |
$this->addHeader('Return-Path: '.$this->from."\r\n");
|
26 |
$this->addHeader('X-mailer: ZFmail 1.0'."\r\n");
|
27 |
-
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
function addHeader($header){
|
11 |
var $subject;
|
12 |
var $body;
|
13 |
var $headers;
|
14 |
+
var $wp_mail_function;
|
15 |
|
16 |
+
function CustomContactFormsMailer($to, $from, $subject, $body, $wp_mail_function){
|
17 |
$this->to = $to;
|
18 |
$this->from = $from;
|
19 |
$this->subject = $subject;
|
20 |
$this->body = $body;
|
21 |
+
$this->wp_mail_function = $wp_mail_function;
|
22 |
}
|
23 |
|
24 |
function send(){
|
26 |
$this->addHeader('Reply-To: '.$this->from."\r\n");
|
27 |
$this->addHeader('Return-Path: '.$this->from."\r\n");
|
28 |
$this->addHeader('X-mailer: ZFmail 1.0'."\r\n");
|
29 |
+
if ($this->wp_mail_function == 1)
|
30 |
+
wp_mail($this->to, $this->subject, $this->body, $this->headers);
|
31 |
+
else
|
32 |
+
mail($this->to, $this->subject, $this->body, $this->headers);
|
33 |
}
|
34 |
|
35 |
function addHeader($header){
|
custom-contact-forms.css
CHANGED
@@ -282,4 +282,37 @@ form.customcontactform-sidebar div p input[type=text], form.customcontactform-si
|
|
282 |
/* outline radius for mozilla/firefox only */
|
283 |
-moz-box-shadow:0 0 10px #000;
|
284 |
-webkit-box-shadow:0 0 10px #000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
}
|
282 |
/* outline radius for mozilla/firefox only */
|
283 |
-moz-box-shadow:0 0 10px #000;
|
284 |
-webkit-box-shadow:0 0 10px #000;
|
285 |
+
}
|
286 |
+
/* --- form success popover -------------------- */
|
287 |
+
#ccf-form-success {
|
288 |
+
display:none;
|
289 |
+
border: 9px solid #efefef;
|
290 |
+
border-spacing:0;
|
291 |
+
width:420px;
|
292 |
+
height:200px
|
293 |
+
padding:0px;
|
294 |
+
margin:0;
|
295 |
+
-moz-border-radius:35px;
|
296 |
+
-khtml-border-radius:35px;
|
297 |
+
-webkit-border-radius:35px;
|
298 |
+
border-radius:305px;
|
299 |
+
position:fixed;
|
300 |
+
left:30%;
|
301 |
+
background-color:white;
|
302 |
+
top:30%;
|
303 |
+
}
|
304 |
+
|
305 |
+
#ccf-form-success h5 {
|
306 |
+
background-color:#efefef; margin:0 0 15px 0;
|
307 |
+
text-align:left;
|
308 |
+
padding:9px;
|
309 |
+
font-size:1.5em;
|
310 |
+
font-weight:bold;
|
311 |
+
}
|
312 |
+
#ccf-form-success p { padding:8px; font-size:1.1em; text-align:center; }
|
313 |
+
#ccf-form-success a.close {
|
314 |
+
position:absolute;
|
315 |
+
right:12px;
|
316 |
+
font-size:1em;
|
317 |
+
top:7px;
|
318 |
}
|
custom-contact-forms.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
-
Description:
|
6 |
-
Version: 2.2.
|
7 |
Author: <a href="http://www.taylorlovett.com" title="Maryland Wordpress Developer">Taylor Lovett</a>
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
Contributors: Taylor Lovett
|
@@ -31,7 +31,8 @@ if (!class_exists('CustomContactForms')) {
|
|
31 |
var $version = '2.1.0';
|
32 |
var $form_errors;
|
33 |
var $error_return;
|
34 |
-
var $
|
|
|
35 |
|
36 |
function CustomContactForms() {
|
37 |
parent::CustomContactFormsDB();
|
@@ -40,7 +41,8 @@ if (!class_exists('CustomContactForms')) {
|
|
40 |
|
41 |
function getAdminOptions() {
|
42 |
$admin_email = get_option('admin_email');
|
43 |
-
$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!',
|
|
|
44 |
$customcontactOptions = get_option($this->adminOptionsName);
|
45 |
if (!empty($customcontactOptions)) {
|
46 |
foreach ($customcontactOptions as $key => $option)
|
@@ -50,6 +52,7 @@ if (!class_exists('CustomContactForms')) {
|
|
50 |
return $customcontactAdminOptions;
|
51 |
}
|
52 |
function init() {
|
|
|
53 |
$this->getAdminOptions();
|
54 |
if (!is_admin()) {
|
55 |
wp_enqueue_script('jquery');
|
@@ -110,15 +113,24 @@ if (!class_exists('CustomContactForms')) {
|
|
110 |
<!-- Custom Contact Forms by Taylor Lovett - http://www.taylorlovett.com -->
|
111 |
<link rel="stylesheet" href="<?php echo get_option('siteurl'); ?>/wp-content/plugins/custom-contact-forms/custom-contact-forms.css" type="text/css" media="screen" />
|
112 |
<!--<script type="text/javascript" language="javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/custom-contact-forms/js/custom-contact-forms.js"></script>-->
|
113 |
-
<?php
|
114 |
-
wp_enqueue_script('jquery-
|
115 |
-
wp_enqueue_script('
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
function setFormError($key, $message) {
|
119 |
$this->form_errors[$key] = $message;
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
function getFormError($key) {
|
123 |
return $this->form_errors[$key];
|
124 |
}
|
@@ -144,6 +156,8 @@ if (!class_exists('CustomContactForms')) {
|
|
144 |
$admin_options[show_widget_home] = $_POST[show_widget_home];
|
145 |
$admin_options[custom_thank_you] = $_POST[custom_thank_you];
|
146 |
$admin_options[author_link] = $_POST[author_link];
|
|
|
|
|
147 |
$admin_options[enable_widget_tooltips] = $_POST[enable_widget_tooltips];
|
148 |
$admin_options[remember_field_values] = $_POST[remember_field_values];
|
149 |
update_option($this->adminOptionsName, $admin_options);
|
@@ -514,7 +528,7 @@ if (!class_exists('CustomContactForms')) {
|
|
514 |
<li class="descrip">Form emails will be sent <span>from</span> this address.</li>
|
515 |
<li>
|
516 |
<label for="default_form_subject">Default Email Subject:</label>
|
517 |
-
<input name="default_form_subject" value="<?php echo $admin_options[default_form_subject]; ?>" type="text"
|
518 |
</li>
|
519 |
<li class="descrip">Default subject to be included in all form emails.</li>
|
520 |
<li>
|
@@ -522,6 +536,11 @@ if (!class_exists('CustomContactForms')) {
|
|
522 |
<input name="custom_thank_you" value="<?php echo $admin_options[custom_thank_you]; ?>" type="text" maxlength="150" />
|
523 |
</li>
|
524 |
<li class="descrip">Upon filling out forms, users will be sent back to the form page if this is left blank.</li>
|
|
|
|
|
|
|
|
|
|
|
525 |
|
526 |
<li>
|
527 |
<label for="remember_field_values">Remember Field Values:</label>
|
@@ -534,10 +553,15 @@ if (!class_exists('CustomContactForms')) {
|
|
534 |
</li>
|
535 |
<li class="descrip">Enabling this shows tooltips containing field instructions on forms in the widget.</li>
|
536 |
<li>
|
537 |
-
<label for="
|
538 |
<select name="author_link"><option value="1">Yes</option><option <?php if ($admin_options[author_link] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
|
539 |
</li>
|
540 |
-
<li
|
|
|
|
|
|
|
|
|
|
|
541 |
<li>
|
542 |
<label>
|
543 |
<input value="1" type="checkbox" name="show_widget_home" <?php if ($admin_options[show_widget_home] == 1) echo 'checked="checked"'; ?> />
|
@@ -955,8 +979,9 @@ if (!class_exists('CustomContactForms')) {
|
|
955 |
|
956 |
function getCaptchaCode($form_id) {
|
957 |
$captcha = parent::selectField('', 'captcha');
|
|
|
958 |
$out = '<img id="captcha-image" src="' . get_bloginfo('wpurl') . '/wp-content/plugins/custom-contact-forms/image.php?fid='.$form_id.'" />
|
959 |
-
<br /><label for="captcha">'.$captcha->field_label.'</label> <input type="text" name="captcha" id="captcha" maxlength="20" />';
|
960 |
return $out;
|
961 |
}
|
962 |
|
@@ -965,16 +990,29 @@ if (!class_exists('CustomContactForms')) {
|
|
965 |
}
|
966 |
|
967 |
function contactAuthor($name, $email, $website, $message, $type) {
|
|
|
968 |
$body = "Name: $name\n";
|
969 |
$body .= "Email: $email\n";
|
970 |
$body .= "Website: $website\n";
|
971 |
$body .= "Message: $message\n";
|
972 |
$body .= "Message Type: $type\n";
|
973 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
974 |
-
$mailer = new CustomContactFormsMailer('admin@taylorlovett.com', $email, "CCF Message: $type", stripslashes($body));
|
975 |
$mailer->send();
|
976 |
}
|
977 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
978 |
function processForms() {
|
979 |
if ($_POST[customcontactforms_submit]) {
|
980 |
$this->startSession();
|
@@ -985,14 +1023,15 @@ if (!class_exists('CustomContactForms')) {
|
|
985 |
$cap_name = 'captcha_' . $_POST[fid];
|
986 |
foreach ($fields as $field_id) {
|
987 |
$field = parent::selectField($field_id, '');
|
988 |
-
|
989 |
-
$checks[] = $field->field_slug;
|
990 |
-
if ($field->field_slug == 'captcha') {
|
991 |
-
if ($_POST[captcha] != $_SESSION[$cap_name])
|
992 |
-
$this->setFormError('captcha', 'You entered the captcha image code incorrectly');
|
993 |
-
} if ($field->field_slug == 'ishuman') {
|
994 |
if ($_POST[ishuman] != 1)
|
995 |
$this->setFormError('ishuman', 'Only humans can use this form.');
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
}
|
997 |
}
|
998 |
$body = '';
|
@@ -1012,12 +1051,14 @@ if (!class_exists('CustomContactForms')) {
|
|
1012 |
$errors = $this->getAllFormErrors();
|
1013 |
if (empty($errors)) {
|
1014 |
unset($_SESSION['captcha_' . $_POST[fid]]);
|
|
|
1015 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
1016 |
-
$mailer = new CustomContactFormsMailer($admin_options[default_to_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body));
|
1017 |
$mailer->send();
|
1018 |
if (!empty($admin_options[custom_thank_you])) {
|
1019 |
header("Location: " . $admin_options[custom_thank_you]);
|
1020 |
}
|
|
|
1021 |
}
|
1022 |
unset($_POST);
|
1023 |
}
|
@@ -1042,4 +1083,5 @@ if (isset($customcontact)) {
|
|
1042 |
//add_action('wp_footer', array(&$customcontact, 'insertPopoverCode'));
|
1043 |
}
|
1044 |
add_action('admin_menu', 'CustomContactForms_ap');
|
|
|
1045 |
?>
|
2 |
/*
|
3 |
Plugin Name: Custom Contact Forms
|
4 |
Plugin URI: http://taylorlovett.com/wordpress-plugins
|
5 |
+
Description: YOU CAN NOW CUSTOMIZE EVERY ASPECT OF YOUR FORMS APPEARANCE WITH ANY EASY TO USE FORM - BORDERS, FONT SIZES, COLORS, PADDING, MARGINS, BACKGROUNDS, AND MORE. Custom Contact Forms is a plugin for handling and displaying custom web forms [customcontact form=1] in any page, post, category, or archive in which you want the form to show. This plugin allows you to create fields with a variety of options and to attach them to specific forms you create; definitely allows for more customization than any other Wordpress Contact Form plugin; comes with a customizable captcha spam blocker! Also comes with a web form widget to drag-and-drop in to your sidebar. <a href="options-general.php?page=custom-contact-forms" title="Maryland Wordpress Developer">Plugin Settings</a>
|
6 |
+
Version: 2.2.5
|
7 |
Author: <a href="http://www.taylorlovett.com" title="Maryland Wordpress Developer">Taylor Lovett</a>
|
8 |
Author URI: http://www.taylorlovett.com
|
9 |
Contributors: Taylor Lovett
|
31 |
var $version = '2.1.0';
|
32 |
var $form_errors;
|
33 |
var $error_return;
|
34 |
+
var $gets;
|
35 |
+
var $fixed_fields = array('customcontactforms_submit', 'fid', 'fixedEmail', 'form_page', 'captcha', 'ishuman');
|
36 |
|
37 |
function CustomContactForms() {
|
38 |
parent::CustomContactFormsDB();
|
41 |
|
42 |
function getAdminOptions() {
|
43 |
$admin_email = get_option('admin_email');
|
44 |
+
$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!',
|
45 |
+
'custom_thank_you' => '', 'remember_field_values' => 0, 'author_link' => 1, 'enable_widget_tooltips' => 1, 'wp_mail_function' => 1, 'form_success_message' => 'Thank you for filling out our web form. We will get back to you ASAP.'); // default general settings
|
46 |
$customcontactOptions = get_option($this->adminOptionsName);
|
47 |
if (!empty($customcontactOptions)) {
|
48 |
foreach ($customcontactOptions as $key => $option)
|
52 |
return $customcontactAdminOptions;
|
53 |
}
|
54 |
function init() {
|
55 |
+
$this->storeGets();
|
56 |
$this->getAdminOptions();
|
57 |
if (!is_admin()) {
|
58 |
wp_enqueue_script('jquery');
|
113 |
<!-- Custom Contact Forms by Taylor Lovett - http://www.taylorlovett.com -->
|
114 |
<link rel="stylesheet" href="<?php echo get_option('siteurl'); ?>/wp-content/plugins/custom-contact-forms/custom-contact-forms.css" type="text/css" media="screen" />
|
115 |
<!--<script type="text/javascript" language="javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/custom-contact-forms/js/custom-contact-forms.js"></script>-->
|
116 |
+
<?php wp_enqueue_script('jquery-tools', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.tools.min.js');
|
117 |
+
//wp_enqueue_script('jquery-ui-position', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.ui.position.js');
|
118 |
+
//wp_enqueue_script('jquery-ui-widget', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.ui.widget.js');
|
119 |
+
//wp_enqueue_script('jquery-bgiframe', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/jquery.bgiframe-2.1.1.js');
|
120 |
+
wp_enqueue_script('ccf-main', get_option('siteurl') . '/wp-content/plugins/custom-contact-forms/js/custom-contact-forms.js', array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'/*, 'jquery-ui-draggable', 'jquery-ui-resizable', 'jquery-ui-dialog'*/), '1.0');
|
121 |
+
//jquery-ui-position
|
122 |
}
|
123 |
|
124 |
function setFormError($key, $message) {
|
125 |
$this->form_errors[$key] = $message;
|
126 |
}
|
127 |
|
128 |
+
function storeGets() {
|
129 |
+
foreach ($_GET as $k => $v) {
|
130 |
+
$this->gets[$k] = $v;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
function getFormError($key) {
|
135 |
return $this->form_errors[$key];
|
136 |
}
|
156 |
$admin_options[show_widget_home] = $_POST[show_widget_home];
|
157 |
$admin_options[custom_thank_you] = $_POST[custom_thank_you];
|
158 |
$admin_options[author_link] = $_POST[author_link];
|
159 |
+
$admin_options[form_success_message] = $_POST[form_success_message];
|
160 |
+
$admin_options[wp_mail_function] = $_POST[wp_mail_function];
|
161 |
$admin_options[enable_widget_tooltips] = $_POST[enable_widget_tooltips];
|
162 |
$admin_options[remember_field_values] = $_POST[remember_field_values];
|
163 |
update_option($this->adminOptionsName, $admin_options);
|
528 |
<li class="descrip">Form emails will be sent <span>from</span> this address.</li>
|
529 |
<li>
|
530 |
<label for="default_form_subject">Default Email Subject:</label>
|
531 |
+
<input name="default_form_subject" value="<?php echo $admin_options[default_form_subject]; ?>" type="text" />
|
532 |
</li>
|
533 |
<li class="descrip">Default subject to be included in all form emails.</li>
|
534 |
<li>
|
536 |
<input name="custom_thank_you" value="<?php echo $admin_options[custom_thank_you]; ?>" type="text" maxlength="150" />
|
537 |
</li>
|
538 |
<li class="descrip">Upon filling out forms, users will be sent back to the form page if this is left blank.</li>
|
539 |
+
<li>
|
540 |
+
<label for="form_success_message">Thank You Message:</label>
|
541 |
+
<input name="form_success_message" value="<?php echo $admin_options[form_success_message]; ?>" type="text"/>
|
542 |
+
</li>
|
543 |
+
<li class="descrip">If a custom thank you page is not provided, this message will be displayed in a stylish JQuery popover when a user successfully fills out a form.</li>
|
544 |
|
545 |
<li>
|
546 |
<label for="remember_field_values">Remember Field Values:</label>
|
553 |
</li>
|
554 |
<li class="descrip">Enabling this shows tooltips containing field instructions on forms in the widget.</li>
|
555 |
<li>
|
556 |
+
<label for="author_link">Hide Plugin Author Link in Code:</label>
|
557 |
<select name="author_link"><option value="1">Yes</option><option <?php if ($admin_options[author_link] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
|
558 |
</li>
|
559 |
+
<li>
|
560 |
+
<label for="wp_mail_function">Use Wordpress Mail Function:</label>
|
561 |
+
<select name="wp_mail_function"><option value="1">Yes</option><option <?php if ($admin_options[wp_mail_function] == 0) echo 'selected="selected"'; ?> value="0">No</option></select>
|
562 |
+
</li>
|
563 |
+
<li class="descrip">Setting this to no will use the PHP mail function. If your forms aren't sending mail properly try setting this to no.</li>
|
564 |
+
<li class="show-widget"><b>Show Sidebar Widget:</b></li>
|
565 |
<li>
|
566 |
<label>
|
567 |
<input value="1" type="checkbox" name="show_widget_home" <?php if ($admin_options[show_widget_home] == 1) echo 'checked="checked"'; ?> />
|
979 |
|
980 |
function getCaptchaCode($form_id) {
|
981 |
$captcha = parent::selectField('', 'captcha');
|
982 |
+
$instructions = (empty($captcha->field_instructions)) ? '' : 'title="'.$captcha->field_instructions.'" class="tooltip-field"';
|
983 |
$out = '<img id="captcha-image" src="' . get_bloginfo('wpurl') . '/wp-content/plugins/custom-contact-forms/image.php?fid='.$form_id.'" />
|
984 |
+
<br /><label for="captcha'.$form_id.'">'.$captcha->field_label.'</label> <input type="text" '.$instructions.' name="captcha" id="captcha'.$form_id.'" maxlength="20" />';
|
985 |
return $out;
|
986 |
}
|
987 |
|
990 |
}
|
991 |
|
992 |
function contactAuthor($name, $email, $website, $message, $type) {
|
993 |
+
$admin_options = $this->getAdminOptions();
|
994 |
$body = "Name: $name\n";
|
995 |
$body .= "Email: $email\n";
|
996 |
$body .= "Website: $website\n";
|
997 |
$body .= "Message: $message\n";
|
998 |
$body .= "Message Type: $type\n";
|
999 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
1000 |
+
$mailer = new CustomContactFormsMailer('admin@taylorlovett.com', $email, "CCF Message: $type", stripslashes($body), $admin_options[wp_mail_function]);
|
1001 |
$mailer->send();
|
1002 |
}
|
1003 |
|
1004 |
+
function insertFormSuccessCode() {
|
1005 |
+
$admin_options = $this->getAdminOptions();
|
1006 |
+
?>
|
1007 |
+
<div id="ccf-form-success">
|
1008 |
+
<h5>Successful Form Submission</h5>
|
1009 |
+
<p><?php echo $admin_options[form_success_message]; ?></p>
|
1010 |
+
<a href="javascript:void(0)" class="close">[close]</a>
|
1011 |
+
</div>
|
1012 |
+
|
1013 |
+
<?php
|
1014 |
+
}
|
1015 |
+
|
1016 |
function processForms() {
|
1017 |
if ($_POST[customcontactforms_submit]) {
|
1018 |
$this->startSession();
|
1023 |
$cap_name = 'captcha_' . $_POST[fid];
|
1024 |
foreach ($fields as $field_id) {
|
1025 |
$field = parent::selectField($field_id, '');
|
1026 |
+
if ($field->field_slug == 'ishuman') {
|
|
|
|
|
|
|
|
|
|
|
1027 |
if ($_POST[ishuman] != 1)
|
1028 |
$this->setFormError('ishuman', 'Only humans can use this form.');
|
1029 |
+
} elseif ($field->field_slug == 'captcha') {
|
1030 |
+
if ($_POST[captcha] != $_SESSION[$cap_name])
|
1031 |
+
$this->setFormError('captcha', 'You entered the captcha image code incorrectly');
|
1032 |
+
} else {
|
1033 |
+
if ($field->field_type == 'Checkbox')
|
1034 |
+
$checks[] = $field->field_slug;
|
1035 |
}
|
1036 |
}
|
1037 |
$body = '';
|
1051 |
$errors = $this->getAllFormErrors();
|
1052 |
if (empty($errors)) {
|
1053 |
unset($_SESSION['captcha_' . $_POST[fid]]);
|
1054 |
+
unset($_SESSION[fields]);
|
1055 |
$body .= 'Sender IP: ' . $_SERVER['REMOTE_ADDR'] . "\n";
|
1056 |
+
$mailer = new CustomContactFormsMailer($admin_options[default_to_email], $admin_options[default_from_email], $admin_options[default_form_subject], stripslashes($body), $admin_options[wp_mail_function]);
|
1057 |
$mailer->send();
|
1058 |
if (!empty($admin_options[custom_thank_you])) {
|
1059 |
header("Location: " . $admin_options[custom_thank_you]);
|
1060 |
}
|
1061 |
+
add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
|
1062 |
}
|
1063 |
unset($_POST);
|
1064 |
}
|
1083 |
//add_action('wp_footer', array(&$customcontact, 'insertPopoverCode'));
|
1084 |
}
|
1085 |
add_action('admin_menu', 'CustomContactForms_ap');
|
1086 |
+
|
1087 |
?>
|
js/custom-contact-forms.js
CHANGED
@@ -40,4 +40,9 @@ $j(document).ready(function(){
|
|
40 |
opacity: 0.7
|
41 |
|
42 |
});
|
|
|
|
|
|
|
|
|
|
|
43 |
});
|
40 |
opacity: 0.7
|
41 |
|
42 |
});
|
43 |
+
|
44 |
+
$j("#ccf-form-success").delay(500).fadeIn('slow');
|
45 |
+
$j("#ccf-form-success .close").click(function() {
|
46 |
+
$j("#ccf-form-success").fadeOut();
|
47 |
+
});
|
48 |
});
|
js/{jquery.ui.dialog.js → jquery-ui-1.8.4.custom.js}
RENAMED
@@ -1,3 +1,754 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
* jQuery UI Dialog 1.8.4
|
3 |
*
|
1 |
+
/*!
|
2 |
+
* jQuery UI 1.8.4
|
3 |
+
*
|
4 |
+
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6 |
+
* http://jquery.org/license
|
7 |
+
*
|
8 |
+
* http://docs.jquery.com/UI
|
9 |
+
*/
|
10 |
+
(function( $, undefined ) {
|
11 |
+
|
12 |
+
// prevent duplicate loading
|
13 |
+
// this is only a problem because we proxy existing functions
|
14 |
+
// and we don't want to double proxy them
|
15 |
+
$.ui = $.ui || {};
|
16 |
+
if ( $.ui.version ) {
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
//Helper functions and ui object
|
21 |
+
$.extend( $.ui, {
|
22 |
+
version: "1.8.4",
|
23 |
+
|
24 |
+
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
25 |
+
plugin: {
|
26 |
+
add: function( module, option, set ) {
|
27 |
+
var proto = $.ui[ module ].prototype;
|
28 |
+
for ( var i in set ) {
|
29 |
+
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
30 |
+
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
31 |
+
}
|
32 |
+
},
|
33 |
+
call: function( instance, name, args ) {
|
34 |
+
var set = instance.plugins[ name ];
|
35 |
+
if ( !set || !instance.element[ 0 ].parentNode ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
for ( var i = 0; i < set.length; i++ ) {
|
40 |
+
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
41 |
+
set[ i ][ 1 ].apply( instance.element, args );
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
},
|
46 |
+
|
47 |
+
contains: function( a, b ) {
|
48 |
+
return document.compareDocumentPosition ?
|
49 |
+
a.compareDocumentPosition( b ) & 16 :
|
50 |
+
a !== b && a.contains( b );
|
51 |
+
},
|
52 |
+
|
53 |
+
hasScroll: function( el, a ) {
|
54 |
+
|
55 |
+
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
56 |
+
if ( $( el ).css( "overflow" ) === "hidden") {
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
|
60 |
+
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
61 |
+
has = false;
|
62 |
+
|
63 |
+
if ( el[ scroll ] > 0 ) {
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
|
67 |
+
// TODO: determine which cases actually cause this to happen
|
68 |
+
// if the element doesn't have the scroll set, see if it's possible to
|
69 |
+
// set the scroll
|
70 |
+
el[ scroll ] = 1;
|
71 |
+
has = ( el[ scroll ] > 0 );
|
72 |
+
el[ scroll ] = 0;
|
73 |
+
return has;
|
74 |
+
},
|
75 |
+
|
76 |
+
isOverAxis: function( x, reference, size ) {
|
77 |
+
//Determines when x coordinate is over "b" element axis
|
78 |
+
return ( x > reference ) && ( x < ( reference + size ) );
|
79 |
+
},
|
80 |
+
|
81 |
+
isOver: function( y, x, top, left, height, width ) {
|
82 |
+
//Determines when x, y coordinates is over "b" element
|
83 |
+
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
|
84 |
+
},
|
85 |
+
|
86 |
+
keyCode: {
|
87 |
+
ALT: 18,
|
88 |
+
BACKSPACE: 8,
|
89 |
+
CAPS_LOCK: 20,
|
90 |
+
COMMA: 188,
|
91 |
+
COMMAND: 91,
|
92 |
+
COMMAND_LEFT: 91, // COMMAND
|
93 |
+
COMMAND_RIGHT: 93,
|
94 |
+
CONTROL: 17,
|
95 |
+
DELETE: 46,
|
96 |
+
DOWN: 40,
|
97 |
+
END: 35,
|
98 |
+
ENTER: 13,
|
99 |
+
ESCAPE: 27,
|
100 |
+
HOME: 36,
|
101 |
+
INSERT: 45,
|
102 |
+
LEFT: 37,
|
103 |
+
MENU: 93, // COMMAND_RIGHT
|
104 |
+
NUMPAD_ADD: 107,
|
105 |
+
NUMPAD_DECIMAL: 110,
|
106 |
+
NUMPAD_DIVIDE: 111,
|
107 |
+
NUMPAD_ENTER: 108,
|
108 |
+
NUMPAD_MULTIPLY: 106,
|
109 |
+
NUMPAD_SUBTRACT: 109,
|
110 |
+
PAGE_DOWN: 34,
|
111 |
+
PAGE_UP: 33,
|
112 |
+
PERIOD: 190,
|
113 |
+
RIGHT: 39,
|
114 |
+
SHIFT: 16,
|
115 |
+
SPACE: 32,
|
116 |
+
TAB: 9,
|
117 |
+
UP: 38,
|
118 |
+
WINDOWS: 91 // COMMAND
|
119 |
+
}
|
120 |
+
});
|
121 |
+
|
122 |
+
//jQuery plugins
|
123 |
+
$.fn.extend({
|
124 |
+
_focus: $.fn.focus,
|
125 |
+
focus: function( delay, fn ) {
|
126 |
+
return typeof delay === "number" ?
|
127 |
+
this.each(function() {
|
128 |
+
var elem = this;
|
129 |
+
setTimeout(function() {
|
130 |
+
$( elem ).focus();
|
131 |
+
if ( fn ) {
|
132 |
+
fn.call( elem );
|
133 |
+
}
|
134 |
+
}, delay );
|
135 |
+
}) :
|
136 |
+
this._focus.apply( this, arguments );
|
137 |
+
},
|
138 |
+
|
139 |
+
enableSelection: function() {
|
140 |
+
return this
|
141 |
+
.attr( "unselectable", "off" )
|
142 |
+
.css( "MozUserSelect", "" );
|
143 |
+
},
|
144 |
+
|
145 |
+
disableSelection: function() {
|
146 |
+
return this
|
147 |
+
.attr( "unselectable", "on" )
|
148 |
+
.css( "MozUserSelect", "none" );
|
149 |
+
},
|
150 |
+
|
151 |
+
scrollParent: function() {
|
152 |
+
var scrollParent;
|
153 |
+
if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
154 |
+
scrollParent = this.parents().filter(function() {
|
155 |
+
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
156 |
+
}).eq(0);
|
157 |
+
} else {
|
158 |
+
scrollParent = this.parents().filter(function() {
|
159 |
+
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
160 |
+
}).eq(0);
|
161 |
+
}
|
162 |
+
|
163 |
+
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
164 |
+
},
|
165 |
+
|
166 |
+
zIndex: function( zIndex ) {
|
167 |
+
if ( zIndex !== undefined ) {
|
168 |
+
return this.css( "zIndex", zIndex );
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( this.length ) {
|
172 |
+
var elem = $( this[ 0 ] ), position, value;
|
173 |
+
while ( elem.length && elem[ 0 ] !== document ) {
|
174 |
+
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
175 |
+
// This makes behavior of this function consistent across browsers
|
176 |
+
// WebKit always returns auto if the element is positioned
|
177 |
+
position = elem.css( "position" );
|
178 |
+
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
179 |
+
// IE returns 0 when zIndex is not specified
|
180 |
+
// other browsers return a string
|
181 |
+
// we ignore the case of nested elements with an explicit value of 0
|
182 |
+
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
183 |
+
value = parseInt( elem.css( "zIndex" ) );
|
184 |
+
if ( !isNaN( value ) && value != 0 ) {
|
185 |
+
return value;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
elem = elem.parent();
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
return 0;
|
193 |
+
}
|
194 |
+
});
|
195 |
+
|
196 |
+
$.each( [ "Width", "Height" ], function( i, name ) {
|
197 |
+
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
198 |
+
type = name.toLowerCase(),
|
199 |
+
orig = {
|
200 |
+
innerWidth: $.fn.innerWidth,
|
201 |
+
innerHeight: $.fn.innerHeight,
|
202 |
+
outerWidth: $.fn.outerWidth,
|
203 |
+
outerHeight: $.fn.outerHeight
|
204 |
+
};
|
205 |
+
|
206 |
+
function reduce( elem, size, border, margin ) {
|
207 |
+
$.each( side, function() {
|
208 |
+
size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
|
209 |
+
if ( border ) {
|
210 |
+
size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
|
211 |
+
}
|
212 |
+
if ( margin ) {
|
213 |
+
size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
|
214 |
+
}
|
215 |
+
});
|
216 |
+
return size;
|
217 |
+
}
|
218 |
+
|
219 |
+
$.fn[ "inner" + name ] = function( size ) {
|
220 |
+
if ( size === undefined ) {
|
221 |
+
return orig[ "inner" + name ].call( this );
|
222 |
+
}
|
223 |
+
|
224 |
+
return this.each(function() {
|
225 |
+
$.style( this, type, reduce( this, size ) + "px" );
|
226 |
+
});
|
227 |
+
};
|
228 |
+
|
229 |
+
$.fn[ "outer" + name] = function( size, margin ) {
|
230 |
+
if ( typeof size !== "number" ) {
|
231 |
+
return orig[ "outer" + name ].call( this, size );
|
232 |
+
}
|
233 |
+
|
234 |
+
return this.each(function() {
|
235 |
+
$.style( this, type, reduce( this, size, true, margin ) + "px" );
|
236 |
+
});
|
237 |
+
};
|
238 |
+
});
|
239 |
+
|
240 |
+
//Additional selectors
|
241 |
+
function visible( element ) {
|
242 |
+
return !$( element ).parents().andSelf().filter(function() {
|
243 |
+
return $.curCSS( this, "visibility" ) === "hidden" ||
|
244 |
+
$.expr.filters.hidden( this );
|
245 |
+
}).length;
|
246 |
+
}
|
247 |
+
|
248 |
+
$.extend( $.expr[ ":" ], {
|
249 |
+
data: function( elem, i, match ) {
|
250 |
+
return !!$.data( elem, match[ 3 ] );
|
251 |
+
},
|
252 |
+
|
253 |
+
focusable: function( element ) {
|
254 |
+
var nodeName = element.nodeName.toLowerCase(),
|
255 |
+
tabIndex = $.attr( element, "tabindex" );
|
256 |
+
if ( "area" === nodeName ) {
|
257 |
+
var map = element.parentNode,
|
258 |
+
mapName = map.name,
|
259 |
+
img;
|
260 |
+
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
261 |
+
return false;
|
262 |
+
}
|
263 |
+
img = $( "img[usemap=#" + mapName + "]" )[0];
|
264 |
+
return !!img && visible( img );
|
265 |
+
}
|
266 |
+
return ( /input|select|textarea|button|object/.test( nodeName )
|
267 |
+
? !element.disabled
|
268 |
+
: "a" == nodeName
|
269 |
+
? element.href || !isNaN( tabIndex )
|
270 |
+
: !isNaN( tabIndex ))
|
271 |
+
// the element and all of its ancestors must be visible
|
272 |
+
&& visible( element );
|
273 |
+
},
|
274 |
+
|
275 |
+
tabbable: function( element ) {
|
276 |
+
var tabIndex = $.attr( element, "tabindex" );
|
277 |
+
return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" );
|
278 |
+
}
|
279 |
+
});
|
280 |
+
|
281 |
+
})( jQuery );
|
282 |
+
/*!
|
283 |
+
* jQuery UI Widget 1.8.4
|
284 |
+
*
|
285 |
+
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
286 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
287 |
+
* http://jquery.org/license
|
288 |
+
*
|
289 |
+
* http://docs.jquery.com/UI/Widget
|
290 |
+
*/
|
291 |
+
(function( $, undefined ) {
|
292 |
+
|
293 |
+
var _remove = $.fn.remove;
|
294 |
+
|
295 |
+
$.fn.remove = function( selector, keepData ) {
|
296 |
+
return this.each(function() {
|
297 |
+
if ( !keepData ) {
|
298 |
+
if ( !selector || $.filter( selector, [ this ] ).length ) {
|
299 |
+
$( "*", this ).add( [ this ] ).each(function() {
|
300 |
+
$( this ).triggerHandler( "remove" );
|
301 |
+
});
|
302 |
+
}
|
303 |
+
}
|
304 |
+
return _remove.call( $(this), selector, keepData );
|
305 |
+
});
|
306 |
+
};
|
307 |
+
|
308 |
+
$.widget = function( name, base, prototype ) {
|
309 |
+
var namespace = name.split( "." )[ 0 ],
|
310 |
+
fullName;
|
311 |
+
name = name.split( "." )[ 1 ];
|
312 |
+
fullName = namespace + "-" + name;
|
313 |
+
|
314 |
+
if ( !prototype ) {
|
315 |
+
prototype = base;
|
316 |
+
base = $.Widget;
|
317 |
+
}
|
318 |
+
|
319 |
+
// create selector for plugin
|
320 |
+
$.expr[ ":" ][ fullName ] = function( elem ) {
|
321 |
+
return !!$.data( elem, name );
|
322 |
+
};
|
323 |
+
|
324 |
+
$[ namespace ] = $[ namespace ] || {};
|
325 |
+
$[ namespace ][ name ] = function( options, element ) {
|
326 |
+
// allow instantiation without initializing for simple inheritance
|
327 |
+
if ( arguments.length ) {
|
328 |
+
this._createWidget( options, element );
|
329 |
+
}
|
330 |
+
};
|
331 |
+
|
332 |
+
var basePrototype = new base();
|
333 |
+
// we need to make the options hash a property directly on the new instance
|
334 |
+
// otherwise we'll modify the options hash on the prototype that we're
|
335 |
+
// inheriting from
|
336 |
+
// $.each( basePrototype, function( key, val ) {
|
337 |
+
// if ( $.isPlainObject(val) ) {
|
338 |
+
// basePrototype[ key ] = $.extend( {}, val );
|
339 |
+
// }
|
340 |
+
// });
|
341 |
+
basePrototype.options = $.extend( true, {}, basePrototype.options );
|
342 |
+
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
343 |
+
namespace: namespace,
|
344 |
+
widgetName: name,
|
345 |
+
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
346 |
+
widgetBaseClass: fullName
|
347 |
+
}, prototype );
|
348 |
+
|
349 |
+
$.widget.bridge( name, $[ namespace ][ name ] );
|
350 |
+
};
|
351 |
+
|
352 |
+
$.widget.bridge = function( name, object ) {
|
353 |
+
$.fn[ name ] = function( options ) {
|
354 |
+
var isMethodCall = typeof options === "string",
|
355 |
+
args = Array.prototype.slice.call( arguments, 1 ),
|
356 |
+
returnValue = this;
|
357 |
+
|
358 |
+
// allow multiple hashes to be passed on init
|
359 |
+
options = !isMethodCall && args.length ?
|
360 |
+
$.extend.apply( null, [ true, options ].concat(args) ) :
|
361 |
+
options;
|
362 |
+
|
363 |
+
// prevent calls to internal methods
|
364 |
+
if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
|
365 |
+
return returnValue;
|
366 |
+
}
|
367 |
+
|
368 |
+
if ( isMethodCall ) {
|
369 |
+
this.each(function() {
|
370 |
+
var instance = $.data( this, name ),
|
371 |
+
methodValue = instance && $.isFunction( instance[options] ) ?
|
372 |
+
instance[ options ].apply( instance, args ) :
|
373 |
+
instance;
|
374 |
+
if ( methodValue !== instance && methodValue !== undefined ) {
|
375 |
+
returnValue = methodValue;
|
376 |
+
return false;
|
377 |
+
}
|
378 |
+
});
|
379 |
+
} else {
|
380 |
+
this.each(function() {
|
381 |
+
var instance = $.data( this, name );
|
382 |
+
if ( instance ) {
|
383 |
+
if ( options ) {
|
384 |
+
instance.option( options );
|
385 |
+
}
|
386 |
+
instance._init();
|
387 |
+
} else {
|
388 |
+
$.data( this, name, new object( options, this ) );
|
389 |
+
}
|
390 |
+
});
|
391 |
+
}
|
392 |
+
|
393 |
+
return returnValue;
|
394 |
+
};
|
395 |
+
};
|
396 |
+
|
397 |
+
$.Widget = function( options, element ) {
|
398 |
+
// allow instantiation without initializing for simple inheritance
|
399 |
+
if ( arguments.length ) {
|
400 |
+
this._createWidget( options, element );
|
401 |
+
}
|
402 |
+
};
|
403 |
+
|
404 |
+
$.Widget.prototype = {
|
405 |
+
widgetName: "widget",
|
406 |
+
widgetEventPrefix: "",
|
407 |
+
options: {
|
408 |
+
disabled: false
|
409 |
+
},
|
410 |
+
_createWidget: function( options, element ) {
|
411 |
+
// $.widget.bridge stores the plugin instance, but we do it anyway
|
412 |
+
// so that it's stored even before the _create function runs
|
413 |
+
$.data( element, this.widgetName, this );
|
414 |
+
this.element = $( element );
|
415 |
+
this.options = $.extend( true, {},
|
416 |
+
this.options,
|
417 |
+
$.metadata && $.metadata.get( element )[ this.widgetName ],
|
418 |
+
options );
|
419 |
+
|
420 |
+
var self = this;
|
421 |
+
this.element.bind( "remove." + this.widgetName, function() {
|
422 |
+
self.destroy();
|
423 |
+
});
|
424 |
+
|
425 |
+
this._create();
|
426 |
+
this._init();
|
427 |
+
},
|
428 |
+
_create: function() {},
|
429 |
+
_init: function() {},
|
430 |
+
|
431 |
+
destroy: function() {
|
432 |
+
this.element
|
433 |
+
.unbind( "." + this.widgetName )
|
434 |
+
.removeData( this.widgetName );
|
435 |
+
this.widget()
|
436 |
+
.unbind( "." + this.widgetName )
|
437 |
+
.removeAttr( "aria-disabled" )
|
438 |
+
.removeClass(
|
439 |
+
this.widgetBaseClass + "-disabled " +
|
440 |
+
"ui-state-disabled" );
|
441 |
+
},
|
442 |
+
|
443 |
+
widget: function() {
|
444 |
+
return this.element;
|
445 |
+
},
|
446 |
+
|
447 |
+
option: function( key, value ) {
|
448 |
+
var options = key,
|
449 |
+
self = this;
|
450 |
+
|
451 |
+
if ( arguments.length === 0 ) {
|
452 |
+
// don't return a reference to the internal hash
|
453 |
+
return $.extend( {}, self.options );
|
454 |
+
}
|
455 |
+
|
456 |
+
if (typeof key === "string" ) {
|
457 |
+
if ( value === undefined ) {
|
458 |
+
return this.options[ key ];
|
459 |
+
}
|
460 |
+
options = {};
|
461 |
+
options[ key ] = value;
|
462 |
+
}
|
463 |
+
|
464 |
+
$.each( options, function( key, value ) {
|
465 |
+
self._setOption( key, value );
|
466 |
+
});
|
467 |
+
|
468 |
+
return self;
|
469 |
+
},
|
470 |
+
_setOption: function( key, value ) {
|
471 |
+
this.options[ key ] = value;
|
472 |
+
|
473 |
+
if ( key === "disabled" ) {
|
474 |
+
this.widget()
|
475 |
+
[ value ? "addClass" : "removeClass"](
|
476 |
+
this.widgetBaseClass + "-disabled" + " " +
|
477 |
+
"ui-state-disabled" )
|
478 |
+
.attr( "aria-disabled", value );
|
479 |
+
}
|
480 |
+
|
481 |
+
return this;
|
482 |
+
},
|
483 |
+
|
484 |
+
enable: function() {
|
485 |
+
return this._setOption( "disabled", false );
|
486 |
+
},
|
487 |
+
disable: function() {
|
488 |
+
return this._setOption( "disabled", true );
|
489 |
+
},
|
490 |
+
|
491 |
+
_trigger: function( type, event, data ) {
|
492 |
+
var callback = this.options[ type ];
|
493 |
+
|
494 |
+
event = $.Event( event );
|
495 |
+
event.type = ( type === this.widgetEventPrefix ?
|
496 |
+
type :
|
497 |
+
this.widgetEventPrefix + type ).toLowerCase();
|
498 |
+
data = data || {};
|
499 |
+
|
500 |
+
// copy original event properties over to the new event
|
501 |
+
// this would happen if we could call $.event.fix instead of $.Event
|
502 |
+
// but we don't have a way to force an event to be fixed multiple times
|
503 |
+
if ( event.originalEvent ) {
|
504 |
+
for ( var i = $.event.props.length, prop; i; ) {
|
505 |
+
prop = $.event.props[ --i ];
|
506 |
+
event[ prop ] = event.originalEvent[ prop ];
|
507 |
+
}
|
508 |
+
}
|
509 |
+
|
510 |
+
this.element.trigger( event, data );
|
511 |
+
|
512 |
+
return !( $.isFunction(callback) &&
|
513 |
+
callback.call( this.element[0], event, data ) === false ||
|
514 |
+
event.isDefaultPrevented() );
|
515 |
+
}
|
516 |
+
};
|
517 |
+
|
518 |
+
})( jQuery );
|
519 |
+
/*
|
520 |
+
* jQuery UI Position 1.8.4
|
521 |
+
*
|
522 |
+
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
523 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
524 |
+
* http://jquery.org/license
|
525 |
+
*
|
526 |
+
* http://docs.jquery.com/UI/Position
|
527 |
+
*/
|
528 |
+
(function( $, undefined ) {
|
529 |
+
|
530 |
+
$.ui = $.ui || {};
|
531 |
+
|
532 |
+
var horizontalPositions = /left|center|right/,
|
533 |
+
horizontalDefault = "center",
|
534 |
+
verticalPositions = /top|center|bottom/,
|
535 |
+
verticalDefault = "center",
|
536 |
+
_position = $.fn.position,
|
537 |
+
_offset = $.fn.offset;
|
538 |
+
|
539 |
+
$.fn.position = function( options ) {
|
540 |
+
if ( !options || !options.of ) {
|
541 |
+
return _position.apply( this, arguments );
|
542 |
+
}
|
543 |
+
|
544 |
+
// make a copy, we don't want to modify arguments
|
545 |
+
options = $.extend( {}, options );
|
546 |
+
|
547 |
+
var target = $( options.of ),
|
548 |
+
collision = ( options.collision || "flip" ).split( " " ),
|
549 |
+
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
|
550 |
+
targetWidth,
|
551 |
+
targetHeight,
|
552 |
+
basePosition;
|
553 |
+
|
554 |
+
if ( options.of.nodeType === 9 ) {
|
555 |
+
targetWidth = target.width();
|
556 |
+
targetHeight = target.height();
|
557 |
+
basePosition = { top: 0, left: 0 };
|
558 |
+
} else if ( options.of.scrollTo && options.of.document ) {
|
559 |
+
targetWidth = target.width();
|
560 |
+
targetHeight = target.height();
|
561 |
+
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|
562 |
+
} else if ( options.of.preventDefault ) {
|
563 |
+
// force left top to allow flipping
|
564 |
+
options.at = "left top";
|
565 |
+
targetWidth = targetHeight = 0;
|
566 |
+
basePosition = { top: options.of.pageY, left: options.of.pageX };
|
567 |
+
} else {
|
568 |
+
targetWidth = target.outerWidth();
|
569 |
+
targetHeight = target.outerHeight();
|
570 |
+
basePosition = target.offset();
|
571 |
+
}
|
572 |
+
|
573 |
+
// force my and at to have valid horizontal and veritcal positions
|
574 |
+
// if a value is missing or invalid, it will be converted to center
|
575 |
+
$.each( [ "my", "at" ], function() {
|
576 |
+
var pos = ( options[this] || "" ).split( " " );
|
577 |
+
if ( pos.length === 1) {
|
578 |
+
pos = horizontalPositions.test( pos[0] ) ?
|
579 |
+
pos.concat( [verticalDefault] ) :
|
580 |
+
verticalPositions.test( pos[0] ) ?
|
581 |
+
[ horizontalDefault ].concat( pos ) :
|
582 |
+
[ horizontalDefault, verticalDefault ];
|
583 |
+
}
|
584 |
+
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : horizontalDefault;
|
585 |
+
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : verticalDefault;
|
586 |
+
options[ this ] = pos;
|
587 |
+
});
|
588 |
+
|
589 |
+
// normalize collision option
|
590 |
+
if ( collision.length === 1 ) {
|
591 |
+
collision[ 1 ] = collision[ 0 ];
|
592 |
+
}
|
593 |
+
|
594 |
+
// normalize offset option
|
595 |
+
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
|
596 |
+
if ( offset.length === 1 ) {
|
597 |
+
offset[ 1 ] = offset[ 0 ];
|
598 |
+
}
|
599 |
+
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
|
600 |
+
|
601 |
+
if ( options.at[0] === "right" ) {
|
602 |
+
basePosition.left += targetWidth;
|
603 |
+
} else if (options.at[0] === horizontalDefault ) {
|
604 |
+
basePosition.left += targetWidth / 2;
|
605 |
+
}
|
606 |
+
|
607 |
+
if ( options.at[1] === "bottom" ) {
|
608 |
+
basePosition.top += targetHeight;
|
609 |
+
} else if ( options.at[1] === verticalDefault ) {
|
610 |
+
basePosition.top += targetHeight / 2;
|
611 |
+
}
|
612 |
+
|
613 |
+
basePosition.left += offset[ 0 ];
|
614 |
+
basePosition.top += offset[ 1 ];
|
615 |
+
|
616 |
+
return this.each(function() {
|
617 |
+
var elem = $( this ),
|
618 |
+
elemWidth = elem.outerWidth(),
|
619 |
+
elemHeight = elem.outerHeight(),
|
620 |
+
position = $.extend( {}, basePosition );
|
621 |
+
|
622 |
+
if ( options.my[0] === "right" ) {
|
623 |
+
position.left -= elemWidth;
|
624 |
+
} else if ( options.my[0] === horizontalDefault ) {
|
625 |
+
position.left -= elemWidth / 2;
|
626 |
+
}
|
627 |
+
|
628 |
+
if ( options.my[1] === "bottom" ) {
|
629 |
+
position.top -= elemHeight;
|
630 |
+
} else if ( options.my[1] === verticalDefault ) {
|
631 |
+
position.top -= elemHeight / 2;
|
632 |
+
}
|
633 |
+
|
634 |
+
// prevent fractions (see #5280)
|
635 |
+
position.left = parseInt( position.left );
|
636 |
+
position.top = parseInt( position.top );
|
637 |
+
|
638 |
+
$.each( [ "left", "top" ], function( i, dir ) {
|
639 |
+
if ( $.ui.position[ collision[i] ] ) {
|
640 |
+
$.ui.position[ collision[i] ][ dir ]( position, {
|
641 |
+
targetWidth: targetWidth,
|
642 |
+
targetHeight: targetHeight,
|
643 |
+
elemWidth: elemWidth,
|
644 |
+
elemHeight: elemHeight,
|
645 |
+
offset: offset,
|
646 |
+
my: options.my,
|
647 |
+
at: options.at
|
648 |
+
});
|
649 |
+
}
|
650 |
+
});
|
651 |
+
|
652 |
+
if ( $.fn.bgiframe ) {
|
653 |
+
elem.bgiframe();
|
654 |
+
}
|
655 |
+
elem.offset( $.extend( position, { using: options.using } ) );
|
656 |
+
});
|
657 |
+
};
|
658 |
+
|
659 |
+
$.ui.position = {
|
660 |
+
fit: {
|
661 |
+
left: function( position, data ) {
|
662 |
+
var win = $( window ),
|
663 |
+
over = position.left + data.elemWidth - win.width() - win.scrollLeft();
|
664 |
+
position.left = over > 0 ? position.left - over : Math.max( 0, position.left );
|
665 |
+
},
|
666 |
+
top: function( position, data ) {
|
667 |
+
var win = $( window ),
|
668 |
+
over = position.top + data.elemHeight - win.height() - win.scrollTop();
|
669 |
+
position.top = over > 0 ? position.top - over : Math.max( 0, position.top );
|
670 |
+
}
|
671 |
+
},
|
672 |
+
|
673 |
+
flip: {
|
674 |
+
left: function( position, data ) {
|
675 |
+
if ( data.at[0] === "center" ) {
|
676 |
+
return;
|
677 |
+
}
|
678 |
+
var win = $( window ),
|
679 |
+
over = position.left + data.elemWidth - win.width() - win.scrollLeft(),
|
680 |
+
myOffset = data.my[ 0 ] === "left" ?
|
681 |
+
-data.elemWidth :
|
682 |
+
data.my[ 0 ] === "right" ?
|
683 |
+
data.elemWidth :
|
684 |
+
0,
|
685 |
+
offset = -2 * data.offset[ 0 ];
|
686 |
+
position.left += position.left < 0 ?
|
687 |
+
myOffset + data.targetWidth + offset :
|
688 |
+
over > 0 ?
|
689 |
+
myOffset - data.targetWidth + offset :
|
690 |
+
0;
|
691 |
+
},
|
692 |
+
top: function( position, data ) {
|
693 |
+
if ( data.at[1] === "center" ) {
|
694 |
+
return;
|
695 |
+
}
|
696 |
+
var win = $( window ),
|
697 |
+
over = position.top + data.elemHeight - win.height() - win.scrollTop(),
|
698 |
+
myOffset = data.my[ 1 ] === "top" ?
|
699 |
+
-data.elemHeight :
|
700 |
+
data.my[ 1 ] === "bottom" ?
|
701 |
+
data.elemHeight :
|
702 |
+
0,
|
703 |
+
atOffset = data.at[ 1 ] === "top" ?
|
704 |
+
data.targetHeight :
|
705 |
+
-data.targetHeight,
|
706 |
+
offset = -2 * data.offset[ 1 ];
|
707 |
+
position.top += position.top < 0 ?
|
708 |
+
myOffset + data.targetHeight + offset :
|
709 |
+
over > 0 ?
|
710 |
+
myOffset + atOffset + offset :
|
711 |
+
0;
|
712 |
+
}
|
713 |
+
}
|
714 |
+
};
|
715 |
+
|
716 |
+
// offset setter from jQuery 1.4
|
717 |
+
if ( !$.offset.setOffset ) {
|
718 |
+
$.offset.setOffset = function( elem, options ) {
|
719 |
+
// set position first, in-case top/left are set even on static elem
|
720 |
+
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
|
721 |
+
elem.style.position = "relative";
|
722 |
+
}
|
723 |
+
var curElem = $( elem ),
|
724 |
+
curOffset = curElem.offset(),
|
725 |
+
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
|
726 |
+
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
|
727 |
+
props = {
|
728 |
+
top: (options.top - curOffset.top) + curTop,
|
729 |
+
left: (options.left - curOffset.left) + curLeft
|
730 |
+
};
|
731 |
+
|
732 |
+
if ( 'using' in options ) {
|
733 |
+
options.using.call( elem, props );
|
734 |
+
} else {
|
735 |
+
curElem.css( props );
|
736 |
+
}
|
737 |
+
};
|
738 |
+
|
739 |
+
$.fn.offset = function( options ) {
|
740 |
+
var elem = this[ 0 ];
|
741 |
+
if ( !elem || !elem.ownerDocument ) { return null; }
|
742 |
+
if ( options ) {
|
743 |
+
return this.each(function() {
|
744 |
+
$.offset.setOffset( this, options );
|
745 |
+
});
|
746 |
+
}
|
747 |
+
return _offset.call( this );
|
748 |
+
};
|
749 |
+
}
|
750 |
+
|
751 |
+
}( jQuery ));
|
752 |
/*
|
753 |
* jQuery UI Dialog 1.8.4
|
754 |
*
|
js/jquery.bgiframe-2.1.1.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
|
2 |
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3 |
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4 |
+
*
|
5 |
+
* $LastChangedDate: 2007-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $
|
6 |
+
* $Rev: 2447 $
|
7 |
+
*
|
8 |
+
* Version 2.1.1
|
9 |
+
*/
|
10 |
+
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
|
js/jquery.ui.position.js
ADDED
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery UI Position 1.8.4
|
3 |
+
*
|
4 |
+
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6 |
+
* http://jquery.org/license
|
7 |
+
*
|
8 |
+
* http://docs.jquery.com/UI/Position
|
9 |
+
*/
|
10 |
+
(function( $, undefined ) {
|
11 |
+
|
12 |
+
$.ui = $.ui || {};
|
13 |
+
|
14 |
+
var horizontalPositions = /left|center|right/,
|
15 |
+
horizontalDefault = "center",
|
16 |
+
verticalPositions = /top|center|bottom/,
|
17 |
+
verticalDefault = "center",
|
18 |
+
_position = $.fn.position,
|
19 |
+
_offset = $.fn.offset;
|
20 |
+
|
21 |
+
$.fn.position = function( options ) {
|
22 |
+
if ( !options || !options.of ) {
|
23 |
+
return _position.apply( this, arguments );
|
24 |
+
}
|
25 |
+
|
26 |
+
// make a copy, we don't want to modify arguments
|
27 |
+
options = $.extend( {}, options );
|
28 |
+
|
29 |
+
var target = $( options.of ),
|
30 |
+
collision = ( options.collision || "flip" ).split( " " ),
|
31 |
+
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
|
32 |
+
targetWidth,
|
33 |
+
targetHeight,
|
34 |
+
basePosition;
|
35 |
+
|
36 |
+
if ( options.of.nodeType === 9 ) {
|
37 |
+
targetWidth = target.width();
|
38 |
+
targetHeight = target.height();
|
39 |
+
basePosition = { top: 0, left: 0 };
|
40 |
+
} else if ( options.of.scrollTo && options.of.document ) {
|
41 |
+
targetWidth = target.width();
|
42 |
+
targetHeight = target.height();
|
43 |
+
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|
44 |
+
} else if ( options.of.preventDefault ) {
|
45 |
+
// force left top to allow flipping
|
46 |
+
options.at = "left top";
|
47 |
+
targetWidth = targetHeight = 0;
|
48 |
+
basePosition = { top: options.of.pageY, left: options.of.pageX };
|
49 |
+
} else {
|
50 |
+
targetWidth = target.outerWidth();
|
51 |
+
targetHeight = target.outerHeight();
|
52 |
+
basePosition = target.offset();
|
53 |
+
}
|
54 |
+
|
55 |
+
// force my and at to have valid horizontal and veritcal positions
|
56 |
+
// if a value is missing or invalid, it will be converted to center
|
57 |
+
$.each( [ "my", "at" ], function() {
|
58 |
+
var pos = ( options[this] || "" ).split( " " );
|
59 |
+
if ( pos.length === 1) {
|
60 |
+
pos = horizontalPositions.test( pos[0] ) ?
|
61 |
+
pos.concat( [verticalDefault] ) :
|
62 |
+
verticalPositions.test( pos[0] ) ?
|
63 |
+
[ horizontalDefault ].concat( pos ) :
|
64 |
+
[ horizontalDefault, verticalDefault ];
|
65 |
+
}
|
66 |
+
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : horizontalDefault;
|
67 |
+
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : verticalDefault;
|
68 |
+
options[ this ] = pos;
|
69 |
+
});
|
70 |
+
|
71 |
+
// normalize collision option
|
72 |
+
if ( collision.length === 1 ) {
|
73 |
+
collision[ 1 ] = collision[ 0 ];
|
74 |
+
}
|
75 |
+
|
76 |
+
// normalize offset option
|
77 |
+
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
|
78 |
+
if ( offset.length === 1 ) {
|
79 |
+
offset[ 1 ] = offset[ 0 ];
|
80 |
+
}
|
81 |
+
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
|
82 |
+
|
83 |
+
if ( options.at[0] === "right" ) {
|
84 |
+
basePosition.left += targetWidth;
|
85 |
+
} else if (options.at[0] === horizontalDefault ) {
|
86 |
+
basePosition.left += targetWidth / 2;
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( options.at[1] === "bottom" ) {
|
90 |
+
basePosition.top += targetHeight;
|
91 |
+
} else if ( options.at[1] === verticalDefault ) {
|
92 |
+
basePosition.top += targetHeight / 2;
|
93 |
+
}
|
94 |
+
|
95 |
+
basePosition.left += offset[ 0 ];
|
96 |
+
basePosition.top += offset[ 1 ];
|
97 |
+
|
98 |
+
return this.each(function() {
|
99 |
+
var elem = $( this ),
|
100 |
+
elemWidth = elem.outerWidth(),
|
101 |
+
elemHeight = elem.outerHeight(),
|
102 |
+
position = $.extend( {}, basePosition );
|
103 |
+
|
104 |
+
if ( options.my[0] === "right" ) {
|
105 |
+
position.left -= elemWidth;
|
106 |
+
} else if ( options.my[0] === horizontalDefault ) {
|
107 |
+
position.left -= elemWidth / 2;
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( options.my[1] === "bottom" ) {
|
111 |
+
position.top -= elemHeight;
|
112 |
+
} else if ( options.my[1] === verticalDefault ) {
|
113 |
+
position.top -= elemHeight / 2;
|
114 |
+
}
|
115 |
+
|
116 |
+
// prevent fractions (see #5280)
|
117 |
+
position.left = parseInt( position.left );
|
118 |
+
position.top = parseInt( position.top );
|
119 |
+
|
120 |
+
$.each( [ "left", "top" ], function( i, dir ) {
|
121 |
+
if ( $.ui.position[ collision[i] ] ) {
|
122 |
+
$.ui.position[ collision[i] ][ dir ]( position, {
|
123 |
+
targetWidth: targetWidth,
|
124 |
+
targetHeight: targetHeight,
|
125 |
+
elemWidth: elemWidth,
|
126 |
+
elemHeight: elemHeight,
|
127 |
+
offset: offset,
|
128 |
+
my: options.my,
|
129 |
+
at: options.at
|
130 |
+
});
|
131 |
+
}
|
132 |
+
});
|
133 |
+
|
134 |
+
if ( $.fn.bgiframe ) {
|
135 |
+
elem.bgiframe();
|
136 |
+
}
|
137 |
+
elem.offset( $.extend( position, { using: options.using } ) );
|
138 |
+
});
|
139 |
+
};
|
140 |
+
|
141 |
+
$.ui.position = {
|
142 |
+
fit: {
|
143 |
+
left: function( position, data ) {
|
144 |
+
var win = $( window ),
|
145 |
+
over = position.left + data.elemWidth - win.width() - win.scrollLeft();
|
146 |
+
position.left = over > 0 ? position.left - over : Math.max( 0, position.left );
|
147 |
+
},
|
148 |
+
top: function( position, data ) {
|
149 |
+
var win = $( window ),
|
150 |
+
over = position.top + data.elemHeight - win.height() - win.scrollTop();
|
151 |
+
position.top = over > 0 ? position.top - over : Math.max( 0, position.top );
|
152 |
+
}
|
153 |
+
},
|
154 |
+
|
155 |
+
flip: {
|
156 |
+
left: function( position, data ) {
|
157 |
+
if ( data.at[0] === "center" ) {
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
var win = $( window ),
|
161 |
+
over = position.left + data.elemWidth - win.width() - win.scrollLeft(),
|
162 |
+
myOffset = data.my[ 0 ] === "left" ?
|
163 |
+
-data.elemWidth :
|
164 |
+
data.my[ 0 ] === "right" ?
|
165 |
+
data.elemWidth :
|
166 |
+
0,
|
167 |
+
offset = -2 * data.offset[ 0 ];
|
168 |
+
position.left += position.left < 0 ?
|
169 |
+
myOffset + data.targetWidth + offset :
|
170 |
+
over > 0 ?
|
171 |
+
myOffset - data.targetWidth + offset :
|
172 |
+
0;
|
173 |
+
},
|
174 |
+
top: function( position, data ) {
|
175 |
+
if ( data.at[1] === "center" ) {
|
176 |
+
return;
|
177 |
+
}
|
178 |
+
var win = $( window ),
|
179 |
+
over = position.top + data.elemHeight - win.height() - win.scrollTop(),
|
180 |
+
myOffset = data.my[ 1 ] === "top" ?
|
181 |
+
-data.elemHeight :
|
182 |
+
data.my[ 1 ] === "bottom" ?
|
183 |
+
data.elemHeight :
|
184 |
+
0,
|
185 |
+
atOffset = data.at[ 1 ] === "top" ?
|
186 |
+
data.targetHeight :
|
187 |
+
-data.targetHeight,
|
188 |
+
offset = -2 * data.offset[ 1 ];
|
189 |
+
position.top += position.top < 0 ?
|
190 |
+
myOffset + data.targetHeight + offset :
|
191 |
+
over > 0 ?
|
192 |
+
myOffset + atOffset + offset :
|
193 |
+
0;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
};
|
197 |
+
|
198 |
+
// offset setter from jQuery 1.4
|
199 |
+
if ( !$.offset.setOffset ) {
|
200 |
+
$.offset.setOffset = function( elem, options ) {
|
201 |
+
// set position first, in-case top/left are set even on static elem
|
202 |
+
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
|
203 |
+
elem.style.position = "relative";
|
204 |
+
}
|
205 |
+
var curElem = $( elem ),
|
206 |
+
curOffset = curElem.offset(),
|
207 |
+
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
|
208 |
+
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
|
209 |
+
props = {
|
210 |
+
top: (options.top - curOffset.top) + curTop,
|
211 |
+
left: (options.left - curOffset.left) + curLeft
|
212 |
+
};
|
213 |
+
|
214 |
+
if ( 'using' in options ) {
|
215 |
+
options.using.call( elem, props );
|
216 |
+
} else {
|
217 |
+
curElem.css( props );
|
218 |
+
}
|
219 |
+
};
|
220 |
+
|
221 |
+
$.fn.offset = function( options ) {
|
222 |
+
var elem = this[ 0 ];
|
223 |
+
if ( !elem || !elem.ownerDocument ) { return null; }
|
224 |
+
if ( options ) {
|
225 |
+
return this.each(function() {
|
226 |
+
$.offset.setOffset( this, options );
|
227 |
+
});
|
228 |
+
}
|
229 |
+
return _offset.call( this );
|
230 |
+
};
|
231 |
+
}
|
232 |
+
|
233 |
+
}( jQuery ));
|
js/jquery.ui.widget.js
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery UI Widget 1.8.4
|
3 |
+
*
|
4 |
+
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6 |
+
* http://jquery.org/license
|
7 |
+
*
|
8 |
+
* http://docs.jquery.com/UI/Widget
|
9 |
+
*/
|
10 |
+
(function( $, undefined ) {
|
11 |
+
|
12 |
+
var _remove = $.fn.remove;
|
13 |
+
|
14 |
+
$.fn.remove = function( selector, keepData ) {
|
15 |
+
return this.each(function() {
|
16 |
+
if ( !keepData ) {
|
17 |
+
if ( !selector || $.filter( selector, [ this ] ).length ) {
|
18 |
+
$( "*", this ).add( [ this ] ).each(function() {
|
19 |
+
$( this ).triggerHandler( "remove" );
|
20 |
+
});
|
21 |
+
}
|
22 |
+
}
|
23 |
+
return _remove.call( $(this), selector, keepData );
|
24 |
+
});
|
25 |
+
};
|
26 |
+
|
27 |
+
$.widget = function( name, base, prototype ) {
|
28 |
+
var namespace = name.split( "." )[ 0 ],
|
29 |
+
fullName;
|
30 |
+
name = name.split( "." )[ 1 ];
|
31 |
+
fullName = namespace + "-" + name;
|
32 |
+
|
33 |
+
if ( !prototype ) {
|
34 |
+
prototype = base;
|
35 |
+
base = $.Widget;
|
36 |
+
}
|
37 |
+
|
38 |
+
// create selector for plugin
|
39 |
+
$.expr[ ":" ][ fullName ] = function( elem ) {
|
40 |
+
return !!$.data( elem, name );
|
41 |
+
};
|
42 |
+
|
43 |
+
$[ namespace ] = $[ namespace ] || {};
|
44 |
+
$[ namespace ][ name ] = function( options, element ) {
|
45 |
+
// allow instantiation without initializing for simple inheritance
|
46 |
+
if ( arguments.length ) {
|
47 |
+
this._createWidget( options, element );
|
48 |
+
}
|
49 |
+
};
|
50 |
+
|
51 |
+
var basePrototype = new base();
|
52 |
+
// we need to make the options hash a property directly on the new instance
|
53 |
+
// otherwise we'll modify the options hash on the prototype that we're
|
54 |
+
// inheriting from
|
55 |
+
// $.each( basePrototype, function( key, val ) {
|
56 |
+
// if ( $.isPlainObject(val) ) {
|
57 |
+
// basePrototype[ key ] = $.extend( {}, val );
|
58 |
+
// }
|
59 |
+
// });
|
60 |
+
basePrototype.options = $.extend( true, {}, basePrototype.options );
|
61 |
+
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
62 |
+
namespace: namespace,
|
63 |
+
widgetName: name,
|
64 |
+
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
65 |
+
widgetBaseClass: fullName
|
66 |
+
}, prototype );
|
67 |
+
|
68 |
+
$.widget.bridge( name, $[ namespace ][ name ] );
|
69 |
+
};
|
70 |
+
|
71 |
+
$.widget.bridge = function( name, object ) {
|
72 |
+
$.fn[ name ] = function( options ) {
|
73 |
+
var isMethodCall = typeof options === "string",
|
74 |
+
args = Array.prototype.slice.call( arguments, 1 ),
|
75 |
+
returnValue = this;
|
76 |
+
|
77 |
+
// allow multiple hashes to be passed on init
|
78 |
+
options = !isMethodCall && args.length ?
|
79 |
+
$.extend.apply( null, [ true, options ].concat(args) ) :
|
80 |
+
options;
|
81 |
+
|
82 |
+
// prevent calls to internal methods
|
83 |
+
if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
|
84 |
+
return returnValue;
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( isMethodCall ) {
|
88 |
+
this.each(function() {
|
89 |
+
var instance = $.data( this, name ),
|
90 |
+
methodValue = instance && $.isFunction( instance[options] ) ?
|
91 |
+
instance[ options ].apply( instance, args ) :
|
92 |
+
instance;
|
93 |
+
if ( methodValue !== instance && methodValue !== undefined ) {
|
94 |
+
returnValue = methodValue;
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
});
|
98 |
+
} else {
|
99 |
+
this.each(function() {
|
100 |
+
var instance = $.data( this, name );
|
101 |
+
if ( instance ) {
|
102 |
+
if ( options ) {
|
103 |
+
instance.option( options );
|
104 |
+
}
|
105 |
+
instance._init();
|
106 |
+
} else {
|
107 |
+
$.data( this, name, new object( options, this ) );
|
108 |
+
}
|
109 |
+
});
|
110 |
+
}
|
111 |
+
|
112 |
+
return returnValue;
|
113 |
+
};
|
114 |
+
};
|
115 |
+
|
116 |
+
$.Widget = function( options, element ) {
|
117 |
+
// allow instantiation without initializing for simple inheritance
|
118 |
+
if ( arguments.length ) {
|
119 |
+
this._createWidget( options, element );
|
120 |
+
}
|
121 |
+
};
|
122 |
+
|
123 |
+
$.Widget.prototype = {
|
124 |
+
widgetName: "widget",
|
125 |
+
widgetEventPrefix: "",
|
126 |
+
options: {
|
127 |
+
disabled: false
|
128 |
+
},
|
129 |
+
_createWidget: function( options, element ) {
|
130 |
+
// $.widget.bridge stores the plugin instance, but we do it anyway
|
131 |
+
// so that it's stored even before the _create function runs
|
132 |
+
$.data( element, this.widgetName, this );
|
133 |
+
this.element = $( element );
|
134 |
+
this.options = $.extend( true, {},
|
135 |
+
this.options,
|
136 |
+
$.metadata && $.metadata.get( element )[ this.widgetName ],
|
137 |
+
options );
|
138 |
+
|
139 |
+
var self = this;
|
140 |
+
this.element.bind( "remove." + this.widgetName, function() {
|
141 |
+
self.destroy();
|
142 |
+
});
|
143 |
+
|
144 |
+
this._create();
|
145 |
+
this._init();
|
146 |
+
},
|
147 |
+
_create: function() {},
|
148 |
+
_init: function() {},
|
149 |
+
|
150 |
+
destroy: function() {
|
151 |
+
this.element
|
152 |
+
.unbind( "." + this.widgetName )
|
153 |
+
.removeData( this.widgetName );
|
154 |
+
this.widget()
|
155 |
+
.unbind( "." + this.widgetName )
|
156 |
+
.removeAttr( "aria-disabled" )
|
157 |
+
.removeClass(
|
158 |
+
this.widgetBaseClass + "-disabled " +
|
159 |
+
"ui-state-disabled" );
|
160 |
+
},
|
161 |
+
|
162 |
+
widget: function() {
|
163 |
+
return this.element;
|
164 |
+
},
|
165 |
+
|
166 |
+
option: function( key, value ) {
|
167 |
+
var options = key,
|
168 |
+
self = this;
|
169 |
+
|
170 |
+
if ( arguments.length === 0 ) {
|
171 |
+
// don't return a reference to the internal hash
|
172 |
+
return $.extend( {}, self.options );
|
173 |
+
}
|
174 |
+
|
175 |
+
if (typeof key === "string" ) {
|
176 |
+
if ( value === undefined ) {
|
177 |
+
return this.options[ key ];
|
178 |
+
}
|
179 |
+
options = {};
|
180 |
+
options[ key ] = value;
|
181 |
+
}
|
182 |
+
|
183 |
+
$.each( options, function( key, value ) {
|
184 |
+
self._setOption( key, value );
|
185 |
+
});
|
186 |
+
|
187 |
+
return self;
|
188 |
+
},
|
189 |
+
_setOption: function( key, value ) {
|
190 |
+
this.options[ key ] = value;
|
191 |
+
|
192 |
+
if ( key === "disabled" ) {
|
193 |
+
this.widget()
|
194 |
+
[ value ? "addClass" : "removeClass"](
|
195 |
+
this.widgetBaseClass + "-disabled" + " " +
|
196 |
+
"ui-state-disabled" )
|
197 |
+
.attr( "aria-disabled", value );
|
198 |
+
}
|
199 |
+
|
200 |
+
return this;
|
201 |
+
},
|
202 |
+
|
203 |
+
enable: function() {
|
204 |
+
return this._setOption( "disabled", false );
|
205 |
+
},
|
206 |
+
disable: function() {
|
207 |
+
return this._setOption( "disabled", true );
|
208 |
+
},
|
209 |
+
|
210 |
+
_trigger: function( type, event, data ) {
|
211 |
+
var callback = this.options[ type ];
|
212 |
+
|
213 |
+
event = $.Event( event );
|
214 |
+
event.type = ( type === this.widgetEventPrefix ?
|
215 |
+
type :
|
216 |
+
this.widgetEventPrefix + type ).toLowerCase();
|
217 |
+
data = data || {};
|
218 |
+
|
219 |
+
// copy original event properties over to the new event
|
220 |
+
// this would happen if we could call $.event.fix instead of $.Event
|
221 |
+
// but we don't have a way to force an event to be fixed multiple times
|
222 |
+
if ( event.originalEvent ) {
|
223 |
+
for ( var i = $.event.props.length, prop; i; ) {
|
224 |
+
prop = $.event.props[ --i ];
|
225 |
+
event[ prop ] = event.originalEvent[ prop ];
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
this.element.trigger( event, data );
|
230 |
+
|
231 |
+
return !( $.isFunction(callback) &&
|
232 |
+
callback.call( this.element[0], event, data ) === false ||
|
233 |
+
event.isDefaultPrevented() );
|
234 |
+
}
|
235 |
+
};
|
236 |
+
|
237 |
+
})( jQuery );
|
readme.txt
CHANGED
@@ -3,12 +3,14 @@ Plugin Name: Custom Contact Forms
|
|
3 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
4 |
Requires at least: 2.7.1
|
5 |
Tested up to: 3.1
|
6 |
-
Stable tag: 2.2.
|
7 |
Contributors: Taylor Lovett
|
8 |
Download link: http://www.taylorlovett.com/wordpress-plugins/
|
9 |
Author: Taylor Lovett
|
10 |
Author URI: http://www.taylorlovett.com
|
11 |
|
|
|
|
|
12 |
== Description ==
|
13 |
|
14 |
Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. CUSTOMIZE EVERY ASPECT OF YOUR FORMS APPEARANCE WITH ANY EASY TO USE FORM - BORDERS, FONT SIZES, COLORS, PADDING, MARGINS, BACKGROUNDS, AND MORE. A plugin for handling and displaying custom web forms in any page, post, or sidebar.
|
@@ -32,7 +34,7 @@ Special Features:
|
|
32 |
|
33 |
* You can create unlimited styles to use on as many forms as you want - NO CSS KNOWLEDGE REQUIRED!
|
34 |
|
35 |
-
*
|
36 |
|
37 |
* Custom error pages for when forms are filled out incorrectly
|
38 |
|
@@ -59,18 +61,22 @@ Special Features:
|
|
59 |
2. Activate the plugin from your Wordpress Admin Panel
|
60 |
3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
|
61 |
4. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]
|
|
|
62 |
== Configuring and Using the Plugin ==
|
63 |
1. Create a form in the Custom Contact Forms setting page. To get to the settings page, click the Custom Contact Forms link in the admin panel sidebar
|
64 |
2. Create fields and attach those fields to the forms of your choice. * Attach the fields in the order that you want them to show up in the form. If you mess up you can detach and reattach them.
|
65 |
3. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]. Replace FORMID with the id listed to the left of the form slug next to the form of your choice above.
|
66 |
4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.
|
67 |
5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!
|
|
|
68 |
== Support ==
|
69 |
For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
|
70 |
admin@taylorlovett.com
|
71 |
I respond to emails same-day!
|
|
|
72 |
== Upgrade Notice ==
|
73 |
-
|
|
|
74 |
== Change Log ==
|
75 |
|
76 |
1.0.0:
|
@@ -136,4 +142,7 @@ Required fields option will be added in mid-August 2010
|
|
136 |
* custom-contact-forms-db.php
|
137 |
|
138 |
2.2.4
|
139 |
-
* custom-contact-forms.php - Textarea field instruction bug fixed
|
|
|
|
|
|
3 |
Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
|
4 |
Requires at least: 2.7.1
|
5 |
Tested up to: 3.1
|
6 |
+
Stable tag: 2.2.5
|
7 |
Contributors: Taylor Lovett
|
8 |
Download link: http://www.taylorlovett.com/wordpress-plugins/
|
9 |
Author: Taylor Lovett
|
10 |
Author URI: http://www.taylorlovett.com
|
11 |
|
12 |
+
Gauranteed the most customizable contact form plugin form for Wordpress.
|
13 |
+
|
14 |
== Description ==
|
15 |
|
16 |
Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. CUSTOMIZE EVERY ASPECT OF YOUR FORMS APPEARANCE WITH ANY EASY TO USE FORM - BORDERS, FONT SIZES, COLORS, PADDING, MARGINS, BACKGROUNDS, AND MORE. A plugin for handling and displaying custom web forms in any page, post, or sidebar.
|
34 |
|
35 |
* You can create unlimited styles to use on as many forms as you want - NO CSS KNOWLEDGE REQUIRED!
|
36 |
|
37 |
+
* Show a stylish JQuery form thank you message or use a custom thank you page.
|
38 |
|
39 |
* Custom error pages for when forms are filled out incorrectly
|
40 |
|
61 |
2. Activate the plugin from your Wordpress Admin Panel
|
62 |
3. Configure the plugin, create fields, and create forms in the Settings page called Custom Contact Forms
|
63 |
4. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]
|
64 |
+
|
65 |
== Configuring and Using the Plugin ==
|
66 |
1. Create a form in the Custom Contact Forms setting page. To get to the settings page, click the Custom Contact Forms link in the admin panel sidebar
|
67 |
2. Create fields and attach those fields to the forms of your choice. * Attach the fields in the order that you want them to show up in the form. If you mess up you can detach and reattach them.
|
68 |
3. Display those forms in posts and pages by inserting the code: [customcontact form=FORMID]. Replace FORMID with the id listed to the left of the form slug next to the form of your choice above.
|
69 |
4. Add a form to your sidebar, by dragging the Custom Contact Form widget in to your sidebar.
|
70 |
5. Configure the General Settings appropriately; this is important if you want to receive your web form messages!
|
71 |
+
|
72 |
== Support ==
|
73 |
For questions, feature requests, and support concerning the Custom Contact Forms plugin, please email me at:
|
74 |
admin@taylorlovett.com
|
75 |
I respond to emails same-day!
|
76 |
+
|
77 |
== Upgrade Notice ==
|
78 |
+
Popover forms will be added in September 2010.
|
79 |
+
|
80 |
== Change Log ==
|
81 |
|
82 |
1.0.0:
|
142 |
* custom-contact-forms-db.php
|
143 |
|
144 |
2.2.4
|
145 |
+
* custom-contact-forms.php - Textarea field instruction bug fixed
|
146 |
+
|
147 |
+
2.2.5
|
148 |
+
* custom-contact-forms.php - Fixed field insert bug fixed
|