@bmlt-enabled/croutonjs 3.21.1 → 3.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crouton-gmaps.js CHANGED
@@ -14318,8 +14318,8 @@ this["hbs_Crouton"]["templates"]["header"] = Handlebars.template({"1":function(c
14318
14318
  };
14319
14319
 
14320
14320
  return ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"include_weekday_button") : stack1),{"name":"if","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":11}}})) != null ? stack1 : "")
14321
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"button_filters") : stack1),{"name":"each","hash":{},"fn":container.program(4, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":4},"end":{"line":8,"column":13}}})) != null ? stack1 : "")
14322
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"button_format_filters") : stack1),{"name":"each","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":4},"end":{"line":11,"column":13}}})) != null ? stack1 : "")
14321
+ + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"grouping_buttons") : stack1),{"name":"each","hash":{},"fn":container.program(4, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":4},"end":{"line":8,"column":13}}})) != null ? stack1 : "")
14322
+ + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"formattype_grouping_buttons") : stack1),{"name":"each","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":4},"end":{"line":11,"column":13}}})) != null ? stack1 : "")
14323
14323
  + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"map_page") : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":12,"column":4},"end":{"line":14,"column":11}}})) != null ? stack1 : "")
14324
14324
  + "\n"
14325
14325
  + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"dropdownData") : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":4},"end":{"line":25,"column":13}}})) != null ? stack1 : "")
