See https://www.woltlab.com/community/thread/307101-adding-an-attachment-recognition-problem/
const thumbnail = file.thumbnails.find((thumbnail) => thumbnail.identifier === "tiny");
if (thumbnail !== undefined) {
file.thumbnail = thumbnail;
+ } else if (file.link) {
+ file.previewUrl = file.link;
}
const url = file.thumbnails.find((thumbnail) => thumbnail.identifier === "")?.link;
return this.dataset.previewUrl;
}
+ set previewUrl(previewUrl: string) {
+ this.dataset.previewUrl = previewUrl;
+
+ this.#rebuildElement();
+ }
+
get unbounded(): boolean {
return this.getAttribute("dimensions") === "unbounded";
}
if (thumbnail !== undefined) {
file.thumbnail = thumbnail;
}
+ else if (file.link) {
+ file.previewUrl = file.link;
+ }
const url = file.thumbnails.find((thumbnail) => thumbnail.identifier === "")?.link;
if (url !== undefined) {
insertButton = getInsertButton(data.attachmentID, url, editor);
get previewUrl() {
return this.dataset.previewUrl;
}
+ set previewUrl(previewUrl) {
+ this.dataset.previewUrl = previewUrl;
+ this.#rebuildElement();
+ }
get unbounded() {
return this.getAttribute("dimensions") === "unbounded";
}