@bmlt-enabled/croutonjs 3.20.12 → 3.21.0

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.
@@ -13291,9 +13291,9 @@ function CroutonLocalization(language) {
13291
13291
  "formats": "Struktur",
13292
13292
  "map": "Kort",
13293
13293
  "neighborhood": "Neighborhood",
13294
- "near_me": "Near Me",
13295
- "text_search": "Text Search",
13296
- "click_search": "Click Search",
13294
+ "near_me": "Find nearby meetings",
13295
+ "text_search": "Find meetings there",
13296
+ "click_search": "Find meetings near to a point on the map",
13297
13297
  "pan_and_zoom": "Pan + Zoom",
13298
13298
  "languages": "Languages",
13299
13299
  "common_needs": "Common Needs",
@@ -13387,7 +13387,7 @@ function CroutonLocalization(language) {
13387
13387
  'filter by visibility': "Zeige nur Meetings, die gerade auf dem Karte stehen",
13388
13388
  'go': "Los!"
13389
13389
  },
13390
- "en-AU": {
13390
+ "en-AU": {
13391
13391
  "days_of_the_week" : ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
13392
13392
  "weekday" : "Weekday",
13393
13393
  "city" : "City",
@@ -13401,10 +13401,10 @@ function CroutonLocalization(language) {
13401
13401
  "postal_codes" : "Postcodes",
13402
13402
  "formats" : "Formats",
13403
13403
  "map" : "Map",
13404
- "neighborhood": "Neighborhood",
13405
- "near_me": "Near Me",
13406
- "text_search": "Text Search",
13407
- "click_search": "Click Search",
13404
+ "neighborhood": "Neighbourhood",
13405
+ "near_me": "Find nearby meetings",
13406
+ "text_search": "Find meetings there",
13407
+ "click_search": "Find meetings near to a point on the map",
13408
13408
  "languages": "Languages",
13409
13409
  "common_needs": "Common Needs",
13410
13410
  "meeting_count": "Weekly Meetings:",
@@ -13434,7 +13434,7 @@ function CroutonLocalization(language) {
13434
13434
  'show meetings near...': 'Show meetings near...',
13435
13435
  'filter meetings': 'Filter meetings',
13436
13436
  'visible meeting list': 'Visible meetings as list',
13437
- 'enter a city or zip code': 'Enter a city or zip code',
13437
+ 'enter a city or zip code': 'Enter a city and state',
13438
13438
  'toggle fullscreen mode': 'Toggle fullscreen mode',
13439
13439
  'close': "Close",
13440
13440
  'meeting page': "Meeting Page",
@@ -13459,9 +13459,9 @@ function CroutonLocalization(language) {
13459
13459
  "formats" : "Formats",
13460
13460
  "map" : "Map",
13461
13461
  "neighborhood": "Neighborhood",
13462
- "near_me": "Near Me",
13463
- "text_search": "Text Search",
13464
- "click_search": "Click Search",
13462
+ "near_me": "Find nearby meetings",
13463
+ "text_search": "Find meetings there",
13464
+ "click_search": "Find meetings near to a point on the map",
13465
13465
  "pan_and_zoom": "Pan + Zoom",
13466
13466
  "languages": "Languages",
13467
13467
  "common_needs": "Common Needs",
@@ -13517,9 +13517,9 @@ function CroutonLocalization(language) {
13517
13517
  "formats" : "Formats",
13518
13518
  "map" : "Map",
13519
13519
  "neighborhood": "Neighborhood",
13520
- "near_me": "Near Me",
13521
- "text_search": "Text Search",
13522
- "click_search": "Click Search",
13520
+ "near_me": "Find nearby meetings",
13521
+ "text_search": "Find meetings there",
13522
+ "click_search": "Find meetings near to a point on the map",
13523
13523
  "pan_and_zoom": "Pan + Zoom",
13524
13524
  "languages": "Languages",
13525
13525
  "common_needs": "Common Needs",
@@ -13575,9 +13575,9 @@ function CroutonLocalization(language) {
13575
13575
  "formats" : "Formats",
13576
13576
  "map" : "Map",
13577
13577
  "neighborhood": "Neighborhood",
13578
- "near_me": "Near Me",
13579
- "text_search": "Text Search",
13580
- "click_search": "Click Search",
13578
+ "near_me": "Find nearby meetings",
13579
+ "text_search": "Find meetings there",
13580
+ "click_search": "Find meetings near to a point on the map",
13581
13581
  "pan_and_zoom": "Pan + Zoom",
13582
13582
  "languages": "Languages",
13583
13583
  "common_needs": "Common Needs",
@@ -13633,9 +13633,9 @@ function CroutonLocalization(language) {
13633
13633
  "formats" : "Formats",
13634
13634
  "map" : "Map",
13635
13635
  "neighborhood": "Neighborhood",
13636
- "near_me": "Near Me",
13637
- "text_search": "Text Search",
13638
- "click_search": "Click Search",
13636
+ "near_me": "Find nearby meetings",
13637
+ "text_search": "Find meetings there",
13638
+ "click_search": "Find meetings near to a point on the map",
13639
13639
  "pan_and_zoom": "Pan + Zoom",
13640
13640
  "languages": "Languages",
13641
13641
  "common_needs": "Common Needs",
@@ -13749,9 +13749,9 @@ function CroutonLocalization(language) {
13749
13749
  "formats" : "فورمت ها",
13750
13750
  "map" : "نقشه",
13751
13751
  "neighborhood": "Neighborhood",
13752
- "near_me": "Near Me",
13753
- "text_search": "Text Search",
13754
- "click_search": "Click Search",
13752
+ "near_me": "Find nearby meetings",
13753
+ "text_search": "Find meetings there",
13754
+ "click_search": "Find meetings near to a point on the map",
13755
13755
  "pan_and_zoom": "Pan + Zoom",
13756
13756
  "languages": "Languages",
13757
13757
  "common_needs": "Common Needs",
@@ -14667,8 +14667,19 @@ this["hbs_Crouton"]["templates"]["mapMenu"] = Handlebars.template({"1":function(
14667
14667
  + alias1((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias3).call(alias2,"go",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":49,"column":59},"end":{"line":49,"column":75}}}))
14668
14668
  + "</button>\n </div>\n </div>\n</div>\n\n";
14669
14669
  },"usePartial":true,"useData":true,"useDepths":true});
14670
- this["hbs_Crouton"]["templates"]["mapSearch"] = Handlebars.template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
14671
- var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
14670
+ this["hbs_Crouton"]["templates"]["mapSearch"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) {
14671
+ var lookupProperty = container.lookupProperty || function(parent, propertyName) {
14672
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
14673
+ return parent[propertyName];
14674
+ }
14675
+ return undefined
14676
+ };
14677
+
14678
+ return " <div class=\"modal-search\">\n <button id=\"bmltsearch-clicksearch\" class=\"filter-button\">"
14679
+ + container.escapeExpression((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"click_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":19,"column":86},"end":{"line":20,"column":48}}}))
14680
+ + "</button>\n </div>\n";
14681
+ },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
14682
+ var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
14672
14683
  if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
14673
14684
  return parent[propertyName];
14674
14685
  }
@@ -14679,17 +14690,27 @@ this["hbs_Crouton"]["templates"]["mapSearch"] = Handlebars.template({"compiler":
14679
14690
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Open Search Dialog",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":90}}}))
14680
14691
  + "\">\n <span class=\"menu-button-label\" style=\"position:initial;\">"
14681
14692
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search for meetings",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":2,"column":62},"end":{"line":2,"column":95}}}))
14682
- + "</span>\n</button>\n<div id=\"bmltsearch_modal\" class=\"modal\" style=\"display: none;\">\n <div id=\"bmltsearch_content\" class=\"modal-content\">\n <span id=\"close_search\" class=\"modal-close\">x</span>\n <span class=\"modal-title\">"
14683
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search for meetings",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":7,"column":34},"end":{"line":7,"column":67}}}))
14684
- + "</span>\n <table>\n <tr><td><div class=\"modal-search\">\n <input id=\"bmltsearch-goto-text\" type=\"text\" placeholder=\""
14685
- + 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":10,"column":70},"end":{"line":10,"column":108}}}))
14686
- + "\" style=\"margin-bottom:5px;\">\n <button id=\"bmltsearch-text-button\" class=\"filter-button\">"
14687
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":11,"column":70},"end":{"line":11,"column":95}}}))
14688
- + "</button>\n </div></td></tr>\n <tr><td><div class=\"modal-search\">\n <button id=\"bmltsearch-nearbyMeetings\" class=\"filter-button\">"
14689
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"near_me",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":14,"column":77},"end":{"line":14,"column":98}}}))
14690
- + "</button>\n </div></td></tr>\n <tr><td><div class=\"modal-search\">\n <button id=\"bmltsearch-clicksearch\" class=\"filter-button\">"
14691
- + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"click_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":17,"column":74},"end":{"line":17,"column":100}}}))
14692
- + "</button>\n </div></td></tr></table>\n </div>\n</div>";
14693
+ + "</span>\n</button>\n<div id=\"bmltsearch_modal\" class=\"modal\" style=\"display: none;\">\n <div id=\"bmltsearch_content\" class=\"modal-content\">\n <span id=\"close_search\" class=\"modal-close\">x</span>\n <div id=\"modal-search-page\">\n <div class=\"modal-title\">"
14694
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search for meetings",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":8,"column":37},"end":{"line":8,"column":70}}}))
14695
+ + "</div>\n <div id=\"modal-search-box\" class=\"modal-search\">\n <input id=\"bmltsearch-goto-text\" type=\"text\"\n placeholder=\""
14696
+ + 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":11,"column":45},"end":{"line":11,"column":83}}}))
14697
+ + "\" style=\"margin-bottom:5px;\">\n <button id=\"bmltsearch-text-button\" class=\"filter-button\">"
14698
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"text_search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":12,"column":86},"end":{"line":12,"column":111}}}))
14699
+ + "</button>\n </div>\n <div class=\"modal-search\">\n <button id=\"bmltsearch-nearbyMeetings\" class=\"filter-button\">"
14700
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"near_me",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":15,"column":89},"end":{"line":15,"column":110}}}))
14701
+ + "</button>\n </div>\n"
14702
+ + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasClickSearch") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":16},"end":{"line":22,"column":23}}})) != null ? stack1 : "")
14703
+ + " <button id=\"show-search-parameters\" class=\"advanced-search-button\">"
14704
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Adjust Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":23,"column":79},"end":{"line":23,"column":106}}}))
14705
+ + "</button>\n </div>\n <div id=\"modal-seach-parameters\">\n <div class=\"modal-title\">"
14706
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Configure Search",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":26,"column":37},"end":{"line":26,"column":67}}}))
14707
+ + "</div>\n <input type=\"number\" id=\"search_parameter\" name=\"search_parameter\" maxlength=\"3\" size=\"3\">\n <p>"
14708
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"This number represents:",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":28,"column":15},"end":{"line":28,"column":52}}}))
14709
+ + "</p>\n <input type=\"radio\" id=\"search_radius\" name=\"map_search_type\" value=\"radius\">\n <label id=\"search_radius_label\" for=\"search_radius\"></label><br>\n <input type=\"radio\" id=\"search_count\" name=\"map_search_type\" value=\"count\">\n <label for=\"search_count\">"
14710
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Approx. number of meetings in result",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":32,"column":38},"end":{"line":32,"column":88}}}))
14711
+ + "</label><br>\n <button id=\"show-search-page\" class=\"advanced-search-button\">"
14712
+ + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Back",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":33,"column":73},"end":{"line":33,"column":91}}}))
14713
+ + "</button>\n </div>\n </div>\n</div>";
14693
14714
  },"useData":true});
