@bmlt-enabled/croutonjs 4.1.4 → 4.1.6

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.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.4', // CroutonJS version for debugging
15292
+ version: '4.1.6', // 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
@@ -15321,7 +15327,7 @@ function Crouton(config) {
15321
15327
  has_meeting_count: false, // Shows the meeting count
15322
15328
  recurse_service_bodies: false,// Recurses service bodies when making service bodies request
15323
15329
  service_body: [], // Array of service bodies to return data for.
15324
- formats: '', // Return only meetings with these formats (format shared-id, not key-string)
15330
+ formats: [], // Return only meetings with these formats (format shared-id, not key-string)
15325
15331
  venue_types: [], // Return only meetings with this venue type (1, 2 or 3)
15326
15332
  meeting_details_href: '', // Link to the meeting details page
15327
15333
  virtual_meeting_details_href: '', // Link to the virtual meeting details page
@@ -15439,6 +15445,7 @@ function Crouton(config) {
15439
15445
  url += self.config['formats'].reduce(function(prev,id) {
15440
15446
  return prev +'&formats[]='+id;
15441
15447
  }, '');
15448
+ if (self.config['formatComparisonOp'] === 'OR') url += '&formats_comparison_operator=OR';
15442
15449
  }
15443
15450
  if (self.config.map_search && !Array.isArray(self.config['venue_types'])) {
15444
15451
  self.config['venue_types'] = [];
@@ -15531,10 +15538,10 @@ function Crouton(config) {
15531
15538
  }
15532
15539
  } else if (viewName=='map') {
15533
15540
  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);
15541
+ } else if (jQuery('#groupingButton_'+viewName).length == 0) {
15542
+ self.groupedView(self.config.grouping_buttons.find((bf) => bf.title.toLowerCase() === viewName.toLowerCase()).field);
15536
15543
  } else {
15537
- self.groupedView(viewName.toUpperCase());
15544
+ self.groupedView(viewName);
15538
15545
  }
15539
15546
  };
15540
15547
 
@@ -16066,7 +16073,7 @@ function Crouton(config) {
16066
16073
  });
16067
16074
  return groups;
16068
16075
  }
16069
- Crouton.prototype.updateDistances = function() {
16076
+ Crouton.prototype.updateDistances = function(initial=false) {
16070
16077
  const self = this;
16071
16078
  var knt = 0;
16072
16079
  jQuery('.meeting-distance').each(function(index) {
@@ -16117,6 +16124,7 @@ function Crouton(config) {
16117
16124
  if (knt > 0) {
16118
16125
  jQuery('#groupingButton_distance_in_km').removeClass('hide');
16119
16126
  self.distanceTabAllowed = true;
16127
+ if (initial && self.config.view_by === "distance") self.groupedView("distance_in_km");
16120
16128
  }
16121
16129
  }
16122
16130
  self.registerPartial = function(name, template) {
@@ -16724,7 +16732,7 @@ Crouton.prototype.render = function(doMeetingMap = false, fitBounds=true) {
16724
16732
  });
16725
16733
 
16726
16734
  jQuery(".groupingButtonLogic").on('click', function (e) {
16727
- self.showView(e.target.attributes['data-field'].value.toLowerCase());
16735
+ self.showView(e.target.attributes['data-field'].value);
16728
16736
  });
16729
16737
  jQuery('#groupingButton_embeddedMapPage').on('click', function (e) {
16730
16738
  self.showView('map')
@@ -17322,19 +17330,19 @@ function MeetingMap(inConfig) {
17322
17330
  </label>
17323
17331
  </div>
17324
17332
  </div>`;
17325
- rules = [`.onoffswitch-inner:before {
17326
- content: "__text__";
17333
+ let rules = `.onoffswitch-inner:before {
17334
+ content: "__text1__";
17327
17335
  padding-left: 10px;
17328
17336
  background-color: #2d5c88; color: #FFFFFF;
17329
- }`,
17330
- `.onoffswitch-inner:after {
17331
- content: "__text__";
17337
+ }
17338
+ .onoffswitch-inner:after {
17339
+ content: "__text2__";
17332
17340
  padding-left: 30px;
17333
17341
  background-color: #EEEEEE; color: #2d5c88;
17334
17342
  text-align: left;
17335
- }`];
17336
- rules[0] = rules[0].replace("__text__", crouton.localization.getWord("Upcoming Meetings"));
17337
- rules[1] = rules[1].replace("__text__", crouton.localization.getWord("All Meetings"));
17343
+ }`
17344
+ .replace("__text1__", crouton.localization.getWord("Upcoming Meetings"))
17345
+ .replace("__text2__", crouton.localization.getWord("All Meetings"));
17338
17346
  var controlDiv = document.createElement('div');
17339
17347
  controlDiv.innerHTML = toggleSrc;
17340
17348
  controlDiv.querySelector(".onoffswitch").addEventListener('click', function (event) {
@@ -17344,8 +17352,9 @@ function MeetingMap(inConfig) {
17344
17352
  crouton.filterNext24(next24status);
17345
17353
  fitDuringFilter = true;
17346
17354
  });
17347
- document.styleSheets[0].insertRule(rules[0]);
17348
- document.styleSheets[0].insertRule(rules[1]);
17355
+ let style = document.createElement('style');
17356
+ style.innerHTML = rules;
17357
+ document.head.appendChild(style);
17349
17358
  return controlDiv;
17350
17359
  }
17351
17360
  function createMenuButton(menuContext) {
@@ -17544,7 +17553,7 @@ function MeetingMap(inConfig) {
17544
17553
  filterVisible(isFilterVisible());
17545
17554
  });
17546
17555
  gSearchPoint = {"lat": position.coords.latitude, "lng": position.coords.longitude};
17547
- crouton.updateDistances();
17556
+ crouton.updateDistances(true);
17548
17557
  },
17549
17558
  showGeocodingDialog
17550
17559
  );
@@ -18331,6 +18340,7 @@ function openMarker(id) {
18331
18340
  jQuery("#meeting-data-row-" + id + " > td").addClass("rowHighlight");
18332
18341
  }
18333
18342
  function addControl(div,pos,cb) {
18343
+ if (!div) return;
18334
18344
  if (!gMainMap) {
18335
18345
  gDiv.appendChild(div);
18336
18346
  return;