From bd843b0c6c021b526efce311cb851e85f5f59a4f Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Wed, 31 Jan 2024 00:09:24 +0100
Subject: [PATCH 1/2] add wheelchair icon
---
croutonjs/src/js/crouton-core.js | 2 ++
croutonjs/src/js/crouton-default-templates.js | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index ccb2fec..1c323f7 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -763,9 +763,11 @@ function Crouton(config) {
var formats = meetingData[m]['formats'].split(",");
var formats_expanded = [];
let formatRootServer = self.formatsData.filter((f)=>f['root_server_uri'] == meetingData[m]['root_server_uri']);
+ meetingData[m]['wheelchar'] = false;
for (var f = 0; f < formats.length; f++) {
for (var g = 0; g < formatRootServer.length; g++) {
if (formats[f] === formatRootServer[g]['key_string']) {
+ if (formatRootServer[g]['world_id'] == 'WCHR') meetingData[m]['wheelchair'] = true;
formats_expanded.push(
{
"id": formatRootServer[g]['id'],
diff --git a/croutonjs/src/js/crouton-default-templates.js b/croutonjs/src/js/crouton-default-templates.js
index 5404364..08144f9 100644
--- a/croutonjs/src/js/crouton-default-templates.js
+++ b/croutonjs/src/js/crouton-default-templates.js
@@ -48,7 +48,8 @@ var croutonDefaultTemplates = {
observer_template: [
"
{{this.contact_name_1}} {{this.contact_phone_1}} {{this.contact_email_1}}
",
- "{{this.contact_name_2}} {{this.contact_phone_2}} {{this.contact_email_2}}
"
+ "{{this.contact_name_2}} {{this.contact_phone_2}} {{this.contact_email_2}}
",
+ "{{#if this.wheelchair}}♿
{{/if}}"
].join('\n'),
meeting_count_template: [
From c855bebb2692a0c372b65dbe71021b1460d22e02 Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Sun, 11 Feb 2024 19:32:19 +0100
Subject: [PATCH 2/2] init_crouton updates meeting_count, etc
---
crouton.php | 4 ++--
croutonjs/src/js/crouton-core.js | 6 ++++++
readme.txt | 4 ++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/crouton.php b/crouton.php
index aaaa628..0d153d8 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.6
+Version: 3.18.7
*/
/* Disallow direct access to the plugin file */
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
@@ -389,7 +389,7 @@ private function renderMap($atts, $croutonMap = true)
public function initCrouton($atts)
{
- return $this->getInitializeCroutonBlock("", ...$this->getCroutonJsConfig($atts));
+ return $this->getInitializeCroutonBlock("crouton.renderMeetingCount();", ...$this->getCroutonJsConfig($atts));
}
public function meetingCount($atts)
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index 1c323f7..8b98497 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -1644,6 +1644,12 @@ function getUniqueFormatsOfType(array, type){
return carry;
},[]);
}
+Crouton.prototype.renderMeetingCount = function() {
+ self = this;
+ self.lock(function() {
+ self.updateMeetingCount()
+ });
+}
Crouton.prototype.getAdjustedDateTime = function(meeting_day, meeting_time, meeting_time_zone) {
var timeZoneAware = this.config['auto_tz_adjust'] === true || this.config['auto_tz_adjust'] === "true";
var meeting_date_time_obj;
diff --git a/readme.txt b/readme.txt
index b0e197e..04a8edf 100644
--- a/readme.txt
+++ b/readme.txt
@@ -36,6 +36,10 @@ https://demo.bmlt.app/crouton
== Changelog ==
+= 3.18.7 =
+* Show wheelchair character in first column for meetings with a format that corresponds to NAWS WHEELCHAIR.
+* Use [init_crouton] for pages with [meeting_count] but no other "main" crouton shortcode.
+
= 3.18.6 =
* French translation.
* Correctly handle links when default permalinks are used.