@bmlt-enabled/croutonjs 3.18.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crouton-core.js CHANGED
@@ -13311,7 +13311,7 @@ function CroutonLocalization(language) {
13311
13311
  "no_meetings_for_this_day": "Keine Meetings an diesem Tag.",
13312
13312
  'css-textalign': '',
13313
13313
  'css-floatdirection': '',
13314
- 'all': 'All',
13314
+ 'all': 'Alle',
13315
13315
  'menu': 'Menu',
13316
13316
  'search for meetings': 'Search for meetings',
13317
13317
  'show meetings near...': 'Meetings in andere Städten',
@@ -14496,7 +14496,7 @@ this["hbs_Crouton"]["templates"]["mapSearch"] = Handlebars.template({"compiler":
14496
14496
  return undefined
14497
14497
  };
14498
14498
 
14499
- return "<button id=\"map-search-button\" class=\"menu-button\" title=\"Erweiterte Suche\" style=\"width: 95px; height:55px;\">\n <span class=\"menu-button-label\" style=\"position:initial;\">"
14499
+ return "<button id=\"map-search-button\" class=\"menu-button\" title=\"Erweiterte Suche\">\n <span class=\"menu-button-label\" style=\"position:initial;\">"
14500
14500
  + 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}}}))
14501
14501
  + "</span>\n</button>\n<div id=\"bmltsearch_modal\" class=\"modal\" style=\"display: none;\">\n <div id=\"bmltsearch_content\" class=\"modal-content\">\n <span class=\"modal-title\">"
