1function autocomplete(n,ip,webcountry) { 2 $("#" + n).autocomplete( 3 { 4 source: function (n, t) { 5 var r = n.term.trim() + "", i = getSearchCategory(), u = r; 6 if (progress && progress.abort(), r + i in cache) { 7 $(".ui-autocomplete").scrollTop(0); t(cache[r + i]); progress = null; return 8 } 9 $(".ui-autocomplete").scrollTop(0); 10 //if ((i == "books") || (i == "giftshop")){ 11 progress = 12 $.ajax({ 13 url: "/AutoComplete.asmx/getMatchingTitlesnew", 14 data: "{ 'title': '" + u + "', 'searchMode': '" + i + "', 'ipcntry': '" + ip + "', 'webcountry':'" + webcountry + "'}", 15 type: "POST", 16 dataType: "json", contentType: "application/json;charset=utf-8", 17 autoFocus: !0, 18 success: function (n) { 19 cache[r + i] = n.d; 20 t(n.d); 21 progress = null; 22 lastSearchMode = i 23 }, 24 error: function () { } 25 }) 26 //} 27 //else { 28 // progress = $.ajax({ 29 // url: "/AutoComplete.asmx/getMatchingTitles", 30 // data: "{ 'title': '" + u + "', 'searchMode': '" + i + "'}", 31 // type: "POST", dataType: "json", 32 // contentType: "application/json;charset=utf-8", autoFocus: !0, 33 // success: function (n) { cache[r + i] = n.d; t(n.d); progress = null; lastSearchMode = i }, 34 // error: function () { } 35 // }) 36 //} 37 }, select: function (n, t) { 38 n.preventDefault(); 39 //if ((getSearchCategory() == "books") || (getSearchCategory() == "giftshop")) 40 forceSearchOnAutocompleteSelection(t.item.title,t.item.idautosub) 41 //else 42 // forceSearchOnAutocompleteSelection(t.item.label) 43 }, 44 create: function () { 45 $(this).data('ui-autocomplete')._renderItem = function (ul, item) { 46 //if ((getSearchCategory() == "books") || (getSearchCategory() == "giftshop")) { 47 return $('<li>') 48 .append('<table><tr><td><img class="icon" src="' + item.ImageSrc + '" onerror="handleMissingImg(this);" /</td><td><table><tr><td>' + item.title + '</td></tr><tr><td>' + item.author + '</td></tr><tr><td style="color:red;font-size:.7em!important">' + item.itemformat + '</td></tr></table></td></tr></table>') 49 //.append('<table><tr><td><img class="icon" src="' + item.ImageSrc + '" onerror="handleMissingImg(this);" /</td><td><div>' + item.title + '</div><div>' + item.author + '</div><div>' + item.itemformat + '</div></td></tr></table>') 50 .appendTo(ul); 51 //} 52 //else { 53 // return $('<li>') 54 // .append(item.label) 55 // .appendTo(ul); 56 //} 57 }; 58 59 }, 60 appendTo: ".ui-front", 61 minLength: 3 62 63 }).on("focus", function () { var n = this; $(n).autocomplete("search", this.value) }) 64} 65var progress = null, 66 cache = {};
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.