Version Description
Download this release
Release Info
Developer | takayukister |
Plugin | Contact Form 7 |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.2
- README.txt +3 -3
- screenshot-1.jpg +0 -0
- screenshot-1.png +0 -0
- wp-contact-form-7.php +21 -22
README.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: takayukister
|
3 |
Tags: contact form, email, ajax
|
4 |
Requires at least: 2.2
|
5 |
-
Tested up to: 2.3-
|
6 |
-
Stable tag: 1.3.
|
7 |
|
8 |
Just another contact form plugin. Simple but flexible.
|
9 |
|
@@ -22,4 +22,4 @@ Just another contact form plugin. Simple but flexible.
|
|
22 |
|
23 |
== Screenshots ==
|
24 |
|
25 |
-
1. screenshot-1.
|
2 |
Contributors: takayukister
|
3 |
Tags: contact form, email, ajax
|
4 |
Requires at least: 2.2
|
5 |
+
Tested up to: 2.3-beta1
|
6 |
+
Stable tag: 1.3.2
|
7 |
|
8 |
Just another contact form plugin. Simple but flexible.
|
9 |
|
22 |
|
23 |
== Screenshots ==
|
24 |
|
25 |
+
1. screenshot-1.png
|
screenshot-1.jpg
DELETED
Binary file
|
screenshot-1.png
ADDED
Binary file
|
wp-contact-form-7.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Contact Form 7
|
|
4 |
Plugin URI: http://ideasilo.wordpress.com/2007/04/30/contact-form-7/
|
5 |
Description: Just another contact form plugin. Simple but flexible.
|
6 |
Author: Takayuki Miyoshi
|
7 |
-
Version: 1.3.
|
8 |
Author URI: http://ideasilo.wordpress.com/
|
9 |
*/
|
10 |
|
@@ -105,8 +105,7 @@ class tam_contact_form_seven {
|
|
105 |
$mail_subject = preg_replace_callback($regex, $callback, $contact_form['mail']['subject']);
|
106 |
$mail_sender = preg_replace_callback($regex, $callback, $contact_form['mail']['sender']);
|
107 |
$mail_body = preg_replace_callback($regex, $callback, $contact_form['mail']['body']);
|
108 |
-
$mail_headers = "
|
109 |
-
. "From: $mail_sender\n"
|
110 |
. "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
111 |
if (@wp_mail($contact_form['options']['recipient'], $mail_subject, $mail_body, $mail_headers)) {
|
112 |
return true;
|
@@ -379,8 +378,8 @@ class tam_contact_form_seven {
|
|
379 |
<script type="text/javascript">
|
380 |
//<![CDATA[
|
381 |
|
382 |
-
|
383 |
-
|
384 |
beforeSubmit: validate,
|
385 |
url: '<?php echo $override_url; ?>',
|
386 |
dataType: 'json',
|
@@ -391,26 +390,26 @@ $(document).ready(function() {
|
|
391 |
});
|
392 |
|
393 |
function validate(formData, jqForm, options) {
|
394 |
-
var wpcf7ResponseOutput =
|
395 |
clearResponseOutput();
|
396 |
-
|
397 |
var valid = true;
|
398 |
|
399 |
-
|
400 |
if (! isEmail(this.value)) {
|
401 |
-
|
402 |
this.wpcf7InvalidMessage = '<?php _e('Email address seems invalid.', 'wpcf7'); ?>';
|
403 |
}
|
404 |
});
|
405 |
|
406 |
-
|
407 |
if (! this.value) {
|
408 |
-
|
409 |
this.wpcf7InvalidMessage = '<?php _e('Please fill the required field.', 'wpcf7'); ?>';
|
410 |
}
|
411 |
});
|
412 |
|
413 |
-
|
414 |
if (this.wpcf7InvalidMessage) {
|
415 |
notValidTip(this, this.wpcf7InvalidMessage);
|
416 |
valid = false;
|
@@ -419,7 +418,7 @@ function validate(formData, jqForm, options) {
|
|
419 |
});
|
420 |
|
421 |
if (! valid) {
|
422 |
-
|
423 |
wpcf7ResponseOutput.addClass('wpcf7-validation-errors');
|
424 |
wpcf7ResponseOutput.append('<?php _e('Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7'); ?>').fadeIn('fast');
|
425 |
}
|
@@ -433,17 +432,17 @@ function isEmail(user_email) {
|
|
433 |
}
|
434 |
|
435 |
function notValidTip(input, message) {
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
});
|
440 |
-
|
441 |
-
|
442 |
});
|
443 |
}
|
444 |
|
445 |
function processJson(data) {
|
446 |
-
var wpcf7ResponseOutput =
|
447 |
clearResponseOutput();
|
448 |
if (1 == data.mailSent) {
|
449 |
wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');
|
@@ -454,9 +453,9 @@ function processJson(data) {
|
|
454 |
}
|
455 |
|
456 |
function clearResponseOutput() {
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
}
|
461 |
|
462 |
//]]>
|
4 |
Plugin URI: http://ideasilo.wordpress.com/2007/04/30/contact-form-7/
|
5 |
Description: Just another contact form plugin. Simple but flexible.
|
6 |
Author: Takayuki Miyoshi
|
7 |
+
Version: 1.3.2
|
8 |
Author URI: http://ideasilo.wordpress.com/
|
9 |
*/
|
10 |
|
105 |
$mail_subject = preg_replace_callback($regex, $callback, $contact_form['mail']['subject']);
|
106 |
$mail_sender = preg_replace_callback($regex, $callback, $contact_form['mail']['sender']);
|
107 |
$mail_body = preg_replace_callback($regex, $callback, $contact_form['mail']['body']);
|
108 |
+
$mail_headers = "From: $mail_sender\n"
|
|
|
109 |
. "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
|
110 |
if (@wp_mail($contact_form['options']['recipient'], $mail_subject, $mail_body, $mail_headers)) {
|
111 |
return true;
|
378 |
<script type="text/javascript">
|
379 |
//<![CDATA[
|
380 |
|
381 |
+
jQuery(document).ready(function() {
|
382 |
+
jQuery('div.wpcf7 > form').ajaxForm({
|
383 |
beforeSubmit: validate,
|
384 |
url: '<?php echo $override_url; ?>',
|
385 |
dataType: 'json',
|
390 |
});
|
391 |
|
392 |
function validate(formData, jqForm, options) {
|
393 |
+
var wpcf7ResponseOutput = jQuery('div.wpcf7-response-output', jqForm.parents('div.wpcf7')).lt(1);
|
394 |
clearResponseOutput();
|
395 |
+
jQuery('img.ajax-loader', jqForm[0]).css({ visibility: 'visible' });
|
396 |
var valid = true;
|
397 |
|
398 |
+
jQuery('.wpcf7-validates-as-email', jqForm[0]).each(function() {
|
399 |
if (! isEmail(this.value)) {
|
400 |
+
jQuery(this).addClass('wpcf7-email-not-valid');
|
401 |
this.wpcf7InvalidMessage = '<?php _e('Email address seems invalid.', 'wpcf7'); ?>';
|
402 |
}
|
403 |
});
|
404 |
|
405 |
+
jQuery('.wpcf7-validates-as-required', jqForm[0]).each(function() {
|
406 |
if (! this.value) {
|
407 |
+
jQuery(this).addClass('wpcf7-required-not-valid');
|
408 |
this.wpcf7InvalidMessage = '<?php _e('Please fill the required field.', 'wpcf7'); ?>';
|
409 |
}
|
410 |
});
|
411 |
|
412 |
+
jQuery.each(jqForm[0].elements, function() {
|
413 |
if (this.wpcf7InvalidMessage) {
|
414 |
notValidTip(this, this.wpcf7InvalidMessage);
|
415 |
valid = false;
|
418 |
});
|
419 |
|
420 |
if (! valid) {
|
421 |
+
jQuery('img.ajax-loader', jqForm[0]).css({ visibility: 'hidden' });
|
422 |
wpcf7ResponseOutput.addClass('wpcf7-validation-errors');
|
423 |
wpcf7ResponseOutput.append('<?php _e('Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7'); ?>').fadeIn('fast');
|
424 |
}
|
432 |
}
|
433 |
|
434 |
function notValidTip(input, message) {
|
435 |
+
jQuery(input).after('<span class="wpcf7-not-valid-tip">' + message + '</span>');
|
436 |
+
jQuery('span.wpcf7-not-valid-tip').mouseover(function() {
|
437 |
+
jQuery(this).fadeOut('fast');
|
438 |
});
|
439 |
+
jQuery(input).mouseover(function() {
|
440 |
+
jQuery(input).siblings('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
|
441 |
});
|
442 |
}
|
443 |
|
444 |
function processJson(data) {
|
445 |
+
var wpcf7ResponseOutput = jQuery(data.into);
|
446 |
clearResponseOutput();
|
447 |
if (1 == data.mailSent) {
|
448 |
wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');
|
453 |
}
|
454 |
|
455 |
function clearResponseOutput() {
|
456 |
+
jQuery('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors');
|
457 |
+
jQuery('span.wpcf7-not-valid-tip').remove();
|
458 |
+
jQuery('img.ajax-loader').css({ visibility: 'hidden' });
|
459 |
}
|
460 |
|
461 |
//]]>
|