1jQuery(document).ready(function($) { 2 3 $('.searchbar-date-selector').change(function(){ 4 5 $('#searchbar-dates').removeClass('inactive'); 6 7 }) 8 9 $('#searchbar-form').submit(function() 10 { 11 if(!$("#searchbar-keywords" ).val() && $('#searchbar-dates').hasClass("inactive") ) 12 { 13 return false; 14 }else 15 { 16 $('#searchbar').addClass('locked'); 17 $('#searchbar').removeClass('open'); 18 19 } 20 }); 21 22 $(document).keydown(function(e) { 23 if (e.key === "Escape") { 24 $('#searchbar').removeClass('open'); 25 $('body,html').css('overflow','scroll'); 26 } 27 }); 28 29 30 $('.searchbar-icon,.search-summary').click(function() 31 { 32 $('#searchbar').addClass('open'); 33 $('body,html').css('overflow','hidden'); 34 $("#searchbar-keywords").focus(); 35 sdm_searchbar_suggestions(); 36 37 38 39 40 }); 41 42 43 $('#searchbar-close').click(function() 44 { 45 $('#searchbar').removeClass('open'); 46 $('body,html').css('overflow','scroll'); 47 48 }); 49 50 51 52 $("#searchbar-keywords").on("input", function() { 53 sdm_searchbar_suggestions(); 54 }); 55 56 function sdm_searchbar_suggestions(){ 57 var input = $("#searchbar-keywords").val().toLowerCase(); 58 $("#searchbar-suggestions").empty(); 59 60 61 62 if (input) { 63 var filteredTags = search_tags 64 .filter(function(tag) { 65 return tag.name.toLowerCase().indexOf(input) !== -1; 66 }) 67 .sort(function(a, b) { 68 return b.count - a.count; // Orden descendente por noteCount 69 }).slice(0,30); 70 71 filteredTags.forEach(function(tag) { 72 var index = tag.name.toLowerCase().indexOf(input); 73 var highlightedTag = tag.name.substring(0, index) + 74 "<b>" + tag.name.substring(index, index + input.length) + "</b>" + 75 tag.name.substring(index + input.length); 76 $("#searchbar-suggestions").append("<li>" + highlightedTag + "</li>"); 77 }); 78 }else 79 { 80 var filteredTags = search_tags.sort(function(a, b) { 81 return b.count - a.count; // Orden descendente por noteCount 82 }).slice(0,30); 83 filteredTags.forEach(function(tag) { 84 var index = tag.name.toLowerCase().indexOf(input); 85 var highlightedTag = tag.name.substring(0, index) + 86 "<b>" + tag.name.substring(index, index + input.length) + "</b>" + 87 tag.name.substring(index + input.length); 88 $("#searchbar-suggestions").append("<li>" + highlightedTag + "</li>"); 89 }); 90 } 91 if(filteredTags.length > 0) 92 { 93 $('#searchbar-form h6').show(); 94 }else 95 { 96 $('#searchbar-form h6').hide(); 97 } 98 } 99 100 $(document).on("click", "#searchbar-suggestions li", function() { 101 $("#searchbar-keywords").val($(this).text()); 102 $("#searchbar form").submit(); 103 }); 104 105});
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.