1$(function(){ 2 3 function encodeQueryData(data) { 4 var ret = []; 5 for (var d in data) 6 ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d])); 7 return ret.join("&"); 8 } 9 10 $('.search-bar-widget').each(function(){ 11 var elem = $(this); 12 13 var inputText = elem.find('> input[type="text"]').keyup(function(event){ 14 if (event.which == 13) { 15 searchBtn.trigger('click'); 16 } 17 }); 18 19 20 var searchBtn = elem.find(".search-btn").unbind('click').click(function(event){ 21 22 var url = elem.attr('data-url').replace(/\s/g,'+'); 23 var variables = elem.attr('data-variables').replace(/\s/g, '').split(','); 24 25 var data = {}; 26 $.each(variables,function(){ 27 var varName = String(this); 28 data[varName] = inputText.val(); 29 }); 30 31 var postUrl = url + '?' + encodeQueryData(data); 32 document.location = postUrl; 33 34 }); 35 36 37 38 }); 39});
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.