-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edits JavaScript files for formatting and linting
- Loading branch information
1 parent
cee743d
commit c87cc5e
Showing
2 changed files
with
41 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
/* show/hide on checkbox click */ | ||
function showMe (box) { | ||
|
||
var chboxs = document.getElementsByName("mc_nuke_all_styles"); | ||
var vis = "none"; | ||
for(var i=0;i<chboxs.length;i++) { | ||
if(chboxs[i].checked){ | ||
vis = "none"; | ||
} | ||
else{ | ||
var vis = ""; | ||
vis = ""; | ||
} | ||
} | ||
document.getElementById(box).style.display = vis; | ||
|
||
|
||
} | ||
// eslint-disable-next-line no-unused-vars -- used on window on click | ||
function showMe(box) { | ||
const chboxs = document.getElementsByName('mc_nuke_all_styles'); | ||
let vis = 'none'; | ||
for (let i = 0; i < chboxs.length; i++) { | ||
if (chboxs[i].checked) { | ||
vis = 'none'; | ||
} else { | ||
vis = ''; | ||
} | ||
} | ||
document.getElementById(box).style.display = vis; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
/* Form submission functions for the MailChimp Widget */ | ||
;(function($){ | ||
$(function($) { | ||
// Change our submit type from HTML (default) to JS | ||
$('#mc_submit_type').val('js'); | ||
|
||
// Attach our form submitter action | ||
$('#mc_signup_form').ajaxForm({ | ||
url: mailchimpSF.ajax_url, | ||
type: 'POST', | ||
dataType: 'text', | ||
beforeSubmit: mc_beforeForm, | ||
success: mc_success | ||
}); | ||
}); | ||
|
||
function mc_beforeForm(){ | ||
(function ($) { | ||
function mc_beforeForm() { | ||
// Disable the submit button | ||
$('#mc_signup_submit').attr("disabled","disabled"); | ||
$('#mc_signup_submit').attr('disabled', 'disabled'); | ||
} | ||
function mc_success(data){ | ||
|
||
function mc_success(data) { | ||
// Re-enable the submit button | ||
$('#mc_signup_submit').removeAttr("disabled"); | ||
$('#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(){ | ||
const reg = /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}}); | ||
$.scrollTo('#mc_signup', { offset: { top: -28 } }); | ||
} | ||
})(jQuery); | ||
|
||
$(function ($) { | ||
// Change our submit type from HTML (default) to JS | ||
$('#mc_submit_type').val('js'); | ||
|
||
// Attach our form submitter action | ||
$('#mc_signup_form').ajaxForm({ | ||
url: window.mailchimpSF.ajax_url, | ||
type: 'POST', | ||
dataType: 'text', | ||
beforeSubmit: mc_beforeForm, | ||
success: mc_success, | ||
}); | ||
}); | ||
})(window.jQuery); |