@bmlt-enabled/croutonjs 3.24.1 → 3.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crouton-gmaps.js CHANGED
@@ -18944,9 +18944,7 @@ function MeetingMap(inConfig) {
18944
18944
  return true;
18945
18945
  };
18946
18946
  function searchResponseCallback(expand = false) {
18947
- if (!gAllMeetings) return;
18948
- if (!gAllMeetings.length) {
18949
- alert ( crouton.localization.getWord("no meetings found") );
18947
+ if (!gAllMeetings || !gAllMeetings.length) {
18950
18948
  return;
18951
18949
  };
18952
18950
  try {
@@ -116,7 +116,7 @@ if(!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.
116
116
  <span class="onoffswitch-switch"></span>
117
117
  </label>
118
118
  </div>
119
- </div>`,e.querySelector(".onoffswitch").addEventListener("click",function(e){e.pointerId<0||(g=!g,v=!1,crouton.filterNext24(g),v=!0)}),document.styleSheets[0].insertRule(rules[0]),document.styleSheets[0].insertRule(rules[1]),e}(),"topleft")):n={imageDir:s.BMLTPlugin_images,config:s,dropdownData:!1},l.addControl(y(n),"topright",a)))}}var g=!1;function y(e){var t=hbs_Crouton.templates.mapMenu,n=document.createElement("div");return n.innerHTML=t(e),n.querySelector("#nearbyMeetings").addEventListener("click",function(e){f().then(e=>{X(!1),l.setViewToPosition(e,ee,X),a={lat:e.latitude,lng:e.longitude},crouton.updateDistances()}).catch(e=>{console.log(e.message),jQuery(".geo").removeClass("hide").addClass("show").html(`<p>${e.message}</p>`)}),dropdownContent=document.getElementById("map-menu-dropdown").style.display="none"}),n.querySelector("#lookupLocation").addEventListener("click",j),e&&e.dropdownData?(n.querySelector("#filterMeetings").addEventListener("click",I),n.querySelector("#showAsTable").addEventListener("click",z)):n.querySelector("#filterTable").addEventListener("click",J),n.querySelector("#fullscreenMode").addEventListener("click",ae),n.querySelector("#map-menu-button").addEventListener("click",function(e){let t=document.getElementById("map-menu-dropdown");"inline-block"==t.style.display?t.style.display="none":(jQuery("#filteringByVisibility").html(U?"&#10004;":""),t.style.display="inline-block")}),[...n.getElementsByClassName("modal-close")].forEach(e=>e.addEventListener("click",e=>D(e.target))),n.querySelector("#close_table").addEventListener("click",R),n.querySelector("#goto-text").addEventListener("keydown",function(e){e&&"Enter"==e.key&&(D(e.target),F(P))}),n.querySelector("#goto-button").addEventListener("click",function(e){D(e.target),F(P)}),n}var v=!0;function _(e){jQuery("#zoomed-out-message").not(".hide").addClass("hide"),D(e)}function b(){f().then(e=>{A(),a={lat:e.latitude,lng:e.longitude},crouton.searchByCoordinates(e.latitude,e.longitude,s.map_search.width),T==c&&_(c)}).catch(e=>{console.log(e.message),T!=c&&N()})}function w(e){croutonMap.showMap(!1,!1),l.clickSearch(e,function(e,t){A(),a={lat:e,lng:t},crouton.searchByCoordinates(e,t,s.map_search.width)}),_(c)}function A(){o.myThrobber&&(o.myThrobber.style.display="block")}function k(){o.myThrobber&&(o.myThrobber.style.display="none")}function S(e){A(),document.getElementById("bmltsearch-goto-text")&&(document.getElementById("bmltsearch-goto-text").value="");e=l.getGeocodeCenter(e);e?(a={lat:e.lat,lng:e.lng},crouton.searchByCoordinates(e.lat,e.lng,s.map_search.width)):k()}function M(e,t=!0,n=!1){if(null===e&&s.map_search)s.map_search.auto?b():s.map_search.coordinates_search?(A(),s.map_search.coordinates_search=!1,a={lat:s.map_search.latitude,lng:s.map_search.longitude},crouton.searchByCoordinates(s.map_search.latitude,s.map_search.longitude,s.map_search.width)):s.map_search.location?l.callGeocoder(s.map_search.location,null,S):N();else{if(u=e.filter(e=>2!=e.venue_type),t){let e=u.reduce(function(e,t){return e.push([t.latitude,t.longitude]),e},[]);var i=s.maxTomatoWidth/2;if(a&&e.push([a.lat,a.lng]),s.map_search&&s.filter_visible){for(e.sort((e,t)=>se({lat:e[0],lng:e[1]},a)-se({lat:t[0],lng:t[1]},a));ue(e)>i&&3<e.length;)e=e.slice(0,e.length/2);ue(e)>i&&(e=e.slice(1,1))}l.fitBounds(e)}W(),k(),(s.filter_visible||s.centerMe||s.goto)&&crouton.forceShowMap(),s.centerMe?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){X(!(coords={latitude:e.coords.latitude,longitude:e.coords.longitude})),l.setViewToPosition(coords,ee,X),a={lat:e.coords.latitude,lng:e.coords.longitude},crouton.updateDistances()},j):n&&j():(s.centerMe||s.goto||s.map_search&&s.filter_visible||l.afterInit(()=>X(s.filter_visible)),s.goto&&l.callGeocoder(s.goto,B))}}var C,x,P=!1,T=null,E=!1;function D(e){if(l.modalOff(),T=null,!e.classList.contains("modal"))return D(e.parentNode);if(e.style.display="none",P&&(P=!1,ie()||ae()),E){const t=document.body;e=t.style.top;t.style.overflowX=C,t.style.position="",t.style.top="",window.scrollTo(0,-1*parseInt(e||"0"))}}function O(e,t=!1){if(ie()&&(P=!0,ae()),e&&(e.style.display="block",E=t,e.focus(),T=e,dd=document.getElementById("map-menu-dropdown"),dd&&(dd.style.display="none"),l.modalOn(),E)){const n=document.body;C=n.style.overflowX;e=-window.scrollY+"px";n.style.overflowX="hidden",n.style.position="fixed",n.style.width="100%",n.style.setProperty("top",e,"important")}}function I(e){O(document.getElementById("filter_modal"))}function N(e){document.getElementById("bmltsearch_modal")||o.appendChild(c),l.isMapDefined()?jQuery("#bmltsearch-clicksearch").parent().show():jQuery("#bmltsearch-clicksearch").parent().hide(),O(c)}function j(e=0){O(document.getElementById("geocoding_modal"))}function z(e=0){X(),jQuery("#bmlt-tabs").append(jQuery("#table_page")),jQuery("#table_page").removeClass("hide"),jQuery("#bmlt-map").css("display","none"),jQuery("#table_page").css("max-height",jQuery("#bmlt-map").height()),jQuery("#bmlt-maptable-div").css("height",jQuery("#bmlt-map").height()-jQuery("#bmlt-maptable-header").height()),document.getElementById("map-menu-dropdown").style.display="none"}function R(e=0){X(!1),jQuery("#table_page").addClass("hide"),jQuery("#bmlt-map").css("display","block")}function B(e,t=null){X(!1);e=ee(e);return X(!0),a.lat==t.lat&&a.lng==t.lng||(a=t,crouton.updateDistances()),e}function F(e){return""!=document.getElementById("goto-text").value?e?l.addListener("idle",function(){l.callGeocoder(document.getElementById("goto-text").value,B)},!0):l.callGeocoder(document.getElementById("goto-text").value,B):alert(""),1}function W(t=!1){if(u)if(u.length)try{$(t),a&&l.markSearchPoint([a.lat,a.lng])}catch(e){console.log(e),l.addListener("projection_changed",function(e){$(t),a&&l.markSearchPoint([a.lat,a.lng])},!0)}else alert(crouton.localization.getWord("no meetings found"))}function H(){return void 0===l.getZoom()||void 0!==s.clustering&&l.getZoom()<s.clustering}function $(e=!1){if(l.isMapDefined()){const n=l.getOpenMarker();l.clearAllMarkers(),l.removeClusterLayer();const i=te(u);var t=H()||1==i.length?i.map(e=>[e]):function(e){var t=new Array;for(const[n,u]of Object.entries(function(e){return e.reduce(function(e,t){return e.hasOwnProperty(t.location_municipality)?e[t.location_municipality].push(t):e[t.location_municipality]=[t],e},{})}(e))){var c=u.map(e=>(item=new Object,item.matched=!1,item.meeting=e,item.coords=l.fromLatLngToPoint(e.latitude,e.longitude),item));c.reduce(function(e,t,n){if(t.matched)return e;matches=[t.meeting];var i,a,r,o,s,l=t.coords;for(c2=n+1;c2<u.length;c2++)c[c2].matched||(i=c[c2].coords,a=l.x-8,r=l.x+8,o=l.y-8,s=l.y+8,i.x>=a&&i.x<=r&&i.y>=o&&i.y<=s&&(matches.push(c[c2].meeting),c[c2].matched=!0));return matches.sort(q),e.push(matches),e},t)}return t}(i);H()&&l.createClusterLayer(),t.forEach(function(e){!function(e,t){var n=[e[0].latitude,e[0].longitude];let i=crouton_Handlebars.compile(V);var a=i(e);l.createMarker(n,1<e.length,a,null,e.map(e=>parseInt(e.id_bigint)),t)}(e,n)}),l.addClusterLayer(),e&&(e=i.reduce(function(e,t){return e.push([t.latitude,t.longitude]),e},[]),l.fitBounds(e))}}function q(e,t){var n=parseInt(e.weekday_tinyint,10),i=parseInt(t.weekday_tinyint,10);if(n<s.start_week&&(n+=7),i<s.start_week&&(i+=7),n<i)return-1;if(i<n)return 1;e=e.start_time.toString().split(":"),t=t.start_time.toString().split(":");return parseInt(e[0])<parseInt(t[0])?-1:parseInt(e[0])>parseInt(t[0])?1:parseInt(e[1])<parseInt(t[1])?-1:parseInt(e[1])>parseInt(t[1])?1:0}document.addEventListener("keydown",function(e){T&&"Escape"==e.key&&D(T)},!0);const V=`
119
+ </div>`,e.querySelector(".onoffswitch").addEventListener("click",function(e){e.pointerId<0||(g=!g,v=!1,crouton.filterNext24(g),v=!0)}),document.styleSheets[0].insertRule(rules[0]),document.styleSheets[0].insertRule(rules[1]),e}(),"topleft")):n={imageDir:s.BMLTPlugin_images,config:s,dropdownData:!1},l.addControl(y(n),"topright",a)))}}var g=!1;function y(e){var t=hbs_Crouton.templates.mapMenu,n=document.createElement("div");return n.innerHTML=t(e),n.querySelector("#nearbyMeetings").addEventListener("click",function(e){f().then(e=>{X(!1),l.setViewToPosition(e,ee,X),a={lat:e.latitude,lng:e.longitude},crouton.updateDistances()}).catch(e=>{console.log(e.message),jQuery(".geo").removeClass("hide").addClass("show").html(`<p>${e.message}</p>`)}),dropdownContent=document.getElementById("map-menu-dropdown").style.display="none"}),n.querySelector("#lookupLocation").addEventListener("click",j),e&&e.dropdownData?(n.querySelector("#filterMeetings").addEventListener("click",I),n.querySelector("#showAsTable").addEventListener("click",z)):n.querySelector("#filterTable").addEventListener("click",J),n.querySelector("#fullscreenMode").addEventListener("click",ae),n.querySelector("#map-menu-button").addEventListener("click",function(e){let t=document.getElementById("map-menu-dropdown");"inline-block"==t.style.display?t.style.display="none":(jQuery("#filteringByVisibility").html(U?"&#10004;":""),t.style.display="inline-block")}),[...n.getElementsByClassName("modal-close")].forEach(e=>e.addEventListener("click",e=>D(e.target))),n.querySelector("#close_table").addEventListener("click",R),n.querySelector("#goto-text").addEventListener("keydown",function(e){e&&"Enter"==e.key&&(D(e.target),F(P))}),n.querySelector("#goto-button").addEventListener("click",function(e){D(e.target),F(P)}),n}var v=!0;function _(e){jQuery("#zoomed-out-message").not(".hide").addClass("hide"),D(e)}function b(){f().then(e=>{A(),a={lat:e.latitude,lng:e.longitude},crouton.searchByCoordinates(e.latitude,e.longitude,s.map_search.width),T==c&&_(c)}).catch(e=>{console.log(e.message),T!=c&&N()})}function w(e){croutonMap.showMap(!1,!1),l.clickSearch(e,function(e,t){A(),a={lat:e,lng:t},crouton.searchByCoordinates(e,t,s.map_search.width)}),_(c)}function A(){o.myThrobber&&(o.myThrobber.style.display="block")}function k(){o.myThrobber&&(o.myThrobber.style.display="none")}function S(e){A(),document.getElementById("bmltsearch-goto-text")&&(document.getElementById("bmltsearch-goto-text").value="");e=l.getGeocodeCenter(e);e?(a={lat:e.lat,lng:e.lng},crouton.searchByCoordinates(e.lat,e.lng,s.map_search.width)):k()}function M(e,t=!0,n=!1){if(null===e&&s.map_search)s.map_search.auto?b():s.map_search.coordinates_search?(A(),s.map_search.coordinates_search=!1,a={lat:s.map_search.latitude,lng:s.map_search.longitude},crouton.searchByCoordinates(s.map_search.latitude,s.map_search.longitude,s.map_search.width)):s.map_search.location?l.callGeocoder(s.map_search.location,null,S):N();else{if(u=e.filter(e=>2!=e.venue_type),t){let e=u.reduce(function(e,t){return e.push([t.latitude,t.longitude]),e},[]);var i=s.maxTomatoWidth/2;if(a&&e.push([a.lat,a.lng]),s.map_search&&s.filter_visible){for(e.sort((e,t)=>se({lat:e[0],lng:e[1]},a)-se({lat:t[0],lng:t[1]},a));ue(e)>i&&3<e.length;)e=e.slice(0,e.length/2);ue(e)>i&&(e=e.slice(1,1))}l.fitBounds(e)}W(),k(),(s.filter_visible||s.centerMe||s.goto)&&crouton.forceShowMap(),s.centerMe?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){X(!(coords={latitude:e.coords.latitude,longitude:e.coords.longitude})),l.setViewToPosition(coords,ee,X),a={lat:e.coords.latitude,lng:e.coords.longitude},crouton.updateDistances()},j):n&&j():(s.centerMe||s.goto||s.map_search&&s.filter_visible||l.afterInit(()=>X(s.filter_visible)),s.goto&&l.callGeocoder(s.goto,B))}}var C,x,P=!1,T=null,E=!1;function D(e){if(l.modalOff(),T=null,!e.classList.contains("modal"))return D(e.parentNode);if(e.style.display="none",P&&(P=!1,ie()||ae()),E){const t=document.body;e=t.style.top;t.style.overflowX=C,t.style.position="",t.style.top="",window.scrollTo(0,-1*parseInt(e||"0"))}}function O(e,t=!1){if(ie()&&(P=!0,ae()),e&&(e.style.display="block",E=t,e.focus(),T=e,dd=document.getElementById("map-menu-dropdown"),dd&&(dd.style.display="none"),l.modalOn(),E)){const n=document.body;C=n.style.overflowX;e=-window.scrollY+"px";n.style.overflowX="hidden",n.style.position="fixed",n.style.width="100%",n.style.setProperty("top",e,"important")}}function I(e){O(document.getElementById("filter_modal"))}function N(e){document.getElementById("bmltsearch_modal")||o.appendChild(c),l.isMapDefined()?jQuery("#bmltsearch-clicksearch").parent().show():jQuery("#bmltsearch-clicksearch").parent().hide(),O(c)}function j(e=0){O(document.getElementById("geocoding_modal"))}function z(e=0){X(),jQuery("#bmlt-tabs").append(jQuery("#table_page")),jQuery("#table_page").removeClass("hide"),jQuery("#bmlt-map").css("display","none"),jQuery("#table_page").css("max-height",jQuery("#bmlt-map").height()),jQuery("#bmlt-maptable-div").css("height",jQuery("#bmlt-map").height()-jQuery("#bmlt-maptable-header").height()),document.getElementById("map-menu-dropdown").style.display="none"}function R(e=0){X(!1),jQuery("#table_page").addClass("hide"),jQuery("#bmlt-map").css("display","block")}function B(e,t=null){X(!1);e=ee(e);return X(!0),a.lat==t.lat&&a.lng==t.lng||(a=t,crouton.updateDistances()),e}function F(e){return""!=document.getElementById("goto-text").value?e?l.addListener("idle",function(){l.callGeocoder(document.getElementById("goto-text").value,B)},!0):l.callGeocoder(document.getElementById("goto-text").value,B):alert(""),1}function W(t=!1){if(u&&u.length)try{$(t),a&&l.markSearchPoint([a.lat,a.lng])}catch(e){console.log(e),l.addListener("projection_changed",function(e){$(t),a&&l.markSearchPoint([a.lat,a.lng])},!0)}}function H(){return void 0===l.getZoom()||void 0!==s.clustering&&l.getZoom()<s.clustering}function $(e=!1){if(l.isMapDefined()){const n=l.getOpenMarker();l.clearAllMarkers(),l.removeClusterLayer();const i=te(u);var t=H()||1==i.length?i.map(e=>[e]):function(e){var t=new Array;for(const[n,u]of Object.entries(function(e){return e.reduce(function(e,t){return e.hasOwnProperty(t.location_municipality)?e[t.location_municipality].push(t):e[t.location_municipality]=[t],e},{})}(e))){var c=u.map(e=>(item=new Object,item.matched=!1,item.meeting=e,item.coords=l.fromLatLngToPoint(e.latitude,e.longitude),item));c.reduce(function(e,t,n){if(t.matched)return e;matches=[t.meeting];var i,a,r,o,s,l=t.coords;for(c2=n+1;c2<u.length;c2++)c[c2].matched||(i=c[c2].coords,a=l.x-8,r=l.x+8,o=l.y-8,s=l.y+8,i.x>=a&&i.x<=r&&i.y>=o&&i.y<=s&&(matches.push(c[c2].meeting),c[c2].matched=!0));return matches.sort(q),e.push(matches),e},t)}return t}(i);H()&&l.createClusterLayer(),t.forEach(function(e){!function(e,t){var n=[e[0].latitude,e[0].longitude];let i=crouton_Handlebars.compile(V);var a=i(e);l.createMarker(n,1<e.length,a,null,e.map(e=>parseInt(e.id_bigint)),t)}(e,n)}),l.addClusterLayer(),e&&(e=i.reduce(function(e,t){return e.push([t.latitude,t.longitude]),e},[]),l.fitBounds(e))}}function q(e,t){var n=parseInt(e.weekday_tinyint,10),i=parseInt(t.weekday_tinyint,10);if(n<s.start_week&&(n+=7),i<s.start_week&&(i+=7),n<i)return-1;if(i<n)return 1;e=e.start_time.toString().split(":"),t=t.start_time.toString().split(":");return parseInt(e[0])<parseInt(t[0])?-1:parseInt(e[0])>parseInt(t[0])?1:parseInt(e[1])<parseInt(t[1])?-1:parseInt(e[1])>parseInt(t[1])?1:0}document.addEventListener("keydown",function(e){T&&"Escape"==e.key&&D(T)},!0);const V=`
120
120
  <div class="accordion">
121
121
  {{#each this}}<div>
122
122
  <input type="radio" name="panel" id="panel-{{this.id_bigint}}" {{#unless @index}}checked{{/unless}}/>