From 4dfc7942eb4f8f09066b4b56f7c5cde132056400 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:13:35 +0100 Subject: [PATCH 1/4] version bump --- crouton.php | 2 +- readme.txt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crouton.php b/crouton.php index bc64528..452d9d0 100644 --- a/crouton.php +++ b/crouton.php @@ -5,7 +5,7 @@ Description: A tabbed based display for showing meeting information. Author: bmlt-enabled Author URI: https://bmlt.app -Version: 3.18.4 +Version: 3.18.5 */ /* Disallow direct access to the plugin file */ if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { diff --git a/readme.txt b/readme.txt index f4e6c14..2e4c231 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: na, meeting list, meeting finder, maps, recovery, addiction, webservant, b Requires at least: 4.0 Required PHP: 8.0 Tested up to: 6.4.2 -Stable tag: 3.18.4 +Stable tag: 3.18.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html crouton implements a Tabbed UI for BMLT. @@ -36,6 +36,10 @@ https://demo.bmlt.app/crouton == Changelog == + += 3.18.5 = +* Version bump because last merge was lost + = 3.18.4 = * Do not embed map page when list contains only online meetings (fix for bug #460). From cad92ede728fe02e1933382895dea79722f8131d Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:52:19 +0100 Subject: [PATCH 2/4] fix bugs in non-wordpress cases --- croutonjs/src/js/crouton-core.js | 9 ++++++++- readme.txt | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js index 67d1168..16bd125 100644 --- a/croutonjs/src/js/crouton-core.js +++ b/croutonjs/src/js/crouton-core.js @@ -644,6 +644,13 @@ function Crouton(config) { croutonMap.loadPopupMap("bmlt-handlebars-map", meetingDetailsData, self.handlebarMapOptions); } } + Crouton.prototype.meetingCount = function(f) { + f(self.meetingData.length); + } + Crouton.prototype.groupCount = function(f) { + var groups = self.meetingData.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name']); + f(arrayUnique(groups).length); + } Crouton.prototype.filterNext24 = function(filterNow = true) { if (!filterNow) { jQuery("#filter-dropdown-next24").val('a-'); @@ -856,7 +863,7 @@ function Crouton(config) { } return 'bmlt-map'; } - if ((self.config['show_map'] || self.config['map_search']) && (typeof window.croutonMap === 'undefined')) { + if (typeof window.croutonMap === 'undefined') { window.croutonMap = new MeetingMap(self.config); if (self.config['map_search']) self.searchMap(); } diff --git a/readme.txt b/readme.txt index 2e4c231..54b88fb 100644 --- a/readme.txt +++ b/readme.txt @@ -38,7 +38,8 @@ https://demo.bmlt.app/crouton = 3.18.5 = -* Version bump because last merge was lost +* Assure croutonMap object created. +* Add meetingCount and groupCount methods for backwards compatibility in non-wordpress cases. = 3.18.4 = * Do not embed map page when list contains only online meetings (fix for bug #460). From f3f8ab3cba793b2f5c6a2b1aad6d0cc4ffe57e4e Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:36:16 +0100 Subject: [PATCH 3/4] testing --- croutonjs/src/js/crouton-core.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js index 16bd125..38ae4d1 100644 --- a/croutonjs/src/js/crouton-core.js +++ b/croutonjs/src/js/crouton-core.js @@ -499,6 +499,10 @@ function Crouton(config) { self.updateMeetingCount = function(showingNow=null) { self = this; let meetingCount = self.meetingData.length; + if (self.meetingCountCallback) self.meetingCountCallback(meetingCount); + if (self.groupCountCallback) self.groupCountCallback( + arrayUnique(self.meetingData.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name'])).length + ); addLive = function(id) {return id+", "+id+"-live"}; if (showingNow !== null) { meetingCount = showingNow.length; @@ -644,12 +648,13 @@ function Crouton(config) { croutonMap.loadPopupMap("bmlt-handlebars-map", meetingDetailsData, self.handlebarMapOptions); } } + self.meetingCountCallback = null; + self.grouoCountCallback = null; Crouton.prototype.meetingCount = function(f) { - f(self.meetingData.length); + self.meetingCountCallback = f; } Crouton.prototype.groupCount = function(f) { - var groups = self.meetingData.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name']); - f(arrayUnique(groups).length); + self.groupCountCallback = f; } Crouton.prototype.filterNext24 = function(filterNow = true) { if (!filterNow) { From f1dcba56e30e87447634f7bbba74c292a33bea22 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:38:40 +0100 Subject: [PATCH 4/4] remove space --- readme.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.txt b/readme.txt index 54b88fb..d1f39be 100644 --- a/readme.txt +++ b/readme.txt @@ -36,7 +36,6 @@ https://demo.bmlt.app/crouton == Changelog == - = 3.18.5 = * Assure croutonMap object created. * Add meetingCount and groupCount methods for backwards compatibility in non-wordpress cases.