@bmlt-enabled/croutonjs 4.1.1 → 4.1.3

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
@@ -11979,7 +11979,7 @@ function CroutonLocalization(language) {
11979
11979
  "google_directions": "مسیرهای Google به جلسه",
11980
11980
  "apple_directions": "مسیرهای Apple به جلسه",
11981
11981
  "no_meetings_for_this_day": "هیچ جلسه ای در این روز وجود ندارد",
11982
- "css-direction: bmlt-rtl": "",
11982
+ "css-direction": "bmlt-rtl",
11983
11983
  "bootstrap-popover-placement": "left",
11984
11984
  "adjust search": "تنظیم جستجو",
11985
11985
  "this number represents": "این عدد نشان دهنده",
@@ -13282,7 +13282,9 @@ this["hbs_Crouton"]["templates"]["groupDetails"] = Handlebars.template({"1":func
13282
13282
  return undefined
13283
13283
  };
13284
13284
 
13285
- return "<div class=\"card group\">\n <div class=\"card-body\">\n <div class=\"card-title header-elements\" style=\"display: flex; justify-content:space-between; align-items:center;\">\n"
13285
+ return "<div class=\"card group "
13286
+ + container.escapeExpression((lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-direction",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":50}}}))
13287
+ + "\">\n <div class=\"card-body\">\n <div class=\"card-title header-elements\" style=\"display: flex; justify-content:space-between; align-items:center;\">\n"
13286
13288
  + ((stack1 = container.invokePartial(lookupProperty(partials,"groupTitle"),depth0,{"name":"groupTitle","data":data,"indent":" ","helpers":helpers,"partials":partials,"decorators":container.decorators})) != null ? stack1 : "")
13287
13289
  + " </div>\n <div class=\"row\" "
13288
13290
  + ((stack1 = (lookupProperty(helpers,"getWord")||(depth0 && lookupProperty(depth0,"getWord"))||alias2).call(alias1,"css-textAlign",{"name":"getWord","hash":{},"data":data,"loc":{"start":{"line":6,"column":25},"end":{"line":6,"column":54}}})) != null ? stack1 : "")
@@ -15281,7 +15283,7 @@ function Crouton(config) {
15281
15283
  self.currentView = "weekday";
15282
15284
  self.distanceTabAllowed = false;
15283
15285
  self.config = {
15284
- version: '4.1.1', // CroutonJS version for debugging
15286
+ version: '4.1.3', // CroutonJS version for debugging
15285
15287
  on_complete: null, // Javascript function to callback when data querying is completed.
15286
15288
  root_server: null, // The root server to use.
15287
15289
  placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
@@ -16055,10 +16057,10 @@ function Crouton(config) {
16055
16057
  commonFormats = commonFormats.filter(value => memberFormats.includes(value));
16056
16058
  });
16057
16059
  group['formats'] = commonFormats.join(',');
16058
- group['formats_expanded'] = group['formats_expanded'].filter((format) => commonFormats.includes(format['key']));
16060
+ if (group['formats_expanded']) group['formats_expanded'] = group['formats_expanded'].filter((format) => commonFormats.includes(format['key']));
16059
16061
  group['membersOfGroup'].forEach(function(member) {
16060
16062
  member['formats'] = member['formats'].split(',').filter((f) => !commonFormats.includes(f)).join(',');
16061
- member['formats_expanded'] = member['formats_expanded'].filter((format) => !commonFormats.includes(format['key']));
16063
+ if (member['formats_expanded']) member['formats_expanded'] = member['formats_expanded'].filter((format) => !commonFormats.includes(format['key']));
16062
16064
  });
16063
16065
  }
16064
16066
  });
@@ -17187,7 +17189,9 @@ function MeetingMap(inConfig) {
17187
17189
  }
17188
17190
  });
17189
17191
  }
17190
-
17192
+ function isFilterVisible() {
17193
+ return config.filter_visible && config.filter_visible == 1;
17194
+ }
17191
17195
  /************************************************************************************//**
17192
17196
  * \brief Load the map and set it up. *
17193
17197
  ****************************************************************************************/
