From b974bb5184de831b03b3472be94b15d0d3d9c213 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 23 Oct 2024 10:08:42 +0200 Subject: [PATCH] Remove using of `jsImageViewer` class and set `data-fancybox` --- com.woltlab.wcf/templates/shared_bbcode_wsm.tpl | 2 +- com.woltlab.wcf/templates/shared_uploadFieldComponent.tpl | 2 +- ts/WoltLabSuite/Core/Component/Attachment/Entry.ts | 2 +- .../Core/Form/Builder/Field/Controller/FileProcessor.ts | 2 +- ts/WoltLabSuite/Core/Ui/File/Upload.ts | 2 +- .../files/js/WoltLabSuite/Core/Component/Attachment/Entry.js | 2 +- .../Core/Form/Builder/Field/Controller/FileProcessor.js | 2 +- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl b/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl index b53650955a..89da936e06 100644 --- a/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl +++ b/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl @@ -4,7 +4,7 @@ {if $media->isImage} {if $thumbnailSize != 'original'} {if !$removeLinks} - + {/if} {$media->altText} {if !$removeLinks} diff --git a/com.woltlab.wcf/templates/shared_uploadFieldComponent.tpl b/com.woltlab.wcf/templates/shared_uploadFieldComponent.tpl index 59db9e3fc4..8205199854 100644 --- a/com.woltlab.wcf/templates/shared_uploadFieldComponent.tpl +++ b/com.woltlab.wcf/templates/shared_uploadFieldComponent.tpl @@ -13,7 +13,7 @@ {foreach from=$uploadFieldFiles item=file}
  • {if $file->isImage()} - + {else} diff --git a/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts b/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts index 144caf8078..afb4eb36ea 100644 --- a/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts +++ b/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts @@ -59,7 +59,7 @@ function fileInitializationCompleted(element: HTMLElement, file: WoltlabCoreFile if (file.link !== undefined && file.filename !== undefined) { const link = document.createElement("a"); link.href = file.link!; - link.classList.add("jsImageViewer"); + link.dataset.fancybox = "attachments"; link.title = file.filename; link.textContent = file.filename; diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts index fef5939cb0..10fe391c01 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts @@ -263,7 +263,7 @@ export class FileProcessor { filenameLink.href = element.link; filenameLink.title = element.filename; filenameLink.textContent = element.filename; - filenameLink.classList.add("jsImageViewer"); + filenameLink.dataset.fancybox = ""; // Insert a hidden image element that will be used by the image viewer as the preview image const previewImage = document.createElement("img"); diff --git a/ts/WoltLabSuite/Core/Ui/File/Upload.ts b/ts/WoltLabSuite/Core/Ui/File/Upload.ts index 0e041911cf..043f5977bb 100644 --- a/ts/WoltLabSuite/Core/Ui/File/Upload.ts +++ b/ts/WoltLabSuite/Core/Ui/File/Upload.ts @@ -177,7 +177,7 @@ class FileUpload extends Upload implements FileUploadHandler if (fileData.image !== null) { const a = document.createElement("a"); - a.classList.add("jsImageViewer"); + a.dataset.fancybox = ""; a.href = fileData.image; const image = document.createElement("img"); image.classList.add("formUploadHandlerContentListImage"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js index d5bfeb4d6e..45eab9a9ff 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js @@ -43,7 +43,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ui/Dropdown/Simple", " if (file.link !== undefined && file.filename !== undefined) { const link = document.createElement("a"); link.href = file.link; - link.classList.add("jsImageViewer"); + link.dataset.fancybox = "attachments"; link.title = file.filename; link.textContent = file.filename; const filename = element.querySelector(".fileList__item__filename"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js index 2a6816322b..ace76ed429 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js @@ -212,7 +212,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui filenameLink.href = element.link; filenameLink.title = element.filename; filenameLink.textContent = element.filename; - filenameLink.classList.add("jsImageViewer"); + filenameLink.dataset.fancybox = ""; // Insert a hidden image element that will be used by the image viewer as the preview image const previewImage = document.createElement("img"); previewImage.src = thumbnail !== undefined ? thumbnail.link : element.link; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js index 3b9ac95de1..cb8454ee34 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js @@ -113,7 +113,7 @@ define(["require", "exports", "tslib", "../../Core", "./Delete", "../../Dom/Util const icon = fileElement.querySelector("fa-icon"); if (fileData.image !== null) { const a = document.createElement("a"); - a.classList.add("jsImageViewer"); + a.dataset.fancybox = ""; a.href = fileData.image; const image = document.createElement("img"); image.classList.add("formUploadHandlerContentListImage"); -- 2.20.1