1jQuery(function() { 2 jQuery('div#menu-form-search form input[name=s]').autocomplete({ 3 source: function(request, response) { 4 jQuery.ajax({ 5 dataType: 'json', 6 url: mrwp_autocomplete_search.ajax_url, 7 data: { 8 term: request.term, 9 }, 10 success: function(data) { 11 response(data); 12 } 13 }); 14 }, 15 minLength: 3, 16 appendTo: '#menu-form-search', 17 18 create: function() { 19 jQuery(this).data('ui-autocomplete')._renderItem = function( ul, item ) { 20 if(typeof item.image != 'undefined' && item.image != null && item.image != false && item.image != '') { 21 return jQuery( "<li><a href='"+item.link+"'><div class='image'><img src='"+item.image+"'></div><div><span>"+item.value+"</span></div></a></li>" ).data("ui-autocomplete-item", item).appendTo( ul ); 22 } else { 23 return jQuery( "<li><a href='"+item.link+"'><div class='image'></div><div><span>"+item.value+"</span></div></a></li>" ).data("ui-autocomplete-item", item).appendTo( ul ); 24 } 25 26 }; 27 } 28 }); 29});
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.