1$('#withdraw').val(0); 2$('#withdraw').focus(); 3 4$(document).on('keyup', '#withdraw', function (event) { 5 let nominal = $(this).val().replace(/\D/g, ''); 6 let limit = (5 * 1e8); 7 8 $(this).val(nominal).priceFormat({ 9 prefix: '', 10 centsLimit: 0, 11 thousandsSeparator: '.' 12 }); 13 14 if (nominal > limit) { 15 $(this).val(limit).priceFormat({ 16 prefix: '', 17 centsLimit: 0, 18 thousandsSeparator: '.' 19 }); 20 } 21 22 $('#withdraw_nominal').val(nominal); 23 setTimeout(function () { 24 $('#btnWithdraw').attr('disabled', false); 25 }, 500); 26 27}); 28 29$('#formWithdraw').submit(function (e) { 30 if ($('#btnWithdraw').attr('disabled')) { 31 e.preventDefault(); 32 return false; 33 } else { 34 e.preventDefault(); 35 // if (foo($('#withdraw_nominal').val())) { 36 $('#btnWithdraw').attr('disabled', true); 37 $('#btnWithdraw').html('loading...'); 38 39 $.ajax({ 40 url: location.origin + '/withdraw/request', 41 method: 'post', 42 data: $(this).serialize(), 43 success: function (response) { 44 45 if (response.status == "success") { 46 47 buzzer({ 48 status: "success", 49 msg: response.message 50 }); 51 52 setTimeout(function () { 53 window.location.reload(); 54 }, 1500); 55 56 } else { 57 $.each(response.errors, function (key, value) { 58 buzzer({ 59 status: "error", 60 msg: value 61 }); 62 }); 63 64 $('#btnWithdraw').html('Kirim'); 65 $('#btnWithdraw').attr('disabled', false); 66 } 67 }, 68 error: function (e) { 69 buzzer({ 70 status: "error", 71 msg: "Something when wrong, please report to customer service." 72 }); 73 74 $('#btnWithdraw').html('Kirim'); 75 $('#btnWithdraw').attr('disabled', false); 76 77 } 78 }); 79 80 // } else { 81 // 82 // buzzer({ 83 // status: "error", 84 // msg: 'withdraw harus kelipatan : 1.000' 85 // }); 86 // 87 // $('#btnWithdraw').html('Kirim'); 88 // $('#btnWithdraw').attr('disabled', false); 89 // 90 // } 91 } 92}); 93 94function foo(nominal) { 95 if (nominal % 1000 == 0) { 96 return true 97 } else { 98 return false 99 } 100} 101 102// delay on keyup stop 103function delay(callback, ms) { 104 var timer = 0; 105 return function () { 106 var context = this, args = arguments; 107 clearTimeout(timer); 108 timer = setTimeout(function () { 109 callback.apply(context, args); 110 }, ms || 0); 111 }; 112}
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.