1var pastEventsInterval; 2var pastEventsTimeout = 0; 3 4jQuery(document).ready(function ($) { 5// document.getElementById("views-exposed-form-events-block-1")?.classList.add("row"); 6 7// let articleSearchKeyWordEl = document.getElementsByClassName("form-item-field-keywords-value"); 8// if (articleSearchKeyWordEl.length > 0) { 9// articleSearchKeyWordEl[0].classList.add("col-md-6"); 10// articleSearchKeyWordEl[0].classList.add("col-12"); 11// } 12 13// let articleSearchCategoryEl = document.getElementsByClassName("form-item-field-year-value"); 14// if (articleSearchCategoryEl.length > 0) { 15// articleSearchCategoryEl[0].classList.add("col-md-4"); 16// articleSearchCategoryEl[0].classList.add("col-12"); 17// } 18 19// let articleSearchSubmitEl = document.getElementById("edit-actions--2"); 20// articleSearchSubmitEl?.classList.add(" "); 21// articleSearchSubmitEl?.classList.add("col-12"); 22 23 pastEventsInterval = setInterval(() => { 24 let pastEventsContainer = document.getElementsByClassName("event-items-container"); 25 if (pastEventsContainer.length > 0) { 26 clearInterval(pastEventsInterval); 27 28 setEventItemsContainerHeight(); 29 30 document.getElementById("show-more")?.addEventListener("click", (evt) => { 31 pastEventsContainer[0].classList.add("expanded"); 32 pastEventsContainer[0].style["height"] = pastEventsContainer[0].scrollHeight + 20 + "px"; 33 evt.currentTarget.parentNode.parentNode.classList.add("hide-show-more"); 34 }); 35 36 $(window).resize(() => { 37 setEventItemsContainerHeight(); 38 }); 39 } else if (pastEventsTimeout > 600) { 40 clearInterval(pastEventsInterval); 41 } else { 42 pastEventsTimeout += 100; 43 } 44 }, 100); 45}); 46 47function setEventItemsContainerHeight() { 48 let pastEventsContainer = document.getElementsByClassName("event-items-container"); 49 let pastEventsItems = pastEventsContainer[0].getElementsByClassName("past-event-container"); 50 51 if (!pastEventsContainer[0].classList.contains("expanded")) { 52 if (pastEventsItems.length > 0) { 53 let totalHeight = 20; 54 let limit = 3; 55 for (let x = 0; x < limit; x++) { 56 if (pastEventsItems.length < limit) { 57 limit = pastEventsItems.length; 58 } 59 totalHeight += pastEventsItems[x].clientHeight; 60 } 61 pastEventsContainer[0].style["height"] = totalHeight + "px"; 62 } else { 63 pastEventsContainer[0].style["height"] = "0px"; 64 } 65 } else { 66 if (pastEventsItems.length > 0) { 67 let totalHeight = 20; 68 for (let x = 0; x < pastEventsItems.length; x++) { 69 totalHeight += pastEventsItems[x].clientHeight; 70 } 71 pastEventsContainer[0].style["height"] = totalHeight + "px"; 72 } else { 73 pastEventsContainer[0].style["height"] = "0px"; 74 document.getElementById("show-more")?.parentNode.parentNode.classList.add("hide-show-more"); 75 } 76 } 77}
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.