From 0e60d0bd31fbf2d17db136d6eda445d3c6359a8c Mon Sep 17 00:00:00 2001 From: dbauszus-glx Date: Tue, 8 Oct 2024 15:24:00 +0100 Subject: [PATCH 01/23] remove cloudinary provider module --- lib/ui/locations/entries/cloudinary.mjs | 317 +++++++++++++++++------- mod/provider/_provider.js | 3 - mod/provider/cloudinary.js | 84 ------- 3 files changed, 229 insertions(+), 175 deletions(-) delete mode 100644 mod/provider/cloudinary.js diff --git a/lib/ui/locations/entries/cloudinary.mjs b/lib/ui/locations/entries/cloudinary.mjs index 4283b9adc7..c2bdb98e77 100644 --- a/lib/ui/locations/entries/cloudinary.mjs +++ b/lib/ui/locations/entries/cloudinary.mjs @@ -1,15 +1,3 @@ -const types = { - image, - images, - documents -} - -const onload = { - image: imageLoad, - images: imageLoad, - documents: docLoad -} - mapp.utils.merge(mapp.dictionaries, { en: { image_upload_failed: 'Image upload failed.', @@ -58,13 +46,37 @@ mapp.utils.merge(mapp.dictionaries, { } }) +const types = { + image, + images, + documents +} + export default entry => types[entry.type](entry) +const onload = { + image: imageLoad, + images: imageLoad, + documents: docLoad +} + +/** +@function image + +@description +This image function takes an entry object and generates HTML elements based on the value property of the entry. Here's an explanation of its functionality. + +@param {Object} entry +@returns {HTML} image +*/ function image(entry) { + let image + if (entry.value) { - const trashBtn = mapp.utils.html` + // The trash button will only be created when entry is editable. + const trashBtn = entry.edit && mapp.utils.html`