1(function ($) { 2 "use strict"; 3 4 5 jQuery(document).ready(function ($) { 6 var searchTimer = null; 7 8 $('#search-form-wrapper').on('submit', function (e) { 9 e.preventDefault(); 10 }); 11 12 $('#search-input').on('input', function () { 13 var keyword = $(this).val().trim(); 14 15 clearTimeout(searchTimer); 16 $('#search-results').stop(true, true).hide().empty(); 17 18 if (keyword.length < 3) { 19 $('#search-spinner').hide(); 20 return; 21 } 22 23 searchTimer = setTimeout(function () { 24 $('#search-spinner').show(); 25 26 $.ajax({ 27 type: 'POST', 28 url: custom_ajax_search_params.ajax_url, 29 data: { 30 action: 'custom_ajax_search', 31 keyword: keyword, 32 nonce: custom_ajax_search_params.nonce 33 }, 34 success: function (response) { 35 $('#search-spinner').hide(); 36 $('#search-results').html(response).slideDown(180); 37 }, 38 error: function () { 39 $('#search-spinner').hide(); 40 $('#search-results') 41 .html('<div class="txa-sr-wrap"><div class="txa-sr-empty"><p>Something went wrong. Please try again.</p></div></div>') 42 .slideDown(180); 43 } 44 }); 45 }, 380); 46 }); 47 48 // Clear on outside click 49 $(document).on('click', function (e) { 50 if (!$(e.target).closest('.txa-hero-2-form-wrap').length) { 51 $('#search-results').slideUp(150).empty(); 52 } 53 }); 54}); 55 56 57 58 59})(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.