@bmlt-enabled/croutonjs 3.23.0 → 3.24.1

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.
@@ -13337,6 +13337,7 @@ function CroutonLocalization(language) {
13337
13337
  'report update': "Report an Update",
13338
13338
  'filter by visibility': "List only these meetings",
13339
13339
  'go': "Go!",
13340
+ "distance": "Afstand",
13340
13341
  "get_directions": "Få vejvisning",
13341
13342
  "select_map_app": "Vælg kortapp",
13342
13343
  "apple_maps": "Apple Maps",
@@ -13345,6 +13346,7 @@ function CroutonLocalization(language) {
13345
13346
  "google_maps_desc_mobile": "Åbn i Google Maps app",
13346
13347
  "waze": "Waze",
13347
13348
  "waze_desc": "Åbn i Waze app",
13349
+ "sorted by distance": "Sorteret efter Afstand",
13348
13350
  },
13349
13351
  "de-DE":{
13350
13352
  "days_of_the_week": ["", "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
@@ -13407,11 +13409,13 @@ function CroutonLocalization(language) {
13407
13409
  "apple_maps": "Apple Maps",
13408
13410
  "apple_maps_desc": "In Apple Maps App öffnen",
13409
13411
  "google_maps": "Google Maps",
13412
+ "distance": "Entfernung",
13410
13413
  "google_maps_desc_mobile": "In Google Maps App öffnen",
13411
13414
  "waze": "Waze",
13412
13415
  "waze_desc": "In Waze App öffnen",
13413
13416
  "remember my choice": "Auswahl speichern",
13414
- "zoomed-out-message": "Wir können nicht die ganze Fläche nach Meetings durchsuchen. Bitte reinzoomen oder eine neue Suche machen."
13417
+ "zoomed-out-message": "Wir können nicht die ganze Fläche nach Meetings durchsuchen. Bitte reinzoomen oder eine neue Suche machen.",
13418
+ "sorted by distance": "Sortiert nach Entfernung",
13415
13419
  },
13416
13420
  "en-AU": {
13417
13421
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -13477,7 +13481,8 @@ function CroutonLocalization(language) {
13477
13481
  "google_maps_desc_mobile": "Open in Google Maps app",
13478
13482
  "waze": "Waze",
13479
13483
  "waze_desc": "Open in Waze app",
13480
- "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search."
13484
+ "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search.",
13485
+ "sorted by distance": "Sorted by Distance",
13481
13486
  },
13482
13487
  "en-CA": {
13483
13488
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -13544,7 +13549,8 @@ function CroutonLocalization(language) {
13544
13549
  "google_maps_desc_mobile": "Open in Google Maps app",
13545
13550
  "waze": "Waze",
13546
13551
  "waze_desc": "Open in Waze app",
13547
- "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search."
13552
+ "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search.",
13553
+ "sorted by distance": "Sorted by Distance",
13548
13554
  },
13549
13555
  "en-NZ": {
13550
13556
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -13611,7 +13617,8 @@ function CroutonLocalization(language) {
13611
13617
  "google_maps_desc_mobile": "Open in Google Maps app",
13612
13618
  "waze": "Waze",
13613
13619
  "waze_desc": "Open in Waze app",
13614
- "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search."
13620
+ "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search.",
13621
+ "sorted by distance": "Sorted by Distance",
13615
13622
  },
13616
13623
  "en-UK": {
13617
13624
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -13678,7 +13685,8 @@ function CroutonLocalization(language) {
13678
13685
  "google_maps_desc_mobile": "Open in Google Maps app",
13679
13686
  "waze": "Waze",
13680
13687
  "waze_desc": "Open in Waze app",
13681
- "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search."
13688
+ "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search.",
13689
+ "sorted by distance": "Sorted by Distance",
13682
13690
  },
13683
13691
  "en-US": {
13684
13692
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -13745,7 +13753,8 @@ function CroutonLocalization(language) {
13745
13753
  "google_maps_desc_mobile": "Open in Google Maps app",
13746
13754
  "waze": "Waze",
13747
13755
  "waze_desc": "Open in Waze app",
13748
- "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search."
13756
+ "zoomed-out-message": "We can't search the entire area for meetings. Please zoom in or do a new search.",
13757
+ "sorted by distance": "Sorted by Distance",
13749
13758
  },
13750
13759
  "es-US": {
13751
13760
  "days_of_the_week" : ["", "Domingo", " Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
@@ -13804,6 +13813,7 @@ function CroutonLocalization(language) {
13804
13813
  'report update': "Actualización de informe",
13805
13814
  'filter by visibility': "Listar solo estas reuniones",
13806
13815
  'go': "¡Adelante!",
13816
+ "distance": "Distancia",
13807
13817
  "get_directions": "Obtener Direcciones",
13808
13818
  "select_map_app": "Seleccionar Aplicación de Mapas",
13809
13819
  "apple_maps": "Apple Maps",
@@ -13812,7 +13822,8 @@ function CroutonLocalization(language) {
13812
13822
  "google_maps_desc_mobile": "Abrir en la aplicación Google Maps",
13813
13823
  "waze": "Waze",
13814
13824
  "waze_desc": "Abrir en la aplicación Waze",
13815
- "zoomed-out-message": "No podemos buscar reuniones en toda la zona. Por favor, acérquese o haga una nueva búsqueda."
13825
+ "zoomed-out-message": "No podemos buscar reuniones en toda la zona. Por favor, acérquese o haga una nueva búsqueda.",
13826
+ "sorted by distance": "Ordenado por distancia",
13816
13827
  },
13817
13828
  "fa-IR": {
13818
13829
  "days_of_the_week" : ["", 'یَکشَنب', 'دوشَنبه', 'سه‌شنبه', 'چهار شنبه', 'پَنج شَنبه', 'جُمعه', 'شَنبه'],
@@ -13869,6 +13880,7 @@ function CroutonLocalization(language) {
13869
13880
  'report update': "Report an Update",
13870
13881
  'filter by visibility': "List only these meetings",
13871
13882
  'go': "Go!",
13883
+ "distance": "فاصله",
13872
13884
  "get_directions": "دریافت مسیر",
13873
13885
  "select_map_app": "انتخاب برنامه نقشه",
13874
13886
  "apple_maps": "نقشه اپل",
@@ -13877,6 +13889,7 @@ function CroutonLocalization(language) {
13877
13889
  "google_maps_desc_mobile": "باز کردن در برنامه گوگل مپس",
13878
13890
  "waze": "ویز",
13879
13891
  "waze_desc": "باز کردن در برنامه ویز",
13892
+ "sorted by distance": "مرتب شده بر اساس فاصله",
13880
13893
  },
13881
13894
  "fr-CA": {
13882
13895
  "days_of_the_week" : ["", "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
@@ -13934,6 +13947,7 @@ function CroutonLocalization(language) {
13934
13947
  'report update': "Report an Update",
13935
13948
  'filter by visibility': "List only these meetings",
13936
13949
  'go': "Go!",
13950
+ "distance": "Distance",
13937
13951
  "get_directions": "Obtenir l'itinéraire",
13938
13952
  "select_map_app": "Sélectionner l'application de cartes",
13939
13953
  "apple_maps": "Apple Maps",
@@ -13942,6 +13956,7 @@ function CroutonLocalization(language) {
13942
13956
  "google_maps_desc_mobile": "Ouvrir dans l'application Google Maps",
13943
13957
  "waze": "Waze",
13944
13958
  "waze_desc": "Ouvrir dans l'application Waze",
13959
+ "sorted by distance": "Trié par distance",
13945
13960
  },
13946
13961
  "it-IT": {
13947
13962
  "days_of_the_week" : ["", "Domenica", " Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
@@ -13999,6 +14014,7 @@ function CroutonLocalization(language) {
13999
14014
  'report update': "Report an Update",
14000
14015
  'filter by visibility': "List only these meetings",
14001
14016
  'go': "Go!",
14017
+ "distance": "Distanza",
14002
14018
  "get_directions": "Ottieni Indicazioni",
14003
14019
  "select_map_app": "Seleziona App Mappe",
14004
14020
  "apple_maps": "Apple Maps",
@@ -14007,6 +14023,7 @@ function CroutonLocalization(language) {
14007
14023
  "google_maps_desc_mobile": "Apri nell'app Google Maps",
14008
14024
  "waze": "Waze",
14009
14025
  "waze_desc": "Apri nell'app Waze",
14026
+ "sorted by distance": "Ordinati per distanza",
14010
14027
  },
14011
14028
  "nl-NL": {
14012
14029
  "days_of_the_week" : ["", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
@@ -14072,6 +14089,7 @@ function CroutonLocalization(language) {
14072
14089
  "google_maps_desc_mobile": "Openen in Google Maps app",
14073
14090
  "waze": "Waze",
14074
14091
  "waze_desc": "Openen in Waze app",
14092
+ "sorted by distance": "Gesorteerd op afstand",
14075
14093
  },
14076
14094
  "pl-PL": {
14077
14095
  "days_of_the_week" : ["", "Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
@@ -14129,6 +14147,7 @@ function CroutonLocalization(language) {
14129
14147
  'report update': "Report an Update",
14130
14148
  'filter by visibility': "List only these meetings",
14131
14149
  'go': "Go!",
14150
+ "distance": "Odległość",
14132
14151
  "get_directions": "Pobierz Wskazówki",
14133
14152
  "select_map_app": "Wybierz Aplikację Map",
14134
14153
  "apple_maps": "Apple Maps",
@@ -14137,6 +14156,7 @@ function CroutonLocalization(language) {
14137
14156
  "google_maps_desc_mobile": "Otwórz w aplikacji Google Maps",
14138
14157
  "waze": "Waze",
14139
14158
  "waze_desc": "Otwórz w aplikacji Waze",
14159
+ "sorted by distance": "Posortowane według odległości",
14140
14160
  },
14141
14161
  "pt-BR": {
14142
14162
  "days_of_the_week" : ["", "Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"],
@@ -14194,6 +14214,7 @@ function CroutonLocalization(language) {
14194
14214
  'report update': "Report an Update",
14195
14215
  'filter by visibility': "List only these meetings",
14196
14216
  'go': "Go!",
14217
+ "distance": "Distância",
14197
14218
  "get_directions": "Obter Direções",
14198
14219
  "select_map_app": "Selecionar Aplicativo de Mapas",
14199
14220
  "apple_maps": "Apple Maps",
@@ -14202,6 +14223,7 @@ function CroutonLocalization(language) {
14202
14223
  "google_maps_desc_mobile": "Abrir no aplicativo Google Maps",
14203
14224
  "waze": "Waze",
14204
14225
  "waze_desc": "Abrir no aplicativo Waze",
14226
+ "sorted by distance": "Classificado por distância",
14205
14227
  },
14206
14228
  "ru-RU": {
14207
14229
  "days_of_the_week" : ["", "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
@@ -14259,6 +14281,7 @@ function CroutonLocalization(language) {
14259
14281
  'report update': "Report an Update",
14260
14282
  'filter by visibility': "List only these meetings",
14261
14283
  'go': "Go!",
14284
+ "distance": "Расстояние",
14262
14285
  "get_directions": "Проложить маршрут",
14263
14286
  "select_map_app": "Выбрать приложение карт",
14264
14287
  "apple_maps": "Apple Maps",
@@ -14267,6 +14290,7 @@ function CroutonLocalization(language) {
14267
14290
  "google_maps_desc_mobile": "Открыть в приложении Google Maps",
14268
14291
  "waze": "Waze",
14269
14292
  "waze_desc": "Открыть в приложении Waze",
14293
+ "sorted by distance": "Сортировка по расстоянию",
14270
14294
  },
14271
14295
  "sv-SE": {
14272
14296
  "days_of_the_week" : ["", "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
@@ -14332,6 +14356,7 @@ function CroutonLocalization(language) {
14332
14356
  "google_maps_desc_mobile": "Öppna i Google Maps-appen",
14333
14357
  "waze": "Waze",
14334
14358
  "waze_desc": "Öppna i Waze-appen",
14359
+ "sorted by distance": "Sorterade efter avstånd",
14335
14360
  }
14336
14361
  };
14337
14362
  }
@@ -14371,8 +14396,8 @@ this["hbs_Crouton"]["templates"]["byday"] = Handlebars.template({"1":function(co
14371
14396
  + ((stack1 = (lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-textAlign",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":3,"column":39},"end":{"line":3,"column":68}}})) != null ? stack1 : "")
14372
14397
  + ">\n <div class=\"group-header\">"
14373
14398
  + alias4(alias3((depth0 != null ? lookupProperty(depth0,"day") : depth0), depth0))
14374
- + "</div>\n <div class=\"group-table-div\">\n <table class='bmlt-table table table-striped table-hover table-bordered tablesaw tablesaw-stack "
14375
- + alias4((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":116},"end":{"line":6,"column":143}}}))
14399
+ + "</div>\n <div class=\"group-table-div\">\n <table class='bmlt-table table table-hover table-bordered tablesaw tablesaw-stack "
14400
+ + alias4((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":102},"end":{"line":6,"column":129}}}))
14376
14401
  + "'>\n <tbody class=\"h-"
14377
14402
  + alias4(alias3((depth0 != null ? lookupProperty(depth0,"day") : depth0), depth0))
14378
14403
  + "\">\n"
@@ -14404,8 +14429,8 @@ this["hbs_Crouton"]["templates"]["byfield"] = Handlebars.template({"1":function(
14404
14429
  + ((stack1 = (lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"css-textAlign",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":3,"column":63},"end":{"line":3,"column":92}}})) != null ? stack1 : "")
14405
14430
  + ">\n <div class=\"group-header\">"
14406
14431
  + alias1(((helper = (helper = lookupProperty(helpers,"key") || (data && lookupProperty(data,"key"))) != null ? helper : alias3),(typeof helper === "function" ? helper.call(alias2,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":4,"column":42},"end":{"line":4,"column":50}}}) : helper)))
14407
- + "</div>\n <div class=\"group-table-div\">\n <table class='bmlt-table table table-striped table-hover table-bordered tablesaw tablesaw-stack "
14408
- + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":101},"end":{"line":6,"column":128}}}))
14432
+ + "</div>\n <div class=\"group-table-div\">\n <table class='bmlt-table table table-hover table-bordered tablesaw tablesaw-stack "
14433
+ + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":87},"end":{"line":6,"column":114}}}))
14409
14434
  + "'>\n <tbody class=\"byfield.hbs\">\n"
14410
14435
  + ((stack1 = container.invokePartial(lookupProperty(partials,"meetings"),(depth0 != null ? lookupProperty(depth0,"group") : depth0),{"name":"meetings","data":data,"indent":" \t","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
14411
14436
  + " </tbody>\n </table>\n </div>\n </div>\n";
@@ -15095,8 +15120,8 @@ this["hbs_Crouton"]["templates"]["weekdays"] = Handlebars.template({"1":function
15095
15120
 
15096
15121
  return " <div id='tab"
15097
15122
  + alias3(((helper = (helper = lookupProperty(helpers,"day") || (depth0 != null ? lookupProperty(depth0,"day") : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"day","hash":{},"data":data,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":29}}}) : helper)))
15098
- + "' class='tab-pane'>\n <div id=\"bmlt-table-div\">\n <table class='bmlt-table table table-striped table-hover table-bordered tablesaw tablesaw-stack "
15099
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":5,"column":112},"end":{"line":5,"column":139}}}))
15123
+ + "' class='tab-pane'>\n <div id=\"bmlt-table-div\">\n <table class='bmlt-table table table-hover table-bordered tablesaw tablesaw-stack "
15124
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":5,"column":98},"end":{"line":5,"column":125}}}))
15100
15125
  + "'>\n <tbody class=\"weekdays.hbs\">\n"
15101
15126
  + ((stack1 = (lookupProperty(helpers,"greaterThan")||(depth0 && lookupProperty(depth0,"greaterThan"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),0,{"name":"greaterThan","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":6},"end":{"line":9,"column":22}}})) != null ? stack1 : "")
15102
15127
  + ((stack1 = (lookupProperty(helpers,"lessThan")||(depth0 && lookupProperty(depth0,"lessThan"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),1,{"name":"lessThan","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":6},"end":{"line":16,"column":19}}})) != null ? stack1 : "")
@@ -15146,9 +15171,7 @@ var croutonDefaultTemplates = {
15146
15171
  "{{#if this.virtual_meeting_additional_info}}",
15147
15172
  " <div class='meeting-additional-info'>{{this.virtual_meeting_additional_info}}</div>",
15148
15173
  "{{/if}}",
15149
- "{{#if this.distance}}",
15150
- " <div class='meeting-distance'>{{getWord 'Distance'}}: {{this.distance}}</div>",
15151
- "{{/if}}"
15174
+ "{{> distance }}"
15152
15175
  ].join('\n'),
15153
15176
 
15154
15177
  metadata_template: [
@@ -16322,6 +16345,7 @@ function Crouton(config) {
16322
16345
  self.filtering = false;
16323
16346
  self.masterFormatCodes = [];
16324
16347
  self.currentView = "weekday";
16348
+ self.distanceTabAllowed = false;
16325
16349
  self.config = {
16326
16350
  on_complete: null, // Javascript function to callback when data querying is completed.
16327
16351
  root_server: null, // The root server to use.
@@ -16671,6 +16695,10 @@ function Crouton(config) {
16671
16695
  };
16672
16696
 
16673
16697
  self.groupedView = function (field) {
16698
+ if (field.includes('distance') && !self.distanceTabAllowed) {
16699
+ self.dayView();
16700
+ return;
16701
+ }
16674
16702
  self.lowlightButton("#day");
16675
16703
  self.lowlightButton(".groupingButton");
16676
16704
  self.highlightButton("#groupingButton_" + field);
@@ -16706,11 +16734,22 @@ function Crouton(config) {
16706
16734
  self.hideAllPages = function (id) {
16707
16735
  jQuery("#tab-pane").removeClass("show").addClass("hide");
16708
16736
  };
16709
-
16737
+ self.addStripes = function() {
16738
+ var showingNow = [];
16739
+ jQuery(".bmlt-data-row:not(.hide)").each(function (index, value) {
16740
+ jQuery(value).addClass((index % 2) ? 'oddRow' : 'evenRow');
16741
+ const rowId = value.id.split("-");
16742
+ showingNow.push(rowId[rowId.length-1]);
16743
+ });
16744
+ showingNow = [...new Set(showingNow)];
16745
+ return showingNow;
16746
+ }
16710
16747
  self.filterMeetingsFromView = function () {
16711
16748
  jQuery(".group-header").removeClass("hide");
16712
16749
  jQuery(".meeting-group").removeClass("hide");
16713
16750
  jQuery(".bmlt-data-row").removeClass("hide");
16751
+ jQuery(".bmlt-data-row").removeClass("evenRow");
16752
+ jQuery(".bmlt-data-row").removeClass("oddRow");
16714
16753
  jQuery(".filter-dropdown").each(function(index, filter) {
16715
16754
  const dataValue = filter.value.replace("a-", "");
16716
16755
  if (dataValue === "") return;
@@ -16721,13 +16760,7 @@ function Crouton(config) {
16721
16760
  jQuery(".bmlt-data-row").not("[data-" + dataType + "~='" + dataValue + "']").addClass("hide");
16722
16761
  }
16723
16762
  });
16724
- var showingNow = [];
16725
- jQuery(".bmlt-data-row").not(".hide").each(function (index, value) {
16726
- jQuery(value).addClass((index % 2) ? 'oddRow' : 'evenRow');
16727
- const rowId = value.id.split("-");
16728
- showingNow.push(rowId[rowId.length-1]);
16729
- });
16730
- showingNow = [...new Set(showingNow)];
16763
+ var showingNow = this.addStripes();
16731
16764
  self.updateMeetingCount(showingNow);
16732
16765
  self.updateFilters();
16733
16766
  if (croutonMap) croutonMap.fillMap(showingNow);
@@ -17109,36 +17142,87 @@ function Crouton(config) {
17109
17142
  + (self.config.force_rootserver_in_querystring ? '&root_server=' + encodeURIComponent(self.config.root_server) : '')
17110
17143
  );
17111
17144
  }
17145
+ this.calculateDistance(meetingData[m]);
17146
+ meetings.push(meetingData[m])
17147
+ }
17112
17148
 
17113
- meetingData[m]['distance'] = '';
17114
- if (meetingData[m]['venue_type'] != 2) {
17115
- const point = {"lat": meetingData[m]['latitude'], "lng": meetingData[m]['longitude']};
17116
- const distances = croutonMap.getDistanceFromSearch(point);
17117
- if (distances) {
17118
- meetingData[m]['distance_in_km'] = distances.km;
17119
- meetingData[m]['distance_in_miles'] = distances.miles;
17120
-
17121
- if (self.config['distance_units'] === "km") {
17122
- if (meetingData[m]['distance_in_km']) {
17123
- const d = meetingData[m]['distance_in_km'];
17124
- if (d < 1) {
17125
- meetingData[m]['distance'] = Math.round( d * 1000) + 'm';
17126
- }
17127
- else {
17128
- meetingData[m]['distance'] = (Math.round(d * 10) / 10).toFixed(1) + 'km';
17129
- }
17149
+ return meetings;
17150
+ };
17151
+ Crouton.prototype.updateDistances = function() {
17152
+ const self = this;
17153
+ var knt = 0;
17154
+ jQuery('.meeting-distance').each(function(index) {
17155
+ const jThis = jQuery(this);
17156
+ const id = jQuery(this).data('id');
17157
+ if (!id) return;
17158
+ knt++;
17159
+ const m = self.meetingData.find((m) => m.id_bigint==id);
17160
+ self.calculateDistance(m);
17161
+ if (m['distance'] == '') {
17162
+ if (!jThis.hasClass('hide')) jThis.addClass('hide');
17163
+ } else {
17164
+ jThis.removeClass('hide');
17165
+ jQuery(this).html(self.localization.getWord('Distance')+': '+m['distance']);
17166
+ jQuery(this).closest('tr').data('distance', m['distance_in_km']);
17167
+ }
17168
+ });
17169
+ const parent = jQuery('#byfield_distance_in_km tbody');
17170
+ if (parent.length == 0) return;
17171
+ if (knt === 0) {
17172
+ parent.children().each(function (index) {
17173
+ if (!this.id) return;
17174
+ const id = this.id.replace("meeting-data-row-", "");
17175
+ const m = self.meetingData.find((m) => m.id_bigint==id);
17176
+ if (!m) return;
17177
+ self.calculateDistance(m);
17178
+ if (m['distance'] != '') {
17179
+ jQuery(this).data('distance', m['distance_in_km']);
17180
+ knt++;
17181
+ }
17182
+ });
17183
+ }
17184
+ const sorted = parent.children().sort(function (a, b) {
17185
+ const distanceA =parseFloat( jQuery(a).data('distance'));
17186
+ const distanceB =parseFloat( jQuery(b).data('distance'));
17187
+ return (distanceA < distanceB) ? -1 : (distanceA > distanceB) ? 1 : 0;
17188
+ });
17189
+ parent.html(sorted);
17190
+ jQuery("#byfield_distance_in_km tbody .bmlt-data-row").css({cursor: "pointer"});
17191
+ jQuery("#byfield_distance_in_km tbody .bmlt-data-row").click(function (e) {
17192
+ if (e.target.tagName !== 'A')
17193
+ croutonMap.rowClick(parseInt(this.id.replace("meeting-data-row-", "")));
17194
+ });
17195
+ if (knt > 0) {
17196
+ jQuery('#groupingButton_distance_in_km').removeClass('hide');
17197
+ self.distanceTabAllowed = true;
17198
+ }
17199
+ }
17200
+ self.calculateDistance = function(meetingData) {
17201
+ meetingData['distance'] = '';
17202
+ if (meetingData['venue_type'] != 2) {
17203
+ const point = {"lat": meetingData['latitude'], "lng": meetingData['longitude']};
17204
+ const distances = croutonMap.getDistanceFromSearch(point);
17205
+ if (distances) {
17206
+ meetingData['distance_in_km'] = distances.km;
17207
+ meetingData['distance_in_miles'] = distances.miles;
17208
+
17209
+ if (self.config['distance_units'] === "km") {
17210
+ if (meetingData['distance_in_km']) {
17211
+ const d = meetingData['distance_in_km'];
17212
+ if (d < 1) {
17213
+ meetingData['distance'] = Math.round( d * 1000) + 'm';
17214
+ }
17215
+ else {
17216
+ meetingData['distance'] = (Math.round(d * 10) / 10).toFixed(1) + 'km';
17130
17217
  }
17131
- } else if (meetingData[m]['distance_in_miles']) {
17132
- const d = meetingData[m]['distance_in_miles'];
17133
- meetingData[m]['distance'] = (Math.round(d * 100) / 100).toFixed(2) + ' miles';
17134
17218
  }
17219
+ } else if (meetingData['distance_in_miles']) {
17220
+ const d = meetingData['distance_in_miles'];
17221
+ meetingData['distance'] = (Math.round(d * 100) / 100).toFixed(2) + ' miles';
17135
17222
  }
17136
17223
  }
17137
- meetings.push(meetingData[m])
17138
17224
  }
17139
-
17140
- return meetings;
17141
- };
17225
+ }
17142
17226
  self.showMessage = function(message) {
17143
17227
  jQuery("#" + self.config['placeholder_id']).html("crouton: " + message);
17144
17228
  jQuery("#" + self.config['placeholder_id']).removeClass("hide");
@@ -17352,6 +17436,7 @@ Crouton.prototype.meetingModal = function(meetingId) {
17352
17436
  }
17353
17437
  Crouton.prototype.searchMap = function() {
17354
17438
  var self = this;
17439
+ self.distanceTabAllowed = true;
17355
17440
  if (!self.config.map_search || typeof self.config.map_search !== 'object') {
17356
17441
  self.config.map_search = {
17357
17442
  width: -50,
@@ -17393,10 +17478,6 @@ Crouton.prototype.searchMap = function() {
17393
17478
  Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
17394
17479
  var self = this;
17395
17480
 
17396
- if (!self.config.map_search) {
17397
- self.config.grouping_buttons = self.config.grouping_buttons.filter((b) => !b.field.startsWith('distance'));
17398
- if (self.config['view_by'] == 'distance') self.config['view_by'] = 'weekday';
17399
- }
17400
17481
  self.lock(function() {
17401
17482
  var body = jQuery("body");
17402
17483
  if (self.config['theme'] !== '') {
@@ -17512,9 +17593,13 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
17512
17593
  ? self.config.grouping_buttons[b]['accordionState'] : '';
17513
17594
  groupingButtonsDataSorted[groupByName] = {};
17514
17595
  if (groupByName.startsWith('distance')) {
17515
- groupingButtonsDataSorted[groupByName]['Sorted by Distance'] = {};
17516
- groupingButtonsDataSorted[groupByName]['Sorted by Distance'].group = [...self.meetingData].sort((a,b) => a['distance_in_km'] - b['distance_in_km']);
17517
- groupingButtonsDataSorted[groupByName]['Sorted by Distance'].accordionState = 'non-collapsable';
17596
+ groupingButtonsDataSorted[groupByName][self.localization.getWord('Sorted by Distance')] = {};
17597
+ if (self.config.map_search) {
17598
+ groupingButtonsDataSorted[groupByName][self.localization.getWord('Sorted by Distance')].group = [...self.meetingData].sort((a,b) => a['distance_in_km'] - b['distance_in_km']);
17599
+ } else { // when not crouton_map, sorting byy distance is triggered by an action in meeting_map.
17600
+ groupingButtonsDataSorted[groupByName][self.localization.getWord('Sorted by Distance')].group = [...self.meetingData].filter(m => m.venue_type != 2);
17601
+ }
17602
+ groupingButtonsDataSorted[groupByName][self.localization.getWord('Sorted by Distance')].accordionState = 'non-collapsable';
17518
17603
  continue;
17519
17604
  }
17520
17605
  var sortKey = [];
@@ -17611,6 +17696,10 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
17611
17696
  },
17612
17697
  "dropdownData": self.dropdownData
17613
17698
  }, function () {
17699
+ if (!self.config.map_search) {
17700
+ jQuery('#groupingButton_distance_in_km').addClass('hide');
17701
+ }
17702
+ self.addStripes();
17614
17703
  self.updateMeetingCount();
17615
17704
  if (self.config['map_search'] != null || self.config['show_map']) {
17616
17705
  jQuery(".bmlt-data-row").css({cursor: "pointer"});
@@ -18043,6 +18132,10 @@ crouton_Handlebars.registerPartial('offerIcsButton',
18043
18132
  "{{#if (hasBMLT2ics)}}{{> icsButton}}<br/>{{/if}}");
18044
18133
  crouton_Handlebars.registerPartial('directionsButton', hbs_Crouton.templates['directionsButton']);
18045
18134
  crouton_Handlebars.registerPartial('meetingDetailsButton', hbs_Crouton.templates['meetingDetailsButton']);
18135
+ crouton_Handlebars.registerPartial('distance',`
18136
+ <div class='meeting-distance{{#unless this.distance}} hide{{/unless}}' data-id='{{this.id_bigint}}'>
18137
+ {{getWord 'Distance'}}: {{this.distance}}
18138
+ </div>`);
18046
18139
  function convertToPunyCode(str) {
18047
18140
  return str !== undefined ? punycode.toASCII(str.toLowerCase()).replace(/\W|_/g, "-") : "";
18048
18141
  }
@@ -18536,6 +18629,9 @@ function MeetingMap(inConfig) {
18536
18629
  retrieveGeolocation().then(position => {
18537
18630
  filterVisible(false);
18538
18631
  gDelegate.setViewToPosition(position, filterMeetingsAndBounds, filterVisible);
18632
+ gSearchPoint = {"lat": position.latitude, "lng": position.longitude};
18633
+ crouton.updateDistances();
18634
+
18539
18635
  }).catch(error => {
18540
18636
  console.log(error.message);
18541
18637
  jQuery('.geo').removeClass("hide").addClass("show").html(`<p>${error.message}</p>`);
@@ -18715,6 +18811,8 @@ function MeetingMap(inConfig) {
18715
18811
  coords = {latitude: position.coords.latitude, longitude: position.coords.longitude};
18716
18812
  filterVisible(false);
18717
18813
  gDelegate.setViewToPosition(coords, filterMeetingsAndBounds, filterVisible);
18814
+ gSearchPoint = {"lat": position.coords.latitude, "lng": position.coords.longitude};
18815
+ crouton.updateDistances();
18718
18816
  },
18719
18817
  showGeocodingDialog
18720
18818
  );
@@ -18772,6 +18870,7 @@ function MeetingMap(inConfig) {
18772
18870
  g_suspendedFullscreen = true;
18773
18871
  toggleFullscreen();
18774
18872
  }
18873
+ if (!modal) return;
18775
18874
  modal.style.display = "block";
18776
18875
  swipableModal = swipe;
18777
18876
  modal.focus();
@@ -18817,10 +18916,14 @@ function MeetingMap(inConfig) {
18817
18916
  jQuery("#table_page").addClass("hide");
18818
18917
  jQuery("#bmlt-map").css("display", "block");
18819
18918
  }
18820
- function resetVisibleThenFilterMeetingsAndBounds(bounds) {
18919
+ function resetVisibleThenFilterMeetingsAndBounds(bounds, center=null) {
18821
18920
  filterVisible(false);
18822
18921
  const ret = filterMeetingsAndBounds(bounds);
18823
18922
  filterVisible(true);
18923
+ if (gSearchPoint.lat != center.lat || gSearchPoint.lng != center.lng) {
18924
+ gSearchPoint = center;
18925
+ crouton.updateDistances();
18926
+ }
18824
18927
  return ret;
18825
18928
  }
18826
18929
  function lookupLocation(fullscreen) {