@bmlt-enabled/croutonjs 4.1.3 → 4.1.5

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.
@@ -11410,6 +11410,8 @@ function CroutonLocalization(language) {
11410
11410
  "address_lookup_fail": "Die Adresse konnte nicht gefunden werden. Bitte versuchen Sie es erneut.",
11411
11411
  "contact": "Kontakt",
11412
11412
  "distance": "Entfernung",
11413
+ "all meetings": "Alle Meetings",
11414
+ 'upcoming meetings': "Nächste 24 Stunden",
11413
11415
  },
11414
11416
  'el-GR': {
11415
11417
  "days_of_the_week": ["", "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"],
@@ -11500,6 +11502,8 @@ function CroutonLocalization(language) {
11500
11502
  "meets virtually": "Διαδικτυακή ομάδα",
11501
11503
  "meets in person": "Φυσική ομάδα",
11502
11504
  "meets virtually and in person": "Διαδικτυακή και φυσική ομάδα",
11505
+ "all meetings": "Όλες οι ομάδες",
11506
+ "upcoming meetings": "Προσεχείς ομάδες",
11503
11507
  },
11504
11508
  "en-AU": {
11505
11509
  "days_of_the_week": ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -11866,6 +11870,8 @@ function CroutonLocalization(language) {
11866
11870
  "address": "Address",
11867
11871
  "comments": "Comments",
11868
11872
  "more info": "More Info",
11873
+ "all meetings": "All Meetings",
11874
+ 'upcoming meetings': "Upcoming Meetings",
11869
11875
  },
11870
11876
  "es-US": {
11871
11877
  "days_of_the_week": ["", "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
@@ -15280,7 +15286,7 @@ function Crouton(config) {
15280
15286
  self.currentView = "weekday";
15281
15287
  self.distanceTabAllowed = false;
15282
15288
  self.config = {
15283
- version: '4.1.3', // CroutonJS version for debugging
15289
+ version: '4.1.5', // CroutonJS version for debugging
15284
15290
  on_complete: null, // Javascript function to callback when data querying is completed.
15285
15291
  root_server: null, // The root server to use.
15286
15292
  placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
@@ -15528,10 +15534,10 @@ function Crouton(config) {
15528
15534
  }
15529
15535
  } else if (viewName=='map') {
15530
15536
  self.mapView();
15531
- } else if (jQuery('#groupingButton_'+viewName.toUpperCase()).length == 0) {
15532
- self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName).field);
15537
+ } else if (jQuery('#groupingButton_'+viewName).length == 0) {
15538
+ self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName.toLowerCase()).field);
15533
15539
  } else {
15534
- self.groupedView(viewName.toUpperCase());
15540
+ self.groupedView(viewName);
15535
15541
  }
15536
15542
  };
15537
15543
 
@@ -16063,7 +16069,7 @@ function Crouton(config) {
16063
16069
  });
16064
16070
  return groups;
16065
16071
  }
