From: Cyperghost Date: Wed, 23 Oct 2024 11:07:22 +0000 (+0200) Subject: Use `data-caption` instead of `title` X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=614f453894f5fa321fccde501af155a7d83c1518;p=GitHub%2FWoltLab%2FWCF.git Use `data-caption` instead of `title` --- diff --git a/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl b/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl index 89da936e06..282c4b1dd2 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 8205199854..d5a9fe7c05 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 afb4eb36ea..ab07eb7bad 100644 --- a/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts +++ b/ts/WoltLabSuite/Core/Component/Attachment/Entry.ts @@ -61,6 +61,7 @@ function fileInitializationCompleted(element: HTMLElement, file: WoltlabCoreFile link.href = file.link!; link.dataset.fancybox = "attachments"; link.title = file.filename; + link.dataset.caption = file.filename; link.textContent = file.filename; const filename = element.querySelector(".fileList__item__filename")!; diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts index 10fe391c01..e8d1fab02e 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts @@ -264,6 +264,7 @@ export class FileProcessor { filenameLink.title = element.filename; filenameLink.textContent = element.filename; filenameLink.dataset.fancybox = ""; + filenameLink.dataset.caption = element.filename; // 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/wcfsetup/install/files/acp/templates/attachmentList.tpl b/wcfsetup/install/files/acp/templates/attachmentList.tpl index 6c846d7718..edfc5f0f01 100644 --- a/wcfsetup/install/files/acp/templates/attachmentList.tpl +++ b/wcfsetup/install/files/acp/templates/attachmentList.tpl @@ -112,7 +112,7 @@ {@$attachment->attachmentID}
    - isImage} data-fancybox="attachments" title="{$attachment->filename}"{/if}> + isImage} data-fancybox="attachments" data-caption="{$attachment->filename}"{/if}> {if $attachment->tinyThumbnailType} {else} 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 45eab9a9ff..b91487d63f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/Entry.js @@ -45,6 +45,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ui/Dropdown/Simple", " link.href = file.link; link.dataset.fancybox = "attachments"; link.title = file.filename; + link.dataset.caption = file.filename; link.textContent = file.filename; const filename = element.querySelector(".fileList__item__filename"); filename.innerHTML = ""; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Viewer.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Viewer.js index e9b29182e4..80399a7b1d 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Viewer.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Image/Viewer.js @@ -26,7 +26,7 @@ define(["require", "exports", "@fancyapps/ui"], function (require, exports, ui_1 Object.defineProperty(exports, "__esModule", { value: true }); exports.setup = setup; exports.getLocalization = getLocalization; - const LOCALES = ["cs", "de", "en", "es", "fr", "it", "ja", "lv", "pl", "sk"]; + const LOCALES = ["cs", "de", "en", "es", "fr", "it", "lv", "pl", "sk"]; function setup() { void getLocalization().then((l10n) => { ui_1.Fancybox.bind("[data-fancybox]", { 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 ace76ed429..970e561ad2 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 @@ -213,6 +213,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui filenameLink.title = element.filename; filenameLink.textContent = element.filename; filenameLink.dataset.fancybox = ""; + filenameLink.dataset.caption = element.filename; // 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;