@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.
package/crouton-gmaps.js CHANGED
@@ -11413,6 +11413,8 @@ function CroutonLocalization(language) {
11413
11413
  "address_lookup_fail": "Die Adresse konnte nicht gefunden werden. Bitte versuchen Sie es erneut.",
11414
11414
  "contact": "Kontakt",
11415
11415
  "distance": "Entfernung",
11416
+ "all meetings": "Alle Meetings",
11417
+ 'upcoming meetings': "Nächste 24 Stunden",
11416
11418
  },
11417
11419
  'el-GR': {
11418
11420
  "days_of_the_week": ["", "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"],
@@ -11503,6 +11505,8 @@ function CroutonLocalization(language) {
11503
11505
  "meets virtually": "Διαδικτυακή ομάδα",
11504
11506
  "meets in person": "Φυσική ομάδα",
11505
11507
  "meets virtually and in person": "Διαδικτυακή και φυσική ομάδα",
11508
+ "all meetings": "Όλες οι ομάδες",
11509
+ "upcoming meetings": "Προσεχείς ομάδες",
11506
11510
  },
11507
11511
  "en-AU": {
11508
11512
  "days_of_the_week": ["", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
@@ -11869,6 +11873,8 @@ function CroutonLocalization(language) {
11869
11873
  "address": "Address",
11870
11874
  "comments": "Comments",
11871
11875
  "more info": "More Info",
11876
+ "all meetings": "All Meetings",
11877
+ 'upcoming meetings': "Upcoming Meetings",
11872
11878
  },
11873
11879
  "es-US": {
11874
11880
  "days_of_the_week": ["", "Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
@@ -15283,7 +15289,7 @@ function Crouton(config) {
15283
15289
  self.currentView = "weekday";
15284
15290
  self.distanceTabAllowed = false;
15285
15291
  self.config = {
15286
- version: '4.1.3', // CroutonJS version for debugging
15292
+ version: '4.1.5', // CroutonJS version for debugging
15287
15293
  on_complete: null, // Javascript function to callback when data querying is completed.
15288
15294
  root_server: null, // The root server to use.
15289
15295
  placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
@@ -15531,10 +15537,10 @@ function Crouton(config) {
15531
15537
  }
15532
15538
  } else if (viewName=='map') {
15533
15539
  self.mapView();
15534
- } else if (jQuery('#groupingButton_'+viewName.toUpperCase()).length == 0) {
15535
- self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName).field);
15540
+ } else if (jQuery('#groupingButton_'+viewName).length == 0) {
15541
+ self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName.toLowerCase()).field);
15536
15542
  } else {
15537
- self.groupedView(viewName.toUpperCase());
15543
+ self.groupedView(viewName);
15538
15544
  }
15539
15545
  };
15540
15546
 
@@ -16066,7 +16072,7 @@ function Crouton(config) {
16066
16072
  });
16067
16073
  return groups;
16068
16074
  }
