PageSourceSearch

https://uscupstate.edu/wp-content/plugins/higherup_core_plugin/js/src/related-posts.js?ver=1

js uscupstate.edu collected 2026-10-01 11:49:55 UTC 3,293 bytes, 126 lines download raw bytes

1if (document.querySelector(".news-list-section")) {
2  const newsListingBorder = [
3    ...document.querySelectorAll(".news-listings-bottom-border"),
4  ];
5
6  let border = "news-listing";
7  borderColor(newsListingBorder, border);
8
9  if (document.querySelector(".news-listing-card")) {
10    var newsListingSwiper = new Swiper(".news-listing-container", {
11      slidesPerView: 1.15,
12      spaceBetween: 30,
13      grabCursor: true,
14      // loop: true,
15      navigation: {
16        nextEl: ".news-listing-next",
17        prevEl: ".news-listing-prev",
18      },
19      pagination: {
20        el: ".news-listing-pagination",
21        clickable: true,
22      },
23      breakpoints: {
24        1248: {
25          slidesPerView: 3,
26        },
27        768: {
28          slidesPerView: 2.15,
29        },
30      },
31    });
32  }
33} else if (document.querySelector(".program-list-section")) {
34  if (document.querySelector(".programs-listing-swiper")) {
35    // variables to reference and control the slider progress bar
36    const progBar = document.querySelector(".related-posts-progress-bar");
37    // Hide pagination bullets, but not remove
38    document.querySelector(".programs-listing-pagination").style.display =
39      "none";
40
41    // initialize swiper
42    var programListingSwiper = new Swiper(".programs-listing-swiper", {
43      slidesPerView: 1,
44      spaceBetween: 30,
45      grabCursor: true,
46      loop: true,
47      // See: {@link https://swiperjs.com/swiper-api#param-on}
48      // On - add event listeners different swiper events
49      on: {
50        slideChange: function () {
51          const index = this.realIndex + 1;
52          sliderInterAction(progBar, index);
53        },
54      },
55      navigation: {
56        nextEl: ".programs-listing-next",
57        prevEl: ".programs-listing-prev",
58      },
59      pagination: {
60        el: ".programs-listing-pagination",
61        clickable: true,
62      },
63      breakpoints: {
64        992: {
65          slidesPerView: 3,
66        },
67        768: {
68          slidesPerView: 2,
69        },
70      },
71    });
72  }
73}
74
75function borderColor(element, selector) {
76  const array = [...element];
77
78  const colorArr = [
79    `${selector}-green`,
80    `${selector}-blue`,
81    `${selector}-red`,
82    `${selector}-maroon`,
83    `${selector}-turquoise`,
84    `${selector}-gold`,
85  ];
86
87  let index = 0;
88  let newIndex = 1;
89  let compare = colorArr.length * newIndex;
90
91  array.forEach((card) => {
92    if (colorArr[index]) {
93      card.classList.add(colorArr[index]);
94      index += 1;
95    } else if (!colorArr[index]) {
96      let x = index - compare;
97      if (colorArr[x]) {
98        card.classList.add(colorArr[x]);
99        index += 1;
100      } else {
101        newIndex += 1;
102        compare = colorArr.length * newIndex;
103        x = index - compare;
104        card.classList.add(colorArr[x]);
105        index += 1;
106      }
107    }
108  });
109}
110
111function sliderInterAction(progBar, index) {
112  if (document.querySelector(".swiper-pagination-bullet")) {
113    const progAmount = document.querySelectorAll(
114      ".swiper-pagination-bullet"
115    ).length;
116
117    const progBarWidth = 100 / progAmount;
118    progBar.style.width = `${progBarWidth}%`;
119
120    if (index < progAmount) {
121      progBar.style.width = `${progBarWidth * index}%`;
122    } else if (index === progAmount) {
123      progBar.style.width = "100%";
124    }
125  }
126}

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.