@bmlt-enabled/croutonjs 4.3.1 → 4.3.3

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.js CHANGED
@@ -11213,6 +11213,7 @@ function CroutonLocalization(language) {
11213
11213
  "waze_desc": "فتح في تطبيق وايز",
11214
11214
  'address_lookup_fail': 'تعذر العثور على العنوان. يرجى المحاولة مرة أخرى.',
11215
11215
  "favorites": "المفضلة",
11216
+ "choose one": "اختر واحدا",
11216
11217
  "widen search": "البحث الواسع",
11217
11218
  "cancel search": "إلغاء البحث"
11218
11219
  },
@@ -11282,6 +11283,7 @@ function CroutonLocalization(language) {
11282
11283
  "address_lookup_fail": "Adresu se nepodařilo najít. Zkuste to prosím znovu.",
11283
11284
  "contact": "Kontakt",
11284
11285
  "favorites": "Oblíbené",
11286
+ "choose one": "Vyberte si jedno:",
11285
11287
  "widen search": "Rozšířit vyhledávání",
11286
11288
  "cancel search": "Zrušit vyhledávání",
11287
11289
  },
@@ -11353,6 +11355,7 @@ function CroutonLocalization(language) {
11353
11355
  "address_lookup_fail": "Adressen kunne ikke findes. Prøv venligst igen.",
11354
11356
  "contact": "Kontakt",
11355
11357
  "favorites": "Favoritter",
11358
+ "choose one": "Vælg én:",
11356
11359
  "widen search": "Udvid søgning",
11357
11360
  "cancel search": "Annuller søgning",
11358
11361
  },
@@ -11431,6 +11434,7 @@ function CroutonLocalization(language) {
11431
11434
  "all meetings": "Alle Meetings",
11432
11435
  'upcoming meetings': "Nächste 24 Stunden",
11433
11436
  "favorites": "Favoriten",
11437
+ "choose one": "Auswählen:",
11434
11438
  "widen search": "Suche ausweiten",
11435
11439
  "cancel search": "Abbrechen",
11436
11440
  },
@@ -11527,6 +11531,7 @@ function CroutonLocalization(language) {
11527
11531
  "all meetings": "Όλες οι ομάδες",
11528
11532
  "upcoming meetings": "Προσεχείς ομάδες",
11529
11533
  "favorites": "Αγαπημένα",
11534
+ "choose one": "Επιλέξτε ένα:",
11530
11535
  "widen search": "Διεύρυνση αναζήτησης",
11531
11536
  "cancel search": "Ακύρωση αναζήτησης",
11532
11537
  },
@@ -11600,6 +11605,7 @@ function CroutonLocalization(language) {
11600
11605
  "sorted by distance": "Sorted by Distance",
11601
11606
  "address_lookup_fail": "The address could not be found. Please try again.",
11602
11607
  "favorites": "Favorites",
11608
+ "choose one": "Select one:",
11603
11609
  "widen search": "Widen Search",
11604
11610
  "cancel search": "Cancel Search",
11605
11611
  },
@@ -11674,6 +11680,7 @@ function CroutonLocalization(language) {
11674
11680
  "sorted by distance": "Sorted by Distance",
11675
11681
  "address_lookup_fail": "The address could not be found. Please try again.",
11676
11682
  "favorites": "Favorites",
11683
+ "choose one": "Select one:",
11677
11684
  "widen search": "Widen Search",
11678
11685
  "cancel search": "Cancel Search",
11679
11686
  },
@@ -11748,6 +11755,7 @@ function CroutonLocalization(language) {
11748
11755
  "sorted by distance": "Sorted by Distance",
11749
11756
  "address_lookup_fail": "The address could not be found. Please try again.",
11750
11757
  "favorites": "Favorites",
11758
+ "choose one": "Select one:",
11751
11759
  "widen search": "Widen Search",
11752
11760
  "cancel search": "Cancel Search",
11753
11761
  },
@@ -11822,6 +11830,7 @@ function CroutonLocalization(language) {
11822
11830
  "sorted by distance": "Sorted by Distance",
11823
11831
  "address_lookup_fail": "The address could not be found. Please try again.",
11824
11832
  "favorites": "Favorites",
11833
+ "choose one": "Select one:",
11825
11834
  "widen search": "Widen Search",
11826
11835
  "cancel search": "Cancel Search",
11827
11836
  },
@@ -11920,7 +11929,7 @@ function CroutonLocalization(language) {
11920
11929
  "all meetings": "All Meetings",
11921
11930
  'upcoming meetings': "Upcoming Meetings",
11922
11931
  "favorites": "Favorites",
11923
- "choose one": "Choose one:",
11932
+ "choose one": "Select one:",
11924
11933
  "widen search": "Widen Search",
11925
11934
  "cancel search": "Cancel Search",
11926
11935
  },
@@ -11996,6 +12005,7 @@ function CroutonLocalization(language) {
11996
12005
  "sorted by distance": "Ordenado por distancia",
11997
12006
  "address_lookup_fail": "The address could not be found. Please try again.",
11998
12007
  "favorites": "Favoritos",
12008
+ "choose one": "Elige uno:",
11999
12009
  "widen search": "Búsqueda amplia",
12000
12010
  "cancel search": "Cancelar búsqueda",
12001
12011
  },
@@ -12082,6 +12092,7 @@ function CroutonLocalization(language) {
12082
12092
  'group details': 'نمایش گروه',
12083
12093
  "address_lookup_fail": "آدرس پیدا نشد. لطفا دوباره تلاش کنید.",
12084
12094
  "favorites": "مورد علاقه",
12095
+ "choose one": "یکی را انتخاب کنید",
12085
12096
  "widen search": "جستجوی گسترده",
12086
12097
  "cancel search": "لغو جستجو",
12087
12098
  },
@@ -12155,6 +12166,7 @@ function CroutonLocalization(language) {
12155
12166
  "sorted by distance": "Trié par distance",
12156
12167
  "address_lookup_fail": "L'adresse est introuvable. Veuillez réessayer.",
12157
12168
  "favorites": "Favoris",
12169
+ "choose one": "Choisis-en un",
12158
12170
  "widen search": "Recherche élargie",
12159
12171
  "cancel search": "Annuler la recherche",
12160
12172
  },
@@ -12228,6 +12240,7 @@ function CroutonLocalization(language) {
12228
12240
  "sorted by distance": "Ordinati per distanza",
12229
12241
  "address_lookup_fail": "L'indirizzo non è stato trovato. Per favore riprova.",
12230
12242
  "favorites": "Preferiti",
12243
+ "choose one": "Scegline uno",
12231
12244
  "widen search": "Ricerca larga",
12232
12245
  "cancel search": "Annulla ricerca",
12233
12246
  },
@@ -12368,6 +12381,7 @@ function CroutonLocalization(language) {
12368
12381
  "sorted by distance": "Posortowane według odległości",
12369
12382
  "address_lookup_fail": "The address could not be found. Please try again.",
12370
12383
  "favorites": "Ulubione",
12384
+ "choose one": "Wybierz jedną",
12371
12385
  "widen search": "Widen Search",
12372
12386
  "cancel search": "Cancel Search",
12373
12387
  },
@@ -12512,6 +12526,7 @@ function CroutonLocalization(language) {
12512
12526
  "sorted by distance": "Сортировка по расстоянию",
12513
12527
  "address_lookup_fail": "Адрес не найден. Пожалуйста, попробуйте еще раз.",
12514
12528
  "favorites": "Избранное",
12529
+ "choose one": "Выбери одну",
12515
12530
  "widen search": "Расширить поиск",
12516
12531
  "cancel search": "Отмена поиска",
12517
12532
  },
@@ -12580,6 +12595,7 @@ function CroutonLocalization(language) {
12580
12595
  "sorted by distance": "Zoradené podľa vzdialenosti",
12581
12596
  "address_lookup_fail": "Adresa sa nenašla. Skúste to znova prosím.",
12582
12597
  "favorites": "Obľúbené",
12598
+ "choose one": "Vyber si jeden",
12583
12599
  "widen search": "Rozšíriť vyhľadávanie",
12584
12600
  "cancel search": "Zrušiť vyhľadávanie",
12585
12601
  },
@@ -13639,18 +13655,18 @@ this["hbs_Crouton"]["templates"]["locationSearch"] = Handlebars.template({"compi
13639
13655
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search by location",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":40}}}))
13640
13656
  + "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-crosshair\" viewBox=\"0 0 16 16\" style=\"vertical-align: sub;\">\n <path d=\"M8.5.5a.5.5 0 0 0-1 0v.518A7 7 0 0 0 1.018 7.5H.5a.5.5 0 0 0 0 1h.518A7 7 0 0 0 7.5 14.982v.518a.5.5 0 0 0 1 0v-.518A7 7 0 0 0 14.982 8.5h.518a.5.5 0 0 0 0-1h-.518A7 7 0 0 0 8.5 1.018zm-6.48 7A6 6 0 0 1 7.5 2.02v.48a.5.5 0 0 0 1 0v-.48a6 6 0 0 1 5.48 5.48h-.48a.5.5 0 0 0 0 1h.48a6 6 0 0 1-5.48 5.48v-.48a.5.5 0 0 0-1 0v.48A6 6 0 0 1 2.02 8.5h.48a.5.5 0 0 0 0-1zM8 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4\"/>\n </svg>\n </span>\n</button>\n<div id=\"bmlt_location_search_modal\" class=\"modal\" style=\"display: none;\">\n <div id=\"bmlt_location_search_content\" class=\"modal-content\" style=\"border-color:unset;\">\n <span id=\"close_location_search\" class=\"modal-close\">x</span>\n <div class=\"modal-title\">"
