@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.
package/crouton-core.css CHANGED
@@ -667,4 +667,7 @@ table.tablesaw {
667
667
  }
668
668
  .bmlt-rtl #meeting-details-contents td {
669
669
  text-align: right !important;
670
+ }
671
+ input#search_radius, input#search_count {
672
+ width: auto;
670
673
  }
package/crouton-core.js CHANGED
@@ -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");