14694
14715
  this["hbs_Crouton"]["templates"]["meetings"] = Handlebars.template({"1":function(container,depth0,helpers,partials,data) {
14695
14716
  var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -14953,6 +14974,9 @@ var croutonDefaultTemplates = {
14953
14974
  "<div class='location-information'>{{this.formatted_location_info}}</div>",
14954
14975
  "{{#if this.virtual_meeting_additional_info}}",
14955
14976
  " <div class='meeting-additional-info'>{{this.virtual_meeting_additional_info}}</div>",
14977
+ "{{/if}}",
14978
+ "{{#if this.distance}}",
14979
+ " <div class='meeting-distance'>{{getWord 'Distance'}}: {{this.distance}}</div>",
14956
14980
  "{{/if}}"
14957
14981
  ].join('\n'),
14958
14982
 
@@ -14984,7 +15008,6 @@ var croutonDefaultTemplates = {
14984
15008
  " {{getWord 'meeting details'}}",
14985
15009
  " </a>",
14986
15010
  " </div>",
14987
- " <div class='geo hide'>{{this.latitude}},{{this.longitude}}</div>",
14988
15011
  " {{/unless}}",
14989
15012
  "{{/isNotTemporarilyClosed}}"
14990
15013
  ].join('\n'),
@@ -15091,7 +15114,7 @@ var croutonDefaultTemplates = {
15091
15114
  This meeting is in <a href="{{serviceBodyUrl}}">{{serviceBodyName}}</a><br/>
15092
15115
  {{> offerIcsButton}}
15093
15116
  </td>`,
15094
- marker_contents_template:
15117
+ marker_contents_template:
15095
15118
  `<h4>{{meeting_name}}</h4>
15096
15119
  <div class="active">
15097
15120
  <div class="marker_div_location_text">{{{this.location_text}}}</div>
@@ -16168,6 +16191,7 @@ function Crouton(config) {
16168
16191
  int_include_unpublished: 0, // Includes unpublished meeting
16169
16192
  button_filters: [
16170
16193
  {'title': 'City', 'field': 'location_municipality'},
16194
+ {'title': 'Distance', 'field': 'distance_in_km'},
16171
16195
  ],
16172
16196
  button_format_filters: [],
16173
16197
  default_filter_dropdown: "", // Sets the default format for the dropdowns, the names will match the `has_` fields dropdowns without `has_. Example: `formats=closed`.
@@ -16188,8 +16212,6 @@ function Crouton(config) {
16188
16212
  has_common_needs: false, // Shows the Common Needs dropdown
16189
16213
  has_venues: true, // Shows the venue types dropdown
16190
16214
  has_meeting_count: false, // Shows the meeting count
16191
- show_distance: false, // Determines distance on page load
16192
- distance_search: 0, // Makes a distance based search with results either number of / or distance from coordinates
16193
16215
  recurse_service_bodies: false,// Recurses service bodies when making service bodies request
16194
16216
  service_body: [], // Array of service bodies to return data for.
16195
16217
  formats: '', // Return only meetings with these formats (format shared-id, not key-string)
@@ -16233,7 +16255,9 @@ function Crouton(config) {
16233
16255
  maxZoom: 18
16234
16256
  },
16235
16257
  minZoom: 6,
16236
- maxZoom: 17
16258
+ maxZoom: 17,
16259
+ distance_units: 'miles',
16260
+ noMap: false
16237
16261
  };
16238
16262
 
16239
16263
  self.setConfig(config);
@@ -16366,6 +16390,10 @@ function Crouton(config) {
16366
16390
  }
16367
16391
  }
16368
16392
 
16393
+ if (self.config.map_search) {
16394
+ self.queryable_data_keys.push('distance_in_km');
16395
+ self.queryable_data_keys.push('distance_in_miles');
16396
+ }
16369
16397
  self.collectDataKeys(self.config['meeting_data_template']);
16370
16398
  self.collectDataKeys(self.config['metadata_template']);
16371
16399
  self.collectDataKeys(self.config['observer_template']);
@@ -16384,6 +16412,9 @@ function Crouton(config) {
16384
16412
  return prev +'&formats[]='+id;
16385
16413
  }, '');
16386
16414
  }
16415
+ if (self.config.map_search && self.config['venue_types'].length === 0) {
16416
+ self.config['venue_types'].push('-2');
16417
+ }
16387
16418
  if (self.config['venue_types']) {
16388
16419
  url += self.config['venue_types'].reduce(function(prev,id) {
16389
16420
  return prev +'&venue_types[]='+id;
@@ -16395,16 +16426,7 @@ function Crouton(config) {
16395
16426
  url += "&advanced_published=-1"
16396
16427
  }
16397
16428
 
16398
- if (self.config['distance_search'] !== 0) {
16399
- return retrieveGeolocation().then((position) => {
16400
- url += '&lat_val=' + position.latitude + '&long_val=' + position.longitude + '&sort_results_by_distance=1';
16401
- url += (self.config['distance_units'] === "km" ? '&geo_width_km=' : '&geo_width=') + self.config['distance_search'];
16402
- return self.getMeetings(url);
16403
- }).catch((error) => {
16404
- console.error(error.message);
16405
- return self.getMeetings(url); // Proceed without geolocation if error occurs
16406
- });
16407
- } else if (self.config['custom_query'] != null) {
16429
+ if (self.config['custom_query'] != null) {
16408
16430
  url += self.config['custom_query'] + '&sort_keys=' + self.config['sort_keys'];
16409
16431
  return self.getMeetings(url);
16410
16432
  } else if (self.config['service_body'].length > 0) {
@@ -16459,6 +16481,8 @@ function Crouton(config) {
16459
16481
  self.dayView();
16460
16482
  } else if (viewName === "city") {
16461
16483
  self.filteredView("location_municipality");
16484
+ } else if (viewName === "distance") {
16485
+ self.filteredView("distance_in_km");
16462
16486
  } else {
16463
16487
  self.filteredView(viewName);
16464
16488
  }
@@ -16615,7 +16639,7 @@ function Crouton(config) {
16615
16639
  crouton_Handlebars.registerPartial('bydays', hbs_Crouton.templates['byday']);
16616
16640
  crouton_Handlebars.registerPartial('formatPopup', hbs_Crouton.templates['formatPopup']);
16617
16641
  window.crouton = self;
16618
- croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,fitBounds,callback);
16642
+ croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,fitBounds,callback,self.config['noMap']);
16619
16643
  }
16620
16644
  self.getCurrentLocation = function(callback) {
16621
16645
  retrieveGeolocation().then(position => {
@@ -16698,31 +16722,6 @@ function Crouton(config) {
16698
16722
  });
16699
16723
  }
16700
16724
 
16701
- self.showLocation = function(position) {
16702
- var latitude = position.latitude;
16703
- var longitude = position.longitude;
16704
- var distanceUnit;
16705
- var distanceCalculation;
16706
-
16707
- if (self.config['distance_units'] === "km") {
16708
- distanceUnit = "km";
16709
- distanceCalculation = "K";
16710
- } else if (self.config['distance_units'] === "nm") {
16711
- distanceUnit = "nm";
16712
- distanceCalculation = "N";
16713
- } else {
16714
- distanceUnit = "mi";
16715
- distanceCalculation = "M";
16716
- }
16717
-
16718
- jQuery( ".geo" ).each(function() {
16719
- var target = jQuery( this ).html();
16720
- var arr = target.split(',');
16721
- var distance_result = self.distance(latitude, longitude, arr[0], arr[1], distanceCalculation);
16722
- jQuery( this ).removeClass("hide").addClass("show").html(distance_result.toFixed(1) + ' ' + distanceUnit);
16723
- });
16724
- };
16725
-
16726
16725
  self.errorHandler = function(msg) {
16727
16726
  jQuery('.geo').removeClass("hide").addClass("show").html('');
16728
16727
  };
@@ -16979,6 +16978,22 @@ function Crouton(config) {
16979
16978
  );
16980
16979
  }
16981
16980
 
16981
+ meetingData[m]['distance'] = '';
16982
+ if (self.config['distance_units'] === "km") {
16983
+ if (meetingData[m]['distance_in_km']) {
16984
+ const d = meetingData[m]['distance_in_km'];
16985
+ if (d < 1) {
16986
+ meetingData[m]['distance'] = Math.round( d * 1000) + 'm';
16987
+ }
16988
+ else {
16989
+ meetingData[m]['distance'] = (Math.round(d * 10) / 10).toFixed(1) + 'km';
16990
+ }
16991
+ }
16992
+ } else if (meetingData[m]['distance_in_miles']) {
16993
+ const d = meetingData[m]['distance_in_miles'];
16994
+ meetingData[m]['distance'] = (Math.round(d * 100) / 100).toFixed(2) + ' miles';
16995
+ }
16996
+
16982
16997
  meetings.push(meetingData[m])
16983
16998
  }
16984
16999
 
@@ -17043,7 +17058,6 @@ Crouton.prototype.setConfig = function(config) {
17043
17058
  self.config.show_map = false;
17044
17059
  self.config.map_page = true;
17045
17060
  }
17046
- self.config["distance_search"] = parseInt(self.config["distance_search"] || 0);
17047
17061
  self.config["day_sequence"] = [];
17048
17062
  self.config.day_sequence.push(self.config.int_start_day_id);
17049
17063
  for (var i = 1; i < 7; i++) {
@@ -17294,6 +17308,7 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17294
17308
 
17295
17309
  for (var f = 0; f < self.config.button_filters.length; f++) {
17296
17310
  var groupByName = self.config.button_filters[f]['field'];
17311
+ if (groupByName.startsWith('distance')) continue;
17297
17312
  var groupByData = getUniqueValuesOfKey(daysOfTheWeekMeetings, groupByName).sort();
17298
17313
  for (var i = 0; i < groupByData.length; i++) {
17299
17314
  var groupByMeetings = daysOfTheWeekMeetings.filterByObjectKeyValue(groupByName, groupByData[i]);
@@ -17332,15 +17347,20 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17332
17347
 
17333
17348
  var buttonFiltersDataSorted = {};
17334
17349
  for (var b = 0; b < self.config.button_filters.length; b++) {
17335
- var sortKey = [];
17336
17350
  var groupByName = self.config.button_filters[b]['field'];
17351
+ buttonFiltersDataSorted[groupByName] = {};
17352
+ if (groupByName.startsWith('distance')) {
17353
+ buttonFiltersDataSorted[groupByName]['Sorted by Distance'] = [...self.meetingData].sort((a,b) => a['distance_in_km'] - b['distance_in_km']);
17354
+ continue;
17355
+ }
17356
+ var sortKey = [];
17357
+
17337
17358
  for (var buttonFiltersDataItem in buttonFiltersData[groupByName]) {
17338
17359
  sortKey.push(buttonFiltersDataItem);
17339
17360
  }
17340
17361
 
17341
17362
  sortKey.sort();
17342
17363
 
17343
- buttonFiltersDataSorted[groupByName] = {};
17344
17364
  for (var s = 0; s < sortKey.length; s++) {
17345
17365
  buttonFiltersDataSorted[groupByName][sortKey[s]] = buttonFiltersData[groupByName][sortKey[s]]
17346
17366
  }
@@ -17530,10 +17550,6 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17530
17550
  jQuery("#filter-dropdown-" + filter[0]).val('a-' + filter[1]).trigger('change').trigger('select2:select');
17531
17551
  }
17532
17552
 
17533
- if (self.config['show_distance']) {
17534
- self.getCurrentLocation(self.showLocation);
17535
- }
17536
-
17537
17553
  if (self.config['show_map'] && !self.config['refresh_map'] && !doMeetingMap) {
17538
17554
  croutonMap.initialize(self.createBmltMapElement(), self.meetingData);
17539
17555
  jQuery("#bmlt-map").removeClass("hide");
@@ -18070,7 +18086,7 @@ function MeetingMap(inConfig) {
18070
18086
  * \brief Load the map and set it up. *
18071
18087
  ****************************************************************************************/
18072
18088
 
18073
- function loadMap(inDiv, menuContext, handlebarMapOptions=null,cb=null) {
18089
+ function loadMap(inDiv, menuContext, handlebarMapOptions=null,cb=null,hide=false) {
18074
18090
  if (inDiv) {
18075
18091
  crouton_Handlebars.registerPartial("markerContentsTemplate", config['marker_contents_template']);
18076
18092
  gInDiv = inDiv;
@@ -18090,7 +18106,7 @@ function MeetingMap(inConfig) {
18090
18106
  }
18091
18107
  let loc = {latitude: config.lat, longitude: config.lng, zoom: config.zoom};
18092
18108
  if (handlebarMapOptions) loc = {latitude: handlebarMapOptions.lat, longitude: handlebarMapOptions.lng};
18093
- if (gDelegate.createMap(inDiv, loc)) {
18109
+ if (gDelegate.createMap(inDiv, loc, hide)) {
18094
18110
  gDelegate.addListener('zoomend', function (ev) {
18095
18111
  if (shouldRedrawMarkers() && gAllMeetings) {
18096
18112
  if (listOnlyVisible) {
@@ -18116,12 +18132,19 @@ function MeetingMap(inConfig) {
18116
18132
  };
18117
18133
  };
18118
18134
  var gSearchModal;
18119
- function createSearchButton(menuContext) {
18120
- var template = hbs_Crouton.templates['mapSearch'];
18121
- var controlDiv = document.createElement('div');
18122
- controlDiv.innerHTML = template();
18135
+ function createSearchButton() {
18136
+ const template = hbs_Crouton.templates['mapSearch'];
18137
+ const controlDiv = document.createElement('div');
18138
+ const params = {'hasClickSearch': gDelegate.hasClickSearch()}
18139
+ controlDiv.innerHTML = template(params);
18123
18140
  controlDiv.querySelector("#map-search-button").addEventListener('click', showBmltSearchDialog);
18124
18141
  controlDiv.querySelector("#bmltsearch-nearbyMeetings").addEventListener('click', nearMeSearch);
18142
+ controlDiv.querySelector("#bmltsearch-goto-text").addEventListener('keypress', function (event) {
18143
+ if (event.key === "Enter") {
18144
+ event.preventDefault();
18145
+ document.getElementById("bmltsearch-text-button").click();
18146
+ }
18147
+ });
18125
18148
  controlDiv.querySelector("#bmltsearch-text-button").addEventListener('click', function () {
18126
18149
  let text = document.getElementById("bmltsearch-goto-text").value.trim();
18127
18150
  if (text === "") return;
@@ -18129,7 +18152,35 @@ function MeetingMap(inConfig) {
18129
18152
  gDelegate.callGeocoder(text, null, mapSearchGeocode);
18130
18153
  closeModalWindow(gSearchModal);
18131
18154
  });
18132
- controlDiv.querySelector("#bmltsearch-clicksearch").addEventListener('click', clickSearch);
18155
+ controlDiv.querySelector("#modal-seach-parameters").style.display = 'none';
18156
+ controlDiv.querySelector("#show-search-parameters").addEventListener('click', function (e) {
18157
+ const controlDiv = e.target.parentElement.parentElement;
18158
+ let w = config.map_search.width;
18159
+ let checked = '#search_radius';
18160
+ if (w < 0) {
18161
+ w = -w;
18162
+ checked = '#search_count';
18163
+ }
18164
+ controlDiv.querySelector(checked).checked = true;
18165
+ controlDiv.querySelector('#search_parameter').value = w;
18166
+ controlDiv.querySelector("#modal-seach-parameters").style.display = 'block';
18167
+ controlDiv.querySelector("#modal-search-page").style.display = 'none';
18168
+ controlDiv.querySelector("#search_radius_label").innerHTML = crouton.localization.getWord('Radius of search in $$').replace('$$', crouton.config.distance_units);
18169
+ });
18170
+ controlDiv.querySelector("#show-search-page").addEventListener('click', function (e) {
18171
+ const controlDiv = e.target.parentElement.parentElement;
18172
+ let w = controlDiv.querySelector('#search_parameter').value;
18173
+ if (controlDiv.querySelector('#search_count')) {
18174
+ w = -Math.round(w);
18175
+ if (w == 0) w = -1;
18176
+ }
18177
+ config.map_search.width = w;
18178
+ controlDiv.querySelector("#modal-seach-parameters").style.display = 'none';
18179
+ controlDiv.querySelector("#modal-search-page").style.display = 'block';
18180
+ });
18181
+
18182
+
18183
+ if (gDelegate.hasClickSearch()) controlDiv.querySelector("#bmltsearch-clicksearch").addEventListener('click', clickSearch);
18133
18184
  [...controlDiv.getElementsByClassName('modal-close')].forEach((elem)=>elem.addEventListener('click', (e)=>closeModalWindow(e.target)));
18134
18185
  gSearchModal = controlDiv.querySelector("#bmltsearch_modal");
18135
18186
  gSearchModal.parentElement.removeChild(gSearchModal);
@@ -18224,14 +18275,14 @@ function MeetingMap(inConfig) {
18224
18275
  function hasMapSearch() {
18225
18276
  return 'map_search' in config;
18226
18277
  }
18227
- function loadFromCrouton(inDiv_id, meetings_responseObject, menuContext = null, handlebarMapOptions = null, fitBounds = true, callback) {
18278
+ function loadFromCrouton(inDiv_id, meetings_responseObject, menuContext = null, handlebarMapOptions = null, fitBounds = true, callback, hide) {
18228
18279
  if (!gDelegate.isApiLoaded()) {
18229
- preloadApiLoadedCallback(loadFromCrouton, [inDiv_id, meetings_responseObject, menuContext, handlebarMapOptions, fitBounds, callback]);
18280
+ preloadApiLoadedCallback(loadFromCrouton, [inDiv_id, meetings_responseObject, menuContext, handlebarMapOptions, fitBounds, callback, hide]);
18230
18281
  gDelegate.loadApi();
18231
18282
  return;
18232
18283
  }
18233
18284
  let inDiv = document.getElementById(inDiv_id);
18234
- loadMap(inDiv, menuContext, handlebarMapOptions,callback);
18285
+ loadMap(inDiv, menuContext, handlebarMapOptions, callback, hide);
18235
18286
  loadAllMeetings(meetings_responseObject, fitBounds, true);
18236
18287
  };
18237
18288
  function loadPopupMap(inDiv_id, meeting, handlebarMapOptions = null) {
@@ -18306,10 +18357,14 @@ function MeetingMap(inConfig) {
18306
18357
  };
18307
18358
  };
18308
18359
  function mapSearchGeocode(resp) {
18309
- let latlng = gDelegate.getGeocodeCenter(resp);
18360
+ showThrobber();
18310
18361
  if (document.getElementById("bmltsearch-goto-text"))
18311
18362
  document.getElementById("bmltsearch-goto-text").value = "";
18312
- showThrobber();
18363
+ let latlng = gDelegate.getGeocodeCenter(resp);
18364
+ if (!latlng) {
18365
+ hideThrobber();
18366
+ return;
18367
+ }
18313
18368
  crouton.searchByCoordinates(latlng.lat, latlng.lng, config.map_search.width);
18314
18369
  }
18315
18370
  function loadAllMeetings(meetings_responseObject, fitBounds=true, fitAll=false) {
@@ -18797,8 +18852,15 @@ function MapDelegate(config) {
18797
18852
  var gMainMap;
18798
18853
  var gTileLayer;
18799
18854
  var gClusterLayer = null;
18800
- function createMap(inDiv, inCenter) {
18855
+ function createMap(inDiv, inCenter, inHidden = false) {
18801
18856
  if (! inCenter ) return null;
18857
+ if ( inHidden ) {
18858
+ gDiv = inDiv;
18859
+ gDiv.style.height = 'auto';
18860
+ gDiv.style.marginBottom = '10px';
18861
+ gMainMap = null;
18862
+ return gDiv;
18863
+ }
18802
18864
  myOptions = {
18803
18865
  'minZoom': config.minZoom,
18804
18866
  'maxZoom': config.maxZoom,
@@ -18828,6 +18890,7 @@ function MapDelegate(config) {
18828
18890
  return gMainMap;
18829
18891
  }
18830
18892
  function addListener(ev,f,once) {
18893
+ if (!gMainMap) return;
18831
18894
  if (ev=='idle') {
18832
18895
  ev = 'moveend';
18833
18896
  }
@@ -18845,9 +18908,11 @@ function MapDelegate(config) {
18845
18908
  return {'event': ev, 'f': f};
18846
18909
  }
18847
18910
  function removeListener(o) {
18911
+ if (!gMainMap) return;
18848
18912
  gMainMap.off(o.event, o.f);
18849
18913
  }
18850
18914
  function setViewToPosition(position, filterMeetings, extra=null) {
18915
+ if (!gMainMap) return;
18851
18916
  var latlng = L.latLng(position.latitude, position.longitude);
18852
18917
  gMainMap.flyTo(latlng);
18853
18918
  gMainMap.once('moveend', function(ev) {
@@ -18869,10 +18934,12 @@ function MapDelegate(config) {
18869
18934
  }
18870
18935
  function clearAllMarkers ( )
18871
18936
  {
18937
+ if (!gMainMap) return;
18872
18938
  gAllMarkers && gAllMarkers.forEach((m) => {m.marker.closePopup(); gMainMap.removeLayer(m.marker)});
18873
18939
  gAllMarkers = [];
18874
18940
  };
18875
18941
  function getZoom() {
18942
+ if (!gMainMap) return null;
18876
18943
  return gMainMap.getZoom();
18877
18944
  }
18878
18945
  function getZoomAdjust(only_out,filterMeetings) {
@@ -18915,12 +18982,15 @@ function MapDelegate(config) {
18915
18982
  return ret;
18916
18983
  }
18917
18984
  function setZoom(filterMeetings, force=0) {
18985
+ if (!gMainMap) return;
18918
18986
  (force > 0) ? gMainMap.setZoom(force) : gMainMap.setZoom(getZoomAdjust(false,filterMeetings));
18919
18987
  }
18920
18988
  function zoomOut(filterMeetings) {
18989
+ if (!gMainMap) return;
18921
18990
  gMainMap.setZoom(getZoomAdjust(true,filterMeetings));
18922
18991
  }
18923
18992
  function fromLatLngToPoint(lat, lng) {
18993
+ if (!gMainMap) return null;
18924
18994
  return gMainMap.latLngToLayerPoint(L.latLng(lat,lng));
18925
18995
  }
18926
18996
  function createMarker ( inCoords, ///< The long/lat for the marker.
@@ -18930,6 +19000,7 @@ function MapDelegate(config) {
18930
19000
  in_ids
18931
19001
  )
18932
19002
  {
19003
+ if (!gMainMap) return;
18933
19004
  var in_main_icon = (multi ? g_icon_image_multi : g_icon_image_single);
18934
19005
 
18935
19006
  let highlightRow = function(target) {
@@ -18961,6 +19032,7 @@ function MapDelegate(config) {
18961
19032
  gAllMarkers.push( {ids: in_ids, marker: marker} );
18962
19033
  }
18963
19034
  function openMarker(id) {
19035
+ if (!gMainMap) return;
18964
19036
  marker = gAllMarkers.find((m) => m.ids.includes(id));
18965
19037
  if (marker) {
18966
19038
  marker.marker.openPopup();
@@ -18971,6 +19043,10 @@ function openMarker(id) {
18971
19043
  jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
18972
19044
  }
18973
19045
  function addControl(div,pos,cb) {
19046
+ if (!gMainMap) {
19047
+ gDiv.appendChild(div);
19048
+ return;
19049
+ }
18974
19050
  var ControlClass = L.Control.extend({
18975
19051
  onAdd: function (map) {
18976
19052
  return div;
@@ -19114,25 +19190,32 @@ function addControl(div,pos,cb) {
19114
19190
  geocode(in_loc, geoCodeParams, callback, filterMeetings);
19115
19191
  }
19116
19192
  function contains(bounds, lat, lng) {
19193
+ if (!gMainMap) return true;
19117
19194
  return bounds.contains(L.latLng ( lat, lng ));
19118
19195
  }
19119
19196
  function getBounds() {
19197
+ if (!gMainMap) return null;
19120
19198
  return gMainMap.getBounds();
19121
19199
  }
19122
19200
  function invalidateSize() {
19201
+ if (!gMainMap) return;
19123
19202
  gMainMap.invalidateSize();
19124
19203
  }
19125
19204
  function fitBounds(locations) {
19205
+ if (!gMainMap) return;
19126
19206
  const bounds = locations.reduce(function(b,lat_lng) {b.extend(lat_lng); return b;}, L.latLngBounds());
19127
19207
  gMainMap.fitBounds(bounds);
19128
19208
  }
19129
19209
  function createClusterLayer() {
19210
+ if (!gMainMap) return;
19130
19211
  gClusterLayer = L.markerClusterGroup();
19131
19212
  }
19132
19213
  function addClusterLayer() {
19214
+ if (!gMainMap) return;
19133
19215
  gClusterLayer && gMainMap.addLayer(gClusterLayer);
19134
19216
  }
19135
19217
  function removeClusterLayer() {
19218
+ if (!gMainMap) return;
19136
19219
  gClusterLayer && gMainMap.removeLayer(gClusterLayer);
19137
19220
  gClusterLayer = null;
19138
19221
  }
@@ -19155,6 +19238,9 @@ function addControl(div,pos,cb) {
19155
19238
  f();
19156
19239
  }
19157
19240
  function returnTrue() {return true;}
19241
+ function hasClickSearch() {
19242
+ return gMainMap != null;
19243
+ }
19158
19244
  this.createMap = createMap;
19159
19245
  this.addListener = addListener;
19160
19246
  this.removeListener = removeListener;
@@ -19181,6 +19267,7 @@ function addControl(div,pos,cb) {
19181
19267
  this.modalOn = modalOn;
19182
19268
  this.modalOff = modalOff;
19183
19269
  this.afterInit = afterInit;
19270
+ this.hasClickSearch = hasClickSearch;
19184
19271
  }
19185
19272
  MapDelegate.prototype.createMap = null;
19186
19273
  MapDelegate.prototype.addListener = null;
@@ -19208,6 +19295,7 @@ MapDelegate.prototype.getGeocodeCenter = null;
19208
19295
  MapDelegate.prototype.modalOn = null;
19209
19296
  MapDelegate.prototype.modalOff = null;
19210
19297
  MapDelegate.prototype.afterInit = null;
19298
+ MapDelegate.prototype.hasClickSearch = null;
19211
19299
 
19212
19300
  /* @preserve
19213
19301
  * Leaflet 1.5.1+Detached: 2e3e0ffbe87f246eb76d86d2633ddd59b262830b.2e3e0ff, a JS library for interactive maps. http://leafletjs.com