13641
13657
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search by location",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":12,"column":33},"end":{"line":12,"column":65}}}))
13642
- + "</div>\n <div class=\"crouton-modal-search-page\">\n <div id=\"modal-location-search-box\" class=\"modal-search\">\n <input id=\"bmlt-location-search-goto-text\" type=\"text\" class=\"crouton-goto-text\"\n placeholder=\""
13643
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Enter a city or zip code",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":16,"column":33},"end":{"line":16,"column":71}}}))
13644
- + "\">\n <button id=\"bmlt-location-search-text-button\" class=\"filter-button\">"
13645
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":17,"column":84},"end":{"line":17,"column":109}}}))
13658
+ + "</div>\n <div class=\"crouton-modal-search-page\">\n <div id=\"modal-location-search-box\" class=\"modal-search\">\n <div>\n <input id=\"bmlt-location-search-goto-text\" type=\"text\" class=\"crouton-goto-text\" autocomplete=\"off\"\n placeholder=\""
13659
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Enter a city or zip code",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":17,"column":33},"end":{"line":17,"column":71}}}))
13660
+ + "\">\n </div>\n <button id=\"bmlt-location-search-text-button\" class=\"filter-button\">"
13661
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":19,"column":84},"end":{"line":19,"column":109}}}))
13646
13662
  + "</button>\n </div>\n <div class=\"modal-search\">\n <button id=\"bmlt-location-search-nearbyMeetings\" class=\"filter-button\">"
13647
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"near_me",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":20,"column":87},"end":{"line":20,"column":108}}}))
13663
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"near_me",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":22,"column":87},"end":{"line":22,"column":108}}}))
13648
13664
  + "</button>\n </div>\n <div id=\"location-search-widen\" class=\"modal-search\">\n <button id=\"bmlt-location-search-widen\" class=\"filter-button\">"
13649
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Widen Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":23,"column":78},"end":{"line":23,"column":104}}}))
13665
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Widen Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":25,"column":78},"end":{"line":25,"column":104}}}))
13650
13666
  + "</button>\n </div>\n <div>\n <!--<button id=\"location-search-close\" class=\"advanced-search-button\" style=\"float:left\">"
13651
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Close",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":26,"column":96},"end":{"line":26,"column":115}}}))
13667
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Close",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":28,"column":96},"end":{"line":28,"column":115}}}))
13652
13668
  + "</a>-->\n <button id=\"bmlt-location_search-cancel\" class=\"advanced-search-button\">"
13653
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Cancel Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":27,"column":88},"end":{"line":27,"column":115}}}))
13669
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Cancel Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":29,"column":88},"end":{"line":29,"column":115}}}))
13654
13670
  + "</button>\n </div>\n </div>\n <div class=\"crouton-modal-search-choice\"></div>\n </div>\n</div>";
13655
13671
  },"useData":true});
