{"version":3,"sources":["scripts.js"],"names":["$","once","doMobileImageSlides","$ssSlides","$ssImages","ssSlideCount","length","i","ssSlide","window","innerWidth","css","$ssImage","eq","$ssSlide","setTimeout","fadeIn","addClass","setInterval","hide","removeClass","delay","fadeOut","isThisMobile","navigator","userAgent","match","ytfixbtn","elem","btnurl","attr","includes","ytid","regExp","colorbox","iframe","width","height","scrolling","overlayClose","opacity","close","closeButton","ytmodal","each","document","lu_isBP","breakpoint","breakpoints","index","indexOf","bitmask","Math","pow","cssint","parseInt","modals","lu_showModal","id","element_root","toggle_callback","data","modal","pop","push","documentElement","toggleClass","lu_hideModal","splice","location","pathname","page_load_category","find","val","text","jQuery","url_params","URLSearchParams","search","tag_name","get","replace","on","this","split","Drupal","behaviors","lu_theme","attach","context","settings","lu_disable_animations","Cookies","append","body","href","fnUpdateAnimationsState","$button","html","click","event","set","expires","remove","stopPropagation","target","closest","preventDefault","menuToggle","state","$focus","focus","trigger","menuButtonToggle","hasClass","videoCat","siblings","children","e","_this","$this","previousScrolled","$header","$headerAnchor","insertBefore","movementAmount","headerStop","offset","top","outerHeight","effectiveScrollTop","scrollTop","style","paddingTop","belowBottom","aboveTop","marginTop","distance","abs","direction","scrollSpy","parentElement","parents","$floating_nav","$nav_toggle","debounceTimer","fnInteriorNavToggle","clearTimeout","aria-expanded","fnInteriorNavButtonToggle","fnPrepareFloatingNav","parent","appendTo","prop","prependTo","breakpoint_bottom_menu_flip","newThird","type","affixed","topOffset","vh","$main_menu_items","$menu","label","aria-haspopup","new_state","insertAfter","slide_num","slick","removeAttr","caption_image_src","see_more_button","category_name","textContent","normalized_category_name","replaceAll","catcolor_name","classList","add","toLowerCase","category_endcap","createElement","appendChild","autoplay","autoplaySpeed","dots","fade","adaptiveHeight","speed"],"mappings":"AAGA,cAEA,SAAUA,EAAGC,GA8hBX,QAASC,KAEP,GAAIC,GAAYH,EAAE,iBACdI,EAAYJ,EAAE,iBACdK,EAAeF,EAAUG,OAEzBC,EAAI,EACJC,EA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GAAI8H,GAAoB1K,EAAEmF,MAAMsE,KAAK,OAEjCc,EAAY,WAAavK,EAAEmF,MAAM2D,QAAQ,iBAAiBW,KAAK,SAASrE,MAAM,MAAM,GAAGA,MAAM,KAAK,EACtGpF,GAAEuK,EAAY,QAAQd,KAAK,MAAOiB,GAClC1K,EAAEmF,MAAMoB,UAIV,IAAIoE,GAAkB3K,EAAE,gCACxB2K,GAAgB1J,SAAS,uBACzB0J,EAAgBjG,KAAK,YAGrB1E,EAAE,8SACG4C,KAAK,WACR,GAAIgI,GAAgBzF,KAAK0F,YACrBC,EAA2BF,EAAcG,WAAW,IAAK,KAAKA,WAAW,IAAK,OAC9EC,EAAgB,YAAcF,CAGlC,IAFA3F,KAAK8F,UAAUC,IAAIF,EAAcG,eAEJ,IAAzBhG,KAAKkC,SAAS/G,OAAc,CAC9B,GAAI8K,GAAkBvI,SAASwI,cAAc,MAC7CD,GAAgBH,UAAUC,IAAI,mBAC9B/F,KAAKmG,YAAYF,MAGrBpL,EAAE,kCAAkC4C,KAAK,WACvCuC,KAAK8F,UAAUC,IAAI,UACnB/F,KAAK8F,UAAUC,IAAI,oBA4EzBlL,EAAE,WAGIA,EAAE,eAAeM,SACnBN,EAAE,cAAcwK,OACde,UAAU,EACVC,cAAe,IACfC,MAAM,EACNC,MAAM,EAENC,gBAAgB,EAChBC,MAAO,MAET5L,EAAE,eAAeW,IAAI,UAAW,UAMhCT,MAuEJyC,KAECgC,OAAQ1E","file":"../scripts.js","sourcesContent":["/**\n * Global scripts for the theme. Stuff that we need all the time on every page.\n */\n\"use strict\";\n\n(function($, once) {\n // Quick and dirty CSS breakpoint checker.\n window.lu_isBP = function (breakpoint) {\n var breakpoints = ['small', 'medium', 'large', 'xlarge'],\n index = breakpoints.indexOf(breakpoint);\n if (index === -1) {\n return false;\n }\n var bitmask = Math.pow(2, index), cssint = parseInt($('head').css('margin-left'));\n return (cssint & bitmask) > 0;\n }\n\n // Modal manager.\n var modals = [];\n window.lu_showModal = function(id, element_root, toggle_callback, data) {\n // Close all previous modals.\n var modal = null;\n while (modal = modals.pop()) {\n if (modal.id !== id) {\n modal.toggle_callback(false);\n }\n }\n toggle_callback(true, data);\n modals.push({ id: id, toggle_callback: toggle_callback, element_root: element_root });\n $(document.documentElement).toggleClass('modal-shown', modals.length > 0);\n }\n window.lu_hideModal = function(id) {\n for (var i = 0; i < modals.length; ++i) {\n if (!id || modals[i].id === id) {\n modals[i].toggle_callback(false);\n modals.splice(i, 1);\n break;\n }\n }\n $(document.documentElement).toggleClass('modal-shown', modals.length > 0);\n }\n\n if (window.location.pathname === '/news/archive') {\n $(function () {\n // change title on page load\n const page_load_category = $('select[name=\"field_news_category_target_id\"]').find(\":selected\").val();\n if (page_load_category !== 'All' && page_load_category != null) {\n $('#block-lawrence-theme-page-title h1').text('News - Category: ' + jQuery('select[name=\"field_news_category_target_id\"]').find(\":selected\").text());\n }\n // get query params to check for tag and set title\n const url_params = new URLSearchParams(window.location.search);\n const tag_name = url_params.get('field_tags_target_id');\n if (tag_name !== '' && tag_name != null) {\n $('#block-lawrence-theme-page-title h1').text('News - Tag: ' + tag_name.replace(/\\s*\\(.*?\\)\\s*/g, ''));\n }\n // change title when select box changes\n $('body').on('change', 'select[name=\"field_news_category_target_id\"]', function () {\n if ($(this).find(\":selected\").val() === 'All') {\n $('#block-lawrence-theme-page-title h1').text('All News');\n } else {\n $('#block-lawrence-theme-page-title h1').text('News - Category: ' + jQuery(this).find(\":selected\").text());\n }\n });\n $('body').on('change', 'input[name=\"field_tags_target_id\"]', function () {\n if ($(this).val() === '' || $(this).val() == null) {\n $('#block-lawrence-theme-page-title h1').text('All News');\n } else {\n // remove the tag ID from the title\n $('#block-lawrence-theme-page-title h1').text('News - Tag: ' + jQuery(this).val().split('(')[0].replace(/\\s*\\(.*?\\)\\s*/g, ''));\n }\n });\n });\n }\n\n Drupal.behaviors.lu_theme = {\n attach: function (context, settings) {\n window.lu_disable_animations = !!(Cookies.get('lu-da') || false);\n // JDS - disabling all animations for now until Chrome fixes itself\n //window.lu_disable_animations = true;\n // Add our Google font, which we do async style to prevent blocking.\n // CKOD\n /*\n $('head').once('lu_theme.googlefont').append($('')\n .attr('href', \"https://fonts.googleapis.com/css2?family=Lora:ital@0;1&display=swap\"));\n $('head').once('lu_theme.googlefont2').append($('')\n .attr('href', \"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,600;1,400;1,600&display=swap\"));\n */\n // jquery once to core once\n //$('head').once('lu_theme.googlefont2').append($('')\n // .attr('href', \"https://use.typekit.net/vnl4adk.css?family=ivypresto-headline:normal,wght@0,100;1,400&display=swap\"));\n $(once('lu_theme.googlefont2', 'head')).each(function(){\n $(this).append($('')\n .attr('href', \"https://use.typekit.net/vnl4adk.css?family=ivypresto-headline:normal,wght@0,100;1,400&display=swap\"));\n });\n // Set this class right away so that things which need to trigger ASAP\n // (like hero gold bars) can do whatever they do to hide until animations\n // load.\n if (!window.lu_disable_animations) {\n $(document.body).addClass('animations-potential');\n }\n // Super gross hack to add the current page to login links, because doing\n // this in Drupal w/menu alters was a pain and caching was dubious.\n // jquery once to core once\n //$('a[href$=\"/user/login\"]').once('lu_theme.login_links').each(function() {\n $(once('lu_theme.login_links', 'a[href$=\"/user/login\"]')).each(function() {\n this.href += '?destination=' + window.location.pathname;\n });\n // Set up the button - change its state based on any cookie value.\n var fnUpdateAnimationsState = function() {\n var $button = $('.menu-animation-toggle');\n if (window.lu_disable_animations) {\n $button.html($button.html().replace(/Disable/, 'Enable').replace(/disable/, 'enable'));\n }\n else {\n $button.html($button.html().replace(/Enable/, 'Disable').replace(/enable/, 'disable'));\n }\n $(document.body).toggleClass('animations-off', window.lu_disable_animations);\n $(document.body).toggleClass('animations-on', !window.lu_disable_animations);\n $(document.body).toggleClass('animations-potential', !window.lu_disable_animations);\n };\n // jquery once to core once\n //$(window).once('lu_theme.animations').on('load', function() {\n $(once('lu_theme.animations', 'html')).each(function(){\n // If animations are enabled, wait for any to load (more than $duration\n // in SCSS) and, after sufficient delay for animations to load to their\n // normal state, enable animations.\n setTimeout(function enableAnimations() {\n fnUpdateAnimationsState();\n }, 375);\n //console.log('window animations on load ran');\n });\n // jquery once to core once\n //$('.menu-animation-toggle', context).once('lu_theme.animations').click(function(event) {\n $(once('lu_theme.animations', '.menu-animation-toggle', context)).each(function(){\n $(this).click(function(event) {\n // Toggle the setting, then react.\n window.lu_disable_animations = !window.lu_disable_animations;\n if (window.lu_disable_animations) {\n Cookies.set('lu-da', '1', { expires: 180 })\n }\n else {\n Cookies.remove('lu-da');\n }\n event.stopPropagation();\n fnUpdateAnimationsState();\n });\n });\n\n // jquery once to core once\n //$(document.documentElement).once('lu_theme.modals').click(function(event) {\n $(once('lu_theme.modals', document.documentElement)).each(function(){\n $(this).click(function(event) {\n // Intercept any clicks that occur outside of our modals, and close\n // them (but only check if we actually are showing modals).\n if (modals.length) {\n for (var i = 0; i < modals.length; ++ i) {\n if ($(event.target).closest(modals[i].element_root).length > 0) {\n return;\n }\n }\n event.preventDefault();\n lu_hideModal();\n }\n });\n });\n\n var menuToggle = function(state, event) {\n $(document.documentElement).toggleClass('nav-menu-shown', state);\n if (state) {\n // Showing modal.\n // Was it the search button or menu button that was clicked?\n var $focus = $('#lu-search-ajax-keys');\n if ($(event.target).closest('.menu-search-toggle').length === 0) {\n $focus = $('#nav-menu > .outer-wrapper');\n $focus.attr('tabindex', 0);\n }\n setTimeout(function() { $focus.focus(); }, 100);\n }\n else {\n // Hiding modal.\n $('#nav-menu > .outer-wrapper').attr('tabindex', null);\n // Reset the search field and notify the event listener stuff.\n $('#lu-search-ajax-keys').val('').trigger('input.lu-search-ajax');\n }\n };\n var menuButtonToggle = function(event) {\n // Register this modal, so it can be closed by other modals.\n if (!$(document.documentElement).hasClass('nav-menu-shown')) {\n lu_showModal('global-nav-menu', $('#nav-menu'), menuToggle, event);\n }\n else {\n lu_hideModal('global-nav-menu');\n }\n event.stopPropagation();\n event.preventDefault();\n };\n // jquery once to core once\n //$('.menu-toggle', context).once('lu_theme').click(menuButtonToggle);\n $(once('lu_theme', '.menu-toggle', context)).each(function(){$(this).click(menuButtonToggle);});\n\n // jquery once to core once\n //$('.node--video_card--card', context).once('lu_theme').find('.field--name-field-video').each(function() {\n $(once('lu_theme', '.node--video_card--card', context)).find('.field--name-field-video').each(function() {\n var videoCat = $('.node--video_card--card > div.field--name-field-news-category');\n videoCat.text('Video');\n // Add \"Play video\" button to video cards.\n\n // var $btn = $('
'), _this = this;\n // $('Play video')\n // .attr('href', $(this).find('a').attr('href'))\n // .click(function(e) {\n // e.preventDefault();\n // $(_this).find('.media--type-remote-video a').click();\n // })\n // .appendTo($btn);\n // $btn.appendTo($(this).parents('.node--video_card--card'));\n\n // JDS - Make the title a link too (because apparently COMMS thinks good SEO means we need to apply links to every field - probably will want done for every word at some point)\n $(this).siblings('.field--name-field-display-title-plain').children('h2').html(\n '' + $(this).siblings('.field--name-field-display-title-plain').children('h2').text() + '')\n .click(function(e) {\n e.preventDefault();\n $(_this).find('.media--type-remote-video a').click();\n });\n });\n\n // Set up floating header.\n // $('#site-header').once('lu_theme').find('.field--name-field-video').each(function() {\n //\n // });\n // Ensure we have a dark logo version, to show while scrolling (white bg).\n // jquery once to core once\n //$('.site-logo img, #site-header .menu-toggles img', context).once('lu_theme').each(function () {\n $(once('lu_theme', '.site-logo img, #site-header .menu-toggles img', context)).each(function () {\n var $this = $(this);\n $this\n .data('og-src', $this.attr('src'))\n .data('scroll-src', $this.attr('src').replace(/-rev\\.svg|-white\\.svg/, \".svg\"));\n });\n var previousScrolled = false;\n var $header = $('#site-header'), $headerAnchor = null;\n\n // Set up a target element that tracks the effective top edge of the\n // header, if it were still placed on the page (in case there are other\n // items like emergency banners or admin toolbars taking up space above).\n // jquery once to core once\n //$header.once('lu_theme-anchor').each(function() {\n $(once('lu_theme-anchor', $header)).each(function() {\n $headerAnchor = $('
').insertBefore($header);\n });\n\n // Initialize our total movement tracker with something bigger than our\n // threshold.\n var movementAmount = 100;\n // jquery once to core once\n //$('.page', context).once('lu_theme')\n $(once('lu_theme', '.page', context))\n .on('scroll-move', function (event) {\n if (!$(event.target).hasClass(\"page\")) {\n return;\n }\n\n // Calculate the lower vertical bound of the header, if it were still\n // anchored on the page.\n var headerStop = $headerAnchor.offset().top + $header.outerHeight(true);\n // The effective scrollTop is the window.scrollTop plus any other\n // elements like admin toolbars.\n var effectiveScrollTop = $(window).scrollTop() + parseInt(document.body.style.paddingTop || 0);\n // Check if the effective scrollTop is below the bottom of the header,\n // or above the top of the header.\n var belowBottom = effectiveScrollTop - headerStop >= 0,\n aboveTop = $headerAnchor.offset().top - effectiveScrollTop >= 0;\n\n // If there's an emergency banner (or maybe over time other things),\n // which push the statically positioned header down, pull it back up\n // when we switch to a fixed position.\n var marginTop = $('.lu-emergency-alert-banner').outerHeight();\n if (!!marginTop) {\n $header.css('margin-top', -marginTop + \"px\");\n }\n\n // Check if we've now scrolled below the static header, triggering\n // our floating header. previousScrolled is just a debounce so we run\n // the transition phase only once.\n if (belowBottom && !previousScrolled) {\n $header.addClass('scrolled');\n // Flip images.\n $('.site-logo img, #site-header .menu-toggles img').each(function () {\n $(this).attr('src', $(this).data('scroll-src'));\n });\n previousScrolled = true;\n $header.addClass('scrolled-transition');\n setTimeout(function() {\n $header.removeClass('scrolled-transition');\n }, 350);\n }\n // If we've scrolled back above the top of where the header rests,\n // stop floating. scrollTop() === 0 is just a sanity check, aboveTop\n // should be correct.\n else if ($(window).scrollTop() === 0 || aboveTop) {\n $header.removeClass('scrolled');\n // Flip images.\n $('.site-logo img, #site-header .menu-toggles img').each(function () {\n $(this).attr('src', $(this).data('og-src'));\n });\n previousScrolled = false;\n }\n // We do *not* want to apply a movement threshold to this value.\n $header.toggleClass('page-scrolled', $(window).scrollTop() > 0);\n\n // Scrolling up, in general? Use to show some elements.\n // Tally the amount of actual movement, so we can smooth out some\n // over-sensitivity in hiding/showing stuff.\n // Negative distance means traveling up the page, positive is\n // scrolling downward.\n movementAmount += event.distance;\n if (Math.abs(movementAmount) >= 15 || $(window).scrollTop() === 0) {\n $header.toggleClass('docked', (event.direction === \"down\"));\n $(event.target).toggleClass('scrolling-up', (event.direction === \"up\"));\n $(event.target).toggleClass('scrolling-down', (event.direction !== \"up\"));\n movementAmount = 0;\n }\n })\n .scrollSpy();\n\n // $('#sidebar-inset', context).once('lu_theme')\n // .on('scroll-move', function (event) {\n // $(this).toggleClass('scrolled', !!event.belowTop);\n // })\n // .scrollSpy();\n\n // News search. Yes this is not the best place for this, it should be its\n // own library, added properly. But this will work and we have no time to\n // do the Right Thing(tm).\n // jquery once to core once\n //$('.view-id-lu_news_blog .views-exposed-form', context.parentElement || context).once('lu_theme')\n $(once('lu_theme', '.view-id-lu_news_blog .views-exposed-form', context.parentElement || context))\n .find('select[name=field_news_category_target_id],select[name=field_profiles_category_target_id]').each(function(){\n $(this).on('change', function() {\n $(this).parents('form').find('.form-submit').click();\n });\n });\n\n // Floating \"Section Menu\" interior navigation block.\n var $floating_nav = null, $nav_toggle = null;\n var debounceTimer = null;\n var fnInteriorNavToggle = function(state) {\n $floating_nav.toggleClass('nav-hidden', !state);\n $floating_nav.toggleClass('nav-shown', state);\n // Fix animations so slide-out doesn't actually animate on first display.\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n if (state) {\n $floating_nav.addClass('nav-was-shown')\n .attr('tabindex', '0');\n setTimeout(function() { $floating_nav.focus(); }, 100);\n }\n else {\n $floating_nav.attr('tabindex', null);\n // Roughly match the ms delay here to the $duration value in SCSS.\n debounceTimer = setTimeout(function() { $floating_nav.removeClass('nav-was-shown'); }, 350);\n }\n\n $nav_toggle\n .text(state ? 'Close Menu' : 'Section Menu')\n .attr({\n \"aria-expanded\": !!state\n });\n };\n var fnInteriorNavButtonToggle = function(event) {\n // Register this modal, so it can be closed by other modals.\n if (!$floating_nav.hasClass('nav-shown')) {\n lu_showModal('interior-nav-menu', $floating_nav, fnInteriorNavToggle, event);\n }\n else {\n lu_hideModal('interior-nav-menu');\n }\n event.stopPropagation();\n };\n var fnPrepareFloatingNav = function(parent) {\n if (!$floating_nav) {\n $floating_nav = $('
').appendTo(parent);\n }\n if (!$nav_toggle) {\n // adding section-menu class to appease Ken's inane need to not hide this on mobile - see _floating_toc.scss line 219\n $nav_toggle = $('')\n .on('click', fnInteriorNavButtonToggle)\n .insertBefore($floating_nav);\n }\n // Clone the nav.\n $floating_nav.html(\n '
Section Menu
' +\n $(parent).find('.menu').prop('outerHTML').replace(/\\sid=(['\"])/gi, ' id=$1nav-copy-').replace(/\\sdata-[^\\s]+?=(['\"]).*?\\1/gi, '')\n );\n var $nav_toggle_scnd = $('')\n .on('click', function() { lu_hideModal('interior-nav-menu'); })\n .prependTo($floating_nav);\n }\n var breakpoint_bottom_menu_flip = 'medium';\n // jquery once to core once\n //$('#block-site-structure', context).once('lu_theme.floating_nav')\n $(once('lu_theme.floating_nav', '#block-site-structure', context))\n .each(function() {\n fnPrepareFloatingNav(this);\n })\n .on('scroll-new-third', function (event) {\n // Check if we've scrolled down the page, and the nav is now above\n // the viewport.\n $(this)\n .toggleClass('scrolled', event.newThird === 'above')\n .trigger({\n type: 'interior-nav-affix',\n affixed: event.newThird === 'above'\n });\n })\n .on('interior-nav-affix', function (event) {\n if (event.affixed) {\n fnPrepareFloatingNav(event.target);\n }\n else {\n // Ensure we close up any open drawers.\n if (lu_isBP(breakpoint_bottom_menu_flip)) {\n setTimeout(function() { lu_hideModal('interior-nav-menu'); }, 0);\n }\n }\n })\n .scrollSpy({ topOffset: function(vh) { return parseInt($('body').css('padding-top') || 0) } });\n\n // On-Scroll region effects - mostly handled via CSS, but trigger w/JS.\n // jquery once to core once\n //$('.effect-on-scroll', context).once('lu_theme.animations').each(function() {\n $(once('lu_theme.animations', '.effect-on-scroll', context)).each(function() {\n // Scroll effects are registered on layout containers, but apply to\n // the paragraphs therein.\n $('.layout__region .paragraph:not(.layout__region .paragraph .paragraph)', this)\n .addClass('effect-target')\n .scrollSpy({ topOffset: function(vh) { return parseInt($('body').css('padding-top') || 0) } });\n });\n // jquery once to core once\n //$('.effect-on-outer-scroll', context).once('lu_theme.animations').each(function() {\n $(once('lu_theme.animations', '.effect-on-outer-scroll', context)).each(function() {\n // Scroll effects are registered on layout containers, and that's where\n // we apply them.\n $(this)\n .addClass('effect-target')\n .scrollSpy({ topOffset: function(vh) { return parseInt($('body').css('padding-top') || 0) } });\n });\n $(document).on('scroll-new-third', '.effect-target', function(event) {\n if (event.newThird === 'visible' || event.newThird === 'above') {\n $(this).addClass('effect-scrolled');\n }\n });\n\n // Fly-out clone of the main menu (on mobile) needs some accordion\n // functionality.\n // Base this on https://www.w3.org/WAI/tutorials/menus/flyout/.\n // jquery once to core once\n //$('#nav-menu .menu--main > .menu', context).once('lu_theme.flyoutmenu').each(function() {\n $(once('lu_theme.flyoutmenu', '#nav-menu .menu--main > .menu', context)).each(function() {\n var $main_menu_items = $('> .menu-item.menu-item--expanded', this);\n\n $main_menu_items.each(function() {\n var $menu = $(this), debounceTimer = null;\n $menu.addClass('submenu-closed');\n var label = $menu.find('> a')\n .attr({\n 'aria-haspopup': 'true',\n 'aria-expanded': 'false'\n }).text();\n var $button = $('')\n .append($('').text('Toggle submenu for \"' + label + '\"'))\n .click(function() {\n var new_state = !$menu.hasClass('submenu-open');\n $menu\n .toggleClass('submenu-closing', !new_state)\n .toggleClass('submenu-open', new_state)\n .attr({ 'aria-expanded': new_state ? 'true' : 'false' });\n $button.attr({ 'aria-expanded': new_state ? 'true' : 'false' });\n if (!new_state) {\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n debounceTimer = setTimeout(function() {\n $menu.addClass('submenu-closed');\n $menu.removeClass('submenu-closing');\n }, 350);\n }\n else {\n $menu.removeClass('submenu-closed');\n }\n })\n .insertAfter($menu.find('> a'));\n });\n });\n\n // onclick slider controls for news article slider\n $('.slick__slide').on(\"click\", function () {\n // get slide number of slide clicked and move to it\n var slide_num = $(this).prop('class').split('--')[1].split(' ')[0];\n $('.slick__slider').slick('slickGoTo', slide_num);\n });\n\n // remove video poster for slick slider videos\n $('.media--slick video').removeAttr('poster');\n\n // get slides' caption image src and insert it as thumbnail image\n $('.slide__description img').each(function () {\n var caption_image_src = $(this).prop('src');\n // get slide number (I know this is hacky but it works great) and replace thumbnail src\n var slide_num = \".slide--\" + $(this).parents('.slick__slide').prop('class').split('--')[1].split(' ')[0];\n $(slide_num + ' img').prop('src', caption_image_src);\n $(this).remove();\n });\n\n // change some aspects of the See More button under the gallery\n var see_more_button = $('.field--name-field-see-more a');\n see_more_button.addClass('button button-arrow');\n see_more_button.text('See More');\n\n // news category color class applier\n $('.node--article--card > .field--name-field-news-category, .node--article--card > .field--name-field-profiles-category, .node--video_card--card > .field--name-field-news-category, .node--snapshot--card > .field--name-field-snapshot-type, .node--article--card > .field--name-field-bjorklunden-category')\n .each(function() {\n var category_name = this.textContent;\n var normalized_category_name = category_name.replaceAll(' ', '_').replaceAll('&', 'and');\n var catcolor_name = 'catcolor-' + normalized_category_name;\n this.classList.add(catcolor_name.toLowerCase());\n\n if (this.children.length === 0) {\n var category_endcap = document.createElement('div');\n category_endcap.classList.add('category-endcap');\n this.appendChild(category_endcap);\n }\n });\n $('.related-articles .more-link a').each(function() {\n this.classList.add('button');\n this.classList.add('button-arrow');\n });\n }\n };\n // Adjust top offset if there's a navigation toolbar.\n // $(document).on('drupalViewportOffsetChange.toolbar', function(event, offsets) {\n // $('#nav-menu').css('top', offsets.top || 0);\n // });\n\n\n // mobile hero image slides\n function doMobileImageSlides() {\n\n var $ssSlides = $('.mobile-slide');\n var $ssImages = $('.mobile-image');\n var ssSlideCount = $ssSlides.length;\n\n var i = 0;\n var ssSlide = 1;\n\n if (ssSlideCount > 0) { // need to do this with one slide, even when more than one else will be blank for first 5 seconds\n\n // hide current hero image on mobile, else it shows briefly between slides\n if (window.innerWidth < 810) {\n $('.hero-image .field--name-field-image').css('display', 'none');\n }\n\n var $ssImage = $ssImages.eq(ssSlide-1);\n var $ssSlide = $ssSlides.eq(ssSlide-1);\n\n setTimeout( function () {\n $ssImage.fadeIn(150, \"linear\");\n $ssSlide.addClass('active');\n }, 200);\n\n if ((ssSlideCount > 1) /* && (window.innerWidth < 810) */) { // don't run this unnecessarily on desktop\n\n ssSlide = 2; // manually set to 2nd slide since we just showed the first one above\n\n setInterval( function () {\n\n if (ssSlide > ssSlideCount) {\n ssSlide = 1;\n }\n\n var $ssSlide = $ssSlides.eq(ssSlide-1);\n var $ssImage = $ssImages.eq(ssSlide-1);\n\n //console.log(i, ssSlide, $ssSlide, $ssImage);\n\n if (i > 0) {\n $ssImages.hide();\n }\n\n $ssSlides.removeClass('active');\n $ssSlide.addClass('active');\n\n $ssImage.fadeIn(150, \"linear\").delay(4500).fadeOut(350, \"linear\"); // must match with timing in _hero.scss (ln 134)\n\n ssSlide++; i++;\n\n }, 4800);\n\n }\n\n } else { // show original hero image for mobile\n\n // need to still hide image if on desktop else it will show instead\n /*\n if (window.innerWidth < 810) {\n $('.hero-image .field--name-field-image').fadeIn(150, 'linear');\n }\n */\n }\n }\n\n $(function() {\n\n // hero text - call slick if necessary and unhide\n if ($('.hero-slide').length) {\n $('.hero-text').slick({\n autoplay: true,\n autoplaySpeed: 4000,\n dots: true,\n fade: true,\n // vertical: true, // does not work with \"fade\"\n adaptiveHeight: true,\n speed: 1000\n });\n $('.hero-slide').css('display', 'block');\n }\n\n // hero mobile image slideshow - only run if on mobile breakpoint\n //if (isThisMobile()) {\n //if (window.innerWidth < 810) {\n doMobileImageSlides();\n //}\n // NOTE: hiding mobile slides via CSS (_hero.scss), tho would be nice\n // to not run this on desktop unnecessarily\n });\n\n\n function isThisMobile() {\n if (navigator.userAgent.match(/Android/i)\n || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i)\n || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i)\n || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)) {\n return true;\n }\n return false;\n }\n\n function ytfixbtn(elem) {\n\n var btnurl = $(elem).attr('href');\n\n if (btnurl.includes('youtube.com') || btnurl.includes('youtu.be')) {\n\n // get the youtube video id\n var ytid = 'dQw4w9WgXcQ';\n var regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = btnurl.match(regExp);\n\n if (match && match[2].length == 11) {\n ytid = match[2];\n $(elem).attr('href', 'https://www.youtube.com/embed/' + ytid + '?rel=0&wmode=transparent&autoplay=1');\n if(isThisMobile()) {\n $(elem).colorbox({iframe:true, width:\"90%\", height:\"75%\", scrolling:false, overlayClose:true, opacity:0.5, close:\"Close\", closeButton:false});\n } else {\n $(elem).colorbox({iframe:true, width:\"75%\", height:\"75%\", scrolling:false, overlayClose:true, opacity:0.5, close:\"Close\", closeButton:false});\n }\n } else {\n //error\n }\n }\n }\n\n function ytmodal() {\n\n /*\n if (alreadyRan) {\n //return;\n }\n alreadyRan = true;\n */\n\n //console.log('ytmodal scripts.js');\n\n // hero text desktop, mobile\n $('#hero .hero-text .region-hero a').each(function(i,elem) {\n ytfixbtn(elem);\n });\n\n // wayfinding paragraphs desktop, mobile\n $('.paragraph--type--wayfinding .field--name-field-link a').each(function(i,elem) {\n ytfixbtn(elem);\n })\n\n // fix the colorbox overlay\n $('#cboxOverlay').css('height', $(document).height() + 'px');\n $('#cboxOverlay').css('width', $(document).width() + 'px');\n }\n\n ytmodal();\n\n})(jQuery, once);\n"]}