jekyll-theme-consulting 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/contact_script.html +19 -22
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 901e4b7bd438ac7354731b1ea6edb29ad70b960cb10b3e4a02a0aaac61933e35
|
4
|
+
data.tar.gz: a981a4533dfee5301464c701c943eacd10f4c7e294bbb868ede9786b2a58bbb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be10235a1497cd00119c6f655deb26069566e459eb4df15bd893415e55fe9b403dcc22d6628a6c437c54568726954d1e570a66db591d12fd76ed2e149b073100
|
7
|
+
data.tar.gz: da2173d4be41f7d49a499f775e2ed189151462ce1a188126f3ef3d60076b5abbc18b93e3385f085e2c3c059e58be67d6c5aa3194527ce51c542cd5cfd2759056
|
@@ -37,9 +37,12 @@
|
|
37
37
|
contactFormElement.focus();
|
38
38
|
}
|
39
39
|
|
40
|
-
const {{ include.onsubmit_callback | default: 'processContactRequest
|
40
|
+
const {{ include.onsubmit_callback | default: 'processContactRequest' }} = function() {
|
41
41
|
if (grecaptcha.getResponse(recaptchaWidget).length > 0) {
|
42
42
|
sendContactMessage();
|
43
|
+
hideModalWindow();
|
44
|
+
resetContactForm();
|
45
|
+
grecaptcha.reset();
|
43
46
|
} else {
|
44
47
|
showModalWindow();
|
45
48
|
}
|
@@ -51,31 +54,25 @@
|
|
51
54
|
};
|
52
55
|
|
53
56
|
const sendContactMessage = function() {
|
54
|
-
const recaptchaToken = grecaptcha.getResponse(recaptchaWidget);
|
55
|
-
|
56
57
|
const data = {
|
57
58
|
name: encodeURIComponent(nameInputElement.value),
|
58
59
|
email: encodeURIComponent(emailInputElement.value),
|
59
60
|
message: encodeURIComponent(messageInputElement),
|
60
|
-
token:
|
61
|
+
token: grecaptcha.getResponse(recaptchaWidget)
|
61
62
|
};
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
.catch((error) => {
|
76
|
-
console.error('Error:', error);
|
77
|
-
});
|
78
|
-
}
|
63
|
+
|
64
|
+
fetch("{{ '/contact' | absolute_url }}", {
|
65
|
+
method: 'POST',
|
66
|
+
mode: 'same-origin',
|
67
|
+
headers: {'Content-Type': 'application/json',},
|
68
|
+
body: JSON.stringify(data),
|
69
|
+
})
|
70
|
+
.then((response) => {
|
71
|
+
alert('Message sent!');
|
72
|
+
})
|
73
|
+
.catch((error) => {
|
74
|
+
console.error('Error:', error);
|
75
|
+
});
|
79
76
|
};
|
80
77
|
|
81
78
|
var onRecaptchaLoadCallback = function() {
|
@@ -83,7 +80,7 @@
|
|
83
80
|
'sitekey' : '{{ site.recaptcha.sitekey }}',
|
84
81
|
'theme' : 'dark',
|
85
82
|
'size' : 'compact',
|
86
|
-
'callback' :
|
83
|
+
'callback' : processContactRequest
|
87
84
|
});
|
88
85
|
};
|
89
86
|
|