@bmlt-enabled/croutonjs 3.18.0 → 3.18.2
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 +52 -67
- package/crouton-core.min.js +1 -1
- package/crouton-gmaps.js +63 -74
- package/crouton-gmaps.min.js +1 -1
- package/crouton-map.js +11 -7
- package/crouton-map.min.js +1 -1
- package/crouton-nocore.js +3 -3
- package/crouton-nocore.min.js +1 -1
- package/crouton.css +8 -1
- package/crouton.js +63 -74
- package/crouton.min.css +1 -1
- package/crouton.min.js +1 -1
- package/crouton.nojquery.js +63 -74
- package/crouton.nojquery.min.js +1 -1
- package/package.json +1 -1
package/crouton.nojquery.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': '
|
|
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\"
|
|
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
|
|
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(
|
|
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,14 @@ 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
|
-
|
|
16393
|
+
window.crouton = self;
|
|
16394
|
+
croutonMap.initialize(self.createBmltMapElement(),self.meetingData,context,null,fitBounds,callback);
|
|
16396
16395
|
}
|
|
16397
16396
|
self.getCurrentLocation = function(callback) {
|
|
16398
16397
|
if (navigator.geolocation) {
|
|
@@ -16401,7 +16400,7 @@ function Crouton(config) {
|
|
|
16401
16400
|
$('.geo').removeClass("hide").addClass("show").html('<p>Geolocation is not supported by your browser</p>');
|
|
16402
16401
|
}
|
|
16403
16402
|
};
|
|
16404
|
-
self.renderView = function (selector, context, callback) {
|
|
16403
|
+
self.renderView = function (selector, context, callback, fitBounds) {
|
|
16405
16404
|
hbs_Crouton['localization'] = self.localization;
|
|
16406
16405
|
crouton_Handlebars.registerPartial('meetings', hbs_Crouton.templates['meetings']);
|
|
16407
16406
|
crouton_Handlebars.registerPartial('bydays', hbs_Crouton.templates['byday']);
|
|
@@ -16413,8 +16412,45 @@ function Crouton(config) {
|
|
|
16413
16412
|
jQuery(selector).html(template(context));
|
|
16414
16413
|
callback();
|
|
16415
16414
|
};
|
|
16416
|
-
self.updateMeetingCount = function(
|
|
16417
|
-
|
|
16415
|
+
self.updateMeetingCount = function(showingNow=null) {
|
|
16416
|
+
self = this;
|
|
16417
|
+
let meetingCount = self.meetingData.length;
|
|
16418
|
+
addLive = function(id) {return id+", "+id+"-live"};
|
|
16419
|
+
if (showingNow !== null) {
|
|
16420
|
+
meetingCount = showingNow.length;
|
|
16421
|
+
addLive = function(id) {return id+"-live"};
|
|
16422
|
+
}
|
|
16423
|
+
jQuery(addLive('#bmlt_tabs_meeting_count')).text(meetingCount);
|
|
16424
|
+
jQuery(addLive('#bmlt_tabs_group_count')).each(function(){
|
|
16425
|
+
var filteredMeetings = self.meetingData;
|
|
16426
|
+
if (showingNow!==null) filteredMeetings = self.meetingData.filter((m) => showingNow.includes(m.id_bigint));
|
|
16427
|
+
var groups = filteredMeetings.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name']);
|
|
16428
|
+
jQuery(this).text(arrayUnique(groups).length);
|
|
16429
|
+
});
|
|
16430
|
+
jQuery(addLive('#bmlt_tabs_service_body_names')).each(function() {
|
|
16431
|
+
var filteredMeetings = self.meetingData;
|
|
16432
|
+
if (showingNow!==null) filteredMeetings = self.meetingData.filter((m) => showingNow.includes(m.id_bigint));
|
|
16433
|
+
var ids = getUniqueValuesOfKey(filteredMeetings, 'service_body_bigint');
|
|
16434
|
+
var me = this;
|
|
16435
|
+
self.getServiceBodies(ids).then(function (service_bodies) {
|
|
16436
|
+
var n = service_bodies.length;
|
|
16437
|
+
var names = service_bodies.map((m)=>m['name']);
|
|
16438
|
+
names.sort();
|
|
16439
|
+
var ret = "";
|
|
16440
|
+
if (n===1) {
|
|
16441
|
+
ret = names[0];
|
|
16442
|
+
}
|
|
16443
|
+
else {
|
|
16444
|
+
ret = names[0];
|
|
16445
|
+
for (var j = 1; j < n-1; j++) {
|
|
16446
|
+
ret += ', ';
|
|
16447
|
+
ret += names[j];
|
|
16448
|
+
}
|
|
16449
|
+
ret += ' and ' + names[n-1];
|
|
16450
|
+
}
|
|
16451
|
+
jQuery(me).text(ret);
|
|
16452
|
+
});
|
|
16453
|
+
});
|
|
16418
16454
|
}
|
|
16419
16455
|
self.getServiceBodies = function(service_bodies_id) {
|
|
16420
16456
|
var requires_parents = self.config.has_regions;
|
|
@@ -16559,9 +16595,6 @@ function Crouton(config) {
|
|
|
16559
16595
|
self.filteredPage();
|
|
16560
16596
|
}
|
|
16561
16597
|
|
|
16562
|
-
self.isMeetingInTime = function(meeting, dayNow, hour, mins) {
|
|
16563
|
-
|
|
16564
|
-
}
|
|
16565
16598
|
self.distance = function(lat1, lon1, lat2, lon2, unit) {
|
|
16566
16599
|
if ((lat1 === lat2) && (lon1 === lon2)) {
|
|
16567
16600
|
return 0;
|
|
@@ -16596,14 +16629,12 @@ function Crouton(config) {
|
|
|
16596
16629
|
|
|
16597
16630
|
crouton_Handlebars.registerPartial("meetingDataTemplate", self.config['meeting_data_template']);
|
|
16598
16631
|
crouton_Handlebars.registerPartial("metaDataTemplate", self.config['metadata_template']);
|
|
16599
|
-
crouton_Handlebars.registerPartial("popupTemplate", self.config['marker_contents_template']);
|
|
16600
16632
|
crouton_Handlebars.registerPartial("observerTemplate", self.config['observer_template']);
|
|
16601
16633
|
crouton_Handlebars.registerPartial("meetingpageTitleTemplate", self.config['meetingpage_title_template']);
|
|
16602
16634
|
crouton_Handlebars.registerPartial("meetingpageContentsTemplate", self.config['meetingpage_contents_template']);
|
|
16603
16635
|
crouton_Handlebars.registerPartial("meetingCountTemplate", self.config['meeting_count_template']);
|
|
16604
16636
|
crouton_Handlebars.registerPartial("meetingLink", self.config['meeting_link_template']);
|
|
16605
16637
|
crouton_Handlebars.registerPartial("meetingModal", self.config['meeting_modal_template']);
|
|
16606
|
-
crouton_Handlebars.registerPartial("markerContentsTemplate", self.config['marker_contents_template']);
|
|
16607
16638
|
|
|
16608
16639
|
for (var m = 0; m < meetingData.length; m++) {
|
|
16609
16640
|
meetingData[m]['formatted_comments'] = meetingData[m]['comments'];
|
|
@@ -16810,52 +16841,6 @@ Crouton.prototype.reset = function() {
|
|
|
16810
16841
|
jQuery("#" + self.config["placeholder_id"]).html("");
|
|
16811
16842
|
};
|
|
16812
16843
|
|
|
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
16844
|
Crouton.prototype.doFilters = function() {
|
|
16860
16845
|
return this.filteredPage();
|
|
16861
16846
|
}
|
|
@@ -16955,7 +16940,7 @@ Crouton.prototype.searchMap = function() {
|
|
|
16955
16940
|
"meetingData": []
|
|
16956
16941
|
},
|
|
16957
16942
|
"dropdownData": [],
|
|
16958
|
-
"location": {'latitude':0,'longitude':0,'zoom':10}
|
|
16943
|
+
"location": {'latitude':0,'longitude':0,'zoom':10} // TODO: Where is this used?
|
|
16959
16944
|
});
|
|
16960
16945
|
}
|
|
16961
16946
|
Crouton.prototype.render = function(doMeetingMap = false) {
|
|
@@ -17265,16 +17250,16 @@ Crouton.prototype.render = function(doMeetingMap = false) {
|
|
|
17265
17250
|
croutonMap.initialize(self.createBmltMapElement(), self.meetingData);
|
|
17266
17251
|
jQuery("#bmlt-map").removeClass("hide");
|
|
17267
17252
|
}
|
|
17268
|
-
if (self.config['map_page']) {
|
|
17253
|
+
if (self.config['map_page'] && !doMeetingMap) {
|
|
17269
17254
|
croutonMap.initialize('byfield_embeddedMapPage', self.meetingData);
|
|
17270
17255
|
}
|
|
17271
17256
|
if (self.config['refresh_map']) {
|
|
17272
|
-
croutonMap.refreshMeetings(self.meetingData,
|
|
17257
|
+
croutonMap.refreshMeetings(self.meetingData, true, true);
|
|
17273
17258
|
}
|
|
17274
17259
|
if (self.config['on_complete'] != null && isFunction(self.config['on_complete'])) {
|
|
17275
17260
|
self.config['on_complete']();
|
|
17276
17261
|
}
|
|
17277
|
-
});
|
|
17262
|
+
}, !doMeetingMap);
|
|
17278
17263
|
});
|
|
17279
17264
|
});
|
|
17280
17265
|
};
|
|
@@ -17690,6 +17675,7 @@ function MeetingMap(inConfig) {
|
|
|
17690
17675
|
const config = inConfig;
|
|
17691
17676
|
if (!config.maxZoom) config.maxZoom = 17;
|
|
17692
17677
|
if (!config.minZoom) config.minZoom = 6;
|
|
17678
|
+
if (!config.marker_contents_template) config.marker_contents_template = croutonDefaultTemplates.marker_contents_template;
|
|
17693
17679
|
var gAllMeetings = null;
|
|
17694
17680
|
var gMeetingIdsFromCrouton = null;
|
|
17695
17681
|
var loadedCallbackFunction = null;
|
|
@@ -17707,6 +17693,7 @@ function MeetingMap(inConfig) {
|
|
|
17707
17693
|
|
|
17708
17694
|
function loadMap(inDiv, menuContext, handlebarMapOptions=null,cb=null) {
|
|
17709
17695
|
if (inDiv) {
|
|
17696
|
+
crouton_Handlebars.registerPartial("markerContentsTemplate", config['marker_contents_template']);
|
|
17710
17697
|
gInDiv = inDiv;
|
|
17711
17698
|
createThrobber(inDiv);
|
|
17712
17699
|
if (!config.map_search) showThrobber();
|
|
@@ -17840,15 +17827,15 @@ function MeetingMap(inConfig) {
|
|
|
17840
17827
|
return controlDiv;
|
|
17841
17828
|
}
|
|
17842
17829
|
|
|
17843
|
-
function loadFromCrouton(inDiv_id, meetings_responseObject, menuContext = null, handlebarMapOptions = null, callback) {
|
|
17830
|
+
function loadFromCrouton(inDiv_id, meetings_responseObject, menuContext = null, handlebarMapOptions = null, fitBounds = true, callback) {
|
|
17844
17831
|
if (!gDelegate.isApiLoaded()) {
|
|
17845
|
-
preloadApiLoadedCallback(loadFromCrouton, [inDiv_id, meetings_responseObject, menuContext, handlebarMapOptions, callback]);
|
|
17832
|
+
preloadApiLoadedCallback(loadFromCrouton, [inDiv_id, meetings_responseObject, menuContext, handlebarMapOptions, fitBounds, callback]);
|
|
17846
17833
|
gDelegate.loadApi();
|
|
17847
17834
|
return;
|
|
17848
17835
|
}
|
|
17849
17836
|
let inDiv = document.getElementById(inDiv_id);
|
|
17850
17837
|
loadMap(inDiv, menuContext, handlebarMapOptions,callback);
|
|
17851
|
-
loadAllMeetings(meetings_responseObject, true);
|
|
17838
|
+
loadAllMeetings(meetings_responseObject, fitBounds, true);
|
|
17852
17839
|
};
|
|
17853
17840
|
function loadPopupMap(inDiv_id, meeting, handlebarMapOptions = null) {
|
|
17854
17841
|
if (!gDelegate.isApiLoaded()) {
|
|
@@ -17929,21 +17916,23 @@ function MeetingMap(inConfig) {
|
|
|
17929
17916
|
showThrobber();
|
|
17930
17917
|
crouton.searchByCoordinates(latlng.lat, latlng.lng, config.map_search.width);
|
|
17931
17918
|
}
|
|
17932
|
-
function loadAllMeetings(meetings_responseObject, fitAll=false) {
|
|
17919
|
+
function loadAllMeetings(meetings_responseObject, fitBounds=true, fitAll=false) {
|
|
17933
17920
|
if (meetings_responseObject === null && config.map_search) {
|
|
17934
17921
|
if (config.map_search.auto) nearMeSearch();
|
|
17935
17922
|
else if (config.map_search.coordinates_search) {
|
|
17936
17923
|
showThrobber();
|
|
17937
17924
|
config.map_search.coordinates_search = false;
|
|
17938
|
-
crouton.searchByCoordinates(config.map_search.latitude, config.map_search.longitude);
|
|
17925
|
+
crouton.searchByCoordinates(config.map_search.latitude, config.map_search.longitude, config.map_search.width);
|
|
17939
17926
|
}
|
|
17940
17927
|
else if (config.map_search.location) gDelegate.callGeocoder(config.map_search.location, null, mapSearchGeocode);
|
|
17941
17928
|
else showBmltSearchDialog();
|
|
17942
17929
|
return;
|
|
17943
17930
|
}
|
|
17944
17931
|
gAllMeetings = meetings_responseObject.filter(m => m.venue_type != 2);
|
|
17945
|
-
|
|
17946
|
-
|
|
17932
|
+
if (fitBounds) {
|
|
17933
|
+
const lat_lngs = gAllMeetings.reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[]);
|
|
17934
|
+
gDelegate.fitBounds(lat_lngs);
|
|
17935
|
+
}
|
|
17947
17936
|
searchResponseCallback();
|
|
17948
17937
|
hideThrobber();
|
|
17949
17938
|
if (config.centerMe) {
|