@@ -14343,12 +14343,12 @@ this["hbs_Crouton"]["templates"]["header"] = Handlebars.template({"1":function(c
14343
14343
  return undefined
14344
14344
  };
14345
14345
 
14346
- return " <div class=\"bmlt-button-container\"><a id=\"filterButton_"
14346
+ return " <div class=\"bmlt-button-container\"><a id=\"groupingButton_"
14347
14347
  + alias2(alias1((depth0 != null ? lookupProperty(depth0,"field") : depth0), depth0))
14348
14348
  + "\" tabindex=0 data-field=\""
14349
14349
  + alias2(alias1((depth0 != null ? lookupProperty(depth0,"title") : depth0), depth0))
14350
- + "\" class=\"filterButton filterButtonLogic btn btn-primary btn-sm\">"
14351
- + alias2((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"title") : depth0),{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":7,"column":180},"end":{"line":7,"column":202}}}))
14350
+ + "\" class=\"groupingButton groupingButtonLogic btn btn-primary btn-sm\">"
14351
+ + alias2((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"title") : depth0),{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":7,"column":186},"end":{"line":7,"column":208}}}))
14352
14352
  + "</a></div>\n";
14353
14353
  },"6":function(container,depth0,helpers,partials,data) {
14354
14354
  var alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -14358,11 +14358,11 @@ this["hbs_Crouton"]["templates"]["header"] = Handlebars.template({"1":function(c
14358
14358
  return undefined
14359
14359
  };
14360
14360
 
14361
- return " <div class=\"bmlt-button-container\"><a id=\"filterButton_"
14361
+ return " <div class=\"bmlt-button-container\"><a id=\"groupingButton_"
14362
14362
  + alias2(alias1((depth0 != null ? lookupProperty(depth0,"field") : depth0), depth0))
14363
14363
  + "\"tabindex=0 data-field=\""
14364
14364
  + alias2(alias1((depth0 != null ? lookupProperty(depth0,"field") : depth0), depth0))
14365
- + "\" class=\"filterButton filterButtonLogic btn btn-primary btn-sm\">"
14365
+ + "\" class=\"groupingButton groupingButtonLogic btn btn-primary btn-sm\">"
14366
14366
  + alias2(alias1((depth0 != null ? lookupProperty(depth0,"title") : depth0), depth0))
14367
14367
  + "</a></div>\n";
14368
14368
  },"8":function(container,depth0,helpers,partials,data) {
@@ -14373,8 +14373,8 @@ this["hbs_Crouton"]["templates"]["header"] = Handlebars.template({"1":function(c
14373
14373
  return undefined
14374
14374
  };
14375
14375
 
14376
- return " <div class=\"bmlt-button-container\"><a id=\"filterButton_embeddedMapPage\" tabindex=0 data-field=\"embeddedMapPage\" class=\"filterButton btn btn-primary btn-sm\">"
14377
- + container.escapeExpression((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"map",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":13,"column":164},"end":{"line":13,"column":181}}}))
14376
+ return " <div class=\"bmlt-button-container\"><a id=\"groupingButton_embeddedMapPage\" tabindex=0 data-field=\"embeddedMapPage\" class=\"groupingButton btn btn-primary btn-sm\">"
14377
+ + container.escapeExpression((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"map",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":13,"column":168},"end":{"line":13,"column":185}}}))
14378
14378
  + "</a></div>\n";
14379
14379
  },"10":function(container,depth0,helpers,partials,data,blockParams,depths) {
14380
14380
  var stack1, helper, alias1=container.escapeExpression, alias2=depth0 != null ? depth0 : (container.nullContext || {}), alias3=container.hooks.helperMissing, alias4="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
@@ -14527,8 +14527,8 @@ this["hbs_Crouton"]["templates"]["main"] = Handlebars.template({"1":function(con
14527
14527
  + " hide\">\n"
14528
14528
  + ((stack1 = container.invokePartial(lookupProperty(partials,"header"),depth0,{"name":"header","data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
14529
14529
  + " </div>\n"
14530
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"buttonFilters") : stack1),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":1},"end":{"line":9,"column":10}}})) != null ? stack1 : "")
14531
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"buttonFormatFilters") : stack1),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":10}}})) != null ? stack1 : "")
14530
+ + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"groupingButtons") : stack1),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":1},"end":{"line":9,"column":10}}})) != null ? stack1 : "")
14531
+ + ((stack1 = lookupProperty(helpers,"each").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"meetings") : depth0)) != null ? lookupProperty(stack1,"formattypeGroupingButtons") : stack1),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":4},"end":{"line":14,"column":10}}})) != null ? stack1 : "")
14532
14532
  + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"config") : depth0)) != null ? lookupProperty(stack1,"map_page") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":4},"end":{"line":18,"column":11}}})) != null ? stack1 : "")
14533
14533
  + " <div id=\"byday\" class=\"bmlt-page "
14534
14534
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":19,"column":37},"end":{"line":19,"column":64}}}))
@@ -15021,7 +15021,7 @@ var croutonDefaultTemplates = {
15021
15021
  meetingpage_frame_template: `
15022
15022
  <div id="meeting_modal" class="modal bootstrap-bmlt" style="display: none;" tabindex="-1" >
15023
15023
  <div class="modal-content">
15024
- <span class="modal-title">{{getWord "Meeting Details"}}</span><span id="close_meeting_details" class="modal-close" style="position: absolute;right: 5px;top:10px;">×</span>
15024
+ <span class="modal-title">{{getWord "Meeting Details"}}</span><span id="close_meeting_details" class="modal-close" style="position: absolute;right: 5px;top:10px;">x</span>
15025
15025
  <table id="meeting-details-table" class="bmlt-table {{getWord 'css-direction'}} table table-striped table-hover table-bordered tablesaw tablesaw-stack meeting-details">
15026
15026
  <thead>
15027
15027
  <th id="meeting-details-title" colspan="2">
@@ -16134,25 +16134,6 @@ crouton_Handlebars.registerHelper("enrich", () => '');
16134
16134
  crouton_Handlebars.registerHelper('selectFormatPopup', () => "formatPopup");
16135
16135
  crouton_Handlebars.registerHelper('selectObserver', () => "observerTemplate");
16136
16136
 
16137
- const retrieveGeolocation = () => {
16138
- return new Promise((resolve, reject) => {
16139
- if (window.storedGeolocation) {
16140
- resolve(window.storedGeolocation);
16141
- } else if (navigator.geolocation) {
16142
- navigator.geolocation.getCurrentPosition((position) => {
16143
- window.storedGeolocation = {
16144
- latitude: position.coords.latitude,
16145
- longitude: position.coords.longitude
16146
- };
16147
- resolve(window.storedGeolocation);
16148
- }, (error) => {
16149
- reject(new Error('Error getting geolocation: ' + error.message));
16150
- });
16151
- } else {
16152
- reject(new Error('Geolocation is not supported by this browser.'));
16153
- }
16154
- });
16155
- };
16156
16137
 
16157
16138
  function Crouton(config) {
16158
16139
  var self = this;
@@ -16160,7 +16141,6 @@ function Crouton(config) {
16160
16141
  self.filtering = false;
16161
16142
  self.masterFormatCodes = [];
16162
16143
  self.currentView = "weekday";
16163
- self.max_filters = 10; // TODO: needs to be refactored so that dropdowns are treated dynamically
16164
16144
  self.config = {
16165
16145
  on_complete: null, // Javascript function to callback when data querying is completed.
16166
16146
  root_server: null, // The root server to use.
@@ -16174,11 +16154,11 @@ function Crouton(config) {
16174
16154
  header: true, // Shows the dropdowns and buttons
16175
16155
  include_weekday_button: true, // Shows the weekday button
16176
16156
  int_include_unpublished: 0, // Includes unpublished meeting
16177
- button_filters: [
16157
+ grouping_buttons: [
16178
16158
  {'title': 'City', 'field': 'location_municipality'},
16179
16159
  {'title': 'Distance', 'field': 'distance_in_km'},
16180
16160
  ],
16181
- button_format_filters: [],
16161
+ formattype_grouping_buttons: [],
16182
16162
  default_filter_dropdown: "", // Sets the default format for the dropdowns, the names will match the `has_` fields dropdowns without `has_. Example: `formats=closed`.
16183
16163
  show_map: "embed", // Shows the map with pins
16184
16164
  map_search: null, // Start search with map click (ex {"latitude":x,"longitude":y,"width":-10,"zoom":10}
@@ -16200,7 +16180,7 @@ function Crouton(config) {
16200
16180
  recurse_service_bodies: false,// Recurses service bodies when making service bodies request
16201
16181
  service_body: [], // Array of service bodies to return data for.
16202
16182
  formats: '', // Return only meetings with these formats (format shared-id, not key-string)
16203
- venue_types: '', // Return only meetings with this venue type (1, 2 or 3)
16183
+ venue_types: [], // Return only meetings with this venue type (1, 2 or 3)
16204
16184
  strict_datafields: true, // Only get the datafields that are mentioned in the templates
16205
16185
  meeting_details_href: '', // Link to the meeting details page
16206
16186
  virtual_meeting_details_href: '', // Link to the virtual meeting details page
@@ -16213,7 +16193,7 @@ function Crouton(config) {
16213
16193
  custom_query: null, // Enables overriding the services related queries for a custom one
16214
16194
  sort_keys: "start_time", // Controls sort keys on the query
16215
16195
  int_start_day_id: 1, // Controls the first day of the week sequence. Sunday is 1.
16216
- view_by: "weekday", // TODO: replace with using the first choice in button_filters as the default view_by.
16196
+ view_by: "weekday", // TODO: replace with using the first choice in grouping_buttons as the default view_by.
16217
16197
  show_qrcode: false, // Determines whether or not to show the QR code for virtual / phone meetings if they exist.
16218
16198
  force_rootserver_in_querystring: true, // Set to false to shorten generated meeting detail query strings
16219
16199
  force_timeformat_in_querystring: true, // Set to false to shorten generated meeting detail query strings
@@ -16397,6 +16377,9 @@ function Crouton(config) {
16397
16377
  return prev +'&formats[]='+id;
16398
16378
  }, '');
16399
16379
  }
16380
+ if (self.config.map_search && !Array.isArray(self.config['venue_types'])) {
16381
+ self.config['venue_types'] = [];
16382
+ }
16400
16383
  if (self.config.map_search && self.config['venue_types'].length === 0) {
16401
16384
  self.config['venue_types'].push('-2');
16402
16385
  }
@@ -16476,13 +16459,15 @@ function Crouton(config) {
16476
16459
  }
16477
16460
  } else if (viewName=='map') {
16478
16461
  self.mapView();
16462
+ } else if (jQuery('#groupingButton_'+viewName.toUpperCase()).length == 0) {
16463
+ self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName).field);
16479
16464
  } else {
16480
- self.filteredView(self.config.button_filters.find((bf) => bf.title.toLowerCase() === viewName).field);
16465
+ self.groupedView(viewName.toUpperCase());
16481
16466
  }
16482
16467
  };
16483
16468
 
16484
16469
  self.byDayView = function () {
16485
- self.lowlightButton(".filterButton");
16470
+ self.lowlightButton(".groupingButton");
16486
16471
  self.highlightButton("#day");
16487
16472
  jQuery('.bmlt-page').each(function (index) {
16488
16473
  self.hidePage("#" + this.id);
@@ -16495,7 +16480,7 @@ function Crouton(config) {
16495
16480
  };
16496
16481
 
16497
16482
  self.dayView = function () {
16498
- self.lowlightButton(".filterButton");
16483
+ self.lowlightButton(".groupingButton");
16499
16484
  self.highlightButton("#day");
16500
16485
  jQuery('.bmlt-page').each(function (index) {
16501
16486
  self.hidePage("#" + this.id);
@@ -16506,10 +16491,10 @@ function Crouton(config) {
16506
16491
  });
16507
16492
  };
16508
16493
 
16509
- self.filteredView = function (field) {
16494
+ self.groupedView = function (field) {
16510
16495
  self.lowlightButton("#day");
16511
- self.lowlightButton(".filterButton");
16512
- self.highlightButton("#filterButton_" + field);
16496
+ self.lowlightButton(".groupingButton");
16497
+ self.highlightButton("#groupingButton_" + field);
16513
16498
  jQuery('.bmlt-page').each(function (index) {
16514
16499
  self.hidePage("#" + this.id);
16515
16500
  self.showPage("#byfield_" + field);
@@ -16534,9 +16519,9 @@ function Crouton(config) {
16534
16519
  };
16535
16520
  self.mapView = function() {
16536
16521
  self.lowlightButton("#day");
16537
- self.lowlightButton(".filterButton");
16538
- self.highlightButton("#filterButton_embeddedMapPage");
16539
- self.filteredView("embeddedMapPage", false);
16522
+ self.lowlightButton(".groupingButton");
16523
+ self.highlightButton("#groupingButton_embeddedMapPage");
16524
+ self.groupedView("embeddedMapPage", false);
16540
16525
  croutonMap.showMap(false,false);
16541
16526
  }
16542
16527
  self.lowlightButton = function (id) {
@@ -16555,7 +16540,7 @@ function Crouton(config) {
16555
16540
  jQuery("#tab-pane").removeClass("show").addClass("hide");
16556
16541
  };
16557
16542
 
16558
- self.filteredPage = function () {
16543
+ self.filterMeetingsFromView = function () {
16559
16544
  jQuery(".meeting-header").removeClass("hide");
16560
16545
  jQuery(".bmlt-data-row").removeClass("hide");
16561
16546
  var filteringDropdown = false;
@@ -16626,8 +16611,27 @@ function Crouton(config) {
16626
16611
  window.crouton = self;
16627
16612
  croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,fitBounds,callback,self.config['noMap']);
16628
16613
  }
16614
+ self.retrieveGeolocation = function() {
16615
+ return new Promise((resolve, reject) => {
16616
+ if (window.storedGeolocation) {
16617
+ resolve(window.storedGeolocation);
16618
+ } else if (navigator.geolocation) {
16619
+ navigator.geolocation.getCurrentPosition((position) => {
16620
+ window.storedGeolocation = {
16621
+ latitude: position.coords.latitude,
16622
+ longitude: position.coords.longitude
16623
+ };
16624
+ resolve(window.storedGeolocation);
16625
+ }, (error) => {
16626
+ reject(new Error('Error getting geolocation: ' + error.message));
16627
+ });
16628
+ } else {
16629
+ reject(new Error('Geolocation is not supported by this browser.'));
16630
+ }
16631
+ });
16632
+ };
16629
16633
  self.getCurrentLocation = function(callback) {
16630
- retrieveGeolocation().then(position => {
16634
+ self.gretrieveGeolocation().then(position => {
16631
16635
  callback(position);
16632
16636
  }).catch(error => {
16633
16637
  jQuery('.geo').removeClass("hide").addClass("show").html(`<p>${error.message}</p>`);
@@ -16782,7 +16786,7 @@ function Crouton(config) {
16782
16786
  Crouton.prototype.filterNext24 = function(filterNow = true) {
16783
16787
  if (!filterNow) {
16784
16788
  jQuery("#filter-dropdown-next24").val('a-');
16785
- self.filteredPage();
16789
+ self.filterMeetingsFromView();
16786
16790
  return;
16787
16791
  }
16788
16792
  const date = new Date();
@@ -16811,33 +16815,9 @@ function Crouton(config) {
16811
16815
  row.dataset.next24 = (next24.includes(row.id.split('-').pop())) ? '1' : '0';
16812
16816
  });
16813
16817
  jQuery("#filter-dropdown-next24").val('a-1');
16814
- self.filteredPage();
16818
+ self.filterMeetingsFromView();
16815
16819
  }
16816
16820
 
16817
- self.distance = function(lat1, lon1, lat2, lon2, unit) {
16818
- if ((lat1 === lat2) && (lon1 === lon2)) {
16819
- return 0;
16820
- } else {
16821
- var radlat1 = Math.PI * lat1/180;
16822
- var radlat2 = Math.PI * lat2/180;
16823
- var theta = lon1-lon2;
16824
- var radtheta = Math.PI * theta/180;
16825
- var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);
16826
- if (dist > 1) {
16827
- dist = 1;
16828
- }
16829
- dist = Math.acos(dist);
16830
- dist = dist * 180/Math.PI;
16831
- dist = dist * 60 * 1.1515;
16832
- if (unit === "K") {
16833
- return dist * 1.609344;
16834
- } else if (unit === "N") {
16835
- return dist * 0.8684;
16836
- } else {
16837
- return dist;
16838
- }
16839
- }
16840
- };
16841
16821
  self.toFarsinNumber = function( n ) {
16842
16822
  const farsiDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
16843
16823
 
@@ -17024,6 +17004,17 @@ function Crouton(config) {
17024
17004
 
17025
17005
  Crouton.prototype.setConfig = function(config) {
17026
17006
  var self = this;
17007
+ const deprecatedNames = {
17008
+ button_filters: 'grouping_buttons',
17009
+ button_format_filters: 'formattype_grouping_buttons',
17010
+
17011
+ }
17012
+ for (var propertyName in deprecatedNames) {
17013
+ if (config.hasOwnProperty(propertyName)) {
17014
+ config[deprecatedNames[propertyName]] = config[propertyName];
17015
+ delete configconfig[deprecatedNames[propertyName]];
17016
+ }
17017
+ }
17027
17018
  for (var propertyName in config) {
17028
17019
  if (propertyName.indexOf("_template") > 0 && config[propertyName].trim() === "") {
17029
17020
  continue;
@@ -17081,7 +17072,7 @@ Crouton.prototype.reset = function() {
17081
17072
  };
17082
17073
 
17083
17074
  Crouton.prototype.doFilters = function() {
17084
- return this.filteredPage();
17075
+ return this.filterMeetingsFromView();
17085
17076
  }
17086
17077
  Crouton.prototype.getServiceBodyDetails = function(serviceBodyId) {
17087
17078
  var self = this;
@@ -17215,8 +17206,8 @@ Crouton.prototype.searchMap = function() {
17215
17206
  "config": self.config,
17216
17207
  "meetings": {
17217
17208
  "weekdays": [],
17218
- "buttonFilters": [],
17219
- "buttonFormatFilters": [],
17209
+ "groupingButtons": [],
17210
+ "formattypeGroupingButtons": [],
17220
17211
  "bydays": [],
17221
17212
  "meetingCount": 0,
17222
17213
  "meetingData": []
@@ -17229,7 +17220,7 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17229
17220
  var self = this;
17230
17221
 
17231
17222
  if (!self.config.map_search) {
17232
- self.config.button_filters = self.config.button_filters.filter((b) => !b.field.startsWith('distance'));
17223
+ self.config.grouping_buttons = self.config.grouping_buttons.filter((b) => !b.field.startsWith('distance'));
17233
17224
  if (self.config['view_by'] == 'distance') self.config['view_by'] = 'weekday';
17234
17225
  }
17235
17226
  self.lock(function() {
@@ -17276,8 +17267,8 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17276
17267
 
17277
17268
  var day_counter = 0;
17278
17269
  var byDayData = [];
17279
- var buttonFiltersData = {};
17280
- var buttonFormatFiltersData = {};
17270
+ var groupingButtonsData = {};
17271
+ var formattypeGroupingButtonsData = {};
17281
17272
  var weekdaysData = [];
17282
17273
  while (day_counter < 7) {
17283
17274
  var day = self.config.day_sequence[day_counter];
@@ -17293,63 +17284,63 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17293
17284
  "meetings": daysOfTheWeekMeetings
17294
17285
  });
17295
17286
 
17296
- for (var f = 0; f < self.config.button_filters.length; f++) {
17297
- var groupByName = self.config.button_filters[f]['field'];
17287
+ for (var f = 0; f < self.config.grouping_buttons.length; f++) {
17288
+ var groupByName = self.config.grouping_buttons[f]['field'];
17298
17289
  if (groupByName.startsWith('distance')) continue;
17299
17290
  var groupByData = getUniqueValuesOfKey(daysOfTheWeekMeetings, groupByName).sort();
17300
17291
  for (var i = 0; i < groupByData.length; i++) {
17301
17292
  var groupByMeetings = daysOfTheWeekMeetings.filterByObjectKeyValue(groupByName, groupByData[i]);
17302
- if (buttonFiltersData.hasOwnProperty(groupByName) && buttonFiltersData[groupByName].hasOwnProperty(groupByData[i])) {
17303
- buttonFiltersData[groupByName][groupByData[i]] = buttonFiltersData[groupByName][groupByData[i]].concat(groupByMeetings);
17304
- } else if (buttonFiltersData.hasOwnProperty(groupByName)) {
17305
- buttonFiltersData[groupByName][groupByData[i]] = groupByMeetings;
17293
+ if (groupingButtonsData.hasOwnProperty(groupByName) && groupingButtonsData[groupByName].hasOwnProperty(groupByData[i])) {
17294
+ groupingButtonsData[groupByName][groupByData[i]] = groupingButtonsData[groupByName][groupByData[i]].concat(groupByMeetings);
17295
+ } else if (groupingButtonsData.hasOwnProperty(groupByName)) {
17296
+ groupingButtonsData[groupByName][groupByData[i]] = groupByMeetings;
17306
17297
  } else {
17307
- buttonFiltersData[groupByName] = {};
17308
- buttonFiltersData[groupByName][groupByData[i]] = groupByMeetings;
17298
+ groupingButtonsData[groupByName] = {};
17299
+ groupingButtonsData[groupByName][groupByData[i]] = groupByMeetings;
17309
17300
  }
17310
17301
 
17311
17302
  }
17312
17303
  }
17313
17304
 
17314
- for (var f = 0; f < self.config.button_format_filters.length; f++) {
17315
- var groupByName = self.config.button_format_filters[f]['field'];
17305
+ for (var f = 0; f < self.config.formattype_grouping_buttons.length; f++) {
17306
+ var groupByName = self.config.formattype_grouping_buttons[f]['field'];
17316
17307
  var groupByData = getUniqueFormatsOfType(daysOfTheWeekMeetings, groupByName);
17317
17308
  if (groupByName=='LANG' && self.config.native_lang && self.config.native_lang.length > 0) {
17318
17309
  groupByData = groupByData.filter((f) => f.key != self.config.native_lang);
17319
17310
  }
17320
17311
  for (var i = 0; i < groupByData.length; i++) {
17321
17312
  var groupByMeetings = daysOfTheWeekMeetings.filter((item) => item.formats_expanded.map(f => f.key).indexOf(groupByData[i].key) >= 0);
17322
- if (buttonFormatFiltersData.hasOwnProperty(groupByName) && buttonFormatFiltersData[groupByName].hasOwnProperty(groupByData[i].description)) {
17323
- buttonFormatFiltersData[groupByName][groupByData[i].description] = buttonFormatFiltersData[groupByName][groupByData[i].description].concat(groupByMeetings);
17324
- } else if (buttonFormatFiltersData.hasOwnProperty(groupByName)) {
17325
- buttonFormatFiltersData[groupByName][groupByData[i].description] = groupByMeetings;
17313
+ if (formattypeGroupingButtonsData.hasOwnProperty(groupByName) && formattypeGroupingButtonsData[groupByName].hasOwnProperty(groupByData[i].description)) {
17314
+ formattypeGroupingButtonsData[groupByName][groupByData[i].description] = formattypeGroupingButtonsData[groupByName][groupByData[i].description].concat(groupByMeetings);
17315
+ } else if (formattypeGroupingButtonsData.hasOwnProperty(groupByName)) {
17316
+ formattypeGroupingButtonsData[groupByName][groupByData[i].description] = groupByMeetings;
17326
17317
  } else {
17327
- buttonFormatFiltersData[groupByName] = {};
17328
- buttonFormatFiltersData[groupByName][groupByData[i].description] = groupByMeetings;
17318
+ formattypeGroupingButtonsData[groupByName] = {};
17319
+ formattypeGroupingButtonsData[groupByName][groupByData[i].description] = groupByMeetings;
17329
17320
  }
17330
17321
  }
17331
17322
  }
17332
17323
  day_counter++;
17333
17324
  }
17334
17325
 
17335
- var buttonFiltersDataSorted = {};
17336
- for (var b = 0; b < self.config.button_filters.length; b++) {
17337
- var groupByName = self.config.button_filters[b]['field'];
17338
- buttonFiltersDataSorted[groupByName] = {};
17326
+ var groupingButtonsDataSorted = {};
17327
+ for (var b = 0; b < self.config.grouping_buttons.length; b++) {
17328
+ var groupByName = self.config.grouping_buttons[b]['field'];
17329
+ groupingButtonsDataSorted[groupByName] = {};
17339
17330
  if (groupByName.startsWith('distance')) {
17340
- buttonFiltersDataSorted[groupByName]['Sorted by Distance'] = [...self.meetingData].sort((a,b) => a['distance_in_km'] - b['distance_in_km']);
17331
+ groupingButtonsDataSorted[groupByName]['Sorted by Distance'] = [...self.meetingData].sort((a,b) => a['distance_in_km'] - b['distance_in_km']);
17341
17332
  continue;
17342
17333
  }
17343
17334
  var sortKey = [];
17344
17335
 
17345
- for (var buttonFiltersDataItem in buttonFiltersData[groupByName]) {
17346
- sortKey.push(buttonFiltersDataItem);
17336
+ for (var groupingButtonsDataItem in groupingButtonsData[groupByName]) {
17337
+ sortKey.push(groupingButtonsDataItem);
17347
17338
  }
17348
17339
 
17349
17340
  sortKey.sort();
17350
17341
 
17351
17342
  for (var s = 0; s < sortKey.length; s++) {
17352
- buttonFiltersDataSorted[groupByName][sortKey[s]] = buttonFiltersData[groupByName][sortKey[s]]
17343
+ groupingButtonsDataSorted[groupByName][sortKey[s]] = groupingButtonsData[groupByName][sortKey[s]]
17353
17344
  }
17354
17345
  }
17355
17346
 
@@ -17424,8 +17415,8 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17424
17415
  "config": self.config,
17425
17416
  "meetings": {
17426
17417
  "weekdays": weekdaysData,
17427
- "buttonFilters": buttonFiltersDataSorted,
17428
- "buttonFormatFilters": buttonFormatFiltersData,
17418
+ "groupingButtons": groupingButtonsDataSorted,
17419
+ "formattypeGroupingButtons": formattypeGroupingButtonsData,
17429
17420
  "bydays": byDayData,
17430
17421
  "meetingCount": self.meetingData.length,
17431
17422
  "meetingData": self.meetingData
@@ -17478,17 +17469,17 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17478
17469
  });
17479
17470
 
17480
17471
  jQuery('.filter-dropdown').on('select2:select', function (e) {
17481
- self.filteredPage();
17472
+ self.filterMeetingsFromView();
17482
17473
  });
17483
17474
 
17484
17475
  jQuery("#day").on('click', function () {
17485
17476
  self.showView('day');
17486
17477
  });
17487
17478
 
17488
- jQuery(".filterButtonLogic").on('click', function (e) {
17479
+ jQuery(".groupingButtonLogic").on('click', function (e) {
17489
17480
  self.showView(e.target.attributes['data-field'].value.toLowerCase());
17490
17481
  });
17491
- jQuery('#filterButton_embeddedMapPage').on('click', function (e) {
17482
+ jQuery('#groupingButton_embeddedMapPage').on('click', function (e) {
17492
17483
  self.showView('map')
17493
17484
  });
17494
17485
  /****
@@ -17527,7 +17518,7 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17527
17518
  }
17528
17519
  if (self.config['map_page'] && !doMeetingMap) {
17529
17520
  if (self.meetingData.filter(m => m.venue_type != 2).length==0) {
17530
- jQuery('#filterButton_embeddedMapPage').addClass('hide');
17521
+ jQuery('#groupingButton_embeddedMapPage').addClass('hide');
17531
17522
  }
17532
17523
  else croutonMap.initialize('byfield_embeddedMapPage', self.meetingData);
17533
17524
  }
@@ -17850,7 +17841,7 @@ Crouton.prototype.simulateFilterDropdown = function() {
17850
17841
  jQuery('.bmlt-page:not(#byfield_embeddedMapPage)').each(function () {
17851
17842
  self.hidePage(this);
17852
17843
  });
17853
- self.filteredPage();
17844
+ self.filterMeetingsFromView();
17854
17845
  }
17855
17846
  Crouton.prototype.getAdjustedDateTime = function(meeting_day, meeting_time, meeting_time_zone) {
17856
17847
  var timeZoneAware = this.config['auto_tz_adjust'] === true || this.config['auto_tz_adjust'] === "true";