From 0afb2c0046b55c123eafb4ab9ee77efa68d12463 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 06 Jun 2026 17:15:31 +0000
Subject: [PATCH] =Starting the Favourites.js setup, converting previous Northeh stuff to new Registrar, fixing up Square.php integration to match
---
assets/js/concise/Gallery.js | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/assets/js/concise/Gallery.js b/assets/js/concise/Gallery.js
index 9abf84c..950aa71 100644
--- a/assets/js/concise/Gallery.js
+++ b/assets/js/concise/Gallery.js
@@ -26,7 +26,6 @@
this.initModal();
this.initListeners();
this.initSubscribers();
- console.log('Gallery loaded...');
}
/*********************************************************************
ELEMENTS
@@ -67,9 +66,15 @@
let selector = filtered ? `[data-gallery="${filtered}"]` : this.elements.imageSelector;
this.items = Array.from(document.querySelectorAll(selector))
.map((img, index) => {
- let caption = img.nextElementSibling && img.nextElementSibling.tagName === 'FIGCAPTION' ?
- img.nextElementSibling.textContent :
- '';
+ let caption = '';
+ if (Object.hasOwn(img.dataset, 'caption')) {
+ caption = img.parentElement.querySelector(img.dataset.caption).cloneNode(true);
+ } else {
+ caption = img.nextElementSibling && img.nextElementSibling.tagName === 'FIGCAPTION' ?
+ img.nextElementSibling.textContent :
+ '';
+ }
+
return {
id: img.dataset.id||index,
@@ -107,10 +112,8 @@
this.toggleGallery(true);
} else if (this.modal.isOpen) {
if (window.targetCheck(e, this.elements.gallery.nextButton)) {
- console.log('Next');
this.nextElement();
} else if (window.targetCheck(e, this.elements.gallery.prevButton)) {
- console.log('Previous');
this.prevElement();
}
}
@@ -393,7 +396,14 @@
galleryImg.src = item.src; // Fallback
galleryImg.alt = item.alt;
- this.ui.gallery.caption.textContent = item.caption;
+ window.removeChildren(this.ui.gallery.caption);
+ if (typeof item.caption === 'object') {
+ this.ui.gallery.caption.append(item.caption);
+
+ } else {
+ this.ui.gallery.caption.textContent = item.caption;
+ }
+
--
Gitblit v1.10.0