13656
13672
  this["hbs_Crouton"]["templates"]["main"] = Handlebars.template({"0":function(container,depth0,helpers,partials,data) {
@@ -13851,8 +13867,8 @@ this["hbs_Crouton"]["templates"]["mapMenu"] = Handlebars.template({"0":function(
13851
13867
  + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"Show meetings near...",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":44,"column":28},"end":{"line":44,"column":63}}}))
13852
13868
  + "</span><span id=\"close_search\" class=\"modal-close\">x</span>\n <p></p>\n <div class=\"crouton-modal-search-page\">\n <div class=\"modal-search\">\n "
13853
13869
  + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"Enter a city or zip code",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":48,"column":16},"end":{"line":48,"column":54}}}))
13854
- + "\n <input id=\"goto-text\" class=\"crouton-goto-text\" type=\"text\">\n <button id=\"goto-button\" class=\"filter-button\">"
13855
- + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":50,"column":63},"end":{"line":50,"column":88}}}))
13870
+ + "\n <div>\n <input id=\"goto-text\" class=\"crouton-goto-text\" type=\"text\" autocomplete=\"off\">\n </div>\n <button id=\"goto-button\" class=\"filter-button\">"
13871
+ + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":52,"column":63},"end":{"line":52,"column":88}}}))
13856
13872
  + "</button>\n </div>\n </div>\n <div class=\"crouton-modal-search-choice\"></div>\n </div>\n</div>\n\n";
13857
13873
  },"usePartial":true,"useData":true,"useDepths":true});
13858
13874
  this["hbs_Crouton"]["templates"]["mapSearch"] = Handlebars.template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
@@ -15452,7 +15468,7 @@ function Crouton(config) {
15452
15468
  self.distanceTabAllowed = false;
15453
15469
  self.favoritesOn = false;
15454
15470
  self.config = {
15455
- version: '4.3.1', // CroutonJS version for debugging
15471
+ version: '4.3.3', // CroutonJS version for debugging
15456
15472
  on_complete: null, // Javascript function to callback when data querying is completed.
15457
15473
  root_server: null, // The root server to use.
15458
15474
  placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
@@ -17382,6 +17398,7 @@ function MeetingMap(inConfig) {
17382
17398
  var gOldBounds = false;
17383
17399
  var gCurrentlyDraggingMap = false;
17384
17400
  var gLocationSearchResult = null;
17401
+ var gAllCities = [];
17385
17402
  function preloadApiLoadedCallback(f,a) {
17386
17403
  gLoadedCallbackFunction = f;
17387
17404
  gLoadedCallbackArgs = a;
@@ -17530,6 +17547,96 @@ function MeetingMap(inConfig) {
17530
17547
  function doGeolocationThenClose() {
17531
17548
  doGeolocation().then(closeModalWindow(gLocationSearchModal));
17532
17549
  }
17550
+ function addAutocompleteEvents(inp, button) {
17551
+ var currentFocus;
17552
+ inp.addEventListener("input",function(e) {
17553
+ var a, b, i, val = this.value;
17554
+ const inp = this;
17555
+ /*close any already open lists of autocompleted values*/
17556
+ closeAllLists();
17557
+ if (!val) { return false;}
17558
+ currentFocus = -1;
17559
+ /*create a DIV element that will contain the items (values):*/
17560
+ a = document.createElement("DIV");
17561
+ a.setAttribute("id", this.id + "autocomplete-list");
17562
+ a.setAttribute("class", "autocomplete-items");
17563
+ /*append the DIV element as a child of the autocomplete container:*/
17564
+ this.parentNode.appendChild(a);
17565
+ /*for each item in the array...*/
17566
+ for (i = 0; i < gAllCities.length; i++) {
17567
+ /*check if the item starts with the same letters as the text field value:*/
17568
+ if (gAllCities[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
17569
+ /*create a DIV element for each matching element:*/
17570
+ b = document.createElement("DIV");
17571
+ /*make the matching letters bold:*/
17572
+ b.innerHTML = "<strong>" + gAllCities[i].substr(0, val.length) + "</strong>";
17573
+ b.innerHTML += gAllCities[i].substr(val.length);
17574
+ /*insert a input field that will hold the current array item's value:*/
17575
+ b.innerHTML += "<input type='hidden' value='" + gAllCities[i] + "'>";
17576
+ /*execute a function when someone clicks on the item value (DIV element):*/
17577
+ b.addEventListener("click", function(event) {
17578
+ /*insert the value for the autocomplete text field:*/
17579
+ inp.value = this.getElementsByTagName("input")[0].value;
17580
+ /*close the list of autocompleted values,
17581
+ (or any other open lists of autocompleted values:*/
17582
+ closeAllLists();
17583
+ button.click();
17584
+ });
17585
+ a.appendChild(b);
17586
+ }
17587
+ }
17588
+ });
17589
+ inp.addEventListener("keydown", function(e) {
17590
+ var x = document.getElementById(this.id + "autocomplete-list");
17591
+ if (x) x = x.getElementsByTagName("div");
17592
+ if (e.keyCode == 40) {
17593
+ /*If the arrow DOWN key is pressed,
17594
+ increase the currentFocus variable:*/
17595
+ currentFocus++;
17596
+ /*and and make the current item more visible:*/
17597
+ addActive(x);
17598
+ } else if (e.keyCode == 38) { //up
17599
+ /*If the arrow UP key is pressed,
17600
+ decrease the currentFocus variable:*/
17601
+ currentFocus--;
17602
+ /*and and make the current item more visible:*/
17603
+ addActive(x);
17604
+ } else if (e.keyCode == 13) {
17605
+ /*If the ENTER key is pressed, prevent the form from being submitted,*/
17606
+ e.preventDefault();
17607
+ if (currentFocus > -1) {
17608
+ /*and simulate a click on the "active" item:*/
17609
+ if (x) x[currentFocus].click();
17610
+ }
17611
+ }
17612
+ });
17613
+ function addActive(x) {
17614
+ /*a function to classify an item as "active":*/
17615
+ if (!x) return false;
17616
+ /*start by removing the "active" class on all items:*/
17617
+ removeActive(x);
17618
+ if (currentFocus >= x.length) currentFocus = 0;
17619
+ if (currentFocus < 0) currentFocus = (x.length - 1);
17620
+ /*add class "autocomplete-active":*/
17621
+ x[currentFocus].classList.add("autocomplete-active");
17622
+ }
17623
+ function removeActive(x) {
17624
+ /*a function to remove the "active" class from all autocomplete items:*/
17625
+ for (var i = 0; i < x.length; i++) {
17626
+ x[i].classList.remove("autocomplete-active");
17627
+ }
17628
+ }
17629
+ function closeAllLists() {
17630
+ var x = document.getElementsByClassName("autocomplete-items");
17631
+ for (var i = 0; i < x.length; i++) {
17632
+ x[i].parentNode.removeChild(x[i]);
17633
+ }
17634
+ }
17635
+ /*execute a function when someone clicks in the document:*/
17636
+ document.addEventListener("click", function (e) {
17637
+ closeAllLists(e.target);
17638
+ });
17639
+ }
17533
17640
  function createLocationSearchButton() {
17534
17641
  const template = hbs_Crouton.templates['locationSearch'];
17535
17642
  const controlDiv = document.createElement('div');
@@ -17538,12 +17645,7 @@ function MeetingMap(inConfig) {
17538
17645
  controlDiv.querySelector("#location-search-button").addEventListener('click', showLocationSearchDialog);
17539
17646
  gDefaultLocationSearchButtonLabel = controlDiv.querySelector("#location-search-button :first-child").innerHTML;
17540
17647
  controlDiv.querySelector("#bmlt-location-search-nearbyMeetings").addEventListener('click', doGeolocationThenClose);
17541
- controlDiv.querySelector("#bmlt-location-search-goto-text").addEventListener('keypress', function (event) {
17542
- if (event.key === "Enter") {
17543
- event.preventDefault();
17544
- document.getElementById("bmlt-location-search-text-button").click();
17545
- }
17546
- });
17648
+ addAutocompleteEvents(controlDiv.querySelector("#bmlt-location-search-goto-text"), controlDiv.querySelector("#bmlt-location-search-text-button"));
17547
17649
  controlDiv.querySelector("#bmlt-location-search-text-button").addEventListener('click', function () {
17548
17650
  let text = document.getElementById("bmlt-location-search-goto-text").value.trim();
17549
17651
  if (text === "") return;
@@ -17645,7 +17747,7 @@ function MeetingMap(inConfig) {
17645
17747
  filterVisible(false);
17646
17748
  gSearchPoint = {"lat": position.lat, "lng": position.lng};
17647
17749
  crouton.updateDistances();
17648
- const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
17750
+ const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(gSearchPoint));
17649
17751
  gDelegate.flyToFixedZoom(position, locationSearchResult.zoom, filterVisible);
17650
17752
  filterVisible(true);
17651
17753
  setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
@@ -17676,11 +17778,7 @@ function MeetingMap(inConfig) {
17676
17778
  });
17677
17779
  [...controlDiv.getElementsByClassName('modal-close')].forEach((elem)=>elem.addEventListener('click', (e)=>closeModalWindow(e.target)));
17678
17780
  controlDiv.querySelector("#close_table").addEventListener('click', hideListView);
17679
- controlDiv.querySelector("#goto-text").addEventListener('keydown', function (event) {
17680
- if (event && event.key == "Enter") {
17681
- lookupLocation(document.getElementById('goto-text').value,g_suspendedFullscreen, mapMenuGeocode);
17682
- }
17683
- });
17781
+ addAutocompleteEvents(controlDiv.querySelector("#goto-text"), controlDiv.querySelector("#goto-button"));
17684
17782
  controlDiv.querySelector("#goto-button").addEventListener('click', function (event) {
17685
17783
  lookupLocation(document.getElementById('goto-text').value, g_suspendedFullscreen, mapMenuGeocode);
17686
17784
  });
@@ -17813,7 +17911,7 @@ function MeetingMap(inConfig) {
17813
17911
  const centerAndBounds = gDelegate.getGeocodeCenterAndBounds(resp, i);
17814
17912
  if (!centerAndBounds) return;
17815
17913
  const zoom = calcZoomThatContainsBoundingBox(centerAndBounds);
17816
- const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, zoom);
17914
+ const locationSearchResult = gDelegate.getZoomAdjustedBounds(gSearchPoint, filterMeetingsAndBounds, zoom, findClosestMeetingLatLng(gSearchPoint));
17817
17915
  gDelegate.flyToFixedZoom(gSearchPoint, locationSearchResult.zoom, filterVisible);
17818
17916
  searchResponseCallback();
17819
17917
  })
@@ -17852,7 +17950,7 @@ function MeetingMap(inConfig) {
17852
17950
  );
17853
17951
  jQuery('#'+modalName+' .crouton-modal-search-page').addClass('hide');
17854
17952
  jQuery('#'+modalName+' .crouton-modal-search-choice').removeClass('hide')
17855
- .html('<div class="choose-location"><h4>'+crouton.localization.getWord('Choose one')+'</h4>'+html.join('')+'</div>')
17953
+ .html('<div class="choose-location"><h4>'+crouton.localization.getWord('Select one')+'</h4>'+html.join('')+'</div>')
17856
17954
  jQuery('#'+modalName+' .location-choice').on('click', function() {
17857
17955
  const index = parseInt(jQuery(this).data("choice"))
17858
17956
  setLocationSearchButtonLabel(choices[index]);
@@ -17877,6 +17975,16 @@ function MeetingMap(inConfig) {
17877
17975
  function locationSearchGeocodeInitial(resp) {
17878
17976
  locationSearchGeocode(resp, true);
17879
17977
  }
17978
+ function findClosestMeetingLatLng(center) {
17979
+ return filterMeetings(gAllMeetings).reduce((closest, meeting) => {
17980
+ const meetingLocation = {lat: meeting.latitude, lng: meeting.longitude};
17981
+ const distance = getDistance(center, meetingLocation);
17982
+ if (distance < closest.distance) {
17983
+ return {meetingLocation: meetingLocation, distance: distance};
17984
+ }
17985
+ return closest;
17986
+ }, {meetingLocation: null, distance: Infinity}).meetingLocation;
17987
+ }
17880
17988
  function locationSearchGeocode(resp, initial=false) {
17881
17989
  chooseResponse('bmlt_location_search_modal', resp, function(resp, i) {
17882
17990
  closeModalWindow(gLocationSearchModal);
@@ -17885,7 +17993,8 @@ function MeetingMap(inConfig) {
17885
17993
  let center = centerAndBounds.center;
17886
17994
  filterVisible(false);
17887
17995
  let zoom = calcZoomThatContainsBoundingBox(centerAndBounds);
17888
- gLocationSearchResult = gDelegate.getZoomAdjustedBounds(center, filterMeetingsAndBounds, zoom);
17996
+
17997
+ gLocationSearchResult = gDelegate.getZoomAdjustedBounds(center, filterMeetingsAndBounds, zoom, findClosestMeetingLatLng(center));
17889
17998
  gSearchPoint = {"lat": gLocationSearchResult.center.lat, "lng": gLocationSearchResult.center.lng};
17890
17999
  filterVisible(true, gLocationSearchResult.bounds);
17891
18000
  crouton.updateDistances(initial);
@@ -17905,6 +18014,13 @@ function MeetingMap(inConfig) {
17905
18014
  return;
17906
18015
  }
17907
18016
  gAllMeetings = meetings_responseObject.filter(m => m.venue_type != 2);
18017
+ gAllCities = meetings_responseObject.reduce(function (carry, m) {
18018
+ const fields = ['location_municipality', 'location_city_subsection', 'location_province', 'location_neighborhood'];
18019
+ fields.forEach(function (f) {
18020
+ if (m[f].length > 1 && !carry.includes(m[f])) carry.push(m[f]);
18021
+ });
18022
+ return carry;
18023
+ }, []);
17908
18024
  if (fitBounds && !config.centerMe && !config.goto) {
17909
18025
  let lat_lngs = gAllMeetings.reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[]);
17910
18026
  const maxRadius = config.maxTomatoWidth/2.0;
@@ -17943,13 +18059,13 @@ function MeetingMap(inConfig) {
17943
18059
  retrieveGeolocation().then(function(coords) {
17944
18060
  filterVisible(false);
17945
18061
  if (isMapVisible() || !makeFilterVisible) {
17946
- const locationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
18062
+ const locationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(coords));
17947
18063
  gDelegate.flyToFixedZoom(coords, locationSearchResult.zoom, () => {
17948
18064
  filterVisible(makeFilterVisible);
17949
18065
  if (makeFilterVisible) setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
17950
18066
  });
17951
18067
  } else {
17952
- gLocationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12);
18068
+ gLocationSearchResult = gDelegate.getZoomAdjustedBounds(coords, filterMeetingsAndBounds, config.locationSearchZoom ?? 12, findClosestMeetingLatLng(coords));
17953
18069
  filterVisible(true, gLocationSearchResult.bounds);
17954
18070
  setLocationSearchButtonLabel(crouton.localization.getWord('closest meetings'));
17955
18071
  }
@@ -18047,12 +18163,15 @@ function MeetingMap(inConfig) {
18047
18163
  }
18048
18164
  jQuery('#bmlt_location_search_modal .crouton-modal-search-page').removeClass('hide');
18049
18165
  jQuery('#bmlt_location_search_modal .crouton-modal-search-choice').addClass('hide');
18050
- jQuery('bmlt-location-search-goto-text').val('');
18166
+ jQuery('#bmlt-location-search-goto-text').val('');
18167
+ jQuery('#bmlt-location-search-goto-textautocomplete-list').remove();
18051
18168
  }
18052
18169
  function showGeocodingDialog(e=null) {
18053
18170
  openModalWindow(document.getElementById('geocoding_modal'));
18054
18171
  jQuery('#geocoding_modal .crouton-modal-search-page').removeClass('hide');
18055
18172
  jQuery('#geocoding_modal .crouton-modal-search-choice').addClass('hide');
18173
+ jQuery('#goto-text').val('');
18174
+ jQuery('#goto-textautocomplete-list').remove();
18056
18175
  }
18057
18176
  function showListView(e=null) {
18058
18177
  filterVisible();
@@ -18480,129 +18599,139 @@ MeetingMap.prototype.hasMapSearch = null;
18480
18599
  MeetingMap.prototype.createLocationSearchButton = null;
18481
18600
 
18482
18601
  function MapDelegate(config) {
18483
- const shadowUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarkerS.png"
18602
+ const shadowUrl = config.BMLTPlugin_images
18603
+ ? config.BMLTPlugin_images + "/NAMarkerS.png"
18484
18604
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAgEAYAAADbCl1AAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAF7UlEQVRo3u2YaWhcVRTH77zJzGS2pG0c1FRr6o5rXVBxwSLuCu5WLGLADa2VKlbFFUVcUasftIIiivu+C4q7xRVRcF8xV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hWfHynM4OvHHoPEgvQHwhInrj6f9lfCcdc4NrB2Lwi6o0h/LJx9GKfex45JcGOK/kh3Wwt97KTGDlWX0myhcR2NdGYMErScyyC+t86NrUIQzFNO7S1MrhIOk42MkK9mFgvLpFc2QpvVMxXULVCrpguiCecWkCNkOGLOLVB3IhNq3Fz6ofpQHY8KyQXBEEwc0jaDz7O5SdW5wVW/FZZ2EeZI5NODkAXIIFCB/HeC+nU2gPM5/bwAszMVtF1h3TcpjqJzPsVnhRWibYXv6tvQnQrJwBt5pgqrQeBn2iV/1Xzb5sjW2EEVfHMRAfOkT2mOfIbnufsREldVWcu4uJHZnCRzF8SlTCb8LerUtrBar0S/7NwqvrbADsh/KoxzIwqw4/wcZecj2lEfeSET5WJga9TmplPGJxa4yua2Q0BcSZYbVZ4FL5GXVnXh8em2XkU1/10xdT6NE9O2tesKVGCNityla2QHBQTO4Et72Ikhgp3vYsjNzD6UibPTJ05intyMCtzINNjo1TLHT5Yid//yIOO4kvZo38FlGC4ohmxkwzt+p6zV4NXsN9+lrgGShllrhN0c4dDrPH8PAV5DOITKkO6MkUX8ey4kiIzgw1MsZA7frju5xu9Cm9+Hhn8D5kmoQVPTsZaP+Eyt1R2rA1HfQ15ovuD127wmO8jjQ1MEqyBpUImraYVgk8UHZziK+UFh8WSEY+GqCGazg21+tpi3IDvXJF3jnPXRnithNcikIVdQBwFsLgYl0pcU39kEBetUBOM/aZ6/XyWEnKC9+nXU4yeKowKqC9KdmXONa86F7JS5f1jjWw0/ig3R1n+UMIxAvUTzXoQKk+4E+NFtrZzavDkHEqQarme6q+0mt/8BTRrNnwf6/EMAAAAASUVORK5CYII=";
18485
- let iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarker.png"
18605
+ let iconUrl = config.BMLTPlugin_images
18606
+ ? config.BMLTPlugin_images + "/NAMarker.png"
18486
18607
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAgCAYAAAD5VeO1AAAABmJLR0QA/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wMzoyNDoxMyswMDowMJsWpgAAAAAldEVYdG1vZGlmeS1kYXRlADIwMTEtMDEtMDZUMDM6MjQ6MTMrMDA6MDDEp9A0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
18487
18608
 
18488
- var g_icon_image_single = L.icon({
18609
+ var g_icon_image_single = L.icon({
18489
18610
  iconUrl: iconUrl,
18490
18611
  shadowUrl: shadowUrl,
18491
- iconSize: [23, 32], // size of the icon
18492
- shadowSize: [43, 32], // size of the shadow
18493
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18494
- shadowAnchor: [12, 32], // the same for the shadow
18495
- popupAnchor: [0, -32] // point from which the popup should open relative to the iconAnchor
18612
+ iconSize: [23, 32], // size of the icon
18613
+ shadowSize: [43, 32], // size of the shadow
18614
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18615
+ shadowAnchor: [12, 32], // the same for the shadow
18616
+ popupAnchor: [0, -32], // point from which the popup should open relative to the iconAnchor
18496
18617
  });
18497
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAMarkerG.png"
18618
+ iconUrl = config.BMLTPlugin_images
18619
+ ? config.BMLTPlugin_images + "/NAMarkerG.png"
18498
18620
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADTRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMi4yLWMwNjMgNTMuMzUyNjI0LCAyMDA4LzA3LzMwLTE4OjA1OjQxICAgICAgICAiPgogPHJkZjpSREY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q3JlYXRvckNvbnRhY3RJbmZvCiAgICBJcHRjNHhtcENvcmU6Q2lBZHJFeHRhZHI9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckNpdHk9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkclJlZ2lvbj0iIgogICAgSXB0YzR4bXBDb3JlOkNpQWRyUGNvZGU9IiIKICAgIElwdGM0eG1wQ29yZTpDaUFkckN0cnk9IiIKICAgIElwdGM0eG1wQ29yZTpDaVRlbFdvcms9IiIKICAgIElwdGM0eG1wQ29yZTpDaUVtYWlsV29yaz0iIgogICAgSXB0YzR4bXBDb3JlOkNpVXJsV29yaz0iIi8+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7HRMckAAAG20lEQVR42qyWeXBV9RXHP/fet+QlL+QlPAgkeZIFxAWxqWBVagVKYtQUUTvtSIeKLYNY24pY/MPptA50nI4OnXbGzojVoSLNdFGJ6ci0MRSo1BZcILgQgglGSdJsL9vL2+679/bcBasVpON4Zn7v3d/2Pef3Pcvvp/DpskjaLQFYmq9QLf++nIWVhP40vCJzLdJekpY722blHKBXBWHzfJUV8xWmlcmqAhn02S2Uh/aFK+jr7+d4V3f2qMXrcXhMpprOB273H7oUHlyu4qsyoVCDoOEC25JfNp3SHU0YeXkkjrXT3bybF/fuoxVe0OEuWTJwNnBFOk80BH3r6qPTKRkdZXrZLHxDw4S/ch2hK69CP3qE9P42ZjW/iFVWgS47MokpRvf8mbZt23hiaOTIGDQKVh/81yBbHrxeYd3q9XdRvXQZxb2nCc6ejXGqC+3yWgLL60g17WS4dQ8BVUPNz0d99TCB8nKC31rDytgFhDbfX/to38DT4pObBC+resALL4GfrLrtVmrWfpeKq68hVFsLlmifOx+tdDbW5AToOoppOsfVCsJkWnYzeucd5IkBkeuWUbdlK98IBVfI9AYb1AGXKNh8Y2UsULX2O0SLIyiWhRopcTkzDBRVEc68Z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ST3RXCb0sSR+1cRXPRf9tX9KYt2Db+HlTl5MHHqDZLec7tT7vDswxOPwF7kCf/ZhVbRFEvrhPQrxhDhSl2ZqbnTgVf2x3zehHzwgjpbJdBpFSrBd0+3EMGXIEtaaNbJyWTyEExIOgx+Te+/w8csGAQ4Lcp5dPs5cV7I8kC8xnM7IJTKLQHSG+KOTTCqDKSYeEvq26vxCPHG/t+UT4L6IQusDfpbNsy9lURBQ3OPZdcqOf9vJlu5mvCXJlpPxUZn/sc7xbosluF0+RosnuTGLu5/NMTYhwGl7wPLosVxgvNtFERoM6RsC/ieDnAD/4KPAZwO35cQbJhvbDBc84xFoehlquXfJh0oPy0SLwSPyufd/XxPaOd4t7V0WF9So1EY93jXF3al4inLeG2Jbjr+Pw/qzPYzUcz21JE3u+12Oo/+2nG+pci6o4X1n5X+nwYjUkA3u8k+K+ilPuYkeizt3G0wk7N2KC6p7dOwVTfsMNsnn8XO93NTzvBWPHjDZ9A8BSlmeAmniPHYZPGUbfybs+KxSIlhb/Fi/DWDtlHal6lgb5XOS6BUq3T8XBWt8djJTx+cpcvbGixVycqH/6jwv5M8sW6TF/t/F/xFgADsAxARvscdVAAAAAElFTkSuQmCC";
18499
18621
  var g_icon_image_multi = L.icon({
18500
18622
  iconUrl: iconUrl,
18501
18623
  shadowUrl: shadowUrl,
18502
- iconSize: [23, 32], // size of the icon
18503
- shadowSize: [43, 32], // size of the shadow
18504
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18505
- shadowAnchor: [12, 32], // the same for the shadow
18506
- popupAnchor: [0, -32] // point from which the popup should open relative to the iconAnchor
18624
+ iconSize: [23, 32], // size of the icon
18625
+ shadowSize: [43, 32], // size of the shadow
18626
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18627
+ shadowAnchor: [12, 32], // the same for the shadow
18628
+ popupAnchor: [0, -32], // point from which the popup should open relative to the iconAnchor
18507
18629
  });
18508
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/NAM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12Sy5Hr2GaW87EWzzHqOqdKv0XeT6KlJVyilcPSVPQJVw+MNxASWRQULuxP7UHI1aWNOLBweSb2JvYjeP7T8A6xX9CqJ2X6nlKSiJWmJpbeCHci06zEymedPiUiY4hM+GoZZoWdxVTsRmzKXhJev7hyHF0FTrRne/GwPkB6G/wf1NN//VX6jkZ84J1VFrvr1MjTJNEpXRrJv3VyPX9qb879UYEWrdLlFQ5+JnfzQ9bE94jf9jUecZ8nr6yrj6JMnaCl6SJ0v1yLYPIC0mWHHDBdZ7ncbbQhkHjItqLp3Em/zHezTbBtii4XILZYqOwx9hOm7x+6fi8+gxVpAlSY+Bpz93KdEL30QJVuuyBKFyiOhrkpm1b8NA5KllUKYeB3Av6WavXXkQr0+OdoaLZxNcJO8MfU+Yyr+SRHOIkNubB2Nki4qCIF6ZLQHGfaRonrU00a78STB7nWpG0B/lFuqc8JE+7RI+w/Aon+Rir9Gs0Ex27jBfp/5+vZkK+xr2l1eqxa+W4tICJw0r+0nrXPypNBG5/QfejV4z3eBY/Gu9iJF/zrmWiye7HMqInSgS5G7iHKJyzQgcKO82k2W6vpdnAeBDy11zlSjzLP6Tav1GeReKUxwI7Rof+roXiP82naPbOtW5u8nXuihetz/gQm8QelKPsMoLVR3S8arxGwf/VGDD/JuCitdh9fKYyg82nU8ulY5dxzurhQh15fAut3HMT6w4+p3LvesWg+X34VpuEFcosZkoBbL/ODfkbt1/SiP2/i/8nwAAca+6jkhGCHgAAAABJRU5ErkJggg==";
18510
18633
  var g_icon_image_selected = L.icon({
18511
18634
  iconUrl: iconUrl,
18512
18635
  shadowUrl: shadowUrl,
18513
- iconSize: [23, 32], // size of the icon
18514
- shadowSize: [43, 32], // size of the shadow
18515
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18516
- shadowAnchor: [12, 32], // the same for the shadow
18517
- popupAnchor: [12, -32] // point from which the popup should open relative to the iconAnchor
18518
- });
18519
- iconUrl = config.BMLTPlugin_images ? config.BMLTPlugin_images+"/SearchPoint.png"
18636
+ iconSize: [23, 32], // size of the icon
18637
+ shadowSize: [43, 32], // size of the shadow
18638
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18639
+ shadowAnchor: [12, 32], // the same for the shadow
18640
+ popupAnchor: [12, -32], // point from which the popup should open relative to the iconAnchor
18641
+ });
18642
+ iconUrl = config.BMLTPlugin_images
18643
+ ? config.BMLTPlugin_images + "/SearchPoint.png"
18520
18644
  : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAhCAYAAAAyCTAQAAAABGdBTUEAALGPC/xhBQAAAHhlWElmTU0AKgAAAAgABAESAAMAAAABAAEAAAEaAAUAAAABAAAAPgEbAAUAAAABAAAARodpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABegAwAEAAAAAQAAACEAAAAAZxgyOAAAAAlwSFlzAAALEwAACxMBAJqcGAAAApJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24+NzI8L3RpZmY6WVJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xP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W7GPC6N4UIR+I31lrdiFRKIoPSe71QNSl8jWvXgwYMh0HK+rKysAc75nDW0+IBNL8diFKG7UamFiCAYhjTJJ5hvei9oGGNUi83NzZUwWu0tHuM1z6z3nBtu8N2Pw9HgPxfdzw+VqAFMGwaXDQyT+fDgh/sqkvgtNvg/iw2TnpuxHpwfiYBol3oQfjZUkQa+6bmJgB2PuUCS+QPeBel9hfPtvIjxFpiLjcD5nQYmATABvj8APdHk3eu6oQNdchzA30FFtTjr8d7B46/xPnB6OAwDblBThBlE/hGNQsWugI5f8fwZUAuYdOYdr2nin8C5xwtudIY+ACYAPCcoKMgBY/wXrwnd8Dz2+7zn/gaM7+8F577hH7+NA6AlH54nw9thAH+NmqjH/oagvPhfBsE57OD9M5R/N1rv91iHm69vjHtf/9/DGIBi4nH9S8y3/2j+G9yfXNblr8O6ITwAAAAASUVORK5CYII=";
18521
18645
  var g_icon_image_searchpoimt = L.icon({
18522
18646
  iconUrl: iconUrl,
18523
18647
  shadowUrl: shadowUrl,
18524
- iconSize: [23, 32], // size of the icon
18525
- shadowSize: [43, 32], // size of the shadow
18526
- iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18527
- shadowAnchor: [12, 32], // the same for the shadow
18528
- popupAnchor: [12, -32] // point from which the popup should open relative to the iconAnchor
18529
- });
18530
- var gAllMarkers = []; ///< Holds all the markers.
18648
+ iconSize: [23, 32], // size of the icon
18649
+ shadowSize: [43, 32], // size of the shadow
18650
+ iconAnchor: [12, 32], // point of the icon which will correspond to marker's location
18651
+ shadowAnchor: [12, 32], // the same for the shadow
18652
+ popupAnchor: [12, -32], // point from which the popup should open relative to the iconAnchor
18653
+ });
18654
+ var gAllMarkers = []; ///< Holds all the markers.
18531
18655
  var gMainMap;
18532
18656
  var gTileLayer;
18533
18657
  var gClusterLayer = null;
18534
18658
  var gSearchPointMarker = false;
18535
18659
  var gOpenMarker = false;
18536
18660
  var gDiv = null;
18537
- function createMap(inDiv, inCenter, inHidden = false) {
18538
- if (! inCenter ) return null;
18539
- gDiv = inDiv;
18540
- if ( inHidden ) {
18541
- gDiv.style.height = 'auto';
18542
- gDiv.style.marginBottom = '10px';
18661
+ function createMap(inDiv, inCenter, inHidden = false) {
18662
+ if (!inCenter) return null;
18663
+ gDiv = inDiv;
18664
+ if (inHidden) {
18665
+ gDiv.style.height = "auto";
18666
+ gDiv.style.marginBottom = "10px";
18543
18667
  gMainMap = null;
18544
18668
  return gDiv;
18545
18669
  }
18546
18670
  myOptions = {
18547
- 'minZoom': config.minZoom,
18548
- 'maxZoom': config.maxZoom,
18549
- 'doubleClickZoom' : false,
18550
- 'scrollWheelZoom' : false
18671
+ minZoom: config.minZoom,
18672
+ maxZoom: config.maxZoom,
18673
+ doubleClickZoom: false,
18674
+ scrollWheelZoom: false,
18551
18675
  };
18552
18676
  myOptions = Object.assign(myOptions, {
18553
- 'center': new L.latLng ( inCenter.latitude, inCenter.longitude ),
18554
- 'zoom': inCenter.zoom});
18555
- var pixel_width = inDiv.offsetWidth;
18677
+ center: new L.latLng(inCenter.latitude, inCenter.longitude),
18678
+ zoom: inCenter.zoom,
18679
+ });
18680
+ var pixel_width = inDiv.offsetWidth;
18556
18681
  if (pixel_width == 0) {
18557
18682
  pixel_width = inDiv.parentNode.offsetWidth;
18558
18683
  }
18559
- var pixel_height = inDiv.offsetHeight;
18684
+ var pixel_height = parseInt(
18685
+ jQuery(inDiv).css("height").replace("px", ""),
18686
+ );
18560
18687
  if (pixel_height == 0) {
18561
18688
  pixel_height = pixel_width;
18562
18689
  }
18563
- if (pixel_height > pixel_width*1.4) {
18564
- inDiv.style.height = (pixel_width*1.6)+'px';
18690
+ if (pixel_height > pixel_width) {
18691
+ jQuery(inDiv).css("height", pixel_width + "px");
18565
18692
  }
18566
- gMainMap = new L.Map ( inDiv, myOptions );
18567
- gTileLayer = L.tileLayer(config.tileUrl,config.tileOptions).addTo(gMainMap);
18568
- gMainMap.zoomControl.setPosition('bottomright');
18569
- gMainMap.on('moveend',function() {
18693
+ gMainMap = new L.Map(inDiv, myOptions);
18694
+ gTileLayer = L.tileLayer(config.tileUrl, config.tileOptions).addTo(
18695
+ gMainMap,
18696
+ );
18697
+ gMainMap.zoomControl.setPosition("bottomright");
18698
+ gMainMap.on("moveend", function () {
18570
18699
  gTileLayer.redraw();
18571
18700
  });
18572
- return gMainMap;
18573
- }
18574
- function addListener(ev,f,once) {
18701
+ return gMainMap;
18702
+ }
18703
+ function addListener(ev, f, once) {
18575
18704
  if (!gMainMap) return;
18576
- if (ev=='idle') {
18577
- ev = 'moveend';
18705
+ if (ev == "idle") {
18706
+ ev = "moveend";
18578
18707
  }
18579
- if (ev=='dragstart') {
18580
- ev = 'movestart';
18708
+ if (ev == "dragstart") {
18709
+ ev = "movestart";
18581
18710
  }
18582
- if (ev=='dragend') {
18583
- ev = 'moveend';
18711
+ if (ev == "dragend") {
18712
+ ev = "moveend";
18584
18713
  }
18585
- if (once) {
18714
+ if (once) {
18586
18715
  gMainMap.once(ev, f);
18587
18716
  } else {
18588
18717
  gMainMap.on(ev, f);
18589
18718
  }
18590
- return {'event': ev, 'f': f};
18591
- }
18719
+ return { event: ev, f: f };
18720
+ }
18592
18721
  function removeListener(o) {
18593
18722
  if (!gMainMap) return;
18594
18723
  gMainMap.off(o.event, o.f);
18595
18724
  }
18596
- function flyToFixedZoom(position, zoomLevel, extra=null) {
18725
+ function flyToFixedZoom(position, zoomLevel, extra = null) {
18597
18726
  if (!gMainMap) return;
18598
18727
 
18599
18728
  const latlng = L.latLng(position.lat, position.lng);
18600
- gMainMap.once('moveend', function(ev) {
18729
+ gMainMap.once("moveend", function (ev) {
18601
18730
  if (gMainMap.getZoom() != zoomLevel) {
18602
- gMainMap.once('zoomend',function() {
18731
+ gMainMap.once("zoomend", function () {
18603
18732
  gMainMap.invalidateSize();
18604
18733
  if (extra) {
18605
- gMainMap.once('load moveend', extra);
18734
+ gMainMap.once("load moveend", extra);
18606
18735
  }
18607
18736
  });
18608
18737
  gMainMap.setZoom(zoomLevel);
@@ -18612,12 +18741,15 @@ function MapDelegate(config) {
18612
18741
  });
18613
18742
  gMainMap.flyTo(latlng, zoomLevel);
18614
18743
  }
18615
- function clearAllMarkers ( )
18616
- {
18744
+ function clearAllMarkers() {
18617
18745
  if (!gMainMap) return;
18618
- gAllMarkers && gAllMarkers.forEach((m) => {m.marker.closePopup(); gMainMap.removeLayer(m.marker)});
18746
+ gAllMarkers &&
18747
+ gAllMarkers.forEach((m) => {
18748
+ m.marker.closePopup();
18749
+ gMainMap.removeLayer(m.marker);
18750
+ });
18619
18751
  gAllMarkers = [];
18620
- };
18752
+ }
18621
18753
  function getZoom() {
18622
18754
  if (!gMainMap) return null;
18623
18755
  return gMainMap.getZoom();
@@ -18627,285 +18759,410 @@ function MapDelegate(config) {
18627
18759
  }
18628
18760
  function webMercatorToLatLng(point, zoom) {
18629
18761
  const latLng = croutonMap.webMercatorToLatLng(point, zoom);
18630
- return L.latLng(latLng.lat, latLng.lng);
18762
+ return L.latLng(latLng.lat, latLng.lng);
18631
18763
  }
18632
18764
  function calculateBounds(center, zoom, width, height) {
18633
18765
  const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
18634
- const northeastWebMercator = {x: centerPoint.x-width/2, y: centerPoint.y-height/2};
18635
- const southwestWebMercator = {x: centerPoint.x+width/2, y: centerPoint.y+height/2};
18636
- return L.latLngBounds(webMercatorToLatLng(southwestWebMercator, zoom), webMercatorToLatLng(northeastWebMercator, zoom));
18637
- }
18638
- function calcOffsetWidth(gDiv) {
18639
- let ret = gDiv.offsetWidth;
18640
- if (ret === 0) ret = gDiv.parentElement.offsetWidth;
18641
- return ret;
18642
- }
18766
+ const northeastWebMercator = {
18767
+ x: centerPoint.x - width / 2,
18768
+ y: centerPoint.y - height / 2,
18769
+ };
18770
+ const southwestWebMercator = {
18771
+ x: centerPoint.x + width / 2,
18772
+ y: centerPoint.y + height / 2,
18773
+ };
18774
+ return L.latLngBounds(
18775
+ webMercatorToLatLng(southwestWebMercator, zoom),
18776
+ webMercatorToLatLng(northeastWebMercator, zoom),
18777
+ );
18778
+ }
18779
+ function withinInscribedCircle(center, point, zoom, width, height) {
18780
+ const centerPoint = croutonMap.latLngToWebMercator(center, zoom);
18781
+ const meetingPoint = croutonMap.latLngToWebMercator(point, zoom);
18782
+ const radius = Math.min(width, height) / 2;
18783
+ const distance = Math.sqrt(
18784
+ Math.pow(centerPoint.x - meetingPoint.x, 2) +
18785
+ Math.pow(centerPoint.y - meetingPoint.y, 2),
18786
+ );
18787
+ return distance <= radius;
18788
+ }
18789
+ function calcOffsetWidth(gDiv) {
18790
+ let ret = gDiv.offsetWidth;
18791
+ if (ret === 0) ret = gDiv.parentElement.offsetWidth;
18792
+ return ret;
18793
+ }
18643
18794
  function calculateBoundsFromCenterAndZoom(center, zoomLevel) {
18644
- const mapWidth = calcOffsetWidth(gDiv);
18645
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
18646
- return calculateBounds(center, zoomLevel, mapWidth, mapHeight);
18647
- }
18648
- function getZoomAdjust(filterMeetings,zoomLevel=gMainMap.getZoom(), center=gMainMap.getCenter()) {
18795
+ const mapWidth = calcOffsetWidth(gDiv);
18796
+ const mapHeight = parseInt(
18797
+ jQuery(gDiv).css("height").replace("px", ""),
18798
+ );
18799
+ return calculateBounds(center, zoomLevel, mapWidth, mapHeight);
18800
+ }
18801
+ function getZoomAdjust(
18802
+ filterMeetings,
18803
+ zoomLevel = gMainMap.getZoom(),
18804
+ center = gMainMap.getCenter(),
18805
+ closestMeeting = null,
18806
+ ) {
18649
18807
  if (!gMainMap) return 12;
18808
+ if (config.map_search && isFilterVisible()) return zoomLevel;
18650
18809
  const mapWidth = calcOffsetWidth(gDiv);
18651
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
18652
- ret = zoomLevel;
18653
- if (config.map_search && isFilterVisible()) return ret;
18810
+ const mapHeight = parseInt(
18811
+ jQuery(gDiv).css("height").replace("px", ""),
18812
+ );
18813
+ let ret = zoomLevel;
18654
18814
  var bounds = calculateBounds(center, ret, mapWidth, mapHeight);
18655
- while(filterMeetings(bounds, center).length==0 && ret>config.minZoom) {
18656
- ret -= 1;
18657
- bounds = calculateBounds(center, ret, mapWidth, mapHeight);
18815
+ if (closestMeeting) {
18816
+ while (
18817
+ !withinInscribedCircle(
18818
+ center,
18819
+ closestMeeting,
18820
+ ret,
18821
+ mapWidth,
18822
+ mapHeight,
18823
+ ) &&
18824
+ ret > config.minZoom
18825
+ ) {
18826
+ ret -= 1;
18827
+ }
18828
+ } else {
18829
+ while (
18830
+ filterMeetings(bounds, center).length == 0 &&
18831
+ ret > config.minZoom
18832
+ ) {
18833
+ ret -= 1;
18834
+ bounds = calculateBounds(center, ret, mapWidth, mapHeight);
18835
+ }
18836
+ }
18837
+ // If we didn't zoom out, zoom in if it doesn't lose meetings
18838
+ if (ret == zoomLevel) {
18839
+ let meetingsInBounds = filterMeetings(bounds, center).length;
18840
+ if (meetingsInBounds > 0) {
18841
+ do {
18842
+ ret = ret + 1;
18843
+ if (ret > config.maxZoom) break;
18844
+ var bounds = calculateBounds(
18845
+ center,
18846
+ ret,
18847
+ mapWidth,
18848
+ mapHeight,
18849
+ );
18850
+ } while (
18851
+ filterMeetings(bounds, center).length === meetingsInBounds
18852
+ );
18853
+ ret = ret - 1;
18854
+ }
18658
18855
  }
18659
18856
  return ret;
18660
18857
  }
18661
18858
  function markSearchPoint(inCoords) {
18662
18859
  if (!gMainMap) return;
18663
18860
  if (gSearchPointMarker) gSearchPointMarker.remove();
18664
- gSearchPointMarker = L.marker(inCoords, {icon: g_icon_image_searchpoimt});
18861
+ gSearchPointMarker = L.marker(inCoords, {
18862
+ icon: g_icon_image_searchpoimt,
18863
+ });
18665
18864
  gSearchPointMarker.addTo(gMainMap);
18666
18865
  }
18667
- function createMarker ( inCoords, ///< The long/lat for the marker.
18668
- multi, ///< Flag if marker has multiple meetings
18669
- in_title, ///< The tooltip
18670
- )
18671
- {
18672
- if (!gMainMap) return;
18673
- var in_main_icon = (multi ? g_icon_image_multi : g_icon_image_single);
18674
-
18675
- var marker = L.marker(inCoords, {icon: in_main_icon, title: in_title})
18676
- marker.isMulti = multi;
18677
- if (gClusterLayer) gClusterLayer.addLayer(marker);
18678
- else marker.addTo(gMainMap);
18866
+ function createMarker(
18867
+ inCoords, ///< The long/lat for the marker.
18868
+ multi, ///< Flag if marker has multiple meetings
18869
+ in_title, ///< The tooltip
18870
+ ) {
18871
+ if (!gMainMap) return;
18872
+ var in_main_icon = multi ? g_icon_image_multi : g_icon_image_single;
18679
18873
 
18680
- return marker;
18681
- }
18682
- function bindPopup(marker, in_html, in_ids, openedMarker) {
18683
- if (!in_html) return;
18684
- let highlightRow = function(target) {
18685
- const id = target.id.split('-')[1];
18686
- gOpenMarker = id;
18687
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18688
- jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
18689
- if (typeof crouton != 'undefined') crouton.dayTabFromId(id);
18690
- }
18691
- marker.bindPopup(in_html);
18692
- marker.on('popupopen', function(e) {
18693
- if (openedMarker && marker.getPopup().getContent().includes("panel-"+openedMarker)) {
18694
- // I want to just do this:
18695
- //jQuery("#panel-"+openedMarker).prop("checked", true);
18696
- // But for some reason, leaflet makes a copy of the popup, so the ID is not unique....
18697
- jQuery("input[type=radio][name=panel]").filter(function() {
18698
- return jQuery(this).attr('id')=="panel-"+openedMarker})
18699
- .each(function(index,value) {
18700
- jQuery(this).prop("checked", true);
18874
+ var marker = L.marker(inCoords, {
18875
+ icon: in_main_icon,
18876
+ title: in_title,
18877
+ });
18878
+ marker.isMulti = multi;
18879
+ if (gClusterLayer) gClusterLayer.addLayer(marker);
18880
+ else marker.addTo(gMainMap);
18881
+
18882
+ return marker;
18883
+ }
18884
+ function bindPopup(marker, in_html, in_ids, openedMarker) {
18885
+ if (!in_html) return;
18886
+ let highlightRow = function (target) {
18887
+ const id = target.id.split("-")[1];
18888
+ gOpenMarker = id;
18889
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18890
+ jQuery("#meeting-data-row-" + id + " > td").addClass(
18891
+ "rowHighlight",
18892
+ );
18893
+ if (typeof crouton != "undefined") crouton.dayTabFromId(id);
18894
+ };
18895
+ marker.bindPopup(in_html);
18896
+ marker.on("popupopen", function (e) {
18897
+ if (
18898
+ openedMarker &&
18899
+ marker
18900
+ .getPopup()
18901
+ .getContent()
18902
+ .includes("panel-" + openedMarker)
18903
+ ) {
18904
+ // I want to just do this:
18905
+ //jQuery("#panel-"+openedMarker).prop("checked", true);
18906
+ // But for some reason, leaflet makes a copy of the popup, so the ID is not unique....
18907
+ jQuery("input[type=radio][name=panel]")
18908
+ .filter(function () {
18909
+ return (
18910
+ jQuery(this).attr("id") == "panel-" + openedMarker
18911
+ );
18912
+ })
18913
+ .each(function (index, value) {
18914
+ jQuery(this).prop("checked", true);
18915
+ });
18916
+ }
18917
+ marker.setIcon(g_icon_image_selected);
18918
+ gMainMap.on("zoomstart", function () {
18919
+ marker.closePopup();
18920
+ });
18921
+ jQuery("input[type=radio][name=panel]:checked").each(
18922
+ function (index, target) {
18923
+ highlightRow(target);
18924
+ },
18925
+ );
18926
+ jQuery("input[type=radio][name=panel]").change(function () {
18927
+ highlightRow(this);
18701
18928
  });
18702
- }
18703
- marker.setIcon(g_icon_image_selected);
18704
- gMainMap.on('zoomstart',function(){
18705
- marker.closePopup();
18706
18929
  });
18707
- jQuery("input[type=radio][name=panel]:checked").each(function(index, target) {
18708
- highlightRow(target);
18709
- });
18710
- jQuery('input[type=radio][name=panel]').change(function() {
18711
- highlightRow(this);
18712
- });
18713
- });
18714
- marker.on('popupclose', function(e) {
18715
- gOpenMarker = false;
18716
- marker.setIcon(marker.isMulti ? g_icon_image_multi : g_icon_image_single);
18717
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18718
- });
18719
- if (openedMarker && in_ids.includes(parseInt(openedMarker))) {
18720
- marker.openPopup();
18721
- marker.once('add', function() {
18722
- if (!marker.isPopupOpen()) marker.openPopup();
18930
+ marker.on("popupclose", function (e) {
18931
+ gOpenMarker = false;
18932
+ marker.setIcon(
18933
+ marker.isMulti ? g_icon_image_multi : g_icon_image_single,
18934
+ );
18935
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18723
18936
  });
18937
+ if (openedMarker && in_ids.includes(parseInt(openedMarker))) {
18938
+ marker.openPopup();
18939
+ marker.once("add", function () {
18940
+ if (!marker.isPopupOpen()) marker.openPopup();
18941
+ });
18942
+ }
18943
+ gAllMarkers.push({ ids: in_ids, marker: marker });
18724
18944
  }
18725
- gAllMarkers.push( {ids: in_ids, marker: marker} );
18726
- }
18727
- function addMarkerCallback(marker, cb, in_ids) {
18728
- if (cb) marker.on('click', function() {
18729
- cb(in_ids);
18730
- });
18731
- gAllMarkers.push( {ids: in_ids, marker: marker} );
18732
- }
18733
- function getOpenMarker() {
18734
- return gOpenMarker;
18735
- }
18736
- function openMarker(id) {
18737
- if (!gMainMap) return;
18738
- marker = gAllMarkers.find((m) => m.ids.includes(id));
18739
- if (marker) {
18740
- marker.marker.openPopup();
18741
- jQuery("#panel-"+id).prop('checked', true);
18742
- if (typeof crouton != 'undefined') crouton.dayTabFromId(id);
18743
- }
18744
- jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18745
- jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
18746
- }
18747
- function addControl(div,pos,cb) {
18748
- if (!div) return;
18749
- if (!gMainMap) {
18750
- gDiv.appendChild(div);
18751
- return;
18752
- }
18753
- var ControlClass = L.Control.extend({
18754
- onAdd: function (map) {
18945
+ function addMarkerCallback(marker, cb, in_ids) {
18946
+ if (cb)
18947
+ marker.on("click", function () {
18948
+ cb(in_ids);
18949
+ });
18950
+ gAllMarkers.push({ ids: in_ids, marker: marker });
18951
+ }
18952
+ function getOpenMarker() {
18953
+ return gOpenMarker;
18954
+ }
18955
+ function openMarker(id) {
18956
+ if (!gMainMap) return;
18957
+ marker = gAllMarkers.find((m) => m.ids.includes(id));
18958
+ if (marker) {
18959
+ marker.marker.openPopup();
18960
+ jQuery("#panel-" + id).prop("checked", true);
18961
+ if (typeof crouton != "undefined") crouton.dayTabFromId(id);
18962
+ }
18963
+ jQuery(".bmlt-data-row > td").removeClass("rowHighlight");
18964
+ jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
18965
+ }
18966
+ function addControl(div, pos, cb) {
18967
+ if (!div) return;
18968
+ if (!gMainMap) {
18969
+ gDiv.appendChild(div);
18970
+ return;
18971
+ }
18972
+ var ControlClass = L.Control.extend({
18973
+ onAdd: function (map) {
18755
18974
  return div;
18756
18975
  },
18757
- onRemove: function(map) {
18976
+ onRemove: function (map) {
18758
18977
  // Nothing to do here
18759
- }
18978
+ },
18760
18979
  });
18761
- var controlConstructor = function(opts) {
18980
+ var controlConstructor = function (opts) {
18762
18981
  return new ControlClass(opts);
18763
- }
18982
+ };
18764
18983
  if (cb) {
18765
18984
  const observer = new MutationObserver(function (records) {
18766
- records.forEach(record => {
18767
- record.addedNodes.forEach(n => {
18985
+ records.forEach((record) => {
18986
+ record.addedNodes.forEach((n) => {
18768
18987
  if (n === div) {
18769
18988
  observer.disconnect();
18770
18989
  cb();
18771
18990
  }
18772
18991
  });
18773
- })
18992
+ });
18774
18993
  });
18775
- observer.observe(document, {childList: true, subtree: true});
18994
+ observer.observe(document, { childList: true, subtree: true });
18776
18995
  }
18777
18996
  controlConstructor({ position: pos }).addTo(gMainMap);
18778
- }
18779
- // Low level GeoCoding
18997
+ }
18998
+ // Low level GeoCoding
18780
18999
  function getJSON(url, params, callback) {
18781
19000
  var xmlHttp = new XMLHttpRequest();
18782
- xmlHttp.onreadystatechange = function() {
18783
- if (xmlHttp.readyState !== 4) {
18784
- return;
18785
- }
18786
- var message;
18787
- if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {
18788
- message = '';
18789
- } else if (typeof xmlHttp.response === 'string') {
18790
- // IE doesn't parse JSON responses even with responseType: 'json'.
18791
- try {
18792
- message = JSON.parse(xmlHttp.response);
18793
- } catch (e) {
18794
- // Not a JSON response
18795
- message = xmlHttp.response;
18796
- }
18797
- } else {
18798
- message = xmlHttp.response;
18799
- }
18800
- callback(message);
18801
- };
18802
- xmlHttp.open('GET', url + getParamString(params), true);
18803
- xmlHttp.responseType = 'json';
18804
- xmlHttp.setRequestHeader('Accept', 'application/json');
18805
- xmlHttp.setRequestHeader('Accept', '*/*');
18806
- xmlHttp.send(null);
18807
- };
19001
+ xmlHttp.onreadystatechange = function () {
19002
+ if (xmlHttp.readyState !== 4) {
19003
+ return;
19004
+ }
19005
+ var message;
19006
+ if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {
19007
+ message = "";
19008
+ } else if (typeof xmlHttp.response === "string") {
19009
+ // IE doesn't parse JSON responses even with responseType: 'json'.
19010
+ try {
19011
+ message = JSON.parse(xmlHttp.response);
19012
+ } catch (e) {
19013
+ // Not a JSON response
19014
+ message = xmlHttp.response;
19015
+ }
19016
+ } else {
19017
+ message = xmlHttp.response;
19018
+ }
19019
+ callback(message);
19020
+ };
19021
+ xmlHttp.open("GET", url + getParamString(params), true);
19022
+ xmlHttp.responseType = "json";
19023
+ xmlHttp.setRequestHeader("Accept", "application/json");
19024
+ xmlHttp.setRequestHeader("Accept", "*/*");
19025
+ xmlHttp.send(null);
19026
+ }
18808
19027
  function getParamString(obj, existingUrl, uppercase) {
18809
19028
  var params = [];
18810
19029
  for (var i in obj) {
18811
- var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);
18812
- var value = obj[i];
18813
- if (!L.Util.isArray(value)) {
18814
- params.push(key + '=' + encodeURIComponent(value));
18815
- } else {
18816
- for (var j = 0; j < value.length; j++) {
18817
- params.push(key + '=' + encodeURIComponent(value[j]));
19030
+ var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);
19031
+ var value = obj[i];
19032
+ if (!L.Util.isArray(value)) {
19033
+ params.push(key + "=" + encodeURIComponent(value));
19034
+ } else {
19035
+ for (var j = 0; j < value.length; j++) {
19036
+ params.push(key + "=" + encodeURIComponent(value[j]));
19037
+ }
18818
19038
  }
18819
- }
18820
19039
  }
18821
- return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');
19040
+ return (
19041
+ (!existingUrl || existingUrl.indexOf("?") === -1 ? "?" : "&") +
19042
+ params.join("&")
19043
+ );
18822
19044
  }
18823
19045
  function geocode(query, params, cb) {
18824
19046
  var serviceUrl = config.nominatimUrl;
18825
- if (!serviceUrl) serviceUrl = 'https://nominatim.openstreetmap.org/';
19047
+ if (!serviceUrl) serviceUrl = "https://nominatim.openstreetmap.org/";
18826
19048
  getJSON(
18827
- serviceUrl + 'search',
18828
- L.extend(
18829
- {
18830
- q: query,
18831
- limit: 5,
18832
- format: 'json',
18833
- addressdetails: 1
18834
- },
18835
- params
18836
- ),
18837
- L.bind(function(data) {
18838
- var results = [];
18839
- if (data && data.length) {
18840
- for (var i = data.length - 1; i >= 0; i--) {
18841
- var bbox = data[i].boundingbox;
18842
- for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);
18843
- results[i] = {
18844
- icon: data[i].icon,
18845
- name: data[i].display_name,
18846
- bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),
18847
- center: L.latLng(data[i].lat, data[i].lon),
18848
- properties: data[i]
18849
- };
19049
+ serviceUrl + "search",
19050
+ L.extend(
19051
+ {
19052
+ q: query,
19053
+ limit: 5,
19054
+ format: "json",
19055
+ addressdetails: 1,
19056
+ layer: "address",
19057
+ },
19058
+ params,
19059
+ ),
19060
+ L.bind(function (data) {
19061
+ if (data && data.length) {
19062
+ results = data.reduce(function (carry, d) {
19063
+ if (
19064
+ !carry.find((item) => item.name === d.display_name)
19065
+ ) {
19066
+ var bbox = d.boundingbox.map((c) => parseFloat(c));
19067
+ carry.push({
19068
+ name: d.display_name,
19069
+ bbox: L.latLngBounds(
19070
+ [bbox[0], bbox[2]],
19071
+ [bbox[1], bbox[3]],
19072
+ ),
19073
+ center: L.latLng(d.lat, d.lon),
19074
+ properties: d,
19075
+ });
19076
+ }
19077
+ return carry;
19078
+ }, []);
19079
+ cb(results);
19080
+ } else {
19081
+ alert(crouton.localization.getWord("address_lookup_fail"));
18850
19082
  }
18851
- cb(results);
18852
- } else {
18853
- alert ( crouton.localization.getWord("address_lookup_fail") );
18854
- }
18855
- }, this)
19083
+ }, this),
18856
19084
  );
18857
- };
18858
- function getGeocodingChoices(in_geocode_response) {
18859
- if (!Array.isArray(in_geocode_response)) return [];
18860
- return in_geocode_response.map((r) => r.name);
18861
19085
  }
18862
- function getZoomAdjustedBounds(center, filterMeetings, zoomLevel) {
19086
+ function getGeocodingChoices(in_geocode_response) {
19087
+ if (!Array.isArray(in_geocode_response)) return [];
19088
+ return in_geocode_response.map((r) => r.name);
19089
+ }
19090
+ function getZoomAdjustedBounds(
19091
+ center,
19092
+ filterMeetings,
19093
+ zoomLevel,
19094
+ closestMeeting = null,
19095
+ ) {
18863
19096
  const mapWidth = calcOffsetWidth(gDiv);
18864
- const mapHeight = parseInt(jQuery(gDiv).css("height").replace("px",""));
19097
+ const mapHeight = parseInt(
19098
+ jQuery(gDiv).css("height").replace("px", ""),
19099
+ );
18865
19100
  if (center) {
18866
- const zoom = getZoomAdjust(filterMeetings, zoomLevel, center);
19101
+ const zoom = getZoomAdjust(
19102
+ filterMeetings,
19103
+ zoomLevel,
19104
+ center,
19105
+ closestMeeting,
19106
+ );
18867
19107
  const bounds = calculateBounds(center, zoom, mapWidth, mapHeight);
18868
- const ret = {"center": center, "bounds": bounds, "zoom": zoom};
19108
+ const ret = { center: center, bounds: bounds, zoom: zoom };
18869
19109
  return ret;
18870
19110
  } else {
18871
- alert ( crouton.localization.getWord("address_lookup_fail") );
19111
+ alert(crouton.localization.getWord("address_lookup_fail"));
18872
19112
  return null;
18873
19113
  }
18874
19114
  }
18875
- function getGeocodeCenterAndBounds (in_geocode_response, i=0) {
18876
- if ( in_geocode_response && in_geocode_response[i] ) {
18877
- return {
18878
- center: {lat: in_geocode_response[i].center.lat, lng: in_geocode_response[i].center.lng},
18879
- southWest: {lat: in_geocode_response[i].bbox.getSouthWest().lat, lng: in_geocode_response[i].bbox.getSouthWest().lng},
18880
- northEast: {lat: in_geocode_response[i].bbox.getNorthEast().lat, lng: in_geocode_response[i].bbox.getNorthEast().lng},
18881
- };
18882
- } else {
18883
- alert ( crouton.localization.getWord("address_lookup_fail") );
18884
- };
18885
- };
18886
- function callGeocoder(in_loc, callback) {
19115
+ function getGeocodeCenterAndBounds(in_geocode_response, i = 0) {
19116
+ if (in_geocode_response && in_geocode_response[i]) {
19117
+ return {
19118
+ center: {
19119
+ lat: in_geocode_response[i].center.lat,
19120
+ lng: in_geocode_response[i].center.lng,
19121
+ },
19122
+ southWest: {
19123
+ lat: in_geocode_response[i].bbox.getSouthWest().lat,
19124
+ lng: in_geocode_response[i].bbox.getSouthWest().lng,
19125
+ },
19126
+ northEast: {
19127
+ lat: in_geocode_response[i].bbox.getNorthEast().lat,
19128
+ lng: in_geocode_response[i].bbox.getNorthEast().lng,
19129
+ },
19130
+ };
19131
+ } else {
19132
+ alert(crouton.localization.getWord("address_lookup_fail"));
19133
+ }
19134
+ }
19135
+ function callGeocoder(in_loc, callback) {
18887
19136
  geoCodeParams = {};
18888
- if (config.region && config.region.trim() !== '') {
19137
+ if (config.region && config.region.trim() !== "") {
18889
19138
  geoCodeParams.countrycodes = config.region;
18890
19139
  }
18891
- if (config.bounds
18892
- && isNumber(config.bounds.north)
18893
- && isNumber(config.bounds.east)
18894
- && isNumber(config.bounds.south)
18895
- && isNumber(config.bounds.west)) {
18896
- geoCodeParams.viewbox = config.bounds.west+","+config.bounds.south+","+
18897
- config.bounds.east+","+config.bounds.north;
18898
- }
18899
- geocode(in_loc, geoCodeParams, callback);
18900
- }
19140
+ if (
19141
+ config.bounds &&
19142
+ isNumber(config.bounds.north) &&
19143
+ isNumber(config.bounds.east) &&
19144
+ isNumber(config.bounds.south) &&
19145
+ isNumber(config.bounds.west)
19146
+ ) {
19147
+ geoCodeParams.viewbox =
19148
+ config.bounds.west +
19149
+ "," +
19150
+ config.bounds.south +
19151
+ "," +
19152
+ config.bounds.east +
19153
+ "," +
19154
+ config.bounds.north;
19155
+ }
19156
+ geocode(in_loc, geoCodeParams, callback);
19157
+ }
18901
19158
  function isNumber(x) {
18902
- if (typeof x === 'number') return true;
18903
- if (typeof x === 'string' && x.trim() !== '' && !isNaN(x)) return true;
19159
+ if (typeof x === "number") return true;
19160
+ if (typeof x === "string" && x.trim() !== "" && !isNaN(x)) return true;
18904
19161
  return false;
18905
19162
  }
18906
19163
  function contains(bounds, lat, lng) {
18907
19164
  if (!gMainMap) return true;
18908
- return bounds.contains(L.latLng ( lat, lng ));
19165
+ return bounds.contains(L.latLng(lat, lng));
18909
19166
  }
18910
19167
  function getBounds() {
18911
19168
  if (!gMainMap) return null;
@@ -18917,7 +19174,10 @@ function addControl(div,pos,cb) {
18917
19174
  }
18918
19175
  function fitBounds(locations) {
18919
19176
  if (!gMainMap) return;
18920
- const bounds = locations.reduce(function(b,lat_lng) {b.extend(lat_lng); return b;}, L.latLngBounds());
19177
+ const bounds = locations.reduce(function (b, lat_lng) {
19178
+ b.extend(lat_lng);
19179
+ return b;
19180
+ }, L.latLngBounds());
18921
19181
  gMainMap.fitBounds(bounds);
18922
19182
  }
18923
19183
  function createClusterLayer() {
@@ -18934,50 +19194,68 @@ function addControl(div,pos,cb) {
18934
19194
  gClusterLayer = null;
18935
19195
  }
18936
19196
  function clickSearch(ev, cb) {
18937
- L.DomUtil.addClass(gMainMap._container,'crosshair-cursor-enabled');
18938
- gMainMap.once('click',function(e) {
18939
- gMainMap.once('click',function(e) {
18940
- L.DomUtil.removeClass(gMainMap._container,'crosshair-cursor-enabled');
18941
- cb(e.latlng.lat,e.latlng.lng);
18942
- })
19197
+ L.DomUtil.addClass(gMainMap._container, "crosshair-cursor-enabled");
19198
+ gMainMap.once("click", function (e) {
19199
+ gMainMap.once("click", function (e) {
19200
+ L.DomUtil.removeClass(
19201
+ gMainMap._container,
19202
+ "crosshair-cursor-enabled",
19203
+ );
19204
+ cb(e.latlng.lat, e.latlng.lng);
19205
+ });
18943
19206
  });
18944
19207
  }
18945
19208
  function getCorners(lat_lngs = false) {
18946
- var bounds = lat_lngs
18947
- ? lat_lngs.reduce(function(b,lat_lng) {b.extend(lat_lng); return b;}, L.latLngBounds())
18948
- : gMainMap.getBounds();
19209
+ var bounds = lat_lngs
19210
+ ? lat_lngs.reduce(function (b, lat_lng) {
19211
+ b.extend(lat_lng);
19212
+ return b;
19213
+ }, L.latLngBounds())
19214
+ : gMainMap.getBounds();
18949
19215
 
18950
- return {
18951
- "ne" : {"lat": bounds.getNorthEast().lat, "lng": bounds.getNorthEast().lng},
18952
- "sw" : {"lat": bounds.getSouthWest().lat, "lng": bounds.getSouthWest().lng}
18953
- }
18954
- }
19216
+ return {
19217
+ ne: {
19218
+ lat: bounds.getNorthEast().lat,
19219
+ lng: bounds.getNorthEast().lng,
19220
+ },
19221
+ sw: {
19222
+ lat: bounds.getSouthWest().lat,
19223
+ lng: bounds.getSouthWest().lng,
19224
+ },
19225
+ };
19226
+ }
18955
19227
  function getCenter() {
18956
- return {"lat": gMainMap.getCenter().lat, "lng": gMainMap.getCenter().lng};
19228
+ return { lat: gMainMap.getCenter().lat, lng: gMainMap.getCenter().lng };
18957
19229
  }
18958
19230
  function modalOn() {
18959
- if (gMainMap) gMainMap.dragging.disable()
19231
+ if (gMainMap) gMainMap.dragging.disable();
18960
19232
  }
18961
19233
  function modalOff() {
18962
- if (gMainMap) gMainMap.dragging.enable()
19234
+ if (gMainMap) gMainMap.dragging.enable();
18963
19235
  }
18964
19236
  function afterInit(doNotWait, f) {
18965
19237
  f();
18966
19238
  }
18967
- function returnTrue() {return true;}
19239
+ function returnTrue() {
19240
+ return true;
19241
+ }
18968
19242
  function isMapDefined() {
18969
- return (gMainMap !== null);
19243
+ return gMainMap !== null;
18970
19244
  }
18971
19245
  function isMapVisible() {
18972
- return (gMainMap !== null) && gMainMap.getSize().x > 0 && gMainMap.getSize().y > 0;
19246
+ return (
19247
+ gMainMap !== null &&
19248
+ gMainMap.getSize().x > 0 &&
19249
+ gMainMap.getSize().y > 0
19250
+ );
18973
19251
  }
18974
- this.createMap = createMap;
18975
- this.addListener = addListener;
19252
+ this.createMap = createMap;
19253
+ this.addListener = addListener;
18976
19254
  this.removeListener = removeListener;
18977
- this.addControl = addControl;
19255
+ this.addControl = addControl;
18978
19256
  this.flyToFixedZoom = flyToFixedZoom;
18979
- this.clearAllMarkers = clearAllMarkers;
18980
- this.callGeocoder = callGeocoder;
19257
+ this.clearAllMarkers = clearAllMarkers;
19258
+ this.callGeocoder = callGeocoder;
18981
19259
  this.getZoomAdjustedBounds = getZoomAdjustedBounds;
18982
19260
  this.getZoom = getZoom;
18983
19261
  this.createMarker = createMarker;
@@ -19040,6 +19318,7 @@ MapDelegate.prototype.getCenter = null;
19040
19318
  MapDelegate.prototype.markSearchPoint = null;
19041
19319
  MapDelegate.prototype.getOpenMarker = null;
19042
19320
  MapDelegate.prototype.calculateBoundsFromCenterAndZoom = null;
19321
+
19043
19322
  /* @preserve
19044
19323
  * Leaflet 1.9.4+v1.d15112c, a JS library for interactive maps. https://leafletjs.com
19045
19324
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade