/* ======================================================================== * DOM-based Routing * Based on http://goo.gl/EUTi53 by Paul Irish * * Only fires on body classes that match. If a body class contains a dash, * replace the dash with an underscore when adding it to the object below. * * .noConflict() * The routing is enclosed within an anonymous function so that you can * always reference jQuery with $, even when in .noConflict() mode. * ======================================================================== */ (function($) { // Use this variable to set up the common and page specific functions. If you // rename this variable, you will also need to rename the namespace below. var Sage = { // All pages common: { init: function() { // JavaScript to be fired on all pages }, finalize: function() { // JavaScript to be fired on all pages, after page specific JS is fired // Modal functionality $(".video-play").on("click", function(e) { e.preventDefault(); var id = $(this).attr("href").split("v=")[1]; if (id.length > 0) { if (document.getElementById(id) === null) { $("body").append('
'); } $(".reveal-overlay, .reveal-overlay .reveal.modal").css("display", "block"); } else { window.location.href = $(this).attr("href"); } $(".close-button").on("click", function() { $(".reveal-overlay, .reveal-overlay .reveal.modal").css("display", "none"); $(".youtube-video")[0].contentWindow.postMessage('{"event":"command","func":"' + "pauseVideo" + '","args":""}', "*"); $(".iframe-container").children("iframe").attr("src", ""); }); }); // Accordion functionality $(".accordion-toggle").on("click", function(e) { e.preventDefault(); $(this).toggleClass("open").siblings(".content").slideToggle(); }); // Language switcher JS var lang = document.querySelector(".wp-language-switcher"); if (lang) { if (lang.length && lang.length > 0) { lang.onchange = function() { window.location = this.value; }; } } // Cause Detail sticky footer $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 750) { $(".floating-footer").addClass("visible"); } else { $(".floating-footer").removeClass("visible"); } }); $("#myModal").on("shown.bs.modal", function() { $("#myInput").trigger("focus"); }); var myBar = document.getElementById("myBar"); function onScroll() { var winScroll = document.body.scrollTop || document.documentElement.scrollTop; var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; var scrolled = (winScroll / height) * 100; myBar.style.width = scrolled + "%"; } if (myBar) { window.onscroll = onScroll; } $(".featured-cards").slick({ dots: true, infinite: true, speed: 300, slidesToShow: 1, slidesToScroll: 1, mobileFirst: true, responsive: [{ breakpoint: 767, settings: "unslick", }, ], }); /* Block - Carousels -------------------------------------------------------------- */ $(".carousel__default").slick({ useTransform: true, cssEase: "ease-in-out", speed: 1000, slidesToShow: 1, slidesToScroll: 1, arrows: true, nextArrow: ".carousel__arrow--right", prevArrow: ".carousel__arrow--left", adaptiveHeight: true, }); $(".carousel__featured-campaigns").slick({ useTransform: true, cssEase: "ease-in-out", speed: 1000, slidesToShow: 3, slidesToScroll: 1, arrows: true, nextArrow: ".carousel__arrow--right", prevArrow: ".carousel__arrow--left", responsive: [{ breakpoint: 959, settings: { slidesToShow: 2, }, }, { breakpoint: 767, settings: { slidesToShow: 1, }, }, ], }); /* GoFindYou article image slider -------------------------------------------------------------- */ $(".heroesCarousel .carousel-contain").slick({ autoplay: true, speed: 1000, arrows: true, fade: true, autoplaySpeed: 8000, nextArrow: ".heroes-carousel-nav--next", prevArrow: ".heroes-carousel-nav--prev", }); /* Heroes archive carousel -------------------------------------------------------------- */ $(".gofindyou-article__body .image-slider").slick({}); /* Block - Layout - Accordion -------------------------------------------------------------- */ jQuery(".accordion__item-top").click(function() { jQuery(this).parent().toggleClass("accordion__item--open"); jQuery(this).siblings(".accordion__item-bottom").slideToggle(500); }); jQuery(".faq-question").on("click", function() { jQuery(this).parent(".faq").toggleClass("open"); jQuery(this).siblings(".faq-answer").slideToggle(500); }); /* Add iterating section ids to BLOCKS + Smooth scroll -------------------------------------------------------------- */ jQuery("main .block").each(function(i) { var navCounter = i + 1; jQuery(this).attr("id", "section-" + navCounter); }); /* Webinar Tags -------------------------------------------------------------- */ if (jQuery(window).width() < 760) { jQuery(".webinars-hub__categories").children().wrapAll("
"); jQuery(".webinars-hub__categories").append(""); } else { jQuery(".webinars-hub__categories").children().not(":nth-child(-n+3)").wrapAll("
"); jQuery(".webinars-hub__categories > a:nth-child(3)").after(""); } var webinarCategoriesHeight = jQuery(".webinars-hub__categories").outerHeight() + 8; jQuery(".webinars-hub__tags-dropdown").css("top", webinarCategoriesHeight); jQuery(".webinars-hub__categories .dropdown-trigger").click(function() { jQuery(this).siblings(".webinars-hub__tags-dropdown").toggleClass("open"); jQuery(this).toggleClass("active"); }); /* Single GoFindYou Lity scripts -------------------------------------------------------------- */ jQuery(".single-gofindyouarticle .modal-button").on("click", function() { var modalButtonID = jQuery(this).attr("id"); jQuery(document).on("lity:open lity:close", function(event, instance) { jQuery(".lity").attr("class", "lity lity-opened lity-inline"); jQuery(".lity").addClass(modalButtonID); }); }); /* Single Webinar Form -------------------------------------------------------------- */ var formHeight = jQuery(".single-webinar__header .form-wrapper").height(); var headerHeight = jQuery(".single-webinar__header").height() + formHeight - 31; jQuery(".single-webinar__header .form-track").css({ height: headerHeight, }); /* Smooth-scroll button links -------------------------------------------------------------- */ $("a.smooth-scroll.btn").click(function(event) { $("html,body").animate({ scrollTop: $(this.hash).offset().top - 100 }, 1500); }); /* Add aria labels on testimonial "Read More". Done to satisfy accessibility audit -------------------------------------------------------------- */ $(window).on("load", function() { $(".bne-testimonial-wrapper .testimonial-single").each(function(index) { var authorName = $(this).find(".testimonial-name").text(); $(this).find(".readmore").attr("aria-label", authorName); }); }); /* Academic Growth -------------------------------------------------------------- */ $(".ag-toggle-student").on("click", function() { $(".ag-toggle p").removeClass("active"); $(this).addClass("active"); $(".ag-toggled-section").removeClass("active"); $(".ag-student-blocks").addClass("active"); }); $(".ag-toggle-teacher").on("click", function() { $(".ag-toggle p").removeClass("active"); $(this).addClass("active"); $(".ag-toggled-section").removeClass("active"); $(".ag-teacher-blocks").addClass("active"); }); /* Remove /c/ from "Home" breadcrumb -------------------------------------------------------------- */ var homeUrl = jQuery("#breadcrumbs .breadcrumb-item:first-child a").attr("href") || ""; // Use a regular expression to replace both "/c/" and "/c" (with or without trailing slash) var stringReplace = homeUrl.replace(/\/c\/?|\/c\/?/g, ""); jQuery("#breadcrumbs .breadcrumb-item:first-child a").attr("href", stringReplace); /* Redirect Search Button to new Search Results Page /s?q= -------------------------------------------------------------- */ $(".js-search-nav-bar-button").on("click", function(event) { event.preventDefault(); window.location.replace("https://www.gofundme.com/s?q="); }); }, }, }; // The routing fires all common scripts, followed by the page specific scripts. // Add additional events for more control over timing e.g. a finalize event var UTIL = { fire: function(func, funcname, args) { var fire; var namespace = Sage; funcname = funcname === undefined ? "init" : funcname; fire = func !== ""; fire = fire && namespace[func]; fire = fire && typeof namespace[func][funcname] === "function"; if (fire) { namespace[func][funcname](args); } }, loadEvents: function() { // Fire common init JS UTIL.fire("common"); // Fire page-specific init JS, and then finalize JS $.each(document.body.className.replace(/-/g, "_").split(/\s+/), function(i, classnm) { UTIL.fire(classnm); UTIL.fire(classnm, "finalize"); }); // Fire common finalize JS UTIL.fire("common", "finalize"); }, }; // Load Events $(document).ready(UTIL.loadEvents); })(jQuery); // Fully reference jQuery after this point. // This corrects a chrome bug where anchor tags were not working if coming from a different page var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); if (window.location.hash && isChrome) { setTimeout(function() { var hash = window.location.hash; window.location.hash = ""; window.location.hash = hash; }, 300); } var $ = jQuery.noConflict(); //# sourceMappingURL=main-min.js.map ; $('.hero .inner-content p').addClass('body-large'); /* Articles Tabs logic -------------------------------------------------------------- */ jQuery('.newsroom-tabs .hrt-tab').on('click', function() { var selectedSlug = jQuery(this).data('slug'); jQuery('.newsroom-tabs .hrt-tab').removeClass('active hrt-tab--active'); jQuery(this).addClass('active hrt-tab--active'); jQuery('.section-tabs .section-tabs__tab').each(function() { var sectionSlug = jQuery(this).data('slug'); if (selectedSlug === sectionSlug) { jQuery(this).addClass('active'); } else { jQuery(this).removeClass('active'); } jQuery('.tabbed-articles-nav .see-more').css('display', 'flex'); jQuery('.tabbed-articles').addClass('more-padding'); }); }); /* Articles Tabs logic -------------------------------------------------------------- */ jQuery('.ss-tabs .tab').on('click', function() { var selectedSlug = jQuery(this).data('slug'); jQuery('.ss-tabs .hrt-tab').removeClass('active hrt-tab--active'); jQuery(this).addClass('active hrt-tab--active'); jQuery('.tabbed-articles-wrapper .tabbed-section').each(function() { var sectionSlug = jQuery(this).data('slug'); if (selectedSlug === sectionSlug) { jQuery(this).addClass('active'); } else { jQuery(this).removeClass('active'); } jQuery('.tabbed-articles-nav .see-more').css('display', 'flex'); jQuery('.tabbed-articles').addClass('more-padding'); }); }); /* See more logic -------------------------------------------------------------- */ jQuery(document).ready(function() { let allTab = $('.hrt-tab[data-slug="all"]'); jQuery(allTab).addClass('hrt-tab--active'); jQuery(allTab).children('.hrt-tab-title').text('All'); jQuery('.tab').click(function() { var dataSlug = jQuery(this).attr('data-slug'); var newUrl = '/c/newsroom-category/' + dataSlug; // adjust the path if necessary jQuery('#gofundme .see-more').attr('href', newUrl); }); }); ; /*! This file is auto-generated */ (()=>{"use strict";var e={d:(t,d)=>{for(var o in d)e.o(d,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:d[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function d(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:()=>d}),(window.wp=window.wp||{}).domReady=t.default})();; /*! This file is auto-generated */ (()=>{var t={507:(t,e,r)=>{"use strict";r.d(e,{A:()=>A});var n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var i=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var o=function(t,e){return function(r,o,s,c=10){const l=t[e];if(!i(r))return;if(!n(o))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:o};if(l[r]){const t=l[r].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,s,c)}};var s=function(t,e,r=!1){return function(o,s){const c=t[e];if(!i(o))return;if(!r&&!n(s))return;if(!c[o])return 0;let l=0;if(r)l=c[o].handlers.length,c[o]={runs:c[o].runs,handlers:[]};else{const t=c[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,s),l}};var c=function(t,e){return function(r,n){const i=t[e];return void 0!==n?r in i&&i[r].handlers.some((t=>t.namespace===n)):r in i}};var l=function(t,e,r,n){return function(i,...o){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const c=s[i].handlers;if(!c||!c.length)return r?o[0]:void 0;const l={name:i,currentIndex:0};return(n?async function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex0:Array.from(n.__current).some((t=>t.name===r))}};var u=function(t,e){return function(r){const n=t[e];if(i(r))return n[r]&&n[r].runs?n[r].runs:0}};class h{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=s(this,"actions"),this.removeFilter=s(this,"filters"),this.hasAction=c(this,"actions"),this.hasFilter=c(this,"filters"),this.removeAllActions=s(this,"actions",!0),this.removeAllFilters=s(this,"filters",!0),this.doAction=l(this,"actions",!1,!1),this.doActionAsync=l(this,"actions",!1,!0),this.applyFilters=l(this,"filters",!0,!1),this.applyFiltersAsync=l(this,"filters",!0,!0),this.currentAction=a(this,"actions"),this.currentFilter=a(this,"filters"),this.doingAction=d(this,"actions"),this.doingFilter=d(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}var A=function(){return new h}},8770:()=>{}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{actions:()=>x,addAction:()=>s,addFilter:()=>c,applyFilters:()=>m,applyFiltersAsync:()=>v,createHooks:()=>t.A,currentAction:()=>y,currentFilter:()=>F,defaultHooks:()=>o,didAction:()=>b,didFilter:()=>k,doAction:()=>f,doActionAsync:()=>p,doingAction:()=>_,doingFilter:()=>g,filters:()=>w,hasAction:()=>d,hasFilter:()=>u,removeAction:()=>l,removeAllActions:()=>h,removeAllFilters:()=>A,removeFilter:()=>a});var t=r(507),e=r(8770),i={};for(const t in e)["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(t)<0&&(i[t]=()=>e[t]);r.d(n,i);const o=(0,t.A)(),{addAction:s,addFilter:c,removeAction:l,removeFilter:a,hasAction:d,hasFilter:u,removeAllActions:h,removeAllFilters:A,doAction:f,doActionAsync:p,applyFilters:m,applyFiltersAsync:v,currentAction:y,currentFilter:F,doingAction:_,doingFilter:g,didAction:b,didFilter:k,actions:x,filters:w}=o})(),(window.wp=window.wp||{}).hooks=n})();;