Current File : /home/illuminatiprivate.express/public_html/themes/nwcu-harlo/assets/javascript/app.min4f4d.js |
var nwApp,locationsInit=function(){var e=document.getElementById("map");e&&(nwApp.locations.map=new google.maps.Map(e,{center:{lat:44.0873743,lng:-123.0471488},fullscreenControl:!1,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},zoom:12}))};jQuery(document).ready((function(e){"use strict";(nwApp={elements:{$window:e(window),$html:e("html"),$body:e("body"),$nav:e("#layout-nav"),$skipNav:e(".skipnav a"),$searchToggle:e(".search-toggle"),$searchForm:e("header .nav-search"),$toTop:e("#to-top"),$introModal:e("#introModal"),$shareBar:e(".side.share-bar"),$externalLink:e(".external-link"),$externalModal:e("#externalModal"),externalUrl:null,$internalLink:e(".internal-link"),$contentModal:e("#contentModal"),$map:e("#map"),$locate:e("#locate"),$list:e(".map-sidebar .locations-list"),$listWrapper:e(".map-sidebar .locations-list .wrapper"),$itemDetail:e(".map-sidebar #item-detail"),$mapForm:e(".map-sidebar form"),$filterToggle:e(".map-sidebar .filter-toggle"),$filters:e(".map-sidebar #location-filters"),$contactDropdown:e("#contact-dropdown"),$contactTopics:e(".topic-content"),$contactForms:e(".form-content")},scroller:{scrolling:!1,scroll:function(){nwApp.scroller.scrolling||(nwApp.scroller.scrolling=!0,window.requestAnimationFrame?requestAnimationFrame(e.proxy(nwApp.scroller.update,nwApp)):setTimeout(e.proxy(nwApp.scroller.update,nwApp),250))},update:function(){var e;nwApp.elements.$window.scrollTop()>=300?this.elements.$toTop.addClass("active"):this.elements.$toTop.removeClass("active"),this.scroller.scrolling=!1}},locations:{map:null,markers:[],activeMarker:null,icons:null,init:function(){nwApp.elements.$map.length&&(nwApp.locations.map=new google.maps.Map(nwApp.elements.$map[0],{center:{lat:44.0873743,lng:-123.0471488},fullscreenControl:!1,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},zoom:12}))},updateMarkers:function(e,n){nwApp.locations.clearMarkers();var t=new google.maps.LatLngBounds,o=0;for(t.extend(n),o=0;o<e.branch.length;o+=1){t.extend({lat:parseFloat(e.branch[o].latitude),lng:parseFloat(e.branch[o].longitude)});var a=new google.maps.Marker({position:{lat:parseFloat(e.branch[o].latitude),lng:parseFloat(e.branch[o].longitude)},map:nwApp.locations.map,title:e.branch[o].name,icon:nwApp.locations.icons[e.branch[o].type],location_id:e.branch[o].id,location_type:e.branch[o].type});nwApp.locations.clickMarker(a),nwApp.locations.markers[a.location_id]=a}for(o=0;o<e.atm.length;o+=1){t.extend({lat:parseFloat(e.atm[o].latitude),lng:parseFloat(e.atm[o].longitude)});var a=new google.maps.Marker({position:{lat:parseFloat(e.atm[o].latitude),lng:parseFloat(e.atm[o].longitude)},map:nwApp.locations.map,title:e.atm[o].name,icon:nwApp.locations.icons[e.atm[o].type],location_id:e.atm[o].id,location_type:e.atm[o].type});nwApp.locations.clickMarker(a),nwApp.locations.markers[a.location_id]=a}for(o=0;o<e.co_op.length;o+=1){t.extend({lat:parseFloat(e.co_op[o].latitude),lng:parseFloat(e.co_op[o].longitude)});var a=new google.maps.Marker({position:{lat:parseFloat(e.co_op[o].latitude),lng:parseFloat(e.co_op[o].longitude)},map:nwApp.locations.map,title:e.co_op[o].institutionName,icon:nwApp.locations.icons.co_op,location_id:e.co_op[o].id,location_type:"co_op"});nwApp.locations.clickMarker(a),nwApp.locations.markers[a.location_id]=a}e.branch.length||e.atm.length||e.co_op.length?nwApp.locations.map.fitBounds(t):(nwApp.locations.map.setCenter(n),nwApp.locations.map.setZoom(12))},clearMarkers:function(){if(nwApp.locations.markers.length){for(var e in nwApp.locations.markers)nwApp.locations.markers[e].setMap(null);nwApp.locations.markers=[],nwApp.locations.activeMarker=null}},clickMarker:function(e){e.addListener("click",(function(){var n=nwApp.elements.$list.find(".item").removeClass("active").filter("#location-"+e.location_id).addClass("active").position(),t=nwApp.elements.$listWrapper.scrollTop();if(nwApp.elements.$itemDetail.removeClass("active"),nwApp.locations.activeMarker){var o=nwApp.locations.markers[nwApp.locations.activeMarker].location_type;nwApp.locations.markers[nwApp.locations.activeMarker].setIcon(nwApp.locations.icons[o])}nwApp.elements.$listWrapper.animate({scrollTop:t+n.top}),e.setIcon(nwApp.locations.icons.active),nwApp.locations.activeMarker=e.location_id}))},clickItem:function(n){var t,o=e(n.currentTarget).data("location-id"),a=nwApp.locations.markers[o];if(nwApp.elements.$list.find(".item").removeClass("active").filter("#location-"+o).addClass("active"),nwApp.locations.activeMarker){var l=nwApp.locations.markers[nwApp.locations.activeMarker].location_type;nwApp.locations.markers[nwApp.locations.activeMarker].setIcon(nwApp.locations.icons[l])}a.setIcon(nwApp.locations.icons.active),nwApp.locations.activeMarker=a.location_id}}}).elements.$internalLink.click((function(n){var t=e(n.currentTarget),o=e(t.attr("href"));o.length&&(n.preventDefault(),e("html, body").animate({scrollTop:o.offset().top-nwApp.elements.$nav.height()-20},500))})),nwApp.elements.$skipNav.click((function(n){var t=e(e(n.currentTarget).attr("href"));t.length&&e("html, body").animate({scrollTop:t.offset().top-nwApp.elements.$nav.height()},500)})),e(".main-nav .dropdown.item").focusin((function(n){e(n.currentTarget).addClass("open")})).focusout((function(n){e(n.currentTarget).removeClass("open")})).click((function(n){e(n.currentTarget).toggleClass("open")})),e(".main-navbar-collapse").on("show.bs.collapse",(function(){nwApp.elements.$body.addClass("navbar-open")})).on("hide.bs.collapse",(function(){nwApp.elements.$body.removeClass("navbar-open")})),nwApp.elements.$searchToggle.click((function(n){n.preventDefault(),nwApp.elements.$searchForm.addClass("open").find('input[name="q"]').focus(),e(".main-navbar-collapse").collapse("hide")})),nwApp.elements.$searchForm.submit((function(e){0==nwApp.elements.$searchForm.find('input[name="q"]').val().length&&(e.preventDefault(),nwApp.elements.$searchForm.removeClass("open"))})),nwApp.elements.$searchForm.find('input[name="q"]').focusout((function(e){e.relatedTarget&&"submit"==e.relatedTarget.type||nwApp.elements.$searchForm.removeClass("open")})),nwApp.elements.$body.on("click",'[href="#"]',(function(e){e.preventDefault()})),e("body").tooltip({selector:'[data-toggle="tooltip"]',container:"body"}),e("table.table").not((function(n,t){return e(this).closest("#item-detail").length})).cardtable(),e(".accordion .panel .panel-collapse").on("show.bs.collapse",(function(n){e(n.currentTarget).closest(".panel").addClass("open")})).on("hide.bs.collapse",(function(n){e(n.currentTarget).closest(".panel").removeClass("open")})),e(".cards .slides").slick({arrows:!1,centerMode:!0,centerPadding:"30px",dots:!0,infinite:!1,mobileFirst:!0,slidesToShow:1,responsive:[{breakpoint:768,settings:{centerMode:!1,infinite:!0,slidesToShow:2}},{breakpoint:992,settings:{centerMode:!1,dots:!1,infinite:!0,slidesToShow:3}}]});var n=1e3*e("body.home-layout .hero-slider-wrapper").data("duration"),t=!0,o;(0==n&&(t=!1),e("body.home-layout .hero-slider-wrapper").slick({autoplay:t,autoplaySpeed:n,arrows:!0,dots:!1,prevArrow:'<span class="prev"><i class="fa fa-angle-left"></i></span>',nextArrow:'<span class="next"><i class="fa fa-angle-right"></i></span>'}),nwApp.elements.$toTop.click((function(n){n.preventDefault(),e("html, body").animate({scrollTop:0})})),nwApp.elements.$shareBar.length&&nwApp.elements.$shareBar.affix({offset:{top:0,bottom:function(){return this.bottom=e("#layout-footer").outerHeight(!0)}}}),nwApp.elements.$window.on("scroll",nwApp.scroller.scroll),nwApp.elements.$body.on("click",".external-link",(function(n){n.preventDefault(),nwApp.elements.externalUrl=e(n.currentTarget).attr("href"),nwApp.elements.$externalModal.modal("show")})),nwApp.elements.$externalModal.find(".modal-footer .btn-primary").click((function(){window.open(nwApp.elements.externalUrl),nwApp.elements.$externalModal.modal("hide")})),nwApp.elements.$body.find(".video").click((function(n){n.preventDefault();var t,o="https://www.youtube.com/embed/"+e(n.currentTarget).attr("href").replace(/https:\/\/youtu.be\//i,"")+"?rel=0&controls=0&showinfo=0&autoplay=1";nwApp.elements.$contentModal.modal("show").find(".modal-body").html('<div class="embed-responsive embed-responsive-16by9"><iframe src="'+o+'" frameborder="0" allowfullscreen></iframe></div>')})),nwApp.elements.$contentModal.on("hide.bs.modal",(function(n){e(n.currentTarget).find(".modal-body").html("")})),nwApp.elements.$locate.click((function(n){var t=e(n.currentTarget).prop("disabled",!0),o=t.data("handler");nwApp.elements.$filters.removeClass("active"),nwApp.elements.$list.addClass("loading").find(".wrapper").html(""),nwApp.elements.$mapForm[0].reset(),"geolocation"in navigator?navigator.geolocation.getCurrentPosition((function(n){var a={lat:n.coords.latitude,lng:n.coords.longitude};nwApp.elements.$mapForm.find('input[name="latitude"]').val(a.lat),nwApp.elements.$mapForm.find('input[name="longitude"]').val(a.lng),e.request(o,{data:nwApp.elements.$mapForm.serializeArray(),success:function(e){t.prop("disabled",!1),nwApp.elements.$list.removeClass("loading"),e.success&&(nwApp.locations.icons=e.images,nwApp.locations.updateMarkers(e.locations,a),nwApp.elements.$listWrapper.html(e.list))}})}),(function(){t.prop("disabled",!1),nwApp.elements.$list.removeClass("loading"),nwApp.elements.$listWrapper.html('<p class="message">The Geolocation service failed. Enter a zip code.</p>')})):(t.prop("disabled",!1),nwApp.elements.$list.removeClass("loading"),nwApp.elements.$listWrapper.html('<p class="message">Your browser does not support Geolocation. Enter a zip code.</p>'))})),nwApp.elements.$body.on("click",".map-sidebar .locations-list .item",nwApp.locations.clickItem),nwApp.elements.$body.on("click",".map-sidebar .locations-list .item a",(function(n){n.preventDefault;var t,o=e(n.currentTarget).closest(".summary").next(".detail").html();nwApp.elements.$itemDetail.find(".content").html(o).end().addClass("active")})),nwApp.elements.$itemDetail.find("button.close").click((function(){nwApp.elements.$itemDetail.removeClass("active")})),nwApp.elements.$filterToggle.click((function(){nwApp.elements.$filters.addClass("active")})),nwApp.elements.$filters.find(".close").click((function(){nwApp.elements.$filters.removeClass("active")})),nwApp.elements.$mapForm.submit((function(n){n.preventDefault();var t=e(n.currentTarget),o=t.find('button[type="submit"]').prop("disabled",!0),a=t.data("handler"),l;nwApp.elements.$filters.removeClass("active"),nwApp.elements.$list.addClass("loading").find(".wrapper").html(""),(new google.maps.Geocoder).geocode({address:t.find('input[name="city-state-zip"]').val()},(function(n,l){if("OK"==l){var s={lat:n[0].geometry.location.lat(),lng:n[0].geometry.location.lng()};t.find('input[name="latitude"]').val(s.lat),t.find('input[name="longitude"]').val(s.lng),e.request(a,{data:t.serializeArray(),success:function(e){o.prop("disabled",!1),nwApp.elements.$list.removeClass("loading"),e.success&&(nwApp.locations.icons=e.images,nwApp.locations.updateMarkers(e.locations,s),nwApp.elements.$listWrapper.html(e.list))}})}else o.prop("disabled",!1),nwApp.elements.$list.removeClass("loading"),nwApp.elements.$listWrapper.html('<p class="message">Geocode service failed. Please try again.</p>')}))})),nwApp.elements.$contactDropdown.find(".dropdown-menu li a").click((function(n){n.preventDefault();var t=e(n.currentTarget);nwApp.elements.$contactDropdown.find(".dropdown-toggle .topic").text(t.text()),nwApp.elements.$contactTopics.slideUp(200,(function(){nwApp.elements.$contactForms.slideUp(200),nwApp.elements.$contactTopics.children("div").removeClass("active").filter("#topic-"+t.data("topic")).addClass("active").end().end().slideDown(200)}))})),nwApp.elements.$contactTopics.find("button").click((function(n){var t=e(n.currentTarget);nwApp.elements.$contactForms.slideUp(200,(function(){nwApp.elements.$contactTopics.slideUp(),nwApp.elements.$contactForms.children("form").removeClass("active").filter("#"+t.data("form")).addClass("active").end().end().slideDown(200)}))})),nwApp.elements.$contactDropdown.length)&&(nwApp.elements.$contactForms.find(".alert").length&&nwApp.elements.$contactForms.show())}));