@bmlt-enabled/croutonjs 4.3.1 → 4.3.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.css CHANGED
@@ -1129,6 +1129,7 @@ div.bmlt_map_container_div button {
1129
1129
  .modal-title {
1130
1130
  font-size: 18px;
1131
1131
  text-align: left;
1132
+ padding-top: 10px;
1132
1133
  }
1133
1134
  #filter_modal p {
1134
1135
  margin-top: .5em;
@@ -1139,7 +1140,7 @@ div.bmlt_map_container_div button {
1139
1140
  color: #fff;
1140
1141
  margin: 10px;
1141
1142
  border-radius: 3px;
1142
- padding: .3em .5em;
1143
+ padding: 10px .5em;
1143
1144
  }
1144
1145
 
1145
1146
  /* Style the buttons inside the tab */
@@ -1366,15 +1367,15 @@ button#location-search-button {
1366
1367
  border-color: black;
1367
1368
  margin-top: 10px;
1368
1369
  }
1369
- #bmltsearch_modal .modal-title {
1370
- margin: 20px 0 10px 0;
1371
- }
1372
1370
  button.advanced-search-button {
1373
1371
  float: right;
1374
1372
  margin-top: 20px;
1375
1373
  }
1376
1374
  .crouton-goto-text {
1377
1375
  width: 100%;
1376
+ font-size: 14px;
1377
+ padding-top: 10px;
1378
+ padding-bottom: 10px;
1378
1379
  box-sizing: border-box;
1379
1380
  }
1380
1381
  div#location-search-widen.hide {
@@ -1393,6 +1394,29 @@ button.location-choice {
1393
1394
  padding: 10px 5px;
1394
1395
  margin-bottom: 5px;
1395
1396
  }
1397
+ .autocomplete-items {
1398
+ border: 1px solid #d4d4d4;
1399
+ border-bottom: none;
1400
+ border-top: none;
1401
+ z-index: 99;
1402
+ /*position the autocomplete items to be the same width as the container:*/
1403
+ top: 100%;
1404
+ left: 0;
1405
+ right: 0;
1406
+ }
1407
+
1408
+ .autocomplete-items div {
1409
+ padding: 10px;
1410
+ cursor: pointer;
1411
+ background-color: #fff;
1412
+ border-bottom: 1px solid #d4d4d4;
1413
+ }
1414
+
1415
+ /*when hovering an item:*/
1416
+ .autocomplete-items div:hover, .autocomplete-items .autocomplete-active {
1417
+ background-color: #bcf5d3;
1418
+ }
1419
+
1396
1420
 
1397
1421
  .card {
1398
1422
  border: 0;
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.2', // 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;
@@ -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
  });
@@ -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]);
@@ -17905,6 +18003,13 @@ function MeetingMap(inConfig) {
17905
18003
  return;
17906
18004
  }
17907
18005
  gAllMeetings = meetings_responseObject.filter(m => m.venue_type != 2);
18006
+ gAllCities = meetings_responseObject.reduce(function (carry, m) {
18007
+ const fields = ['location_municipality', 'location_city_subsection', 'location_province', 'location_neighborhood'];
18008
+ fields.forEach(function (f) {
18009
+ if (m[f].length > 1 && !carry.includes(m[f])) carry.push(m[f]);
18010
+ });
18011
+ return carry;
18012
+ }, []);
17908
18013
  if (fitBounds && !config.centerMe && !config.goto) {
17909
18014
  let lat_lngs = gAllMeetings.reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[]);
17910
18015
  const maxRadius = config.maxTomatoWidth/2.0;
@@ -18047,12 +18152,15 @@ function MeetingMap(inConfig) {
18047
18152
  }
18048
18153
  jQuery('#bmlt_location_search_modal .crouton-modal-search-page').removeClass('hide');
18049
18154
  jQuery('#bmlt_location_search_modal .crouton-modal-search-choice').addClass('hide');
18050
- jQuery('bmlt-location-search-goto-text').val('');
18155
+ jQuery('#bmlt-location-search-goto-text').val('');
18156
+ jQuery('#bmlt-location-search-goto-textautocomplete-list').remove();
18051
18157
  }
18052
18158
  function showGeocodingDialog(e=null) {
18053
18159
  openModalWindow(document.getElementById('geocoding_modal'));
18054
18160
  jQuery('#geocoding_modal .crouton-modal-search-page').removeClass('hide');
18055
18161
  jQuery('#geocoding_modal .crouton-modal-search-choice').addClass('hide');
18162
+ jQuery('#goto-text').val('');
18163
+ jQuery('#goto-textautocomplete-list').remove();
18056
18164
  }
18057
18165
  function showListView(e=null) {
18058
18166
  filterVisible();
@@ -18830,24 +18938,25 @@ function addControl(div,pos,cb) {
18830
18938
  q: query,
18831
18939
  limit: 5,
18832
18940
  format: 'json',
18833
- addressdetails: 1
18941
+ addressdetails: 1,
18942
+ layer: "address"
18834
18943
  },
18835
18944
  params
18836
18945
  ),
18837
18946
  L.bind(function(data) {
18838
- var results = [];
18839
18947
  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
- };
18850
- }
18948
+ results = data.reduce(function(carry, d) {
18949
+ if (!carry.find((item) => item.name === d.display_name)) {
18950
+ var bbox = d.boundingbox.map((c) => parseFloat(c));
18951
+ carry.push({
18952
+ name: d.display_name,
18953
+ bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),
18954
+ center: L.latLng(d.lat, d.lon),
18955
+ properties: d
18956
+ });
18957
+ }
18958
+ return carry;
18959
+ }, []);
18851
18960
  cb(results);
18852
18961
  } else {
18853
18962
  alert ( crouton.localization.getWord("address_lookup_fail") );