From 8793e4e9c25cff4538221c8403e8108030aee5ce Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Fri, 8 Nov 2024 00:44:34 +0100
Subject: [PATCH 1/6] fix for jsInFooter
---
crouton.php | 12 +++++++-----
croutonjs/src/templates/header.hbs | 10 +++++-----
readme.txt | 6 +++++-
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/crouton.php b/crouton.php
index 50ef1490..ec62340b 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.20.4
+Version: 3.20.5
*/
/* Disallow direct access to the plugin file */
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
@@ -314,9 +314,11 @@ private function inlineScript($s)
}
private function outputScript($s)
{
- if (isset($this->options['jsInFooter'])) {
+ if ($this->options['jsInFooter']) {
wp_add_inline_script('croutonjs', $s);
$s = "";
+ } else {
+ $s = "";
}
return $this->waitMsg.sprintf('%s
Should the generated Javascript be placed in the footer or in the body.
' . $_GET['this_title'] . '
';
}
@@ -305,34 +330,22 @@ private function sharedRender()
if (isset($_GET['sub_title'])) {
$output .= '' . $_GET['sub_title'] . '
';
}
-
- return $output;
- }
- private function inlineScript($s)
- {
- wp_add_inline_script('croutonjs', $s);
- }
- private function outputScript($s)
- {
- if ($this->options['jsInFooter']) {
- wp_add_inline_script('croutonjs', $s);
- $s = "";
- } else {
- $s = "";
- }
- return $this->waitMsg.sprintf('%s
From 010776e6409ada4f1ff3cda9d2576a195f7ad123 Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Sat, 9 Nov 2024 09:19:58 +0100
Subject: [PATCH 3/6] lint
---
crouton.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crouton.php b/crouton.php
index 089411d7..5031a203 100644
--- a/crouton.php
+++ b/crouton.php
@@ -338,7 +338,8 @@ private function outputTag()
*
* @return void
*/
- public function replaceShortcodeWithStandardTags() {
+ public function replaceShortcodeWithStandardTags()
+ {
if (isset($_GET['meeting-id'])) {
return do_shortcode($this->getDefaultMeetingDetailsPageContents());
}
From 631753edbe3238e3ea1f16116fc4d962db6b30b5 Mon Sep 17 00:00:00 2001
From: Alan B <918773+alanb2718@users.noreply.github.com>
Date: Fri, 8 Nov 2024 12:50:13 -0800
Subject: [PATCH 4/6] fix service_body_names to not list names of parents
---
croutonjs/src/js/crouton-core.js | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js
index 27b3afe3..997717ba 100644
--- a/croutonjs/src/js/crouton-core.js
+++ b/croutonjs/src/js/crouton-core.js
@@ -539,7 +539,7 @@ function Crouton(config) {
if (showingNow!==null) filteredMeetings = self.meetingData.filter((m) => showingNow.includes(m.id_bigint));
var ids = getUniqueValuesOfKey(filteredMeetings, 'service_body_bigint');
var me = this;
- self.getServiceBodies(ids).then(function (service_bodies) {
+ self.getServiceBodies(ids, false).then(function (service_bodies) {
var n = service_bodies.length;
var names = service_bodies.map((m)=>m['name']);
names.sort();
@@ -559,9 +559,7 @@ function Crouton(config) {
});
});
}
- self.getServiceBodies = function(service_bodies_id) {
- const requires_parents = true;
-
+ self.getServiceBodies = function(service_bodies_id, requires_parents=true) {
var url = this.config['root_server'] + '/client_interface/jsonp/?switcher=GetServiceBodies'
+ (requires_parents ? '&parents=1' : '') + getServiceBodiesQueryString(service_bodies_id);
return fetchJsonp(url)
From 3f54521f1b76ea33fd7a674ffbe242ea5cfe1eb4 Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Sat, 9 Nov 2024 16:32:48 +0100
Subject: [PATCH 5/6] bump readme
---
readme.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/readme.txt b/readme.txt
index 3997e578..e0ce105a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -36,6 +36,10 @@ https://demo.bmlt.app/crouton
== Changelog ==
+= 3.20.5 =
+* Fix list_service_bodies including the parent service body.
+* Correctly call add_inline_script, and always use it.
+
= 3.20.4 =
* Bug fix for checkbox placing JS in footer
* Accessibility improvements
From f6985da4d98e6818a1f90a4d8ae08dad7665c3dd Mon Sep 17 00:00:00 2001
From: otrok7 <50595291+otrok7@users.noreply.github.com>
Date: Sat, 9 Nov 2024 16:54:40 +0100
Subject: [PATCH 6/6] small fixes
---
crouton.php | 2 +-
readme.txt | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/crouton.php b/crouton.php
index 5031a203..1eba0f8f 100644
--- a/crouton.php
+++ b/crouton.php
@@ -336,7 +336,7 @@ private function outputTag()
* When we are processing the main shortcodes themselves, we can just insert standard tags, because the difference is
* in how we initialize the JS Crouton object. And we do that when deciding whether to enqueue scripts or not.
*
- * @return void
+ * @return string
*/
public function replaceShortcodeWithStandardTags()
{
diff --git a/readme.txt b/readme.txt
index e0ce105a..1436c279 100644
--- a/readme.txt
+++ b/readme.txt
@@ -39,8 +39,6 @@ https://demo.bmlt.app/crouton
= 3.20.5 =
* Fix list_service_bodies including the parent service body.
* Correctly call add_inline_script, and always use it.
-
-= 3.20.4 =
* Bug fix for checkbox placing JS in footer
* Accessibility improvements