Add the link to the full version to files
authorAlexander Ebert <ebert@woltlab.com>
Fri, 26 Apr 2024 13:41:48 +0000 (15:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 26 Apr 2024 13:41:48 +0000 (15:41 +0200)
ts/WoltLabSuite/Core/Component/File/woltlab-core-file.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/woltlab-core-file.js
wcfsetup/install/files/lib/data/file/File.class.php

index 998c1c2fd8366736addb0998edbafd475c3fd0a3..11cfc1d02454a1d8ae9bb09b6df8ffbebc72ed8b 100644 (file)
@@ -90,12 +90,18 @@ export class WoltlabCoreFileElement extends HTMLElement {
       for (const thumbnail of thumbnails) {
         this.#thumbnails.push(new Thumbnail(thumbnail.identifier, thumbnail.link));
       }
+
+      delete this.dataset.thumbnails;
     }
 
     if (this.dataset.metaData) {
       this.#data = JSON.parse(this.dataset.metaData);
+      delete this.dataset.metaData;
     }
 
+    this.#link = this.dataset.link!;
+    delete this.dataset.link;
+
     this.#state = State.Ready;
 
     return true;
index 942dc5aca4d6aec12b258ea1ab5977399ff92f09..af4bad8d47e2ce15e3e96d102a3be969a93fd86c 100644 (file)
@@ -68,10 +68,14 @@ define(["require", "exports"], function (require, exports) {
                 for (const thumbnail of thumbnails) {
                     this.#thumbnails.push(new Thumbnail(thumbnail.identifier, thumbnail.link));
                 }
+                delete this.dataset.thumbnails;
             }
             if (this.dataset.metaData) {
                 this.#data = JSON.parse(this.dataset.metaData);
+                delete this.dataset.metaData;
             }
+            this.#link = this.dataset.link;
+            delete this.dataset.link;
             this.#state = 3 /* State.Ready */;
             return true;
         }
index 147449269a84041a73d82a42ff6b43096f13c01c..c77b2b02620ad9dcae34b8dbff55631e4719f48c 100644 (file)
@@ -151,6 +151,7 @@ class File extends DatabaseObject
                     data-mime-type="%s"
                     data-thumbnails="%s"
                     data-meta-data="%s"
+                    data-link="%s"
                 ></woltlab-core-file>
                 EOT,
             $this->fileID,
@@ -158,6 +159,7 @@ class File extends DatabaseObject
             StringUtil::encodeHTML($this->mimeType),
             StringUtil::encodeHTML(\json_encode($thumbnails)),
             StringUtil::encodeHTML(\json_encode($metaData)),
+            StringUtil::encodeHTML($this->getLink()),
         );
     }