https://www.nomadtravel.co.uk/wp-content/plugins/woo-wallet/assets/js/frontend/wc-endpoint-wallet.js
1/* global wallet_param */ 2 3jQuery(function ($) { 4 var transactionDetailsDataTable = $('#wc-wallet-transaction-details').DataTable( 5 { 6 processing: true, 7 serverSide: true, 8 ajax: { 9 url: wallet_param.ajax_url, 10 type: 'POST', 11 data: { 12 action: 'draw_wallet_transaction_details_table', 13 security: wallet_param.transaction_table_nonce 14 } 15 }, 16 columns: wallet_param.columns, 17 responsive: true, 18 searching: true, 19 language: { 20 emptyTable: wallet_param.i18n.emptyTable, 21 zeroRecords: wallet_param.i18n.zeroRecords, 22 lengthMenu: wallet_param.i18n.lengthMenu, 23 info: wallet_param.i18n.info, 24 infoEmpty: wallet_param.i18n.infoEmpty, 25 infoFiltered: wallet_param.i18n.infoFiltered, 26 paginate: wallet_param.i18n.paginate, 27 processing: wallet_param.i18n.processing, 28 search: wallet_param.i18n.search 29 }, 30 initComplete: function () { 31 $('#wc-wallet-transaction-details_wrapper .dataTables_filter input').attr('placeholder', wallet_param.i18n.placeholder); 32 $('#wc-wallet-transaction-details_wrapper .dataTables_filter input').datepicker({ 33 dateFormat: 'yy-mm-dd', 34 maxDate: new Date(), 35 onSelect: function (dateText) { 36 transactionDetailsDataTable.search(dateText).draw(); 37 } 38 }); 39 } 40 } 41 ); 42 $('.woo-wallet-select2').selectWoo({ 43 language: { 44 inputTooShort: function () { 45 if (wallet_param.search_by_user_email) { 46 return wallet_param.i18n.non_valid_email_text; 47 } 48 return wallet_param.i18n.inputTooShort; 49 }, 50 noResults: function () { 51 if (wallet_param.search_by_user_email) { 52 return wallet_param.i18n.non_valid_email_text; 53 } 54 return wallet_param.i18n.no_resualt; 55 }, 56 searching: function () { 57 return wallet_param.i18n.searching; 58 } 59 }, 60 minimumInputLength: 3, 61 ajax: { 62 url: wallet_param.ajax_url, 63 dataType: 'json', 64 type: 'POST', 65 delay: 250, 66 data: function (term) { 67 return { 68 action: 'woo-wallet-user-search', 69 security: wallet_param.search_user_nonce, 70 autocomplete_field: 'ID', 71 term: term.term 72 }; 73 }, 74 processResults: function (data) { 75 // Tranforms the top-level key of the response object from 'items' to 'results' 76 return { 77 results: $.map(data, function (item) { 78 return { 79 id: item.value, 80 text: item.label 81 }; 82 }) 83 }; 84 } 85 } 86 }); 87 $('#woo_wallet_transfer_form').submit(function () { 88 // submit more than once return false 89 $(this).submit(function () { 90 return false; 91 }); 92 // submit once return true 93 return true; 94 }); 95});
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.