16069
- Crouton.prototype.updateDistances = function() {
16075
+ Crouton.prototype.updateDistances = function(initial=false) {
16070
16076
  const self = this;
16071
16077
  var knt = 0;
16072
16078
  jQuery('.meeting-distance').each(function(index) {
@@ -16100,8 +16106,12 @@ function Crouton(config) {
16100
16106
  });
16101
16107
  }
16102
16108
  const sorted = parent.children().sort(function (a, b) {
16103
- const distanceA =parseFloat( jQuery(a).data('distance'));
16104
- const distanceB =parseFloat( jQuery(b).data('distance'));
16109
+ const idA =parseFloat( jQuery(a).data('meetingid').replace("meeting-data-row-", ""));
16110
+ const idB =parseFloat( jQuery(b).data('meetingid').replace("meeting-data-row-", ""));
16111
+ const dataA = self.meetingData.find((m) => m.id_bigint==idA);
16112
+ const dataB = self.meetingData.find((m) => m.id_bigint==idB);
16113
+ const distanceA = dataA ? parseFloat(dataA['distance_in_km']) : Number.POSITIVE_INFINITY;
16114
+ const distanceB = dataB ? parseFloat(dataB['distance_in_km']) : Number.POSITIVE_INFINITY;
16105
16115
  return (distanceA < distanceB) ? -1 : (distanceA > distanceB) ? 1 : 0;
16106
16116
  });
16107
16117
  parent.html(sorted);
@@ -16113,6 +16123,7 @@ function Crouton(config) {
16113
16123
  if (knt > 0) {
16114
16124
  jQuery('#groupingButton_distance_in_km').removeClass('hide');
16115
16125
  self.distanceTabAllowed = true;
16126
+ if (initial && self.config.view_by === "distance") self.groupedView("distance_in_km");
16116
16127
  }
16117
16128
  }
16118
16129
  self.registerPartial = function(name, template) {
@@ -16720,7 +16731,7 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
16720
16731
  });
16721
16732
 
16722
16733
  jQuery(".groupingButtonLogic").on('click', function (e) {
16723
- self.showView(e.target.attributes['data-field'].value.toLowerCase());
16734
+ self.showView(e.target.attributes['data-field'].value);
16724
16735
  });
16725
16736
  jQuery('#groupingButton_embeddedMapPage').on('click', function (e) {
16726
16737
  self.showView('map')
@@ -17318,19 +17329,19 @@ function MeetingMap(inConfig) {
17318
17329
  </label>
17319
17330
  </div>
17320
17331
  </div>`;
17321
- rules = [`.onoffswitch-inner:before {
17322
- content: "__text__";
17332
+ let rules = `.onoffswitch-inner:before {
17333
+ content: "__text1__";
17323
17334
  padding-left: 10px;
17324
17335
  background-color: #2d5c88; color: #FFFFFF;
17325
- }`,
17326
- `.onoffswitch-inner:after {
17327
- content: "__text__";
17336
+ }
17337
+ .onoffswitch-inner:after {
17338
+ content: "__text2__";
17328
17339
  padding-left: 30px;
17329
17340
  background-color: #EEEEEE; color: #2d5c88;
17330
17341
  text-align: left;
17331
- }`];
17332
- rules[0] = rules[0].replace("__text__", crouton.localization.getWord("Upcoming Meetings"));
17333
- rules[1] = rules[1].replace("__text__", crouton.localization.getWord("All Meetings"));
17342
+ }`
17343
+ .replace("__text1__", crouton.localization.getWord("Upcoming Meetings"))
17344
+ .replace("__text2__", crouton.localization.getWord("All Meetings"));
17334
17345
  var controlDiv = document.createElement('div');
17335
17346
  controlDiv.innerHTML = toggleSrc;
17336
17347
  controlDiv.querySelector(".onoffswitch").addEventListener('click', function (event) {
@@ -17340,8 +17351,9 @@ function MeetingMap(inConfig) {
17340
17351
  crouton.filterNext24(next24status);
17341
17352
  fitDuringFilter = true;
17342
17353
  });
17343
- document.styleSheets[0].insertRule(rules[0]);
17344
- document.styleSheets[0].insertRule(rules[1]);
17354
+ let style = document.createElement('style');
17355
+ style.innerHTML = rules;
17356
+ document.head.appendChild(style);
17345
17357
  return controlDiv;
17346
17358
  }
17347
17359
  function createMenuButton(menuContext) {
@@ -17540,7 +17552,7 @@ function MeetingMap(inConfig) {
17540
17552
  filterVisible(isFilterVisible());
17541
17553
  });
17542
17554
  gSearchPoint = {"lat": position.coords.latitude, "lng": position.coords.longitude};
17543
- crouton.updateDistances();
17555
+ crouton.updateDistances(true);
17544
17556
  },
17545
17557
  showGeocodingDialog
17546
17558
  );
@@ -18252,10 +18264,6 @@ function MapDelegate(in_config) {
18252
18264
  var worldPoint = gMainMap.getProjection().fromLatLngToPoint(latLng);
18253
18265
  return new google.maps.Point(worldPoint.x * scale, worldPoint.y * scale);
18254
18266
  };
18255
- function setZoom(filterMeetings) {
18256
- if (!gMainMap) return;
18257
- gMainMap.setZoom(getZoomAdjust(false,filterMeetings));
18258
- }
18259
18267
  function createClusterLayer() {
18260
18268
  gIsClustering = true;
18261
18269
  }
@@ -18390,6 +18398,7 @@ function openInfoWindow(marker) {
18390
18398
  });
18391
18399
  }
18392
18400
  function addControl(div,pos,cb) {
18401
+ if (!div) return;
18393
18402
  if (!gMainMap) {
18394
18403
  gDiv.appendChild(div);
18395
18404
  return;