1jQuery(function($){ 2 3 const blockedDomains = ["gmail.com", "yahoo.com", "icloud.com", "outlook.com", "hotmail.com", "hotmail.co.uk"]; 4 function isBlockedEmail(email) { 5 const val = String(email || '').trim().toLowerCase(); 6 const atIndex = val.lastIndexOf('@'); 7 if (atIndex === -1) return false; 8 const domain = val.slice(atIndex + 1); 9 return blockedDomains.includes(domain); 10 } 11 12 jQuery('.customerio-form-container .customerio-dropdown-selector').each(function () { 13 jQuery(this).find('p.question').click(function () { 14 jQuery(this).parent().toggleClass('active') 15 }) 16 }) 17 18 jQuery('input[name="lead-type"]').on('change', function() { 19 var isOtherSelected = jQuery('#businessDescription4').is(':checked'); 20 var otherInput = jQuery('.customerio-form-container .customerio-dropdown-selector .other-text-input'); 21 22 if (isOtherSelected) { 23 otherInput.attr('required', true); 24 } else { 25 otherInput.removeAttr('required'); 26 } 27 }); 28// jQuery('.customerio-form-container .customerio-dropdown-selector').each(function () { 29// const dropdown = jQuery(this); 30// dropdown.find('fieldset input[type="radio"]').on('change', function () { 31// dropdown.removeClass('active'); 32// }); 33// }); 34// jQuery('.plnb-article-content div:has(.customerio-form-container input[type=email])').each(function () { 35 36 const emailInput = jQuery('.customerio-form-container form input[type=email]'); 37 const dropdown = jQuery('.customerio-form-container .customerio-dropdown-selector'); 38 39 emailInput.on('click', function () { 40// const emailValue = jQuery(this).val(); 41// const emailParts = emailValue.split('@'); 42 dropdown.removeClass('hidden'); 43 44 }); 45// }) 46 47 jQuery('input[name="lead-type"]').on('change', function() { 48 if (jQuery('#businessDescription4').is(':checked')) { 49 jQuery('.other-text-input').addClass('active'); 50 } else { 51 jQuery('.other-text-input').removeClass('active'); 52 } 53 }); 54 55 56// const siteId = 'e84f267b5f4686bca695'; 57// const formId = 'test_customerio_form'; 58// const successUrl = 'https://planable.io/'; 59 60 // Loop through each form container 61 jQuery('.customerio-form-container').each(function () { 62 const container = jQuery(this); 63 const form = container.find('form'); 64 65 // Set form action dynamically 66// form.attr('action', 67// 'https://customerioforms.com/forms/submit_action' + 68// '?form_id=' + formId + 69// '&site_id=' + siteId + 70// '&success_url=' + encodeURIComponent(successUrl) 71// ); 72 73 // Handle submit button click 74 container.find('button.plnb-button-tertiary').on('click', function (e) { 75 let hasError = false; 76 77 // Email validation 78 const emailInput = form.find('input[type="email"][required]'); 79 const emailVal = jQuery.trim(emailInput.val()); 80 const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 81 const skipDomainValidation = container.hasClass('allow-personal-email'); 82 83 if ( 84 emailInput.length && 85 ( 86 emailVal === '' || 87 !emailRegex.test(emailVal) || 88 (!skipDomainValidation && isBlockedEmail(emailVal)) 89 ) 90 ) { 91 emailInput.css('outline', '2px solid var(--plnb-clr-red-400)'); 92 hasError = true; 93 form.find('.customerio-email-error').show(); 94 } else { 95 emailInput.css('outline', ''); 96 form.find('.customerio-email-error').hide(); 97 } 98 99 100 // Radio inputs validation 101 container.find('.customerio-dropdown-selector').each(function () { 102 const selector = jQuery(this); 103 const hasChecked = selector.find('input[type="radio"]:checked').length > 0; 104 105 if (!hasChecked) { 106 selector.css('outline', '2px solid var(--plnb-clr-red-400)'); 107 hasError = true; 108 } else { 109 selector.css('outline', ''); 110 } 111 }); 112 113 if (hasError) { 114 e.preventDefault(); 115 } 116 }); 117 118 // Auto-remove border on radio select 119 container.find('.customerio-dropdown-selector input[type="radio"]').on('change', function () { 120 jQuery(this).closest('.customerio-dropdown-selector').css('outline', ''); 121 }); 122
123 // Auto-remove red border on email blur if valid 124 form.find('input[type="email"][required]').on('blur', function () { 125 const emailVal = jQuery.trim(jQuery(this).val()); 126 const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 127 const skipDomainValidation = container.hasClass('allow-personal-email'); 128 129 if (emailVal !== '' && emailRegex.test(emailVal) && (skipDomainValidation || !isBlockedEmail(emailVal))) { 130 jQuery(this).css('outline', ''); 131 form.find('.customerio-email-error').hide(); 132 } else if (emailVal !== '' && emailRegex.test(emailVal) && !skipDomainValidation && isBlockedEmail(emailVal)) { 133 jQuery(this).css('outline', '2px solid var(--plnb-clr-red-400)'); 134 form.find('.customerio-email-error').show(); 135 } 136 }); 137 138 }); 139 140 jQuery('.et_pb_toggle_title').click(function(){ 141 var $toggle = jQuery(this).closest('.et_pb_toggle'); 142 if (!$toggle.hasClass('et_pb_accordion_toggling')) { 143 var $accordion = $toggle.closest('.et_pb_accordion'); 144 if ($toggle.hasClass('et_pb_toggle_open')) { 145 $accordion.addClass('et_pb_accordion_toggling'); 146 $toggle.find('.et_pb_toggle_content').slideToggle(250, function() { 147 $toggle.removeClass('et_pb_toggle_open').addClass('et_pb_toggle_close'); 148 149 }); 150 } 151 setTimeout(function(){ 152 $accordion.removeClass('et_pb_accordion_toggling'); 153 }, 300); 154 } 155 }); 156 157 function handleFooterExpandableMenus() { 158 jQuery(".drop-down-title").each(function() { 159 jQuery(this).on('click', function() { 160 jQuery(this).toggleClass("active"); 161 jQuery(this).siblings("ul").toggleClass("active"); 162 }) 163 }) 164 } 165 166 // jQuery plugin for Use Case pages -> show/reveal blocks 167 jQuery.fn.extend({ 168 handleUseCaseBlocks: function (options) { 169 // $this represents the main row which is shown initially on mobile 170 var $this = this; 171 172 var settings = jQuery.extend( 173 { 174 buttonLoad: ".primary-button.load-blocks", 175 usualButton: ".primary-button:not(.load-blocks)", 176 rowSelector: ".use-case-squares-row", 177 sectionSelector: ".et_pb_section", 178 gradientClass: "has-gradient" 179 }, 180 options 181 ); 182 183 const $parentSection = $this.parents(settings.sectionSelector); 184 185 $this.hideUsualButtons = function() { 186 $parentSection.find(settings.usualButton).hide(); 187 } 188 $this.showUsualButtons = function() { 189 $parentSection.find(settings.usualButton).show(); 190 } 191 192 $this.handleLoadMore = function() { 193 $parentSection.find(settings.buttonLoad).on('click', function(e) { 194 e.preventDefault(); 195 // find all rows and show them 196 $this.parents(settings.sectionSelector).find(settings.rowSelector).css("display", "grid"); 197 // hide load more button 198 jQuery(this).hide(); 199 // show other buttons 200 $this.showUsualButtons() 201 // disable gradient 202 $this.removeClass(settings.gradientClass); 203 }) 204 } 205 206 $this.init = function () { 207 $this.hideUsualButtons(); 208 $this.handleLoadMore(); 209 }; 210 211 $this.init(); 212 213 return $this; 214 }, 215 }); 216 217 // call functions 218 handleFooterExpandableMenus(); 219 if(jQuery(".use-case-squares-row.mobile-main").length > 0){ 220 jQuery(".use-case-squares-row.mobile-main").each(function() { 221 if((jQuery(this).parents(".et_pb_section").find(".et_pb_button.load-blocks:visible").length > 0)){ 222 jQuery(this).handleUseCaseBlocks(); 223 } 224 }) 225 } 226 227 // Handle lottie thumbnails 228 function handleLottieThumbnails() { 229 if (jQuery("lottie-player").length === 0) return; 230 231 jQuery("lottie-player").each(function() { 232 const thumbnail = jQuery(this).attr("data-thumbnail"); 233 console.log('thumbnail', thumbnail); 234 if (!thumbnail) return; 235 jQuery(this).on('load', function() { 236 console.log('loaded'); 237 jQuery(`.${thumbnail}`).hide(); 238 }) 239 }) 240 } 241 242// handleLottieThumbnails(); 243 244// if (document.querySelectorAll("body.page-id-968639").length > 0) { 245// document.querySelector(".step-inputs-container.step1 .plnb-button-primary").addEventListener('click', function() { 246// analytics.track('book-a-demo',{ 247// "user_email": document.getElementById("email").value, 248// "user_fullname": document.getElementById("firstName").value + " " + document.getElementById("lastName").value, 249// "user_company_website": document.getElementById("companyWebsite").value, 250// "user_phone_number": document.getElementById("phone").value 251// }) 252// }) 253// } 254 255 setTimeout(function () { 256 if ( 257 jQuery('body').is('.page-id-972710, .page-id-972827, .page-id-972851, .page-id-972917, .page-id-972928') 258 ) { 259 var label = jQuery('.seva-form.formkit-form .formkit-checkboxes label').first(); 260 261 if (label.length) { 262 var text = label.html(); 263 264 if (typeof text === 'string') { 265 var match = text.match(/\((https?:\/\/[^\)]+)\)/); 266 267 if (match && match[1] && text.includes('Privacy Policy')) { 268 var url = match[1]; 269 var updatedText = text 270 .replace('(' + url + ')', '') // Remove the parentheses and URL 271 .replace( 272 'Privacy Policy', 273 '<a href="' + url + '" target="_blank" rel="noopener">Privacy Policy</a>' 274 ); 275 label.html(updatedText); 276 } 277 } 278 } 279 } 280 }, 100) 281 282}); 283 284 285// Testing tracked anon iframe 286jQuery(function () { 287 if (typeof analytics === "undefined" || typeof analytics.ready !== "function") return; 288 289 analytics.ready(function () { 290 var anonymousId; 291 try {
292 anonymousId = analytics.user().anonymousId(); 293 } catch (e) {} 294 295 var ta = (typeof window.tracked_anon === "string" && window.tracked_anon) ? window.tracked_anon : null; 296 if (!ta && !anonymousId) return; 297 298 var $iframe = jQuery("#dynamicIframe"); 299 if (!$iframe.length) return; 300 301 var base = $iframe.attr("data-src") || $iframe.attr("src"); 302 if (!base) return; 303 304 var u = new URL(String(base), window.location.href); 305 u.searchParams.delete("tracked_anon"); 306 u.searchParams.delete("anonymousId"); 307 if (ta) u.searchParams.set("tracked_anon", ta); 308 if (anonymousId) u.searchParams.set("anonymousId", anonymousId); 309 310 $iframe.attr("src", u.toString()); 311 }); 312});
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.