$.noConflict(); var map; var markers = []; function initMap() { var myLatLng = {lat: 60.391263, lng: 5.322054}; map = new google.maps.Map(document.getElementById('map'), { center: myLatLng, zoom: 15 }); var i = 0; var popupText, marker, infowindow; var infowindow = new google.maps.InfoWindow(); var locations = [] jQuery('.location-item').each(function(){ popupText = '

' + jQuery(this).find('.location-title').eq(0).html() + '

' + jQuery(this).children('.address').eq(0).html(); locations.push(popupText); marker = new google.maps.Marker({ position: {lat: jQuery(this).data('lat'), lng: jQuery(this).data('lng')}, map: map, title: 'Bergen Assembly' }); markers.push(marker); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i]); infowindow.open(map, marker); } })(marker, i)); i++; }); } jQuery( document ).ready(function( $ ) { function initGalleries() { $('.gallery').each(function() { $(this).magnificPopup({ delegate: 'a', type: 'image', mainClass: 'mfp-with-zoom', // this class is for CSS animation below zoom: { enabled: true, // By default it's false, so don't forget to enable it duration: 300, // duration of the effect, in milliseconds easing: 'ease-in-out', // CSS transition easing function // The "opener" function should return the element from which popup will be zoomed in // and to which popup will be scaled down // By defailt it looks for an image tag: opener: function(openerElement) { // openerElement is the element on which popup was initialized, in this case its tag // you don't need to add "opener" option if this code matches your needs, it's defailt one. return openerElement.is('img') ? openerElement : openerElement.find('img'); } }, image: { titleSrc: function(item) { return (item.el.attr('title')); } }, gallery: { enabled:true, arrowMarkup: '', tCounter: '' }, closeMarkup: '' }); }); $('div.gallery-blocks a.gallery-link').click(function(e){ e.preventDefault(); $($(this).data('gallery')+' a.gallery-block-link').first().trigger('click'); }); if (!$('body').hasClass('single')) { $("img.lazy").lazyload({ effect : "fadeIn", container: $("#reader-panel") }); } else { $("img.lazy").lazyload({ effect : "fadeIn" }); } } $(document).ready(function(){ /* Splash */ $('.splash').delay($('body').data('splash-delay')*450).fadeOut(); $('.splash').click(function(){ $('.splash').stop().fadeOut(); }); /* Scroll Menu */ var lastScrollTop = 0; $(window).scroll(function(event){ var st = $(this).scrollTop(); if (st > lastScrollTop){ // downscroll code $('.scroll-menu').stop().hide(); } else { // upscroll code if(st > $(window).height()/2) { $('.scroll-menu').stop().show(); } else { $('.scroll-menu').stop().hide(); } } lastScrollTop = st; }); /* Gallery */ initGalleries(); /* Reader panel */ $('.reader-link').click(function(e){ linkUrl = $(this).attr('href'); e.preventDefault(); $.ajax({ url:linkUrl, type:'GET', success: function(data){ $('body').addClass('noscroll'); $('.reader-panel-item').show(); // console.log($(data).find('#reader-wrapper')[0]); $('#reader-panel').html($(data).find('#reader-wrapper')[0]).scrollTop(0); history.pushState({}, '', linkUrl); initGalleries(); } }); }); /* Reader panel same page */ $('.reader-link-same-page').click(function(e){ linkUrl = $(this).attr('href'); history.pushState({}, '', linkUrl+'#reader'); e.preventDefault(); $('body').addClass('noscroll'); $('.reader-panel-item').show(); var content = ""; $('.reader-content-item').each(function(){ content = content + $(this).html(); }); // Filter Praxes 'X' for reader content = content.replace("󰁀", "X"); content = content.replace("󰁀", "X"); $('.reader-content').html(content); }); $('.reader-panel-close').click(function() { window.history.back(); $('body').removeClass('noscroll'); $('.reader-panel-item').hide(); $('.reader-panel').html(''); }); /* Calendar Filter */ $('#calendar-filter a').click(function(e){ e.preventDefault(); $('h3.event-month-row-header').show(); $('.events-row').show(); $('#calendar-filter a').removeClass('active'); $(this).addClass('active'); if ($(this).data('filter') == 'all') { $('div.type-event').show(); } else { $($(this).data('filter')).show(); $('div.type-event').not($(this).data('filter')).hide(); $('h3.event-month-row-header').each(function(){ if ($(this).next('.row').children(':visible').length == 0) { $(this).hide(); $(this).next('.row').hide(); } }); } }); /* Location/Map */ $('.location-item').click(function(e){ e.preventDefault(); google.maps.event.trigger(markers[$(this).data('marker')],'click'); $('html, body').animate({ scrollTop: $("#content").offset().top - 30 }, 120); }); }); }); /** * navigation.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. */ ( function() { var container, button, menu, links, subMenus; container = document.getElementById( 'site-navigation' ); if ( ! container ) { return; } button = container.getElementsByTagName( 'button' )[0]; if ( 'undefined' === typeof button ) { return; } menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); menu.setAttribute( 'aria-expanded', 'true' ); } }; // Get all the link elements within the menu. links = menu.getElementsByTagName( 'a' ); subMenus = menu.getElementsByTagName( 'ul' ); // Set menu items with submenus to aria-haspopup="true". for ( var i = 0, len = subMenus.length; i < len; i++ ) { subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); } // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleFocus, true ); } /** * Sets or removes .focus class on an element. */ function toggleFocus() { var self = this; // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } else { self.className += ' focus'; } } self = self.parentElement; } } } )(); /** * skip-link-focus-fix.js * * Helps with accessibility for keyboard only users. * * Learn more: https://git.io/vWdr2 */ ( function() { var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { window.addEventListener( 'hashchange', function() { var id = location.hash.substring( 1 ), element; if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { return; } element = document.getElementById( id ); if ( element ) { if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { element.tabIndex = -1; } element.focus(); } }, false ); } })(); //# sourceMappingURL=app.js.map