1var submitForm = {}; 2$(document).ready(function(){ 3 4 //hover 5 const $box = $('.form-control'); 6 const timeout = 200; 7 // $box.focus({ preventScroll: true }) 8 9 // Handle hover, focus, and active states 10 $box.on('mouseenter mousedown', function () { 11 $(this).parent('div').find('.form-label').addClass('active'); 12 13 setTimeout(() => { 14 $(this).addClass('active'); 15 }, timeout); 16 17 }); 18 19 $box.on('mouseleave mouseup', function () { 20 $(this).parent('div').find('.form-label').removeClass('active'); 21 $(this).removeClass('active'); 22 }); 23 24 // $box.on('mouseup', function () { 25 // if ($(this).is(':focus')) { 26 // $(this).parent('div').find('.form-label').addClass('active'); 27 28 // setTimeout(() => { 29 // $(this).addClass('active'); 30 // }, timeout); 31 // } 32 // }); 33 34 $box.on('input', function () { 35 const $label = $(this).parent('div').find('.form-label'); 36 if ($(this).val() === '') { 37 $label.removeClass('full'); 38 $(this).removeClass('full'); 39 } else { 40 $label.addClass('full'); 41 42 setTimeout(() => { 43 $(this).addClass('full'); 44 }, timeout); 45 } 46 }); 47 48 $box.on('focus', function () { 49 $(this).parent('div').find('.form-label').addClass('focus'); 50 51 setTimeout(() => { 52 $(this).addClass('focus'); 53 }, timeout); 54 }); 55 56 $box.on('blur', function () { 57 $(this).parent('div').find('.form-label').removeClass('focus'); 58 $(this).removeClass('focus'); 59 }); 60 61 62 63 //contact 64 65 if($('.ccm-block-express-form').hasClass('contact')){ 66 $('.form-group.at-telephone, .form-group.at-email').wrapAll('<div class="form-side-by-side"></div>'); 67 } 68 69 70 71 72 var loadHiddenV2Captcha = function(){ 73 $('.recaptcha-script').each(function () { 74 if (!this.getAttribute('src') && this.getAttribute('data-src')) { 75 this.setAttribute('src', this.getAttribute('data-src')); 76 this.removeAttribute('data-src'); 77 $('.g-recaptcha-response-hidden').remove(); 78 } 79 }) 80 } 81 if($(this).find('button[data-callback]').length > 0){ 82 var inputPrivacy = $('[name="privacy-policy"]'); 83 if (inputPrivacy.length > 0 ){ 84 $('[name="privacy-policy"]').click(function(){ 85 loadHiddenV2Captcha(); 86 }); 87 }else{ 88 loadHiddenV2Captcha(); 89 } 90 91 } 92 // $('.at-address.required-field').each(function(){ 93 // $(this).find('.ccm-attribute-address-') 94 // }) 95 // $('.required-field .form-check-input, .required-field input[type="radio"]').closest('.required-field').addClass('required-checkbox'); 96 //required as show input not available if using invisible captcha 97 if($(this).find('.form-group.captcha').length == 0){ 98 $('[name="privacy-policy"]').click(function(){ 99 $('.recaptcha-script').each(function () { 100 if (!this.getAttribute('src') && this.getAttribute('data-src')) { 101 this.setAttribute('src', this.getAttribute('data-src')); 102 this.removeAttribute('data-src'); 103 $('.g-recaptcha-response-hidden').remove(); 104 } 105 }) 106 }); 107 } 108 // $('.ccm-block-express-form form button[type="submit"]').click(function(e){ 109 // var thisForm = $(this).closest('form'), valid = true, index = 0, requiredCheckboxes = thisForm.find('.required-checkbox'), requiredNumbers = thisForm.find('.required-field.at-number'); 110 // if (requiredCheckboxes.length > 0) { 111 // while (index < requiredCheckboxes.length) { 112 // var thisFieldValid =true; 113 // var thisVal = $(requiredCheckboxes[index]).find('input:checked').val(); 114 // if (typeof thisVal === 'undefined' || thisVal === ''){ 115 // valid = false; 116 // thisFieldValid =false; 117 // $(requiredCheckboxes[index]).addClass('is-invalid').find('input[type="checkbox"], input[type="radio"]').click(function(){ 118 // $(this).closest('.is-invalid').removeClass('is-invalid') 119 // }); 120 // } 121 // if (thisFieldValid){ 122 // $(requiredCheckboxes[index]).removeClass('is-invalid'); 123 // } 124 // index++; 125 // } 126 // } 127 128 // if (!thisForm[0].checkValidity() || !valid) { 129 // e.preventDefault(); 130 // e.stopPropagation(); 131 // } 132 133 // thisForm.addClass('was-validated')
134 // thisForm.find('.invalid-feedback:visible').attr('role', 'alert') 135 // thisForm.find('input:invalid,select:invalid,textarea:invalid').first().focus() 136 // }) 137 138 139}) 140
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.