1(function () { 2 function initHomeReviewsCarousel() { 3 var carousel = document.getElementById("carousel"); 4 if (!carousel) return; 5 6 var inner = carousel.querySelector(".jw-carousel-inner"); 7 if (!inner) return; 8 9 var items = Array.prototype.filter.call(inner.children, function (item) { 10 return item.classList.contains("jw-carousel-item"); 11 }); 12 13 if (items.length <= 1) return; 14 15 carousel.classList.add("home-reviews-carousel"); 16 17 Array.prototype.forEach.call(carousel.querySelectorAll(".jw-carousel-indicators"), function (oldDots) { 18 oldDots.parentNode.removeChild(oldDots); 19 }); 20 21 var dots = document.createElement("ol"); 22 dots.className = "jw-carousel-indicators"; 23 24 var current = 0; 25 26 items.forEach(function (item, index) { 27 item.classList.remove("left", "right"); 28 if (item.classList.contains("active")) current = index; 29 30 var dot = document.createElement("li"); 31 dot.setAttribute("data-slide-to", index + 1); 32 dot.addEventListener("click", function () { 33 show(index); 34 restart(); 35 }); 36 dots.appendChild(dot); 37 }); 38 39 carousel.appendChild(dots); 40 41 function show(index) { 42 current = index; 43 carousel.style.setProperty("--review-index", index); 44 45 items.forEach(function (item, itemIndex) { 46 item.classList.toggle("active", itemIndex === index); 47 item.classList.remove("left", "right"); 48 }); 49 50 Array.prototype.forEach.call(dots.children, function (dot, dotIndex) { 51 dot.classList.toggle("active", dotIndex === index); 52 }); 53 } 54 55 var timer = null; 56 57 function start() { 58 timer = window.setInterval(function () { 59 show((current + 1) % items.length); 60 }, 5000); 61 } 62 63 function restart() { 64 window.clearInterval(timer); 65 start(); 66 } 67 68 carousel.addEventListener("mouseenter", function () { 69 window.clearInterval(timer); 70 }); 71 72 carousel.addEventListener("mouseleave", start); 73 74 show(current); 75 start(); 76 } 77 78 if (document.readyState === "loading") { 79 document.addEventListener("DOMContentLoaded", initHomeReviewsCarousel); 80 } else { 81 initHomeReviewsCarousel(); 82 } 83})();
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.