-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathservices_mc.js
More file actions
46 lines (40 loc) · 1.24 KB
/
Copy pathservices_mc.js
File metadata and controls
46 lines (40 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Form submission functions for the MailChimp Widget */
;(function($){
$(function($) {
$('#mc_submit_type').val('js');
$('#mc_signup_form').ajaxChimp({
url: 'https://engineyard.us10.list-manage.com/subscribe/post?u=357ed40192fe99974e132c922&id=afe7ebf4de',
callback: callbackFunction
});
});
function callbackFunction (resp) {
$("#mce-EMAIL,#mce-NAME").removeClass('error');
switch(resp.msg[0]) {
case '0':
$("#mce-EMAIL").addClass('error');
break;
case '1':
$("#mce-NAME").addClass('error');
break;
}
}
function mc_beforeForm(){
// Disable the submit button
$('#mc_signup_submit').attr("disabled","disabled");
}
function mc_success(data){
// Re-enable the submit button
$('#mc_signup_submit').removeAttr("disabled");
// Put the response in the message div
$('#mc_message').html(data);
// See if we're successful, if so, wipe the fields
var reg = new RegExp("class='mc_success_msg'", 'i');
if (reg.test(data)){
$('#mc_signup_form').each(function(){
this.reset();
});
$('#mc_submit_type').val('js');
}
$.scrollTo('#mc_signup', {offset: {top: -28}});
}
})(jQuery);