@bmlt-enabled/croutonjs 3.19.4 → 3.20.0
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.css +0 -6
- package/crouton-core.js +211 -99
- package/crouton-core.min.css +1 -1
- package/crouton-core.min.js +1 -1
- package/crouton-gmaps.js +250 -119
- package/crouton-gmaps.min.js +1 -1
- package/crouton-map.js +39 -20
- package/crouton-map.min.js +1 -1
- package/crouton-nocore.js +142 -51
- package/crouton-nocore.min.js +1 -1
- package/crouton.css +24 -16
- package/crouton.js +250 -119
- package/crouton.min.css +1 -1
- package/crouton.min.js +1 -1
- package/crouton.nojquery.js +250 -119
- package/crouton.nojquery.min.js +1 -1
- package/package.json +1 -1
package/crouton-map.js
CHANGED
|
@@ -62,10 +62,10 @@ function MeetingMap(inConfig) {
|
|
|
62
62
|
}
|
|
63
63
|
if (config.map_search.zoom) {
|
|
64
64
|
config.zoom = config.map_search.zoom;
|
|
65
|
-
}
|
|
65
|
+
}
|
|
66
66
|
}
|
|
67
67
|
let loc = {latitude: config.lat, longitude: config.lng, zoom: config.zoom};
|
|
68
|
-
if (handlebarMapOptions) loc = {latitude: handlebarMapOptions.lat, longitude: handlebarMapOptions.lng};
|
|
68
|
+
if (handlebarMapOptions) loc = {latitude: handlebarMapOptions.lat, longitude: handlebarMapOptions.lng};
|
|
69
69
|
if (gDelegate.createMap(inDiv, loc)) {
|
|
70
70
|
gDelegate.addListener('zoomend', function (ev) {
|
|
71
71
|
if (shouldRedrawMarkers() && gAllMeetings) {
|
|
@@ -79,7 +79,11 @@ function MeetingMap(inConfig) {
|
|
|
79
79
|
menuContext.imageDir = config.BMLTPlugin_images;
|
|
80
80
|
gDelegate.addControl(createNext24Toggle(), 'topleft');
|
|
81
81
|
gDelegate.addControl(createMenuButton(menuContext), 'topright', cb);
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
menuContext = {imageDir: config.BMLTPlugin_images, config: config, dropdownData:false};
|
|
85
|
+
gDelegate.addControl(createMenuButton(menuContext), 'topright', cb);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
};
|
|
85
89
|
};
|
|
@@ -148,6 +152,7 @@ function MeetingMap(inConfig) {
|
|
|
148
152
|
controlDiv.innerHTML = template(menuContext);
|
|
149
153
|
controlDiv.querySelector("#nearbyMeetings").addEventListener('click', function (e) {
|
|
150
154
|
retrieveGeolocation().then(position => {
|
|
155
|
+
filterVisible(false);
|
|
151
156
|
gDelegate.setViewToPosition(position, filterMeetingsAndBounds);
|
|
152
157
|
}).catch(error => {
|
|
153
158
|
console.error(error.message);
|
|
@@ -157,14 +162,19 @@ function MeetingMap(inConfig) {
|
|
|
157
162
|
});
|
|
158
163
|
|
|
159
164
|
controlDiv.querySelector("#lookupLocation").addEventListener('click', showGeocodingDialog);
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
if (menuContext && menuContext.dropdownData) {
|
|
166
|
+
controlDiv.querySelector("#filterMeetings").addEventListener('click', showFilterDialog);
|
|
167
|
+
controlDiv.querySelector("#showAsTable").addEventListener('click', showListView);
|
|
168
|
+
} else {
|
|
169
|
+
controlDiv.querySelector("#filterTable").addEventListener('click', toggleVisible);
|
|
170
|
+
}
|
|
162
171
|
controlDiv.querySelector("#fullscreenMode").addEventListener('click', toggleFullscreen);
|
|
163
172
|
controlDiv.querySelector("#map-menu-button").addEventListener('click', function (e) {
|
|
164
173
|
let dropdownContent = document.getElementById("map-menu-dropdown");
|
|
165
|
-
if (dropdownContent.style.display == "inline-block")
|
|
174
|
+
if (dropdownContent.style.display == "inline-block") {
|
|
166
175
|
dropdownContent.style.display = "none";
|
|
167
|
-
|
|
176
|
+
filterVisible(false);
|
|
177
|
+
} else
|
|
168
178
|
dropdownContent.style.display = "inline-block";
|
|
169
179
|
});
|
|
170
180
|
[...controlDiv.getElementsByClassName('modal-close')].forEach((elem)=>elem.addEventListener('click', (e)=>closeModalWindow(e.target)));
|
|
@@ -303,7 +313,7 @@ function MeetingMap(inConfig) {
|
|
|
303
313
|
showGeocodingDialog();
|
|
304
314
|
}
|
|
305
315
|
} else if (config.goto) {
|
|
306
|
-
gDelegate.callGeocoder(goto, filterMeetingsAndBounds);
|
|
316
|
+
gDelegate.callGeocoder(config.goto, filterMeetingsAndBounds);
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
319
|
function createCityHash(allMeetings) {
|
|
@@ -332,12 +342,11 @@ function MeetingMap(inConfig) {
|
|
|
332
342
|
}
|
|
333
343
|
}
|
|
334
344
|
if (swipableModal) {
|
|
335
|
-
const body = document.
|
|
345
|
+
const body = document.body;
|
|
336
346
|
const scrollY = body.style.top;
|
|
337
347
|
body.style.overflowX = g_overflowX;
|
|
338
348
|
body.style.position = '';
|
|
339
349
|
body.style.top = '';
|
|
340
|
-
body.style.width = '';
|
|
341
350
|
window.scrollTo(0, parseInt(scrollY || '0') * -1);
|
|
342
351
|
}
|
|
343
352
|
}
|
|
@@ -359,14 +368,13 @@ function MeetingMap(inConfig) {
|
|
|
359
368
|
if (dd) dd.style.display = "none";
|
|
360
369
|
gDelegate.modalOn();
|
|
361
370
|
if (swipableModal) {
|
|
362
|
-
const body = document.
|
|
371
|
+
const body = document.body;
|
|
363
372
|
g_overflowX = body.style.overflowX;
|
|
364
373
|
const newTop = -window.scrollY+'px';
|
|
365
|
-
const newWidth = window.width+'px';
|
|
366
374
|
body.style.overflowX = 'hidden';
|
|
367
375
|
body.style.position = 'fixed';
|
|
368
|
-
body.style.
|
|
369
|
-
body.style.
|
|
376
|
+
body.style.width="100%";
|
|
377
|
+
body.style.setProperty('top', newTop, 'important');
|
|
370
378
|
}
|
|
371
379
|
}
|
|
372
380
|
function showFilterDialog(e) {
|
|
@@ -397,14 +405,18 @@ function MeetingMap(inConfig) {
|
|
|
397
405
|
jQuery("#table_page").addClass("hide");
|
|
398
406
|
jQuery("#bmlt-map").css("display", "block");
|
|
399
407
|
}
|
|
408
|
+
function resetVisibleThenFilterMeetingsAndBounds(bounds) {
|
|
409
|
+
filterVisible(false);
|
|
410
|
+
filterMeetingsAndBounds(bounds);
|
|
411
|
+
}
|
|
400
412
|
function lookupLocation(fullscreen) {
|
|
401
413
|
if (document.getElementById('goto-text').value != '') {
|
|
402
414
|
if (fullscreen) {
|
|
403
415
|
gDelegate.addListener('idle', function () {
|
|
404
|
-
gDelegate.callGeocoder(document.getElementById('goto-text').value,
|
|
416
|
+
gDelegate.callGeocoder(document.getElementById('goto-text').value, resetVisibleThenFilterMeetingsAndBounds);
|
|
405
417
|
}, true);
|
|
406
418
|
} else {
|
|
407
|
-
gDelegate.callGeocoder(document.getElementById('goto-text').value,
|
|
419
|
+
gDelegate.callGeocoder(document.getElementById('goto-text').value, resetVisibleThenFilterMeetingsAndBounds);
|
|
408
420
|
}
|
|
409
421
|
} else {
|
|
410
422
|
alert("");
|
|
@@ -456,12 +468,12 @@ function MeetingMap(inConfig) {
|
|
|
456
468
|
? filtered.map((m)=>[m])
|
|
457
469
|
: mapOverlappingMarkersInCity(filtered);
|
|
458
470
|
|
|
459
|
-
if (useMarkerCluster()) gDelegate.createClusterLayer();
|
|
471
|
+
if (useMarkerCluster()) gDelegate.createClusterLayer();
|
|
460
472
|
// Draw the meeting markers.
|
|
461
473
|
overlap_map.forEach(function (marker) {
|
|
462
474
|
createMapMarker(marker);
|
|
463
475
|
});
|
|
464
|
-
gDelegate.addClusterLayer();
|
|
476
|
+
gDelegate.addClusterLayer();
|
|
465
477
|
if (expand) {
|
|
466
478
|
const lat_lngs = filtered.reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[]);
|
|
467
479
|
gDelegate.fitBounds(lat_lngs);
|
|
@@ -566,20 +578,27 @@ function MeetingMap(inConfig) {
|
|
|
566
578
|
(meetings.length > 1),
|
|
567
579
|
marker_html, null ,meetings.map((m)=>parseInt(m.id_bigint)));
|
|
568
580
|
};
|
|
581
|
+
var listOnlyVisible = false;
|
|
569
582
|
function filterBounds(bounds) {
|
|
570
583
|
return gAllMeetings.filter((meeting) => gDelegate.contains(bounds, meeting.latitude, meeting.longitude));
|
|
571
584
|
}
|
|
572
585
|
function filterVisible(on=true) {
|
|
586
|
+
if (on===listOnlyVisible) return;
|
|
573
587
|
let mtgs = on ? filterBounds(gDelegate.getBounds()) : gAllMeetings;
|
|
574
588
|
let visible = mtgs.map((m)=>m.id_bigint);
|
|
575
589
|
jQuery(".bmlt-data-row").each(function(index,row) {
|
|
576
590
|
row.dataset.visible = (visible.includes(row.id.split('-').pop())) ? '1' : '0';
|
|
577
591
|
});
|
|
578
592
|
jQuery("#byday").removeClass('hide');
|
|
579
|
-
jQuery("#filter-dropdown-visibile").val('a-1');
|
|
593
|
+
jQuery("#filter-dropdown-visibile").val(on?'a-1':'');
|
|
580
594
|
fitDuringFilter = false;
|
|
581
|
-
crouton.
|
|
595
|
+
crouton.simulateFilterDropdown();
|
|
582
596
|
fitDuringFilter = true;
|
|
597
|
+
jQuery("#filteringByVisibility").html(on?'✔':'');
|
|
598
|
+
listOnlyVisible = on;
|
|
599
|
+
}
|
|
600
|
+
function toggleVisible() {
|
|
601
|
+
filterVisible(!listOnlyVisible);
|
|
583
602
|
}
|
|
584
603
|
function filterBounds(bounds) {
|
|
585
604
|
var ret = gAllMeetings.filter((meeting) =>
|