@@ -17214,7 +17218,7 @@ function MeetingMap(inConfig) {
17214
17218
  if (handlebarMapOptions) loc = {latitude: handlebarMapOptions.lat, longitude: handlebarMapOptions.lng};
17215
17219
  if (gDelegate.createMap(inDiv, loc, hide)) {
17216
17220
  // crouton_map and filter_visible triggers a query, Otherwise, redraw markers
17217
- if (config.map_search && config.filter_visible) {
17221
+ if (config.map_search && isFilterVisible()) {
17218
17222
  gDelegate.addListener('idle', triggerCroutonMapNewQuery, false);
17219
17223
  } else {
17220
17224
  gDelegate.addListener('zoomend', function (ev) {
@@ -17512,7 +17516,7 @@ function MeetingMap(inConfig) {
17512
17516
  let lat_lngs = gAllMeetings.reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[]);
17513
17517
  const maxRadius = config.maxTomatoWidth/2.0;
17514
17518
  if (gSearchPoint) lat_lngs.push([gSearchPoint.lat, gSearchPoint.lng]);
17515
- if (config.map_search && config.filter_visible) {
17519
+ if (config.map_search && isFilterVisible()) {
17516
17520
  lat_lngs.sort((a,b) => getDistance({"lat":a[0],"lng":a[1]},gSearchPoint) - getDistance({"lat":b[0],"lng":b[1]},gSearchPoint));
17517
17521
  while (getLatLngRadius(lat_lngs) > maxRadius && lat_lngs.length > 3) {
17518
17522
  lat_lngs = lat_lngs.slice(0, lat_lngs.length/2);
@@ -17520,18 +17524,21 @@ function MeetingMap(inConfig) {
17520
17524
  if (getLatLngRadius(lat_lngs) > maxRadius)
17521
17525
  lat_lngs = lat_lngs.slice(1,1);
17522
17526
  }
17523
- gDelegate.fitBounds(lat_lngs);
17527
+ if (lat_lngs.length > 0) gDelegate.fitBounds(lat_lngs);
17524
17528
  }
17525
17529
  searchResponseCallback();
17526
17530
  hideThrobber();
17527
- if (config.filter_visible || config.centerMe || config.goto) crouton.forceShowMap();
17531
+ if (isFilterVisible() || config.centerMe || config.goto) crouton.forceShowMap();
17528
17532
  if (config.centerMe) {
17529
17533
  if (navigator.geolocation) {
17530
17534
  navigator.geolocation.getCurrentPosition(
17531
17535
  function (position) {
17532
17536
  coords = {latitude: position.coords.latitude, longitude: position.coords.longitude};
17533
17537
  filterVisible(false);
17534
- gDelegate.setViewToPosition(coords, filterMeetingsAndBounds, filterVisible);
17538
+ if (config.zoom) gDelegate.setZoom(false, config.zoom);
17539
+ gDelegate.setViewToPosition(coords, filterMeetingsAndBounds, () => {
17540
+ filterVisible(isFilterVisible());
17541
+ });
17535
17542
  gSearchPoint = {"lat": position.coords.latitude, "lng": position.coords.longitude};
17536
17543
  crouton.updateDistances();
17537
17544
  },
@@ -17541,10 +17548,10 @@ function MeetingMap(inConfig) {
17541
17548
  showGeocodingDialog();
17542
17549
  }
17543
17550
  } else {
17544
- if ((!config.centerMe && !config.goto) && !(config.map_search && config.filter_visible)) {
17545
- gDelegate.afterInit(()=>filterVisible(config.filter_visible));
17551
+ if ((!config.centerMe && !config.goto) && !(config.map_search && isFilterVisible())) {
17552
+ gDelegate.afterInit(()=>filterVisible(isFilterVisible()));
17546
17553
  }
17547
- if (config.goto) gDelegate.callGeocoder(config.goto, resetVisibleThenFilterMeetingsAndBounds);
17554
+ if (config.goto) gDelegate.callGeocoder(config.goto, isFilterVisible() ? resetVisibleThenFilterMeetingsAndBounds : setVisibleThenFilterMeetingsAndBounds);
17548
17555
  }
17549
17556
  }
17550
17557
  function createCityHash(allMeetings) {
@@ -17647,6 +17654,15 @@ function MeetingMap(inConfig) {
17647
17654
  }
17648
17655
  return ret;
17649
17656
  }
17657
+ function setVisibleThenFilterMeetingsAndBounds(bounds, center=null) {
17658
+ filterVisible(false);
17659
+ const ret = filterMeetingsAndBounds(bounds);
17660
+ if (gSearchPoint.lat != center.lat || gSearchPoint.lng != center.lng) {
17661
+ gSearchPoint = center;
17662
+ crouton.updateDistances();
17663
+ }
17664
+ return ret;
17665
+ }
17650
17666
  function lookupLocation(fullscreen) {
17651
17667
  if (document.getElementById('goto-text').value != '') {
17652
17668
  if (fullscreen) {
@@ -17844,7 +17860,7 @@ function MeetingMap(inConfig) {
17844
17860
  function onDragEnd() {
17845
17861
  isMouseDown = false;
17846
17862
  // if no [crouton_map], then turn filter visible back on.
17847
- if (config.map_search && config.filter_visible) triggerCroutonMapNewQuery(null);
17863
+ if (config.map_search && isFilterVisible()) triggerCroutonMapNewQuery(null);
17848
17864
  else filterVisible(true);
17849
17865
  }
17850
17866
  function triggerCroutonMapNewQuery(ev) {
@@ -18166,10 +18182,13 @@ function MapDelegate(in_config) {
18166
18182
  gAllMarkers = [];
18167
18183
  gOpenMarker = false;
18168
18184
  };
18185
+ function isFilterVisible() {
18186
+ return config.filter_visible && config.filter_visible == 1;
18187
+ }
18169
18188
  function getZoomAdjust(only_out,filterMeetings) {
18170
18189
  if (!gMainMap) return 12;
18171
18190
  var ret = gMainMap.getZoom();
18172
- if (config.map_search && config.filter_visible) return ret;
18191
+ if (config.map_search && isFilterVisible()) return ret;
18173
18192
  var center = gMainMap.getCenter();
18174
18193
  var bounds = gMainMap.getBounds();
18175
18194
  var zoomedOut = false;