1jQuery( document ).ready(function() { 2 3 4 5 function verify_apple_domain() { 6 jQuery('.apple_domain_error').text(''); 7 jQuery('.apple_verify_domain').prop('disabled', true); 8 jQuery('.apple_verify_domain').text('Verifying'); 9 var data = { 10 'action' : 'verify_apple_domain', 11 'verify_apple_nonce' : jQuery('#apple_domain_verification').val(), 12 } 13 jQuery.ajax({ 14 url: my_ajax_backend_scripts.ajax_url, // Replace with your server-side URL 15 type: 'POST', // Or 'GET' depending on your backend 16 data: data, // Send the input value to the server 17 success: function (response) { 18 var response = JSON.parse(response); 19 if(response.verification_result){ 20 jQuery('.apple_verify_domain').html('<i class="fa fa-check-square" aria-hidden="true"></i> Verified'); 21 jQuery('.apple_verify_domain').prop('disabled', true); 22 } else { 23 jQuery('.apple_verify_domain').text('Verify domain'); 24 jQuery('.apple_domain_error').text(response.message); 25 jQuery('.apple_verify_domain').prop('disabled', false); 26 } 27 }, 28 error: function (xhr, status, error) { 29 // Handle errors 30 console.error('AJAX Error:', error); 31 } 32 }); 33 } 34 if(jQuery('#apple_pay'+square_index_params.sandbox+'_enabled:checked').length){ 35 36 if (jQuery('#apple_pay'+square_index_params.sandbox+'_enabled').is(':checked')) { 37 // Show the Verify domain button if checked 38 jQuery('.apple_verify_domain').show(); 39 verify_apple_domain(); 40 } else { 41 // Hide the Verify domain button if unchecked 42 jQuery('.apple_verify_domain').hide(); 43 } 44 } 45 jQuery('#apple_pay'+square_index_params.sandbox+'_enabled').on('change', function() { 46 // Check if the checkbox is checked 47 if (jQuery(this).is(':checked')) { 48 // Show the Verify domain button if checked 49 jQuery('.apple_verify_domain').show(); 50 } else { 51 // Hide the Verify domain button if unchecked 52 jQuery('.apple_verify_domain').hide(); 53 } 54 }); 55 jQuery(".apple_verify_domain").click(function (event) { 56 57 event.preventDefault(); 58 verify_apple_domain(); 59 }); 60 if(jQuery('.applePayEnable:checked').length){ 61 if (jQuery('.applePayEnable').is(':checked')) { 62 63 // Show the Verify domain button if checked 64 jQuery('.apple_verify_domain').show(); 65 verify_apple_domain(); 66 } else { 67 // Hide the Verify domain button if unchecked 68 jQuery('.apple_verify_domain').hide(); 69 } 70 } 71 jQuery('.applePayEnable').on('change', function() { 72 // Check if the checkbox is checked 73 if (jQuery(this).is(':checked')) { 74 // Show the Verify domain button if checked 75 jQuery('.apple_verify_domain').show(); 76 } else { 77 // Hide the Verify domain button if unchecked 78 jQuery('.apple_verify_domain').hide(); 79 } 80 }); 81 jQuery(".apple_verify_domain").click(function (event) { 82 83 event.preventDefault(); 84 verify_apple_domain(); 85 }); 86 87});
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.