1var ifcf7_login_signup = { 2 3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 5 init_fields: function(element){ 6 if(!jQuery(element).hasClass('ifcf7_login_signup')){ 7 return; 8 } 9 jQuery(element).on('wpcf7cf_change_step', function(e, previousStep, currentStep){ 10 jQuery(e.currentTarget).find('input[type="hidden"][name="email_exists"]').val('').trigger('change'); 11 if(2 !== currentStep){ 12 return; 13 } 14 var user_email = jQuery(e.currentTarget).find('input[type="email"][name="user_email"]').val(); 15 jQuery(e.currentTarget).find('.ifcf7_login_signup_loading').html('<span class="ifcf7-spinner mb-3"><span></span></span>'); 16 if('' !== user_email){ 17 ifcf7_login_signup.submit_disabled = jQuery(element).find('.wpcf7-submit').is(':disabled'); 18 if(!ifcf7_login_signup.submit_disabled){ 19 jQuery(element).find('.wpcf7-submit').addClass('disabled'); 20 } 21 jQuery.ajax({ 22 beforeSend: function(xhr){ 23 xhr.setRequestHeader('X-WP-Nonce', wpApiSettings.nonce); 24 }, 25 data: { 26 user_email: user_email, 27 }, 28 method: 'POST', 29 url: wpApiSettings.root + 'ifcf7/v1/user-email-exists', 30 }).done(function(response){ 31 jQuery(e.currentTarget).on('wpcf7cf_show_group', ifcf7_login_signup.wpcf7cf_show_group); 32 jQuery(e.currentTarget).find('input[type="hidden"][name="email_exists"]').val(response.user_email_exists).trigger('change'); 33 }).fail(function(response){ 34 jQuery(e.currentTarget).find('.ifcf7_login_signup_loading').html('<div class="alert alert-danger" role="alert">' + response.responseJSON.message + '</div>'); 35 }); 36 jQuery(e.currentTarget).find('.ifcf7_login_signup_user_email').text(user_email); 37 } else { 38 jQuery(e.currentTarget).find('.ifcf7_login_signup_user_email').text('@'); 39 } 40 }); 41 }, 42 43 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 45 load: function(){ 46 jQuery(function($){ 47 $('.wpcf7-form').each(function(){ 48 ifcf7_login_signup.init_fields(this); 49 }); 50 }); 51 }, 52 53 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 55 submit_disabled: false, 56 57 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 58 59 wpcf7cf_show_group: function(e){ 60 jQuery(e.currentTarget).find('.ifcf7_login_signup_loading').html(''); 61 jQuery(e.currentTarget).off('wpcf7cf_show_group', ifcf7_login_signup.wpcf7cf_show_group); 62 if(!ifcf7_login_signup.submit_disabled){ 63 jQuery(e.currentTarget).find('.wpcf7-submit').removeClass('disabled'); 64 } 65 }, 66 67 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 69};
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.