14502
14502
  + alias3((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"Search for meetings",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":28},"end":{"line":6,"column":61}}}))
@@ -14796,7 +14796,7 @@ var croutonDefaultTemplates = {
14796
14796
 
14797
14797
  meeting_count_template: [
14798
14798
  "{{#if this.config.has_meeting_count}}",
14799
- "<span class='bmlt_tabs_meeting_count'>{{getWord 'meeting_count'}} <span id='bmlt_tabs_meeting_count'>{{this.meetings.meetingCount}}</span></span>",
14799
+ "<span class='bmlt_tabs_meeting_count'>{{getWord 'meeting_count'}} <span id='bmlt_tabs_meeting_count-live'>{{this.meetings.meetingCount}}</span></span>",
14800
14800
  "{{/if}}"
14801
14801
  ].join('\n'),
14802
14802
 
@@ -15985,7 +15985,6 @@ function Crouton(config) {
15985
15985
  theme: "jack", // Allows for setting pre-packaged themes. Choices are listed here: https://github.com/bmlt-enabled/crouton/blob/master/croutonjs/dist/templates/themes
15986
15986
  meeting_data_template: croutonDefaultTemplates.meeting_data_template,
15987
15987
  metadata_template: croutonDefaultTemplates.metadata_template,
15988
- marker_contents_template: croutonDefaultTemplates.marker_contents_template,
15989
15988
  observer_template: croutonDefaultTemplates.observer_template,
15990
15989
  meeting_count_template: croutonDefaultTemplates.meeting_count_template,
15991
15990
  meeting_link_template: croutonDefaultTemplates.meeting_link_template,
@@ -15993,7 +15992,6 @@ function Crouton(config) {
15993
15992
  meetingpage_title_template: croutonDefaultTemplates.meetingpage_title_template,
15994
15993
  meetingpage_contents_template: croutonDefaultTemplates.meetingpage_contents_template,
15995
15994
  meetingpage_frame_template: croutonDefaultTemplates.meetingpage_frame_template,
15996
- marker_contents_template: croutonDefaultTemplates.marker_contents_template,
15997
15995
  lat: 0,
15998
15996
  lng: 0,
15999
15997
  zoom: 10,
@@ -16317,7 +16315,7 @@ function Crouton(config) {
16317
16315
  showingNow.push(rowId[rowId.length-1]);
16318
16316
  });
16319
16317
  showingNow = [...new Set(showingNow)];
16320
- self.updateMeetingCount(showingNow.length);
16318
+ self.updateMeetingCount(showingNow);
16321
16319
  self.updateFilters();
16322
16320
  if (croutonMap) croutonMap.fillMap(showingNow);
16323
16321
  if (self.config.map_page) {
@@ -16356,7 +16354,7 @@ function Crouton(config) {
16356
16354
  } else if (self.config.show_map) croutonMap.fillMap();
16357
16355
  self.filtering = false;
16358
16356
  self.updateFilters();
16359
- self.updateMeetingCount(self.meetingData.length);
16357
+ self.updateMeetingCount();
16360
16358
  jQuery(".filter-dropdown").val(null).trigger("change");
16361
16359
  jQuery(".meeting-header").removeClass("hide");
16362
16360
  jQuery(".bmlt-data-row").removeClass("hide");
@@ -16386,13 +16384,13 @@ function Crouton(config) {
16386
16384
  dropdown.optionsShowing = dropdown.uniqueData(showing).map((o) => dropdown.optionName(o));
16387
16385
  });
16388
16386
  }
16389
- self.renderStandaloneMap = function (selector, context, callback) {
16387
+ self.renderStandaloneMap = function (selector, context, callback=null, fitBounds=true) {
16390
16388
  hbs_Crouton['localization'] = self.localization;
16391
16389
  self.config["hide_byday_headers"] = true;
16392
16390
  crouton_Handlebars.registerPartial('meetings', hbs_Crouton.templates['meetings']);
16393
16391
  crouton_Handlebars.registerPartial('bydays', hbs_Crouton.templates['byday']);
16394
16392
  crouton_Handlebars.registerPartial('formatPopup', hbs_Crouton.templates['formatPopup']);
16395
- croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,callback);
16393
+ croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,fitBounds,callback);
16396
16394
  }
16397
16395
  self.getCurrentLocation = function(callback) {
16398
16396
  if (navigator.geolocation) {
@@ -16401,7 +16399,7 @@ function Crouton(config) {
16401
16399
  $('.geo').removeClass("hide").addClass("show").html('<p>Geolocation is not supported by your browser</p>');
16402
16400
  }
16403
16401
  };
16404
- self.renderView = function (selector, context, callback) {
16402
+ self.renderView = function (selector, context, callback, fitBounds) {
16405
16403
  hbs_Crouton['localization'] = self.localization;
16406
16404
  crouton_Handlebars.registerPartial('meetings', hbs_Crouton.templates['meetings']);
16407
16405
  crouton_Handlebars.registerPartial('bydays', hbs_Crouton.templates['byday']);
@@ -16413,8 +16411,45 @@ function Crouton(config) {
16413
16411
  jQuery(selector).html(template(context));
16414
16412
  callback();
16415
16413
  };
16416
- self.updateMeetingCount = function(meetingCount) {
16417
- jQuery('#bmlt_tabs_meeting_count').html(meetingCount);
16414
+ self.updateMeetingCount = function(showingNow=null) {
16415
+ self = this;
16416
+ let meetingCount = self.meetingData.length;
16417
+ addLive = function(id) {return id+", "+id+"-live"};
16418
+ if (showingNow !== null) {
16419
+ meetingCount = showingNow.length;
16420
+ addLive = function(id) {return id+"-live"};
16421
+ }
16422
+ jQuery(addLive('#bmlt_tabs_meeting_count')).text(meetingCount);
16423
+ jQuery(addLive('#bmlt_tabs_group_count')).each(function(){
16424
+ var filteredMeetings = self.meetingData;
16425
+ if (showingNow!==null) filteredMeetings = self.meetingData.filter((m) => showingNow.includes(m.id_bigint));
16426
+ var groups = filteredMeetings.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name']);
16427
+ jQuery(this).text(arrayUnique(groups).length);
16428
+ });
16429
+ jQuery(addLive('#bmlt_tabs_service_body_names')).each(function() {
16430
+ var filteredMeetings = self.meetingData;
16431
+ if (showingNow!==null) filteredMeetings = self.meetingData.filter((m) => showingNow.includes(m.id_bigint));
16432
+ var ids = getUniqueValuesOfKey(filteredMeetings, 'service_body_bigint');
16433
+ var me = this;
16434
+ self.getServiceBodies(ids).then(function (service_bodies) {
16435
+ var n = service_bodies.length;
16436
+ var names = service_bodies.map((m)=>m['name']);
16437
+ names.sort();
16438
+ var ret = "";
16439
+ if (n===1) {
16440
+ ret = names[0];
16441
+ }
16442
+ else {
16443
+ ret = names[0];
16444
+ for (var j = 1; j < n-1; j++) {
16445
+ ret += ', ';
16446
+ ret += names[j];
16447
+ }
16448
+ ret += ' and ' + names[n-1];
16449
+ }
16450
+ jQuery(me).text(ret);
16451
+ });
16452
+ });
16418
16453
  }
16419
16454
  self.getServiceBodies = function(service_bodies_id) {
16420
16455
  var requires_parents = self.config.has_regions;
@@ -16559,9 +16594,6 @@ function Crouton(config) {
16559
16594
  self.filteredPage();
16560
16595
  }
16561
16596
 
16562
- self.isMeetingInTime = function(meeting, dayNow, hour, mins) {
16563
-
16564
- }
16565
16597
  self.distance = function(lat1, lon1, lat2, lon2, unit) {
16566
16598
  if ((lat1 === lat2) && (lon1 === lon2)) {
16567
16599
  return 0;
@@ -16596,14 +16628,12 @@ function Crouton(config) {
16596
16628
 
16597
16629
  crouton_Handlebars.registerPartial("meetingDataTemplate", self.config['meeting_data_template']);
16598
16630
  crouton_Handlebars.registerPartial("metaDataTemplate", self.config['metadata_template']);
16599
- crouton_Handlebars.registerPartial("popupTemplate", self.config['marker_contents_template']);
16600
16631
  crouton_Handlebars.registerPartial("observerTemplate", self.config['observer_template']);
16601
16632
  crouton_Handlebars.registerPartial("meetingpageTitleTemplate", self.config['meetingpage_title_template']);
16602
16633
  crouton_Handlebars.registerPartial("meetingpageContentsTemplate", self.config['meetingpage_contents_template']);
16603
16634
  crouton_Handlebars.registerPartial("meetingCountTemplate", self.config['meeting_count_template']);
16604
16635
  crouton_Handlebars.registerPartial("meetingLink", self.config['meeting_link_template']);
16605
16636
  crouton_Handlebars.registerPartial("meetingModal", self.config['meeting_modal_template']);
16606
- crouton_Handlebars.registerPartial("markerContentsTemplate", self.config['marker_contents_template']);
16607
16637
 
16608
16638
  for (var m = 0; m < meetingData.length; m++) {
16609
16639
  meetingData[m]['formatted_comments'] = meetingData[m]['comments'];
@@ -16810,52 +16840,6 @@ Crouton.prototype.reset = function() {
16810
16840
  jQuery("#" + self.config["placeholder_id"]).html("");
16811
16841
  };
16812
16842
 
16813
- Crouton.prototype.meetingCount = function(callback) {
16814
- var self = this;
16815
- self.lock(function() {
16816
- callback(self.meetingData.length);
16817
- });
16818
- };
16819
-
16820
- Crouton.prototype.groupCount = function(callback) {
16821
- var self = this;
16822
- self.lock(function() {
16823
- var groups = [];
16824
- for (var i = 0; i < self.meetingData.length; i++) {
16825
- groups.push(self.meetingData[i]['worldid_mixed'] !== "" ? self.meetingData[i]['worldid_mixed'] : self.meetingData[i]['meeting_name']);
16826
- }
16827
- callback(arrayUnique(groups).length);
16828
- });
16829
- };
16830
-
16831
- Crouton.prototype.serviceBodyNames = function(callback) {
16832
- var self = this;
16833
- self.lock(function() {
16834
- var ids = getUniqueValuesOfKey(self.meetingData, 'service_body_bigint');
16835
- self.getServiceBodies(ids).then(function (service_bodies) {
16836
- var n = service_bodies.length;
16837
- var names = [];
16838
- for (var i = 0; i < n; i++) {
16839
- names.push(service_bodies[i]['name']);
16840
- }
16841
- names.sort();
16842
- if (n===1) {
16843
- callback(names[0]);
16844
- }
16845
- else if (n===2) {
16846
- callback(names[0] + ' and ' + names[1]);
16847
- }
16848
- else {
16849
- var str = '';
16850
- for (var j = 0; j < n-1; j++) {
16851
- str += names[j];
16852
- str += ', ';
16853
- }
16854
- callback(str + ' and ' + names[n-1]);
16855
- }
16856
- });
16857
- });
16858
- };
16859
16843
  Crouton.prototype.doFilters = function() {
16860
16844
  return this.filteredPage();
16861
16845
  }
@@ -16955,7 +16939,7 @@ Crouton.prototype.searchMap = function() {
16955
16939
  "meetingData": []
16956
16940
  },
16957
16941
  "dropdownData": [],
16958
- "location": {'latitude':0,'longitude':0,'zoom':10}
16942
+ "location": {'latitude':0,'longitude':0,'zoom':10} // TODO: Where is this used?
16959
16943
  });
16960
16944
  }
16961
16945
  Crouton.prototype.render = function(doMeetingMap = false) {
@@ -17265,16 +17249,16 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17265
17249
  croutonMap.initialize(self.createBmltMapElement(), self.meetingData);
17266
17250
  jQuery("#bmlt-map").removeClass("hide");
17267
17251
  }
17268
- if (self.config['map_page']) {
17252
+ if (self.config['map_page'] && !doMeetingMap) {
17269
17253
  croutonMap.initialize('byfield_embeddedMapPage', self.meetingData);
17270
17254
  }
17271
17255
  if (self.config['refresh_map']) {
17272
- croutonMap.refreshMeetings(self.meetingData, 0, '', true);
17256
+ croutonMap.refreshMeetings(self.meetingData, true, true);
17273
17257
  }
17274
17258
  if (self.config['on_complete'] != null && isFunction(self.config['on_complete'])) {
17275
17259
  self.config['on_complete']();
17276
17260
  }
17277
- });
17261
+ }, !doMeetingMap);
17278
17262
  });
17279
17263
  });
17280
17264
  };