1$(function uil_init_search_ac() { 2 $('.uil-search-ac').each(function () { 3 var $input = $(this).find('input'); 4 $input 5 .autocomplete({ 6 minLength: 2, 7 source: function (request, response) { 8 $.get($input.attr('data-search-ac-url'), {q: request.term}, function (data) { 9 response(data); 10 }); 11 }, 12 select: function (event, ui) { 13 window.location.href = ui.item.url.split('#', 1)[0]; 14 return false; 15 }, 16 change: function (event, ui) { 17 // check(ui.item); 18 }, 19 close: function (event, ui) { 20 // check(ui.item); 21 } 22 }); 23 // .on('blur', function () { 24 // check(); 25 // }); 26 // .data("autocomplete")._renderItem = function (ul, item) { 27 // return $("<li></li>") 28 // .data("item.autocomplete", item) 29 // .append('<div>' + item.label + '<br>' + item.key_page + '</div>') 30 // .appendTo(ul); 31 // }; 32 } 33 ); 34});
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.