1/*! 2 * @splidejs/splide-extension-auto-scroll 3 * Version : 0.5.3 4 * License : MIT 5 * Copyright: 2022 Naotoshi Fujita 6 */ (function (S) { 7 typeof define == "function" && define.amd ? define(S) : S(); 8})(function () { 9 "use strict"; 10 function S(n) { 11 n.length = 0; 12 } 13 function D(n, t, r) { 14 return Array.prototype.slice.call(n, t, r); 15 } 16 function _(n) { 17 return n.bind.apply(n, [null].concat(D(arguments, 1))); 18 } 19 function q(n) { 20 return requestAnimationFrame(n); 21 } 22 function C(n, t) { 23 return typeof t === n; 24 } 25 var z = Array.isArray; 26 (_(C, "function"), _(C, "string"), _(C, "undefined")); 27 function B(n) { 28 return z(n) ? n : [n]; 29 } 30 function H(n, t) { 31 B(n).forEach(t); 32 } 33 var cn = Object.keys; 34 function sn(n, t, r) { 35 if (n) { 36 var e = cn(n); 37 e = r ? e.reverse() : e; 38 for (var o = 0; o < e.length; o++) { 39 var c = e[o]; 40 if (c !== "__proto__" && t(n[c], c) === !1) break; 41 } 42 } 43 return n; 44 } 45 function dn(n) { 46 return ( 47 D(arguments, 1).forEach(function (t) { 48 sn(t, function (r, e) { 49 n[e] = t[e]; 50 }); 51 }), 52 n 53 ); 54 } 55 var ln = Math.min; 56 function vn() { 57 var n = []; 58 function t(u, s, a, d) { 59 o(u, s, function (f, v, l) { 60 var h = "addEventListener" in f, 61 w = h 62 ? f.removeEventListener.bind(f, v, a, d) 63 : f.removeListener.bind(f, a); 64 (h ? f.addEventListener(v, a, d) : f.addListener(a), n.push([f, v, l, a, w])); 65 }); 66 } 67 function r(u, s, a) { 68 o(u, s, function (d, f, v) { 69 n = n.filter(function (l) { 70 return l[0] === d && l[1] === f && l[2] === v && (!a || l[3] === a) 71 ? (l[4](), !1) 72 : !0; 73 }); 74 }); 75 } 76 function e(u, s, a) { 77 var d, 78 f = !0; 79 return ( 80 typeof CustomEvent == "function" 81 ? (d = new CustomEvent(s, { bubbles: f, detail: a })) 82 : ((d = document.createEvent("CustomEvent")), 83 d.initCustomEvent(s, f, !1, a)), 84 u.dispatchEvent(d), 85 d 86 ); 87 } 88 function o(u, s, a) { 89 H(u, function (d) { 90 d && 91 H(s, function (f) { 92 f.split(" ").forEach(function (v) { 93 var l = v.split("."); 94 a(d, l[0], l[1]); 95 }); 96 }); 97 }); 98 } 99 function c() { 100 (n.forEach(function (u) { 101 u[4](); 102 }), 103 S(n)); 104 } 105 return { bind: t, unbind: r, dispatch: e, destroy: c }; 106 } 107 var K = "move", 108 J = "moved", 109 En = "updated", 110 Q = "drag", 111 pn = "dragged", 112 U = "scroll", 113 W = "scrolled", 114 mn = "destroy"; 115 function hn(n) { 116 var t = n ? n.event.bus : document.createDocumentFragment(), 117 r = vn(); 118 function e(c, u) { 119 r.bind(t, B(c).join(" "), function (s) { 120 u.apply(u, z(s.detail) ? s.detail : []); 121 }); 122 } 123 function o(c) { 124 r.dispatch(t, c, D(arguments, 1)); 125 } 126 return ( 127 n && n.event.on(mn, r.destroy), 128 dn(r, { bus: t, on: e, off: _(r.unbind, t), emit: o }) 129 ); 130 } 131 function Y(n, t, r, e) { 132 var o = Date.now, 133 c, 134 u = 0, 135 s, 136 a = !0, 137 d = 0; 138 function f() { 139 if (!a) { 140 if ( 141 ((u = n ? ln((o() - c) / n, 1) : 1), 142 r && r(u), 143 u >= 1 && (t(), (c = o()), e && ++d >= e)) 144 ) 145 return l(); 146 q(f); 147 } 148 } 149 function v(E) { 150 (!E && w(), (c = o() - (E ? u * n : 0)), (a = !1), q(f)); 151 } 152 function l() { 153 a = !0; 154 } 155 function h() { 156 ((c = o()), (u = 0), r && r(u)); 157 } 158 function w() { 159 (s && cancelAnimationFrame(s), (u = 0), (s = 0), (a = !0)); 160 } 161 function M(E) { 162 n = E; 163 } 164 function N() { 165 return a; 166 } 167 return { start: v, rewind: h, pause: l, cancel: w, set: M, isPaused: N }; 168 } 169 function An(n, t) { 170 var r; 171 function e() { 172 r || 173 ((r = Y( 174 t || 0, 175 function () { 176 (n(), (r = null)); 177 }, 178 null, 179 1, 180 )), 181 r.start()); 182 } 183 return e; 184 } 185 var gn = "is-active", 186 wn = "slide", 187 yn = "fade"; 188 function X(n, t, r) { 189 return Array.prototype.slice.call(n, t, r); 190 } 191 function V(n) { 192 return n.bind.apply(n, [null].concat(X(arguments, 1))); 193 } 194 function L(n, t) { 195 return typeof t === n; 196 } 197 function $(n) { 198 return !Z(n) && L("object", n); 199 } 200 var bn = Array.isArray; 201 (V(L, "function"), V(L, "string")); 202 var Sn = V(L, "undefined"); 203 function Z(n) { 204 return n === null; 205 } 206 function _n(n) {
207 return bn(n) ? n : [n]; 208 } 209 function O(n, t) { 210 _n(n).forEach(t); 211 } 212 function Ln(n, t, r) { 213 n && 214 O(t, function (e) { 215 e && n.classList[r ? "add" : "remove"](e); 216 }); 217 } 218 var On = Object.keys; 219 function j(n, t, r) { 220 if (n) { 221 var e = On(n); 222 e = r ? e.reverse() : e; 223 for (var o = 0; o < e.length; o++) { 224 var c = e[o]; 225 if (c !== "__proto__" && t(n[c], c) === !1) break; 226 } 227 } 228 return n; 229 } 230 function k(n) { 231 return ( 232 X(arguments, 1).forEach(function (t) { 233 j(t, function (r, e) { 234 n[e] = t[e]; 235 }); 236 }), 237 n 238 ); 239 } 240 function Tn(n, t) { 241 O(n, function (r) { 242 O(t, function (e) { 243 r && r.removeAttribute(e); 244 }); 245 }); 246 } 247 function nn(n, t, r) { 248 $(t) 249 ? j(t, function (e, o) { 250 nn(n, o, e); 251 }) 252 : O(n, function (e) { 253 Z(r) || r === "" ? Tn(e, t) : e.setAttribute(t, String(r)); 254 }); 255 } 256 var tn = Math.min, 257 rn = Math.max, 258 qn = Math.floor, 259 zn = Math.ceil, 260 Bn = Math.abs; 261 function Dn(n, t, r) { 262 var e = tn(t, r), 263 o = rn(t, r); 264 return tn(rn(e, n), o); 265 } 266 var Cn = { speed: 1, autoStart: !0, pauseOnHover: !0, pauseOnFocus: !0 }, 267 Vn = { startScroll: "Start auto scroll", pauseScroll: "Pause auto scroll" }; 268 function $n(n, t, r) { 269 var e = hn(n), 270 o = e.on, 271 c = e.off, 272 u = e.bind, 273 s = e.unbind, 274 a = t.Move, 275 d = a.translate, 276 f = a.getPosition, 277 v = a.toIndex, 278 l = a.getLimit, 279 h = t.Controller, 280 w = h.setIndex, 281 M = h.getIndex, 282 N = t.Direction.orient, 283 E = t.Elements.toggle, 284 en = t.Live, 285 I = n.root, 286 Mn = An(t.Arrows.update, 500), 287 p = {}, 288 m, 289 A, 290 x, 291 F, 292 P, 293 T; 294 function Nn() { 295 var i = r.autoScroll; 296 p = k({}, Cn, $(i) ? i : {}); 297 } 298 function on() { 299 n.is(yn) || (!m && r.autoScroll !== !1 && ((m = Y(0, Pn)), In(), Fn())); 300 } 301 function un() { 302 m && 303 (m.cancel(), 304 (m = null), 305 (T = void 0), 306 c([K, Q, U, J, W]), 307 s(I, "mouseenter mouseleave focusin focusout"), 308 s(E, "click")); 309 } 310 function In() { 311 (p.pauseOnHover && 312 u(I, "mouseenter mouseleave", function (i) { 313 ((x = i.type === "mouseenter"), R()); 314 }), 315 p.pauseOnFocus && 316 u(I, "focusin focusout", function (i) { 317 ((F = i.type === "focusin"), R()); 318 }), 319 p.useToggleButton && 320 u(E, "click", function () { 321 A ? y() : b(); 322 }), 323 o(En, xn), 324 o([K, Q, U], function () { 325 ((P = !0), b(!1)); 326 }), 327 o([J, pn, W], function () { 328 ((P = !1), R()); 329 })); 330 } 331 function xn() { 332 var i = r.autoScroll; 333 (i !== !1 ? ((p = k({}, p, $(i) ? i : {})), on()) : un(), m && !Sn(T) && d(T)); 334 } 335 function Fn() { 336 p.autoStart && (document.readyState === "complete" ? y() : u(window, "load", y)); 337 } 338 function y() {
339 G() && (m.start(!0), en.disable(!0), (F = x = A = !1), an()); 340 } 341 function b(i) { 342 (i === void 0 && (i = !0), A || ((A = i), an(), G() || (m.pause(), en.disable(!1)))); 343 } 344 function R() { 345 A || (x || F || P ? b(!1) : y()); 346 } 347 function Pn() { 348 var i = f(), 349 g = Rn(i); 350 (i !== g 351 ? (d(g), Gn((T = f()))) 352 : (b(!1), p.rewind && n.go(p.speed > 0 ? 0 : t.Controller.getEnd())), 353 Mn()); 354 } 355 function Rn(i) { 356 var g = p.speed || 1; 357 return ((i += N(g)), n.is(wn) && (i = Dn(i, l(!1), l(!0))), i); 358 } 359 function Gn(i) { 360 var g = n.length, 361 fn = (v(i) + g) % g; 362 fn !== M() && 363 (w(fn), 364 t.Slides.update(), 365 t.Pagination.update(), 366 r.lazyLoad === "nearby" && t.LazyLoad.check()); 367 } 368 function an() { 369 if (E) { 370 var i = A ? "startScroll" : "pauseScroll"; 371 (Ln(E, gn, !A), nn(E, "aria-label", r.i18n[i] || Vn[i])); 372 } 373 } 374 function G() { 375 return !m || m.isPaused(); 376 } 377 return { setup: Nn, mount: on, destroy: un, play: y, pause: b, isPaused: G }; 378 } 379 typeof window < "u" && 380 ((window.splide = window.splide || {}), 381 (window.splide.Extensions = window.splide.Extensions || {}), 382 (window.splide.Extensions.AutoScroll = $n)); 383}); 384 385/* 386 * jQuery WidowFix Plugin 387 * http://matthewlein.com/widowfix/ 388 * Copyright (c) 2010 Matthew Lein 389 * Version: 1.3.2 (7/23/2011) 390 * Dual licensed under the MIT and GPL licenses 391 * Requires: jQuery v1.4 or later 392 */ 393 394(function (a) { 395 jQuery.fn.widowFix = function (d) { 396 var c = { letterLimit: null, prevLimit: null, linkFix: false, dashes: false }; 397 var b = a.extend(c, d); 398 if (this.length) { 399 return this.each(function () { 400 var i = a(this); 401 var n; 402 if (b.linkFix) { 403 var h = i.find("a:last"); 404 h.wrap("<var>"); 405 var e = a("var").html(); 406 n = h.contents()[0]; 407 h.contents().unwrap(); 408 } 409 var f = a(this).html().split(" "), 410 m = f.pop(); 411 if (f.length <= 1) { 412 return; 413 } 414 function k() { 415 if (m === "") { 416 m = f.pop(); 417 k(); 418 } 419 } 420 k(); 421 if (b.dashes) { 422 var j = ["-", "â", "â"]; 423 a.each(j, function (o, p) { 424 if (m.indexOf(p) > 0) { 425 m = '<span style="white-space:nowrap;">' + m + "</span>"; 426 return false; 427 } 428 }); 429 } 430 var l = f[f.length - 1]; 431 if (b.linkFix) { 432 if (b.letterLimit !== null && n.length >= b.letterLimit) { 433 i.find("var").each(function () { 434 a(this).contents().replaceWith(e); 435 a(this).contents().unwrap(); 436 }); 437 return; 438 } else { 439 if (b.prevLimit !== null && l.length >= b.prevLimit) { 440 i.find("var").each(function () { 441 a(this).contents().replaceWith(e); 442 a(this).contents().unwrap(); 443 }); 444 return; 445 } 446 } 447 } else { 448 if (b.letterLimit !== null && m.length >= b.letterLimit) { 449 return; 450 } else { 451 if (b.prevLimit !== null && l.length >= b.prevLimit) { 452 return; 453 } 454 } 455 } 456 var g = f.join(" ") + " " + m; 457 i.html(g); 458 if (b.linkFix) { 459 i.find("var").each(function () { 460 a(this).contents().replaceWith(e); 461 a(this).contents().unwrap(); 462 }); 463 } 464 }); 465 } 466 }; 467})(jQuery); 468 469function clickSlider() { 470 $(".splide__arrow--next").click(); 471 //console.log("called"); 472} 473 474var globalResizeTimer = null; 475 476$(window).resize(function () { 477 if (globalResizeTimer != null) window.clearTimeout(globalResizeTimer); 478 globalResizeTimer = window.setTimeout(function () { 479 clickSlider(); 480 }, 200); 481}); 482 483$(document).ready(function () { 484 // SEARCH FULLSCREEN 485 486 // Create dark background 487 let darkness = document.createElement("DIV"); 488 darkness.classList.add("darkness"); 489 darkness.addEventListener("click", function (event) { 490 if (event.target === this) { 491 $(".darkness #search").remove(); 492 darkness.classList.remove("darknessOpaque"); 493 $(".darkness").remove(); 494 } 495 // put search form back where it was 496 }); 497 498 // Create the search button that launches the darkness 499 let searchLauncher = document.createElement("DIV"); 500 searchLauncher.classList.add("searchLauncher"); 501 searchLauncher.addEventListener("click", function () { 502 $("body").append(darkness); 503 darkness.offsetWidth = darkness.offsetWidth; // transition fix? 504 darkness.classList.add("darknessOpaque"); 505 $("#search").clone().appendTo(".darkness"); 506 $(".darkness #search input.form-control").attr( 507 "placeholder", 508 "What Are You Searching For?", 509 ); 510 }); 511 512 console.log(searchLauncher); 513 514 $("#titlebar .ccm-search-block-form").append(searchLauncher); 515 516 $("#search input.form-control").attr("placeholder", "What Are You Searching For?"); 517 518 // ---------------------------------------------------------------------------------------------------------- 519 520 //Remove orphans from all H1s 521 $( 522 "h1:not(.allowOrphan, .allowOrphan *),h2:not(.allowOrphan, .allowOrphan *), h3:not(.allowOrphan, .allowOrphan *), h4:not(.allowOrphan, .allowOrphan *), h5:not(.allowOrphan, .allowOrphan *), p:not(.allowOrphan, .allowOrphan *)", 523 ).widowFix(); 524 525 //$('.splide__arrow--next').each(function(){ 526 // $(this).click(); 527 //}); 528 529 // Prevent orphans....this code is cursed and will destroy all event handlers on those elements 530 /* 531 $("p,h1,h2,h3,h4,h5,h6,li").each(function(i,e) { 532 var text = $(e).html(); 533 text = text.split(' '); 534 var lastWord = text.pop(); 535 text = text.join(' ') + " " + lastWord; 536 $(e).html(text); 537 }); 538 */ 539 540 // NAV STUFF-------------------------------------------------------------------------------------------- 541 542 // hide nav on scroll 543 var prevScrollpos = window.pageYOffset; 544 window.addEventListener("scroll", function () { 545 var currentScrollPos = window.pageYOffset; 546 var windowTop = Math.max($("body").scrollTop(), $("html").scrollTop()); 547 548 if (prevScrollpos > currentScrollPos) { 549 //$("#titlebar").style.top = "0"; 550 $("#titlebar").removeClass("slideUp"); 551 } else { 552 if (currentScrollPos > 0) { 553 $("#titlebar").addClass("slideUp"); // -150px 554 } 555 } 556 prevScrollpos = currentScrollPos; 557 558 // switch light/dark theme 559 $("section").each(function (index) { 560 if (windowTop > $(this).position().top - 100) { 561 if ($(this).hasClass("light")) { 562 $("#titlebar").addClass("lightNav"); 563 } else { 564 $("#titlebar").removeClass("lightNav"); 565 } 566 } 567 }); 568 }); 569 570 // show subnav on hover 571 //$('#titlebar nav > ul > li > a').css("border","solid 1px green"); 572 $("#titlebar nav > ul > li > a").hover( 573 function () { 574 $("#titlebar").addClass("hover"); 575 $("#titlebar nav > ul > li > a").removeClass("hover"); 576 $(this).addClass("hover"); 577 }, 578 function () {}, 579 ); 580 581 // hide subnav on mouseout
582 $("#titlebar").mouseleave(function () { 583 $(this).removeClass("hover"); 584 $("#donateSubnav > a").addClass("hover"); 585 }); 586 587 // burger nav 588 $(".burger").click(function () { 589 $(this).toggleClass("open"); 590 $("#titlebar").toggleClass("open"); 591 $("nav > ul > li > a").removeClass("clicked"); 592 $("#titlebar").removeClass("hover"); 593 }); 594 595 // mobile sub nav clicked 596 $("nav > ul > li > a") 597 .not("#donateSubnav a") 598 .click(function (event) { 599 event.preventDefault(); // is this needed? what's the plan here? 600 $("nav > ul > li > a").removeClass("clicked"); 601 $(this).addClass("clicked"); 602 }); 603 604 // close sub nav 605 $(".subNavBackLink").click(function () { 606 $(".clicked").removeClass("clicked"); 607 }); 608 609 // REMOVED DONATE CLICK IN MAIN NAV 610 // donate link clicks burger AND reveals donate subnav 611 // $("#titlebar a.donate").click(function () { 612 // if (window.innerWidth < 992) { 613 // if (!$(".burger").hasClass("open")) { 614 // $(".burger").click(); 615 // } 616 // $("nav > ul > li > a").removeClass("clicked"); 617 // $("#donateSubnav > a").addClass("clicked"); 618 // } 619 // }); 620 621 // show donate on hover (desktop only, somehow) 622 // $("#titlebar a.donate").hover( 623 // function () { 624 // $("#titlebar").addClass("hover"); 625 // $("nav > ul > li > a").removeClass("hover"); 626 // $("#donateSubnav > a").addClass("hover"); 627 // $(this).addClass("hover"); 628 // }, 629 // function () {} 630 // ); 631 632 // /nav---------------------------------------------------------------------------------------------- 633 634 // page loader 635 setTimeout(function () { 636 $("body").addClass("loaded"); 637 }, 2000); 638 639 /* fix for splide carousel loading off-center */ 640 $(".splide__arrow--next").each(function () { 641 //$(this).click(); 642 }); 643 644 setTimeout(function () { 645 //$('.splide__arrow--next').click(); 646 }, 100); 647 648 // splide slider - ministry partner logos on about page 649 if ($("#partnerSplide").length) { 650 new Splide("#partnerSplide", { 651 type: "loop", 652 breakpoints: { 653 1600: { 654 perPage: 4, 655 }, 656 1200: { 657 perPage: 3, 658 }, 659 992: { 660 perPage: 3, 661 }, 662 768: { 663 perPage: 3, 664 }, 665 480: { 666 perPage: 2, 667 }, 668 }, 669 perPage: 3, 670 perMove: 1, 671 arrows: false, 672 gap: "75px", 673 pagination: false, 674 focus: 1, 675 speed: 1000, 676 cloneStatus: false, 677 updateOnMove: true, 678 autoHeight: true, 679 autoplay: true, 680 interval: 2500, 681 }).mount(); 682 } 683 684 // GENESIS CODE 685 686 $(".join .ccm-input-email").attr("placeholder", "Email Address"); 687 688 // Rescue team header slideshow 689 $(".rescueTeamLanding .headerRescueTeam .slide a").removeAttr("target"); 690 691 var rescueHeaders = $(".rescueTeamLanding .headerRescueTeam .slide"); 692 var currentRescueSlide = 0; 693 var rescueTimer = setInterval(rescueHeaderSwitch, 5000); // comment this to stop slideshow 694 695 function rescueHeaderSwitch() { 696 //hide 697 rescueHeaders.css({ 698 visibility: "hidden", 699 position: "absolute", 700 height: "0", 701 overflow: "hidden", 702 width: "0", 703 }); 704 rescueHeaders.find("img").removeClass("fadeIcon"); 705 rescueHeaders.find(".h1Wrapper").removeClass("rattle"); 706 rescueHeaders.find("h1").removeClass("slam"); 707 //incremement
708 if (currentRescueSlide < rescueHeaders.length - 1) { 709 currentRescueSlide++; 710 } else { 711 currentRescueSlide = 0; 712 } 713 //show 714 rescueHeaders.eq(currentRescueSlide).css({ 715 visibility: "visible", 716 position: "relative", 717 height: "auto", 718 overflow: "visible", 719 width: "unset", 720 }); 721 rescueHeaders.eq(currentRescueSlide).find("img").addClass("fadeIcon"); 722 rescueHeaders.eq(currentRescueSlide).find(".h1Wrapper").addClass("rattle"); 723 rescueHeaders.eq(currentRescueSlide).find("h1").addClass("slam"); 724 } 725 726 function pauseRescueHeader() { 727 clearInterval(rescueTimer); 728 } 729 function startRescueHeader() { 730 rescueTimer = setInterval(rescueHeaderSwitch, 2000); 731 } 732 733 $(".headerRescueTeam .btn").mouseover(pauseRescueHeader); 734 $(".headerRescueTeam .btn").mouseout(startRescueHeader); 735 736 // -0end rescue team header slideshow 737 738 //Fix orphan words https://github.com/nathanford/widowadjust 739 // coded in a drunken stupor 740 /* 741 wt.fix({ 742 elements: 'p', 743 chars: 15, 744 method: 'nbsp', 745 event: 'resize' 746 }); 747 //Fix orphan words - headings 748 wt.fix({ 749 elements: 'h1, .mainContent h2, h3, h4, h5, h6', 750 chars: 8, 751 method: 'nbsp', 752 event: 'resize' 753 }); 754 //Fix orphan words - Join section heading 755 wt.fix({ 756 elements: '.join h2', 757 chars: 8, 758 method: 'nbsp', 759 event: 'resize' 760 }); 761 762*/ 763 764 $(".animatedSlides-xyz").each(function () { 765 var slideGroup = $(this).find(".slide").clone(); 766 console.log("slides: =" + slideGroup); 767 if ($(this).find("ul").length != 0) { 768 $(this).find("ul").append(slideGroup.clone()); 769 $(this).find("ul").append(slideGroup.clone()); 770 $(this).find("ul").append(slideGroup.clone()); 771 $(this).find(".slidescontainer").css("animation-duration", "20s"); 772 } else { 773 $(this).find(".slidescontainer").append(slideGroup.clone()); 774 $(this).find(".slidescontainer").append(slideGroup.clone()); 775 $(this).find(".slidescontainer").append(slideGroup.clone()); 776 $(this).find(".slidescontainer").css("animation-duration", "25s"); 777 } 778 }); 779 780 /* Homepage statbox sliders 781 782 const statSplide = new Splide( '#statbox1', { 783 type : 'loop', 784 drag : 'free', 785 focus : 'center', 786 pagination: false, 787 perPage: 3, 788 autoScroll: { 789 speed: 1, 790 }, 791} ); 792 793statSplide.mount(); 794 795*/ 796 797 // hide empty sections 798 var $row = $(".projectVideosRow"); 799 if (!$row.children().length || !$row.text().trim()) { 800 $(".projectVideos").hide(); 801 } 802 803 var $row2 = $(".projectStories"); 804 if (!$row2.children().length || !$row2.text().trim()) { 805 $(".projectStories").hide(); 806 } 807}); //doc.ready------------------------------------- 808 809/* Ministry Header - Toggle dropdown content */ 810function myFunction() { 811 document.getElementById("myDropdown").classList.toggle("show"); 812} 813 814// Close the dropdown menu if the user clicks outside of it 815window.onclick = function (event) { 816 if (!event.target.matches(".dropbtn")) { 817 var dropdowns = document.getElementsByClassName("dropdown-content"); 818 var i; 819 for (i = 0; i < dropdowns.length; i++) { 820 var openDropdown = dropdowns[i]; 821 if (openDropdown.classList.contains("show")) { 822 openDropdown.classList.remove("show"); 823 } 824 } 825 } 826}; 827 828// SPLIDE FIX??? 829document.addEventListener("DOMContentLoaded", function () { 830 var splides = document.querySelectorAll(".videos .splide"); 831 832 // Loop through each Splide instance. 833 splides.forEach(function (splide) { 834 var splideSlides = splide.querySelectorAll(".splide__slide"); 835 console.log("splide fix"); 836 837 // Recalculate the width of the Splide items when the Splide instance is initialized. 838 splideSlides.forEach(function (slide) { 839 slide.style.width = splide.offsetWidth + "px"; 840 }); 841 842 // Recalculate the width of the Splide items when the window is resized. 843 window.addEventListener("resize", function () {
844 splideSlides.forEach(function (slide) { 845 slide.style.width = splide.offsetWidth + "px"; 846 }); 847 }); 848 }); 849});
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.