if (url !== undefined) {
buttonList.append(getInsertThumbnailButton((data as FileProcessorData).attachmentID, url, editorId));
}
+
+ if (file.link !== undefined && file.filename !== undefined) {
+ const link = document.createElement("a");
+ link.href = file.link!;
+ link.classList.add("jsImageViewer");
+ link.title = file.filename;
+ link.textContent = file.filename;
+
+ filename.innerHTML = "";
+ filename.append(link);
+ }
}
element.append(buttonList);
if (!$thumbnail.length) {
$thumbnail = $link.parentsUntil('.formAttachmentList').last().find('.attachmentTinyThumbnail');
}
+
+ let thumbnailSrc = '';
+ if ($thumbnail.length === 0) {
+ const attachmentItem = $link[0].closest(".attachment__item");
+ if (attachmentItem !== null) {
+ const file = attachmentItem.querySelector("woltlab-core-file");
+ const thumbnail = file?.thumbnails.find((x) => x.identifier === "tiny");
+ thumbnailSrc = thumbnail.link;
+ }
+ } else {
+ thumbnailSrc = $thumbnail.prop("src");
+ }
+
$images.push({
image: {
},
series: null,
thumbnail: {
- url: $thumbnail.prop('src')
+ url: thumbnailSrc
},
user: null
});
if (url !== undefined) {
buttonList.append(getInsertThumbnailButton(data.attachmentID, url, editorId));
}
+ if (file.link !== undefined && file.filename !== undefined) {
+ const link = document.createElement("a");
+ link.href = file.link;
+ link.classList.add("jsImageViewer");
+ link.title = file.filename;
+ link.textContent = file.filename;
+ filename.innerHTML = "";
+ filename.append(link);
+ }
}
element.append(buttonList);
})