1var catCount = 0; 2var curpath = ""; 3var endpoint = false; 4 5 6$( document ).ready(function() { 7 curpath = window.location.pathname; 8 curpathsplit = curpath.split("/"); 9 goback = ""; 10 11 for (i=0; i<=curpathsplit.length-3;i++) { 12 goback+= curpathsplit[i] + "/"; 13 } 14 //console.log(goback); 15 16 $("#kb-nav li").each(function(index) { 17 // Mark each category 18 if ($(this).find("li").length > 0) { 19 $(this).addClass("category"); 20 } 21 22 // Find current page's location in the tree and mark it (and it's parent) 23 if ($(this).find("a").attr("href") == curpath) { 24 $(this).addClass("me"); 25 $(this).parent().parent().addClass("me-category"); 26 if ($(this).hasClass("category")) { 27 endpoint = false; 28 } else { 29 endpoint = true; 30 } 31 } 32 33 }); 34 35 curStyle = ""; 36 37 if (endpoint == true) { 38 curStyle = "faq-page"; 39 } 40 41 if ($(".me-category").hasClass("level_1")) { 42 curStyle = "top-level"; 43 //console.log("Parent is top-level"); 44 } 45 46 if ($(".me").hasClass("category")) { 47 curStyle = "category"; 48 //console.log("Show categories"); 49 } 50 51 if ($("#kb-nav").find(".me").length > 0) { 52 53 } else { 54 curStyle = "top-level"; 55 } 56 57//console.log("Current Page: " + $(".me a").html()); 58//console.log("Parent:" + $(".me-category a").html()); 59 60 switch (curStyle) { 61 case "top-level": 62 $("#kb-nav ul.level_1 > li").each(function( index ) { 63 readmorelink = $(this).find("a").attr("href") 64 addGroup($(this), $(this).find("a").html(), readmorelink); 65 }); 66 break; 67 case "faq-page": 68 $("#kb-nav-container").append("<a href='" + goback + "' class='btn btn-union'>< Go Back</a>"); 69 break; 70 case "category": 71 console.log("Showing Categories"); 72 $("#kb-nav ul.level_1 > li.me").each(function( index ) { 73 readmorelink = $(this).find("a").attr("href") 74 addGroup($(this), $(this).find("a").html(), readmorelink); 75 }); 76 break; 77 } 78 79 80 81 //("#kb-nav ul.level_1 > li").each(function( index ) { 82 //readmorelink = $(this).find("a").attr("href") 83 //addGroup($(this), $(this).find("a").html(), readmorelink); 84 //}); 85 $("#kb-nav").remove(); 86}); 87 88function addGroup(obj, catTitle, readmorelink) { 89 catCount++; 90 var faqcount = 0; 91 $("#kb-nav-container").append("<div class='list-group mb-3' id='cat-" + catCount + "'><div class='list-group-item list-group-item-secondary faq-cat'>" + catTitle + " <span class='qty'></span></div></div>"); 92 $(obj).find("ul li").each(function( index ) { 93 $("#cat-" + catCount).append("<a class='list-group-item list-group-item-action' href='" + $(this).find("a").attr("href") + "'>" + $(this).find("a").html() + "</a>"); 94 faqcount++; 95 }); 96 $("#cat-" + catCount + " .qty").html("(" + faqcount + ")"); 97 $("#cat-" + catCount).append("<a class='list-group-item list-group-item-action' href='" + readmorelink + "'>Read All FAQs</a>"); 98}
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.