1// Index file for importing all modules 2 3import CheckMyForm from "./modules/gdm-form-validation.js"; 4// import toggleActiveClass from "./modules/toggleActiveClass.js"; 5 6// querySelectors of the form and form related containers 7 8// window.addEventListener("DOMContentLoaded", () => { 9const companyProfileUnitForm = document.querySelector( 10 "#company-profile-unit-form", 11); 12const companyProfileFormWrapper = document.querySelector("#gdm-form-wrapper"); 13const thankyouContainer = document.querySelector("#form-thank-you-container"); 14const recaptchaSecretKey = document.querySelector("#recaptcha-secret-key"); 15const captchaFetchLocation = 16 "/wp-content/plugins/vms-automation-gd/captcha.php"; 17const ajaxPhpLocation = 18 "/wp-content/themes/goodlife-wp-B2B/companyprofile-ajaxcall.php"; 19 20const formRevealButton = document.querySelector("#reveal-form-btn"); // use querySeectorAll for multiple forms in same page and adjust logic relevantly 21const formRevealButtonWrapper = document.querySelector( 22 ".reveal-form-btn__wrapper", 23); 24const formRevealInput = document.querySelector("#form-reveal-input"); 25const hiddenForm = document.querySelector(".reveal-form__wrapper"); 26 27if (companyProfileUnitForm) { 28 // check iform is true 29 30 // create new instance for check my form 31 32 // 1. Pass in th form 33 // 2. Pass in thank you container 34 // 3. pass in captchkey 35 // 4. pass in form wrapper 36 // 5. pass in captcha php file location and ajax location 37 38 const validateCompanyForm = new CheckMyForm( 39 companyProfileUnitForm, 40 thankyouContainer, 41 recaptchaSecretKey, 42 companyProfileFormWrapper, 43 captchaFetchLocation, 44 ajaxPhpLocation, 45 ); 46 47 validateCompanyForm.initFormValidation(); // initialize the form validation 48} 49 50function revealForm() { 51 if (!formRevealInput.classList.contains("active")) { 52 formRevealInput.classList.add("active"); 53 formRevealButtonWrapper.classList.add("active"); 54 55 hiddenForm.classList.add("active"); 56 formRevealButton.style.display = "none"; 57 } 58} 59if (formRevealButton) { 60 formRevealButton.addEventListener("click", (event) => { 61 event.preventDefault(); 62 revealForm(); 63 }); 64} 65 66if (formRevealInput) { 67 formRevealInput.addEventListener("keypress", (event) => { 68 if (event.key === "Enter") { 69 event.preventDefault(); 70 revealForm(); 71 } 72 }); 73} 74//}); 75 76// const articleShareButton = document.querySelectorAll( 77// ".gdm-article-share__button" 78// ); 79// const shareButtonListContainer = document.querySelectorAll( 80// ".gdm-article-share-list__container " 81// ); 82 83// //toggle btn and toggle container 84 85// // pass in event tracker value as boolean as third argument 86// //pass in the class name to track the event for specific functionality 87 88// articleShareButton && 89// articleShareButton.length && 90// articleShareButton.forEach((btn) => { 91// // console.dir(btn); 92 93// const [...btnChildren] = btn.children; 94 95// btnChildren.forEach((child) => { 96// toggleActiveClass(btn, child, true, "copy-link", true, "blank"); 97// }); 98// }); 99 100jQuery("#newsletter_opt_in").click(function () { 101 if (jQuery(this).is(":checked")) { 102 jQuery(this).val("No"); 103 } else { 104 jQuery(this).val("Yes"); 105 } 106});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.