From 0b5737a5761a6c7fe86d0fa87a3403836a856cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Fri, 10 Jan 2025 11:44:26 +0100 Subject: [PATCH] Add prehistoric icons... --- webgis/js/components/Prehistoric.js | 13 +++++++++++-- webgis/js/ui.js | 16 ++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/webgis/js/components/Prehistoric.js b/webgis/js/components/Prehistoric.js index 32a3b34..49fee26 100644 --- a/webgis/js/components/Prehistoric.js +++ b/webgis/js/components/Prehistoric.js @@ -17,13 +17,22 @@ export class Prehistoric { return `

+ + + Denominazione: ${this._data.denomination}

- Località generica: ${this._data.genericPlace} + + + + Periodo: ${this._data.period}

- Periodo: ${this._data.period} + + + + Località generica: ${this._data.genericPlace}

Descrizione breve
diff --git a/webgis/js/ui.js b/webgis/js/ui.js index bacad18..0bc7ca9 100644 --- a/webgis/js/ui.js +++ b/webgis/js/ui.js @@ -252,27 +252,27 @@ UI.sitesMenu = function (menuListSel, map, sites) { /** * Open Spotlight gallery * @param {string} galleryId The id of the trigger element - * @param {Array} images Array of image objects from DB + * @param {Array} items Array of image objects from DB * @param {boolean} video Is this a video gallery? */ -UI.imageGallery = function (galleryId, images, video = false) { +UI.imageGallery = function (galleryId, items, video = false) { const element = document.querySelector(`#${galleryId}`); if (element) { let gallery = []; - for (let img of images) { - let author = img.author ? ` (${img.author})` : ''; + for (let media of items) { + let author = media.author ? ` (${media.author})` : ''; let mediaObj = { - description: img.caption + author + description: media.caption + author }; if (video) { mediaObj.media = 'video'; - mediaObj["src-mp4"] = `video/${img.filename}`; - mediaObj.poster = `video/${img.filename.replace('mp4', 'png')}`; + mediaObj["src-mp4"] = `video/${media.filename}`; + mediaObj.poster = `video/${media.filename.replace('mp4', 'png')}`; mediaObj.autoplay = true; } else { - mediaObj.src = `img/${img.filename}`; + mediaObj.src = `img/${media.filename}`; } gallery.push(mediaObj);