1/** 2 * Gift card balance check. 3 * 4 * @since 1.0.0 5 * @package Wt_Woocommerce_Gift_Cards 6 */ 7 8jQuery( document ).ready( 9 function ($) { 10 $( '#wt_gc_check_balance_form' ).on( 11 'submit', 12 function (e) { 13 e.preventDefault(); 14 var form = $( this ); 15 var resultDiv = $( '#wt_gc_balance_result' ); 16 17 $.ajax( 18 { 19 url: wt_gc_balance_check_params.ajax_url, 20 type: 'POST', 21 data: { 22 action: 'wt_gc_check_balance', 23 nonce: wt_gc_balance_check_params.nonce, 24 coupon_code: form.find( '#wt_gc_coupon_code' ).val(), 25 restricted_email: form.find( '#wt_gc_restricted_email' ).val() 26 }, 27 beforeSend: function () { 28 form.find( 'button[type="submit"]' ).prop( 'disabled', true ); 29 resultDiv.html( '' ).removeClass( 'wt_gc_balance_success wt_gc_balance_error' ); 30 }, 31 success: function (response) { 32 if (response.success) { 33 resultDiv.html( response.data.message ).addClass( 'wt_gc_balance_success' ); 34 } else { 35 resultDiv.html( response.data ).addClass( 'wt_gc_balance_error' ); 36 } 37 }, 38 error: function () { 39 resultDiv.html( wt_gc_balance_check_params.ajax_error ).addClass( 'wt_gc_balance_error' ); 40 }, 41 complete: function () { 42 form.find( 'button[type="submit"]' ).prop( 'disabled', false ); 43 } 44 } 45 ); 46 } 47 ); 48 } 49);
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.