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 3.9 3.9-beta 3.9.1 3.9.2 3.9.3 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1-beta 4.1.1 4.1.2 4.2 4.2-beta 4.2.1 4.2.2 4.3 4.3.1 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6 4.6.1 4.7 4.8 4.8.1 4.9 4.9.1 4.9.2 5.0 5.0.1
contact-form-7 / contact-form-7.js
contact-form-7 Last commit date
admin 16 years ago images 18 years ago includes 16 years ago languages 16 years ago modules 16 years ago README.txt 16 years ago contact-form-7.js 17 years ago screenshot-1.png 16 years ago settings.php 16 years ago stylesheet-rtl.css 17 years ago stylesheet.css 17 years ago wp-contact-form-7.php 16 years ago
contact-form-7.js
106 lines
1 jQuery(document).ready(function() {
2 try {
3 jQuery('div.wpcf7 > form').ajaxForm({
4 beforeSubmit: wpcf7BeforeSubmit,
5 dataType: 'json',
6 success: wpcf7ProcessJson
7 });
8 } catch (e) {
9 }
10
11 try {
12 jQuery('div.wpcf7 > form').each(function(i, n) {
13 wpcf7ToggleSubmit(jQuery(n));
14 });
15 } catch (e) {
16 }
17 });
18
19 // Exclusive checkbox
20 function wpcf7ExclusiveCheckbox(elem) {
21 jQuery(elem.form).find('input:checkbox[name="' + elem.name + '"]').not(elem).removeAttr('checked');
22 }
23
24 // Toggle submit button
25 function wpcf7ToggleSubmit(form) {
26 var submit = jQuery(form).find('input:submit');
27 if (! submit.length) return;
28
29 var acceptances = jQuery(form).find('input:checkbox.wpcf7-acceptance');
30 if (! acceptances.length) return;
31
32 submit.removeAttr('disabled');
33 acceptances.each(function(i, n) {
34 n = jQuery(n);
35 if (n.hasClass('wpcf7-invert') && n.is(':checked') || ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
36 submit.attr('disabled', 'disabled');
37 });
38 }
39
40 function wpcf7BeforeSubmit(formData, jqForm, options) {
41 wpcf7ClearResponseOutput();
42 jQuery('img.ajax-loader', jqForm[0]).css({ visibility: 'visible' });
43
44 formData.push({name: '_wpcf7_is_ajax_call', value: 1});
45 jQuery(jqForm[0]).append('<input type="hidden" name="_wpcf7_is_ajax_call" value="1" />');
46
47 return true;
48 }
49
50 function wpcf7NotValidTip(into, message) {
51 jQuery(into).append('<span class="wpcf7-not-valid-tip">' + message + '</span>');
52 jQuery('span.wpcf7-not-valid-tip').mouseover(function() {
53 jQuery(this).fadeOut('fast');
54 });
55 jQuery(into).find(':input').mouseover(function() {
56 jQuery(into).find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
57 });
58 jQuery(into).find(':input').focus(function() {
59 jQuery(into).find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
60 });
61 }
62
63 function wpcf7ProcessJson(data) {
64 var wpcf7ResponseOutput = jQuery(data.into).find('div.wpcf7-response-output');
65 wpcf7ClearResponseOutput();
66 if (data.invalids) {
67 jQuery.each(data.invalids, function(i, n) {
68 wpcf7NotValidTip(jQuery(data.into).find(n.into), n.message);
69 });
70 wpcf7ResponseOutput.addClass('wpcf7-validation-errors');
71 }
72 if (data.captcha) {
73 jQuery.each(data.captcha, function(i, n) {
74 jQuery(data.into).find(':input[name="' + i + '"]').clearFields();
75 jQuery(data.into).find('img.wpcf7-captcha-' + i).attr('src', n);
76 var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
77 jQuery(data.into).find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
78 });
79 }
80 if (data.quiz) {
81 jQuery.each(data.quiz, function(i, n) {
82 jQuery(data.into).find(':input[name="' + i + '"]').clearFields();
83 jQuery(data.into).find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
84 jQuery(data.into).find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
85 });
86 }
87 if (1 == data.spam) {
88 wpcf7ResponseOutput.addClass('wpcf7-spam-blocked');
89 }
90 if (1 == data.mailSent) {
91 jQuery(data.into).find('form').resetForm().clearForm();
92 wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');
93
94 if (data.onSentOk)
95 jQuery.each(data.onSentOk, function(i, n) { eval(n) });
96 } else {
97 wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ng');
98 }
99 wpcf7ResponseOutput.append(data.message).fadeIn('fast');
100 }
101
102 function wpcf7ClearResponseOutput() {
103 jQuery('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
104 jQuery('span.wpcf7-not-valid-tip').remove();
105 jQuery('img.ajax-loader').css({ visibility: 'hidden' });
106 }