1( function( $ ) { 2 $( 'body' ).on( 'change', '.wcdpp_checkout_radio', function() { 3 $( document.body ).trigger( 'update_checkout' ); 4 }); 5 $( 'body' ).on( 'updated_checkout', function() { 6 // Show the custom deposit amount field 7 if( $( 'body' ).find( '.wcdpp_checkout_radio:checked' ).val() == 'custom' ) { 8 $( '#wcdpp_user_defined_deposit' ).show(); 9 } else { 10 $( '#wcdpp_user_defined_deposit' ).hide(); 11 } 12 }); 13 $( 'body' ).on( 'focus', '#wcdpp_user_defined_deposit', function() { 14 $( 'input[name=wcdpp_deposit_field][value=custom]' ).prop( 'checked', true ); 15 }); 16 $( 'body' ).on( 'keyup', '#wcdpp_user_defined_deposit', function() { 17 var max = $( this ).attr( 'max' ); 18 if( max && $( this ).val() > parseFloat( max ) ) { 19 $( this ).val( max ); 20 } 21 $( document.body ).trigger( 'update_checkout' ); 22 }); 23 // Create a user-defined part payment 24 $( '#wcdpp_make_part_payment' ).on( 'click', function( e ) { 25 e.preventDefault(); 26 $( 'body' ).scrollTop( 0 ); 27 $( '#order_review' ).block({ 28 message: null, 29 overlayCSS: { 30 backgroundColor: '#fff', 31 opacity: 0.6, 32 cursor: 'wait' 33 }, 34 }); 35 $.ajax({ 36 type: 'POST', 37 url: wcdpp_vars.ajaxurl, 38 data: { 39 action: 'wcdpp_make_part_payment', 40 security: $( '#wcdpp_make_part_payment_nonce' ).val(), 41 amount: $( '#wcdpp_optional_part_payment' ).val(), 42 order_id: wcdpp_vars.order_id 43 }, 44 success: function( response ) { 45 // Redirect here 46 window.location.reload(); 47 48 } 49 }); 50 }); 51 52}) ( jQuery );
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.