PageSourceSearch

https://cjmrradio.com/wp-content/themes/whiteoakstation-cjmr/js/date-slick.js?ver=468769939395

js cjmrradio.com collected 2026-10-10 00:23:14 UTC 9,701 bytes, 261 lines download raw bytes

1jQuery(document).ready(function () {
2  let media = window.matchMedia("(min-width: 768px)");
3
4  function wrapGroups() {
5    let mylist = jQuery(".day-slider");
6    let list = mylist.children(".day-box");
7
8    for (let i = 0; i < list.length; i += 7) {
9      let group = list.slice(i, i + 7);
10      let wrapper = jQuery('<div class="day-js-slide"></div>');
11      group.first().before(wrapper);
12      group.appendTo(wrapper);
13    }
14    setTimeout(() => {
15      let isUserClick = false;
16      let currentActiveSlideIndex = 0;
17      let days = jQuery(".day-box strong");
18      days.each((_i, ele) => {
19        let dayText = jQuery(ele).text().trim();
20        let dayOfWeek = dayText.slice(0, 3);
21        let newText =
22          `${dayOfWeek}` + `<span class="day">${dayText.slice(3)}</span>`;
23        jQuery(ele).html(newText);
24      });
25      /*jQuery(".day-slider").on("init", function (event, slick) {
26        jQuery(
27          jQuery(".day-slider .slick-slide").eq(0).find(".day-box")[0]
28        ).addClass("day-active");
29      });*/
30      jQuery(".day-slider").on("init", function (event, slick) {
31        setTimeout(function () {
32          const today = new Date();
33          const options = { year: "numeric", month: "long", day: "numeric" };
34          const todayFormatted = today.toLocaleDateString("en-US", options);
35      
36          const $boxes = jQuery(".day-box");
37          $boxes.removeClass("day-active");
38      
39          const matchedBox = $boxes.filter(`[data-calender="${todayFormatted}"]`);
40      
41          if (matchedBox.length) {
42            matchedBox.addClass("day-active").trigger("click");
43          } else {
44            $boxes.first().addClass("day-active").trigger("click");
45          }
46        }, 100); // Adjust delay if needed
47      });
48
49     
50      
51      
52      jQuery(".day-slider").slick({
53        slidesToShow: 1,
54        slidesToScroll: 1,
55        focusOnSelect: true,
56        arrows: true,
57        infinite: false,
58        prevArrow:
59          '<div class="slick-arrow slick-prev flex flex-center" aria-label="Previous Arrow" role="button"><i class="fa-solid fa-circle-chevron-left"></i></div>',
60        nextArrow:
61          '<div class="slick-arrow slick-next flex flex-center" aria-label="Next Arrow" role="button"><i class="fa-solid fa-circle-chevron-right"></i></div>',
62      });
63      jQuery(function () {
64        //inital state
65        var start = jQuery(".day-slide.slick-active")
66          .find(".day-box")
67          .eq(0)
68          .attr("data-calender");
69        jQuery("#start").html(start);
70        var end = jQuery(".day-slide.slick-active")
71          .find(".day-box")
72          .eq(6)
73          .attr("data-calender");
74        jQuery("#end").html(end);
75
76        var mstart = jQuery(".day-box.slick-current").attr("data-calender");
77        console.log("mstart", mstart);
78      });
79
80      jQuery(".day-slider").on("setPosition", function (event, slick) {
81        if (!isUserClick) {
82          const currentSlideIndex = slick.currentSlide;
83          if (currentSlideIndex !== currentActiveSlideIndex) {
84            jQuery(".day-box").removeClass("day-active");
85            const activeSlide = slick.$slides.eq(currentSlideIndex);
86            const myActiveBox = jQuery(activeSlide.find(".day-box")[0]);
87            myActiveBox.addClass("day-active");
88            currentActiveSlideIndex = currentSlideIndex;
89            let myslideno = +myActiveBox.attr("data-slide-box");
90            console.log("mysliderno", myslideno);
91            jQuery(`[data-slide-show]`).hide();
92            jQuery(`[data-slide-show=${0}]`).fadeIn(1000);
93
94            var start = jQuery(".day-slide.slick-active")
95              .find(".day-box")
96              .eq(0)
97              .attr("data-calender");
98            jQuery("#start").html(start);
99            var end = jQuery(".day-slide.slick-active")
100              .find(".day-box")
101              .eq(6)
102              .attr("data-calender");
103            jQuery("#end").html(end);
104
105            var mstart = jQuery(".day-box.slick-current").attr("data-calender");
106            console.log("mstart", mstart);
107          }
108        }
109      });
110      jQuery("[data-slide-box]").on("click", function (e) {
111        e.preventDefault();
112        isUserClick = true;
113        jQuery(this).siblings("[data-slide-box]").removeClass("day-active");
114        jQuery(this).addClass("day-active");
115        var slideno = jQuery(this).data("slide-box");
116        jQuery(`[data-slide-show]`).hide();
117        jQuery(`[data-slide-show=${slideno}]`).fadeIn(1000);
118        setTimeout(function () {
119          isUserClick = false;
120        }, 100);
121      });
122      const showSlider = jQuery(".show-slider");
123      function initializeSlider() {
124        showSlider.each(function () {
125          const $this = jQuery(this);
126          const showSlide = $this.children(".shows-block").length;
127          if (window.matchMedia("(max-width: 1023px)").matches) {
128            if (!$this.hasClass("slick-initialized")) {
129              $this.slick({
130                slidesToShow: 1,
131                slidesToScroll: 1,
132                arrows: true,
133                infinite: false,
134                variableWidth: true,
135                prevArrow:
136                  '<div class="slick-arrow slick-prev flex flex-center" aria-label="Previous Arrow" role="button"><i class="fa-solid fa-circle-chevron-left"></i></div>',
137                nextArrow:
138                  '<div class="slick-arrow slick-next flex flex-center" aria-label="Next Arrow" role="button"><i class="fa-solid fa-circle-chevron-right"></i></div>',
139              });
140            }
141          } else {
142            if (showSlide >= 3 && !$this.hasClass("slick-initialized")) {
143              $this.slick({
144                slidesToShow: 1,
145                slidesToScroll: 1,
146                arrows: true,
147                infinite: false,
148                variableWidth: true,
149                prevArrow:
150                  '<div class="slick-arrow slick-prev flex flex-center" aria-label="Previous Arrow" role="button"><i class="fa-solid fa-circle-chevron-left"></i></div>',
151                nextArrow:
152                  '<div class="slick-arrow slick-next flex flex-center" aria-label="Next Arrow" role="button"><i class="fa-solid fa-circle-chevron-right"></i></div>',
153              });
154            }
155          }
156        });
157      }
158      function destroySlider() {
159        showSlider.each(function () {
160          const $this = jQuery(this);
161          if (
162            jQuery(window).width() >= 1024 &&
163            $this.hasClass("slick-initialized")
164          ) {
165            $this.slick("unslick");
166          }
167        });
168      }
169      // Initial call
170      initializeSlider();
171      jQuery(window).on("resize", function () {
172        destroySlider();
173        initializeSlider();
174      });
175      // jQuery(".show-slider").slick({
176      //   slidesToShow: 1,
177      //   slidesToScroll: 1,
178      //   arrows: true,
179      //   infinite: false,
180      //   variableWidth: true,
181      //   prevArrow:
182      //     '<div class="slick-arrow slick-prev flex flex-center" aria-label="Previous Arrow" role="button"><i class="fa-solid fa-circle-chevron-left"></i></div>',
183      //   nextArrow:
184      //     '<div class="slick-arrow slick-next flex flex-center" aria-label="Next Arrow" role="button"><i class="fa-solid fa-circle-chevron-right"></i></div>',
185      // });
186    }, 0);
187  }
188
189  function unwrapGroups() {
190    jQuery(document).ready(function () {
191      jQuery(".day-slider").on("init", function (event, slick) {
192        var currentSlide = slick.currentSlide || 0;
193        var $currentSlide = jQuery(slick.$slides.get(currentSlide));
194        var slideAttr = $currentSlide.attr("data-calender");
195        jQuery("#mstart").html(slideAttr);
196      });
197    });
198
199    jQuery(".group-wrapper").each(function () {
200      jQuery(this).children(".day-box").insertBefore(this); // move <li> elements before the div
201      jQuery(this).remove(); // remove the empty wrapper
202    });
203
204    setTimeout(() => {
205      jQuery(".day-slider").slick({
206        slidesToShow: 1,
207        slidesToScroll: 1,
208        focusOnSelect: true,
209        asNavFor: ".show-my-sliders",
210        variableWidth: true,
211        centerMode: true,
212        centerPadding: "0",
213        arrows: true,
214        infinite: false,
215        prevArrow:
216          '<div class="slick-arrow slick-prev flex flex-center" aria-label="Previous Arrow" role="button"><i class="fa-solid fa-circle-chevron-left"></i></div>',
217        nextArrow:
218          '<div class="slick-arrow slick-next flex flex-center" aria-label="Next Arrow" role="button"><i class="fa-solid fa-circle-chevron-right"></i></div>',
219      });
220
221      console.log("Mobile View");
222
223      jQuery(".day-slider").on(
224        "afterChange",
225        function (event, slick, currentSlide) {
226          var $currentSlide = jQuery(slick.$slides.get(currentSlide));
227          var slideAttr = $currentSlide.attr("data-calender");
228          jQuery("#mstart").html(slideAttr);
229        }
230      );
231
232
233    
234      
235
236      jQuery(".show-my-sliders").slick({
237        slidesToShow: 1,
238        slidesToScroll: 1,
239        focusOnSelect: true,
240        arrows: false,
241        asNavFor: ".day-slider",
242        adaptiveHeight: true,
243      });
244    }, 0);
245  }
246
247  // Initial load
248  if (media.matches) {
249    wrapGroups();
250  } else {
251    unwrapGroups();
252  }
253
254  media.addEventListener("change", (e) => {
255    if (e.matches) {
256      wrapGroups();
257    } else {
258      unwrapGroups();
259    }
260  });
261});

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.