16066
- Crouton.prototype.updateDistances = function() {
16072
+ Crouton.prototype.updateDistances = function(initial=false) {
16067
16073
  const self = this;
16068
16074
  var knt = 0;
16069
16075
  jQuery('.meeting-distance').each(function(index) {
@@ -16097,8 +16103,12 @@ function Crouton(config) {
16097
16103
  });
16098
16104
  }
16099
16105
  const sorted = parent.children().sort(function (a, b) {
16100
- const distanceA =parseFloat( jQuery(a).data('distance'));
16101
- const distanceB =parseFloat( jQuery(b).data('distance'));
16106
+ const idA =parseFloat( jQuery(a).data('meetingid').replace("meeting-data-row-", ""));
16107
+ const idB =parseFloat( jQuery(b).data('meetingid').replace("meeting-data-row-", ""));
16108
+ const dataA = self.meetingData.find((m) => m.id_bigint==idA);
16109
+ const dataB = self.meetingData.find((m) => m.id_bigint==idB);
16110
+ const distanceA = dataA ? parseFloat(dataA['distance_in_km']) : Number.POSITIVE_INFINITY;
16111
+ const distanceB = dataB ? parseFloat(dataB['distance_in_km']) : Number.POSITIVE_INFINITY;
16102
16112
  return (distanceA < distanceB) ? -1 : (distanceA > distanceB) ? 1 : 0;
16103
16113
  });
16104
16114
  parent.html(sorted);
@@ -16110,6 +16120,7 @@ function Crouton(config) {
16110
16120
  if (knt > 0) {
16111
16121
  jQuery('#groupingButton_distance_in_km').removeClass('hide');
16112
16122
  self.distanceTabAllowed = true;
16123
+ if (initial && self.config.view_by === "distance") self.groupedView("distance_in_km");
16113
16124
  }
16114
16125
  }
16115
16126
  self.registerPartial = function(name, template) {
@@ -16717,7 +16728,7 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
16717
16728
  });
16718
16729
 
16719
16730
  jQuery(".groupingButtonLogic").on('click', function (e) {
16720
- self.showView(e.target.attributes['data-field'].value.toLowerCase());
16731
+ self.showView(e.target.attributes['data-field'].value);
16721
16732
  });
16722
16733
  jQuery('#groupingButton_embeddedMapPage').on('click', function (e) {
16723
16734
  self.showView('map')
@@ -17315,19 +17326,19 @@ function MeetingMap(inConfig) {
17315
17326
  </label>
17316
17327
  </div>
17317
17328
  </div>`;
17318
- rules = [`.onoffswitch-inner:before {
17319
- content: "__text__";
17329
+ let rules = `.onoffswitch-inner:before {
17330
+ content: "__text1__";
17320
17331
  padding-left: 10px;
17321
17332
  background-color: #2d5c88; color: #FFFFFF;
17322
- }`,
17323
- `.onoffswitch-inner:after {
17324
- content: "__text__";
17333
+ }
17334
+ .onoffswitch-inner:after {
17335
+ content: "__text2__";
17325
17336
  padding-left: 30px;
17326
17337
  background-color: #EEEEEE; color: #2d5c88;
17327
17338
  text-align: left;
17328
- }`];
17329
- rules[0] = rules[0].replace("__text__", crouton.localization.getWord("Upcoming Meetings"));
17330
- rules[1] = rules[1].replace("__text__", crouton.localization.getWord("All Meetings"));
17339
+ }`
17340
+ .replace("__text1__", crouton.localization.getWord("Upcoming Meetings"))
17341
+ .replace("__text2__", crouton.localization.getWord("All Meetings"));
17331
17342
  var controlDiv = document.createElement('div');
17332
17343
  controlDiv.innerHTML = toggleSrc;
17333
17344
  controlDiv.querySelector(".onoffswitch").addEventListener('click', function (event) {
@@ -17337,8 +17348,9 @@ function MeetingMap(inConfig) {
17337
17348
  crouton.filterNext24(next24status);
17338
17349
  fitDuringFilter = true;
17339
17350
  });
17340
- document.styleSheets[0].insertRule(rules[0]);
17341
- document.styleSheets[0].insertRule(rules[1]);
17351
+ let style = document.createElement('style');
17352
+ style.innerHTML = rules;
17353
+ document.head.appendChild(style);
17342
17354
  return controlDiv;
17343
17355
  }
17344
17356
  function createMenuButton(menuContext) {
@@ -17537,7 +17549,7 @@ function MeetingMap(inConfig) {
17537
17549
  filterVisible(isFilterVisible());
17538
17550
  });
17539
17551
  gSearchPoint = {"lat": position.coords.latitude, "lng": position.coords.longitude};
17540
- crouton.updateDistances();
17552
+ crouton.updateDistances(true);
17541
17553
  },
17542
17554
  showGeocodingDialog
17543
17555
  );