1jQuery(document).ready(function () { 2 3 document.addEventListener('wpcf7mailsent', function (event) { 4 jQuery('form.wpcf7-form').find(".evcf7_email_sent, .evcf7_error_sending_mail").remove(); 5 }, false); 6 7 document.addEventListener('wpcf7submit', function (event) { 8 jQuery(this).parents('form.wpcf7-form').find(".evcf7_email_sent, .evcf7_error_sending_mail").remove(); 9 }, false); 10 11 if (jQuery('form.wpcf7-form').find('input[name=verification]')) { 12 13 if (typeof evcf7Obj.evcf7_options.verify_button_text !== 'undefined') { 14 jQuery('form.wpcf7-form').each(function () { 15 if (jQuery(this).find('input[name=verification]:first').parents('span.verification').length > 0) { 16 jQuery(this).find('input[name=verification]:first').parents('span.verification').after('<p class="evcf7-verify-btn"><input type="button" name="evcf7-verify-email" value="' + evcf7Obj.evcf7_options.verify_button_text + '"><span class="loader"></span></p>'); 17 } else { 18 jQuery(this).find('input[name=verification]:first').parents('span[data-name="verification"]').after('<p class="evcf7-verify-btn"><input type="button" name="evcf7-verify-email" value="' + evcf7Obj.evcf7_options.verify_button_text + '"><span class="loader"></span></p>'); 19 } 20 }); 21 } 22 23 jQuery('body').on('click', 'form.wpcf7-form input[name=evcf7-verify-email]', function () { 24 var $this = jQuery(this); 25 jQuery(this).parents('form.wpcf7-form').find(".evcf7_email_sent, .evcf7_error_sending_mail, .wpcf7-not-valid-tip").remove(); 26 var form_id = $this.parents('form.wpcf7-form').find('input[name=_wpcf7]').val(); 27 var data_email = $this.parents('form.wpcf7-form').find('input[name=verification]').val(); 28 29 var currentrequest = null; 30 if (!Geekcodelab_isEmail(data_email)) { 31 alert(evcf7Obj.evcf7_options.invalid_format_message); 32 currentrequest = 1; 33 } else { 34 $this.prop('disabled', true); 35 $this.next().css("visibility", "visible"); 36 } 37 38 if (form_id != undefined && data_email != undefined && data_email != '') { 39 jQuery.ajax({ 40 url: evcf7Obj.ajaxurl, 41 type: 'POST', 42 beforeSend: function (xhr) { 43 if (currentrequest == 1) { 44 xhr.abort(); 45 } 46 }, 47 data: { 48 'action': 'evcf7_verify_email', 49 'data_email': data_email, 50 'form_id': form_id 51 }, 52 success: function (response) { 53 var form_parent = $this.parents('form.wpcf7-form'); 54 response = response.trim(); 55 form_parent.find('input[name=verification]:first').after(response.trim()); 56 57 var len = form_parent.find('.evcf7_email_sent').length; 58 if (len > 0) form_parent.find('.evcf7-verify-btn').remove(); 59 60 $this.next().css("visibility", "hidden"); 61 $this.prop('disabled', false); 62 63 } 64 }); 65 } 66 }); 67 } 68}); 69 70function Geekcodelab_isEmail(email) { 71 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 72 return regex.test(email); 73}
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.