1window.lazySizesConfig = window.lazySizesConfig || {}; 2window.lazySizesConfig.expand = 1500; 3 4/*! 5* Manage device/os/helpers classnames v20190909.1935 6* @requires browser.detection 7*/ 8(function(){ 9 var ua = navigator.userAgent.toLowerCase(); 10 var up = navigator.platform.toLowerCase(); 11 var standard = ['chrome', 'firefox', 'android', 'samsungbrowser']; 12 var ie = isIE(); 13 var classes = []; 14 15 if(!ie){ 16 if (isAndroidBrowser()){ 17 classes.push('android', 'native'); 18 } else { 19 for (var i = 0, max = standard.length; i < max; i++) if (ua.indexOf(standard[i]) != -1) classes.push(standard[i]); 20 if (ua.indexOf('safari') > -1 && ua.indexOf('chrome') == -1 && ua.indexOf('crios') == -1) classes.push('safari'); 21 if (ua.indexOf('chrome') > -1 || ua.indexOf('crios') > -1) classes.push('chrome'); 22 if(/(ipad|iphone|ipod)/g.test(ua)) classes.push('ios'); 23 } 24 } else { 25 if(ua.indexOf('iemobile') === -1){ 26 classes.push('ie'+ie, ua.indexOf('edge') > -1 ? 'edge' : 'ie'); 27 } 28 } 29 30 if (up.indexOf('mac') > -1) classes.push('mac'); 31 if (up.indexOf('win') > -1) classes.push('win'); 32 if (ua.indexOf('iemobile') > -1) classes.push('mie'); 33 if (ua.indexOf('iemobile/9.') > -1) classes.push('mie9'); 34 if (ua.indexOf('iemobile/10.') > -1) classes.push('mie10'); 35 36 document.documentElement.className += ' ' + classes.join(' '); 37 document.addEventListener('DOMContentLoaded', function(){ document.documentElement.setAttribute('ready', ''); }); 38 window.addEventListener('load', function(){ document.documentElement.setAttribute('loaded', ''); }); 39})(); 40 41 42/*! 43* Intent Attributes 44* @requires whatinput 45*/ 46(function(namespace){ 47 var update = function(type) { 48 if(type == 'pointer') type = 'mouse'; 49 ['keyboard','mouse','touch'].forEach(function(value) { 50 if(type != value) document.documentElement.removeAttribute(value); 51 }); 52 document.documentElement.setAttribute(type, ''); 53 }; 54 update(whatInput.ask('intent')); 55 whatInput.registerOnChange(update, 'intent'); 56})('whatintent'); 57 58 59/*! 60* Open external links in a new tab 61*/ 62(function(){ 63 /* 64 document.addEventListener('click', function(event){ 65 var a = event.target.closest('a[rel*="external"]'); 66 if (!a) return; 67 event.preventDefault(); 68 window.open(a.getAttribute("href")); 69}); 70*/ 71 72/* External links in body area only */ 73$(".external_links_new #content a, .external_links_new #footer a").filter(function() { 74 return this.hostname != window.location.hostname; 75}).attr('target', '_blank'); 76 77 78})(); 79 80 81/*! 82* Forms enhancements 83*/ 84(function(namespace){ 85 var placeholderize = function(el) { el.classList.toggle('is-placeholder', (el.value === '' || el.value === null)); }; 86 var autoresize = function(el) { el.style.height = 'auto'; el.style.height = (el.scrollHeight) + 'px'; }; 87 var is_field = function(event) { return event.target && (event.target.matches('input') || event.target.matches('select') || event.target.matches('textarea')); }; 88 var is_select = function(event) { return event.target && event.target.matches('select'); }; 89 document.body.addEventListener('change', function(event){ if(is_select(event)){ placeholderize(event.target); if(event.target.matches('[data-link]')) window.location = event.target.value; } }); 90 document.body.addEventListener('invalid', function(event){ if(is_field(event)) event.target.classList.add('-validated'); }, true); 91 document.body.addEventListener('focusout', function(event){ if(is_field(event)) event.target.checkValidity(); }); 92 document.body.addEventListener('input', function(event){ if(event.target.matches('textarea[data-autoresize]')) autoresize(event.target); }); 93 var init = function() { 94 each(document.querySelectorAll('select'), function(el) { placeholderize(el); }); 95 each(document.querySelectorAll('textarea[data-autoresize]'), function(el) { autoresize(el); }); 96 }; 97 window.addEventListener('reinitialize', init); 98 init(); 99})('forms'); 100 101 102/*! 103* WordPress Activation Fixes 104* Fix a 'bug' in WordPress core where activation screens show the home URL instead of the current blog URL. 105*/ 106(function(){ 107 // If we're activating, update the URL of the login + home links with the URL from the current site. 108 if( '/wp-activate.php' == window.location.pathname ) { 109 var current_host = window.location.host; 110 $links = $('.wp-activate-container').find('.view > a').each(function(el) { 111 var default_domain = $(this).attr('href').split('/')[2]; 112 var new_url = this.toString().replace(default_domain, current_host); 113 $(this).attr('href', new_url); 114 }); 115 } 116})(); 117 118/*! 119* Attach window events 120* @requires v.window.utils 121*/ 122(function(){ 123 if(typeof window.utils !== 'undefined'){ 124 window.utils.listeners.add('scroll', 'throttled', 'throttle', 100, {leading: false}); 125 window.utils.listeners.add('scroll', 'debounced', 'debounce', 100); 126 window.utils.listeners.add('resize', 'throttled', 'throttle', 150, {leading: false}); 127 window.utils.listeners.add('resize', 'debounced', 'debounce', 300); 128 } 129 130 window.addEventListener('resize/debounced', function(event) { 131 if(event.detail.width) window.dispatchEvent(new CustomEvent('recalculate'));
132 }); 133})(); 134 135 136/*! 137* Update --vw/--vh on resize 138* @requires v.window.utils 139*/ 140(function(){ 141 window.addEventListener('resize/throttled', function(event) { 142 if(event.detail.width){ 143 document.documentElement.style.setProperty('--vw', document.documentElement.clientWidth * 0.01 + 'px'); 144 document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01 + 'px'); 145 } 146 if(event.detail.height) document.documentElement.style.setProperty('--vha', window.innerHeight * 0.01 + 'px'); 147 }); 148})('vwh'); 149 150 151/*! 152* Trigger animations on scroll v20190213.0100 153* @requires in-view 154*/ 155(function(namespace){ 156 if(typeof inView !== 'undefined' && document.documentElement.matches('[r5s]')){ 157 inView.offset({ top: 0, right: 0, bottom: window.innerWidth < 720 ? 25 : 75, left: 0 }); 158 var reveal = function(el){ 159 el.setAttribute('revealed', ''); 160 el.dispatchEvent(new CustomEvent('revealed')); 161 }; 162 var init = function(){ 163 inView('[reveal]:not([reveal*="+"])').on('enter', function(el){ 164 if(!el.entered){ 165 var data = el.getAttribute('reveal') || false; 166 var delay = (data) ? (data+'').split('/')[1] : 0; 167 if(delay && delay > 25){ 168 setTimeout(function(){ reveal(el); }, delay); 169 } else { 170 reveal(el); 171 } 172 el.entered = true; 173 } 174 }); 175 }; 176 window.addEventListener('reinitialize', init); 177 init(); 178 } 179})('reveal'); 180 181 182/*! 183* Reveal Delays Sequencer v20181231.1815 184* Sequence elements in the same row 185*/ 186(function(namespace){ 187 188 var init = function(){ 189 var els = document.querySelectorAll('[aligned]'); 190 var data = {}; 191 192 each(els,function(el) { 193 var offset = el.getBoundingClientRect(); 194 var id = 't' + offset.top; 195 if(!data.hasOwnProperty(id)) data[id] = []; 196 data[id].push({el: el, left: offset.left}); 197 }); 198 199 for (var key in data) { 200 if (data.hasOwnProperty(key)) { 201 var set = data[key]; 202 set.sort(function(obj1, obj2) { 203 return obj1.left - obj2.left; 204 }); 205 206 set.forEach(function(item,index){ 207 item.el.setAttribute('aligned', (index + 1)); 208 item.el.style.setProperty('--rq', index); 209 }); 210 } 211 } 212 }; 213 214 window.addEventListener('reinitialize', init); 215 window.addEventListener('recalculate', init); 216 init(); 217 218})('aligned'); 219 220 221/*! 222* Offset Watcher 223*/ 224(function(namespace){ 225 var calculate = function(){ 226 each(document.querySelectorAll('[data-offsetwatch]'), function(el, index) { 227 var offset = el.getBoundingClientRect(); 228 el.style.setProperty('--offset-left', offset.left + 'px'); 229 el.style.setProperty('--offset-right', document.documentElement.clientWidth - offset.right + 'px'); 230 }); 231 }; 232 calculate(); 233 window.addEventListener('reinitialize', calculate); 234 window.addEventListener('recalculate', calculate); 235})('offsetwatch'); 236 237 238/*! 239* Autoclass 240* Add classname onload with a delay 241*/ 242(function(namespace){ 243 var attr = 'data-autoclass'; 244 eachOnce('[' + attr +']', namespace, function(index, root) { 245 var options = root.getAttribute(attr).split('/'); 246 var classname = options[0] || 'is-active'; 247 var delay = options[1] || 50; 248 setTimeout(function() { 249 root.classList.add(classname); 250 }, delay); 251 }); 252})('autoclass'); 253 254 255/*! 256* Loadmore with infinite scrolling 257* @requires jquery 258*/ 259(function(){ 260 261 $('[data-loadmore]').each(function(index, el) { 262 var $root = $(this); 263 var $more = $root.find('[data-more]'); 264 var group = $root.data('loadmore') || false; 265 var loading_class = 'is-loading'; 266 267 $more.on('click', function(event) { 268 event.preventDefault(); 269 270 var $more = $(this); 271 if($more.is('[disabled]')) return; 272 273 var $entries = $root.find('[data-entries]'); 274 $more.attr('disabled',true); 275 276 $.ajax({ 277 url: $more.attr('href'), 278 context: document.body 279 }).done(function(data) { 280 var $ajax = $(data); 281 if(group) $ajax = $ajax.find('[data-loadmore="' + group + '"]'); 282 var $data = $ajax.find('[data-entries]').children(); 283 var $next = $ajax.find('[data-more]'); 284 285 if($data.length > 0){ 286 $data.appendTo($entries); 287 if($next.length > 0) $more.attr('href', $next.attr('href')).removeAttr('disabled'); 288 window.dispatchEvent(new CustomEvent('reinitialize')); 289 } 290 291 if($next.length === 0){ 292 $more.fadeOut(300,function(){ 293 $more.parent().remove(); 294 $(window).off('scroll.loadmore'); 295 });
296 } 297 }); 298 }); 299 300 // infinite scroll 301 302 var infinite = _.throttle(function() { 303 var current = $(window).scrollTop() + $(window).height(); 304 var line = $more.offset().top; 305 if(current >= line - $more.data('auto')) $more.trigger('click'); 306 }, 250); 307 308 if($more.length > 0 && $more.is('[data-auto]')) $(window).on('scroll.loadmore', infinite); 309 310 }); 311})(); 312 313/*! 314* Youtube embeds 315* @requires jquery 316* @requires youtube_iframe_api 317*/ 318(function(namespace){ 319 320 if($('[data-youtube]').length !== 0 || $('[data-popup-youtube]').length !== 0) { 321 window.ytapi = []; 322 323 var api_promise = new Promise(function(onYouTubeIframeAPIReady) { 324 var tag = document.createElement('script'); 325 var firstScriptTag = document.getElementsByTagName('script')[0]; 326 window.onYouTubeIframeAPIReady = onYouTubeIframeAPIReady; 327 tag.src = "https://www.youtube.com/iframe_api"; 328 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 329 }); 330 331 document.addEventListener('lazybeforeunveil', function(event) { 332 if(event.target.matches('[data-youtube]')){ 333 var $player = $(event.target); 334 var $parent = $player.parent(); 335 var id = Math.random().toString(36).substr(2, 9); 336 var yid = $player.data('youtube'); 337 $player.attr('id', id); 338 $player.addClass('lazyloaded'); 339 340 api_promise.then(function() { 341 window.ytapi[id] = new YT.Player(id, { videoId: yid, playerVars: { modestbranding: 1, playsinline: 1, rel: 0, showinfo: 0, enablejsapi: 1 }, events: { onStateChange: function(event) { 342 $parent.trigger('statechange', {state: event.data}); 343 } } }); 344 }); 345 } 346 if(event.target.matches('[data-popup-youtube]')) { 347 var $player = $(event.target); 348 var $parent = $player.parent(); 349 var id = Math.random().toString(36).substr(2, 9); 350 var yid = $player.data('popup-youtube'); 351 $player.attr('id', id); 352 $player.addClass('lazyloaded'); 353 354 api_promise.then(function() { 355 window.ytapi[id] = new YT.Player(id, { videoId: yid, playerVars: { modestbranding: 1, playsinline: 1, rel: 0, showinfo: 0, enablejsapi: 1 }, events: { onStateChange: function(event) { 356 $parent.trigger('statechange', {state: event.data}); 357 } } }); 358 }); 359 } 360 }); 361 } 362 363})('youtube'); 364 365/*! 366* Video player 367* @requires jquery 368*/ 369(function(namespace){ 370 var classname = 'is-playing'; 371 document.addEventListener('click', function(event){ 372 if(event.target.matches('.video1-image, .video1-image *')){ 373 event.preventDefault(); 374 event.stopPropagation(); 375 var root = event.target.closest('.video1'); 376 if(root){ 377 var video = root.querySelector('video'); 378 if(video) { 379 video.play() 380 } else { 381 var youtube = root.querySelector('[data-youtube]'); 382 if(youtube && window.ytapi[youtube.id]){ 383 window.ytapi[youtube.id].playVideo(); 384 if(typeof window.ytapi[youtube.id].monitored !== undefined){ 385 window.ytapi[youtube.id].monitored = true; 386 $(youtube).parent().on('statechange', function(event, data) { 387 if(data.state == 0){ 388 var root = event.target.closest('.video1'); 389 if(root) root.classList.remove(classname); 390 } 391 }); 392 } 393 } 394 } 395 root.classList.add(classname); 396 } 397 } 398 }, true); 399 document.addEventListener('ended', function(event){ 400 if(event.target.matches('.video1 video')){ 401 var root = event.target.closest('.video1'); 402 if(root) root.classList.remove(classname); 403 } 404 }, true); 405})('videoplayer'); 406 407/*! 408 * Lightbox 409 * @requires electerious/basicLightbox 410 */ 411(function(namespace){ 412 if (typeof basicLightbox !== 'undefined'){ 413 window.addEventListener('click', function() { 414 if(event.target.matches('[data-lightbox], [data-lightbox] *')){ 415 event.preventDefault(); 416 var el = event.target.closest('[data-lightbox]'); 417 var target_selector = el.getAttribute('data-lightbox') || false; 418 if (!target_selector) return false; 419 var target_element = document.querySelector(target_selector); 420 if (!target_element) return false; 421 var template = target_element.innerHTML; 422 var close = document.createElement("i"); 423 close.setAttribute('class','lightbox1-close icon-close'); 424 close.setAttribute('data-close',true); 425 426 window.lightbox = basicLightbox.create(template, { 427 className: 'lightbox1', 428 onShow: function(instance) { instance.element().append(close); } 429 }); 430 window.lightbox.show(); 431 } 432 if(event.target.matches('.lightbox1-close, .lightbox1-close *')){ 433 event.preventDefault(); 434 window.lightbox.close(); 435 } 436 }); 437 window.addEventListener('keyup', function(event) { 438 if(event.key == "Escape" && typeof window.lightbox !== 'undefined'){ 439 window.lightbox.close(); 440 } 441 }); 442 } 443})('lightbox'); 444 445 446/*! 447* Carousels 448* requires jquery 449* requires jquery.slick 450*/ 451(function(){ 452 if(typeof $.fn.slick !== 'undefined'){ 453 454 var defaults = { 455 slide: '[data-item]', 456 speed: 700, 457 infinite: false, 458 arrows: true, 459 dots: true 460 }; 461 462 $('.gallery1').each(function(index, el) { 463 var $root = $(this); 464 var $items = $root.find('[data-items]'); 465 var $item = $items.children();
466 var $captions = $root.find('[data-captions]') 467 var $current = $root.find('[data-current]'); 468 var count = $item.length; 469 var locked = false; 470 471 $root.on('click', '.slick-arrow.slick-disabled', function(event) { 472 if(!locked){ 473 var forward = $(event.target).closest('.slick-arrow').is('.slick-next'); 474 var next = !forward && $items.slick('slickCurrentSlide') == 0 ? count - 1 : 0; 475 $items.slick('slickGoTo',next) 476 } 477 }); 478 479 $items.on('beforeChange', function(event, slick, currentSlide, nextSlide){ 480 $current.html(('00000' + (nextSlide + 1)).slice(-(count+'').length)); 481 $captions.children().eq(nextSlide).addClass('is-active').siblings().removeClass('is-active'); 482 locked = true; 483 }).on('afterChange', function(event, slick, currentSlide){ 484 locked = false; 485 }).on('edge', function(event, slick, direction){ 486 var next = direction == 'right' ? count - 1 : 0; 487 $items.slick('slickGoTo',next); 488 }).on('init', function(event, slick){ 489 $captions.html(''); 490 $items.find('figcaption').remove().clone().appendTo($captions); 491 $captions.children().eq(slick.currentSlide).addClass('is-active'); 492 $root.find('.slick-list').attr('tabindex','0'); 493 window.dispatchEvent(new CustomEvent('relightbox')); 494 }).slick($.extend({}, defaults, { 495 slidesToShow: 1, 496 slidesToScroll: 1 497 })); 498 }); 499 500 $('.carousel1').each(function(index, el) { 501 var $root = $(this); 502 var $items = $root.find('[data-items]'); 503 var $item = $items.children(); 504 var count = $item.length; 505 506 //if(count <= 3) return false; 507 508 $items.slick($.extend({}, defaults, { 509 slidesToShow: 3, 510 slidesToScroll: 3, 511 responsive: [ 512 {breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 2 }}, 513 {breakpoint: 600, settings: { slidesToShow: 1, slidesToScroll: 1 }} 514 ] 515 })); 516 }); 517 518 //Logo Rail 519 $('.rail1').each(function(index, el) { 520 521 var $root = $(this); 522 var $items = $root.find('[data-items]'); 523 524 var $number_to_show = $root.find('.rail1-entries').attr('data-show-items'); 525 $number_to_show = $number_to_show.replace('grid', ''); 526 527 var $item = $items.children(); 528 var count = $item.length; 529 530 //if(count <= 4) return false; 531 532 $items.slick($.extend({}, defaults, { 533 slidesToShow: $number_to_show, 534 dots: false, 535 infinite: true, 536 slide: 'figure', 537 responsive: [ 538 {breakpoint: 1200, settings: { slidesToShow: 4 }}, 539 {breakpoint: 900, settings: { slidesToShow: 3 }}, 540 {breakpoint: 600, settings: { slidesToShow: 2 }}, 541 {breakpoint: 300, settings: { slidesToShow: 1 }} 542 ] 543 })); 544 }); 545 546 } 547})(); 548 549 550/*! 551* (v) Localscroll v20191002.0115 552* @requires smoothscroll.polyfill 553*/ 554(function(namespace){ 555 document.body.addEventListener('click',function(event) { 556 if(event.target.closest('[data-localscroll]')){ 557 event.preventDefault(); 558 var target = document.querySelector(event.target.closest('a').getAttribute('href')); 559 if(target) target.scrollIntoView({ behavior: 'smooth' }); 560 } 561 }); 562})('localscroll'); 563 564 565/*! 566* Action Network - Email Signup Forms. 567* http://opensupporter.github.io/jquery-osdi/ 568*/ 569(function(namespace){ 570 571 $('.signup1.-an-submit').each(function(index, el) { 572 var $root = $(this); 573 //var $items = $root.find('[data-items]'); 574 var $button = $root.find('button'); 575 var button_text_orig = $button.text(); 576 var delay = 2000; 577 578 $root.osdi({ 579 done: function(data, textStatus, jqXHR) { 580 $button.text('Success!'); 581 setTimeout( function() { 582 // close the modal ppopup if it's active 583 if( $root.hasClass('modal1-form') ) { 584 $root.closest('.modal1').removeClass('is-active'); 585 } 586 $button.text(button_text_orig) 587 }, delay); 588 589 }, 590 fail: function(jqXHR, textStatus, errorThrown) { 591 // console.log(jqXHR.responseText); 592 $button.text('Error'); 593 setTimeout(function() { $button.text(button_text_orig) }, delay); 594 }, 595 always: function(data_jqXHR, textStatus, jqXHR_errorThrown) { 596 // Runs every time. 597 } 598 }).on('submit', function() { 599 $(this).find('button').html('Please Wait'); 600 return false; 601 }); 602 603 }); 604 605})('actionnetwork'); 606 607/*! 608* Popups 609* @requires jquery 610*/ 611(function(namespace){ 612 var init = function(){ 613 $('[data-autopop]:not(.is-initialized-' + namespace + ')').each(function(index, el) { 614 var $root = $(this).addClass('is-initialized-' + namespace); 615 setTimeout(function(){ 616 $root.addClass('is-active'); 617 618 /* Set a cookie */ 619 var id = $root.data('id'); 620 Cookies.set('announcement', id, { expires: Number(archiejs.modal_frequency) }); 621 622 },$root.data('autopop') || 3000); 623 }); 624 }; 625 626 /* Only init if cookie is not set or ?popup is added to URL*/ 627 var str = window.location.search; 628 var a_val = Cookies.get('announcement'); 629 var a_cur = $('.modal1').data('id'); 630 if ( (a_val != a_cur) || (str.indexOf("?popup") >= 0) ) { 631 init(); 632 } 633})('pops'); 634 635(function(namespace){ 636 var init = function(){
637 $('.accordion1-details').each(function(index, el){ 638 let height = el.scrollHeight; 639 el.style.setProperty('--h', height + 'px'); 640 }); 641 642 $('.accordion1-title').on('click', function(){ 643 let $this = $(this); 644 let isOpen = $this.attr('aria-expanded') === 'true'; 645 $this.attr('aria-expanded', !isOpen); 646 $this.toggleClass('-open'); 647 }); 648 649 // Handle keyboard interaction 650 $('.accordion1-title').on('keydown', function(e){ 651 if (e.key === 'Enter' || e.key === ' ') { 652 e.preventDefault(); 653 $(this).trigger('click'); 654 } 655 }); 656 } 657 658 $(window).on('load', init); 659 $(window).on('reinitialize.' + namespace, init); 660})('accordion1'); 661 662 663 664/*! 665 * Alert1 666 * @requires jquery 667 */ 668(function(namespace){ 669 670 // Initially hide the .alert1 element 671 $('.alert1').hide(); 672 673 // Check if ?banner is in the URL or if .alert1-close is not present 674 const shouldShowBanner = window.location.search.includes('banner') || $('.alert1-close').length === 0; 675 676 // If .alert1-close does not exist, always show the banner 677 // Otherwise, show it based on sessionStorage 678 if ( shouldShowBanner || sessionStorage.getItem('alert1Hidden') !== 'true' ) { 679 $('.alert1').show(); 680 } 681 682 // Add click event handler for the .alert1-close button 683 $('.alert1-close').click(function(e) { 684 e.preventDefault(); 685 686 // Slide up the .alert1 element with a duration of 500 milliseconds 687 $('.alert1').slideUp(500); 688 689 // Store a flag in sessionStorage to keep it hidden for the session 690 sessionStorage.setItem('alert1Hidden', 'true'); 691 }); 692 693})('alert1'); 694 695 696/*! 697* Search toggle 698* focus on the search field when opening search box 699* focus back on nav item when closing search box 700*/ 701(function(namespace){ 702 var init = function(){ 703 $('.search-form-toggle').on('click', function(e){ 704 e.preventDefault(); 705 $('.search-form-modal').toggleClass('-active'); 706 setTimeout(function() { 707 if ( $('.search-form-modal').hasClass('-active' ) ) { 708 $('.search-form-modal .search-form-submit').focus(); 709 } else { 710 $('.menu-item.search-form-toggle a').focus(); 711 } 712 },50); 713 }); 714 window.addEventListener('keyup', function(event) { 715 if(event.key == "Escape" ){ 716 $('.search-form-modal').removeClass('-active'); 717 } 718 }); 719 } 720 $(window).on('load', init); 721})('search-form'); 722 723/*! 724* MailChimp - Email Signup Forms. 725* https://medium.com/@ivanlucasgoncalves/mailchimp-form-using-ajax-call-6bc55f1d2e51 726*/ 727(function(namespace){ 728 $('.signup1.-mc-submit').each(function(index, el) { 729 var $root = $(this); 730 var $action = $root.attr('action'); 731 732 if($action.indexOf('post-json') >= 0) { 733 $root.on('submit', function(e) { 734 e.preventDefault(); 735 var buttonText = $(this).find('button').text(); 736 $(this).find('button').text('Please Wait').prop('disabled', true); 737 738 $.ajax({
739 type: "GET", 740 url: $action + '&c=?', 741 data: $(this).serialize(), 742 cache: false, 743 dataType: "jsonp", 744 contentType: "application/json; charset=utf-8", 745 error: (error) => { 746 $(this).find('.signup1-result-message').text(archiejs.mc_failure); 747 $(this).find('button').text(buttonText).prop('disabled', false); 748 }, 749 success: (res) => { 750 if(res.result === 'success') { 751 // if success, remove all signup fields 752 // and show admin-set message 753 $(this).find('.signup1-fields').remove(); 754 $(this).find('.signup1-result-message').text(archiejs.mc_success); 755 } else { 756 // if mailchimp returns an error, 757 // display admin-set message and reset the submit button 758 $(this).find('.signup1-result-message').text(archiejs.mc_failure); 759 $(this).find('button').text(buttonText).prop('disabled', false); 760 } 761 }, 762 }); 763 }); 764 } 765 }); 766})('mailchimp'); 767 768/*! 769 * Video Modal Autoplay 770 * @requires jquery 771 */ 772(function(namespace){ 773 var $videoIframe = $('[data-iframe]'); 774 775 if($videoIframe.length) { 776 // open modal and play youtube video 777 $videoIframe.on('click', function(e) { 778 e.preventDefault(); 779 $('#promo1-content').hide(); 780 $('#modal1Video').css('opacity', 1); 781 782 var youtube = document.querySelector('[data-popup-youtube]'); 783 if(youtube && window.ytapi[youtube.id]){ 784 window.ytapi[youtube.id].playVideo(); 785 if(typeof window.ytapi[youtube.id].monitored !== undefined){ 786 window.ytapi[youtube.id].monitored = true; 787 $(youtube).parent().on('statechange', function(event, data) { 788 if(data.state == 0){ 789 var root = event.target.closest('.video1'); 790 if(root) root.classList.remove(classname); 791 } 792 }); 793 } 794 } 795 }); 796 797 // switch back to popup and stop youtube video 798 // if overlay is clicked, popup will close 799 $('[data-video-toggle], .modal1-overlay').on('click', function(e) { 800 e.preventDefault(); 801 802 $('#modal1Video').css('opacity', 0); 803 var youtube = document.querySelector('[data-popup-youtube]'); 804 window.ytapi[youtube.id].stopVideo(); 805 $('#promo1-content').show(); 806 }); 807 } 808})('videomodalautoplay'); 809 810/*! 811* Event sign up form (Mobilize) 812* @requires jquery 813*/ 814(function(namespace){ 815 $('.tm-event-sign-up').each(function(index, el) { 816 var $root = $(this); 817 var $button = $root.find('.tm-sign-up-submit'); 818 $root.on('submit',function(e){ 819 e.preventDefault(); 820 var data = { 821 action: "event_sign_up", 822 nonce: archiejs.security, 823 formData: $root.serialize(), 824 }; 825 $.ajax({ 826 url: $root.attr('action'), 827 data: data, 828 type: "POST", 829 beforeSend: function (xhr) { 830 $button.val('Please Wait'); 831 }, 832 success: function (data) { 833 data = JSON.parse(data); 834 $button.val($button.data('value')); 835 if ( data['status'] == 'success' ) { 836 $root[0].reset(); // clear form 837 $root.find('.response').html(`${data['message']}`).css('display','block'); 838 } else { 839 $root.find('.response').html(`<span class='invalid1 -visible'>${data['message']}</span>`).css('display','block'); 840 } 841 }, 842 }); 843 }); 844 }); 845})('mobilize'); 846 847/*! 848* showmore1 849* @requires jquery 850*/ 851(function(namespace){ 852 var init = function(){ 853 $('.showmore1-details').each(function(index, el){ 854 let height = el.scrollHeight; 855 el.style.setProperty('--h', height + 'px'); 856 }); 857 $('.showmore1-title, .showmore1-title *').on('click', function(e){ 858 e.preventDefault(); 859 $(this).prev().toggleClass('-open'); 860 var text = $(this, 'span').text(); 861 var nextText = $(this).data('nexttext'); 862 $(this).data('nexttext', text); 863 $(this).find('span').text(nextText); 864 }); 865 } 866 $(window).on('load', init); 867 $(window).on('reinitialize.' + namespace, init); 868})('showmore1'); 869 870/*! 871* eventLocations 872* @requires jquery 873*/ 874(function(namespace){ 875 var init = function(){ 876 $('#location-range').on('change', function(e){ 877 updateUrl({'range': $(this).val()}); 878 }); 879 880 $('#exclude-virtual').on('change', function(e){
881 updateUrl({'virtual': ! $(this).prop("checked")}); 882 }); 883 $('#event-location-filter').on('click', function(e){ 884 e.preventDefault(); 885 var url = new URL(window.location.href); 886 if ( ! $('#archiePlaces').val() ) { 887 url.searchParams.delete('place'); 888 url.searchParams.delete('lat'); 889 url.searchParams.delete('lng'); 890 url.searchParams.delete('range'); 891 } 892 if ( url.searchParams.get('virtual') === 'true' ) { 893 url.searchParams.delete('virtual'); 894 } 895 window.location.href = url; 896 }); 897 }, 898 updateUrl = function(params){ 899 var url = new URL(window.location.href); 900 var search_params = url.searchParams; 901 Object.entries(params).map(item => { 902 search_params.set(item[0], item[1]); 903 }); 904 window.history.replaceState(null, null, url) 905 }, 906 initAutocomplete = function(){ 907 var places = new google.maps.places.Autocomplete(document.getElementById('archiePlaces')); 908 places.setFields(['formatted_address', 'geometry']); 909 google.maps.event.addListener(places, 'place_changed', function () { 910 var place = places.getPlace(); 911 updateUrl({ 912 'lat': place.geometry.location.lat(), 913 'lng': place.geometry.location.lng(), 914 'place': place.formatted_address 915 }); 916 }); 917 } 918 if ( document.querySelector('#archiePlaces' ) ) { 919 $(window).on('load', init); 920 $(window).on('load', initAutocomplete); 921 } 922})('eventLocations');
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.