From: Cyperghost Date: Tue, 10 Sep 2024 08:59:07 +0000 (+0200) Subject: Move the registration of the HTML-Element `woltlab-core-file` into the helper script X-Git-Tag: 6.1.0_Beta_2~42 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62dc5635ab99337c5861ff33ab0313457d8a6cdd;p=GitHub%2FWoltLab%2FWCF.git Move the registration of the HTML-Element `woltlab-core-file` into the helper script --- diff --git a/ts/WoltLabSuite/Core/Component/Attachment/List.ts b/ts/WoltLabSuite/Core/Component/Attachment/List.ts index f1c418eceb..147584cf0f 100644 --- a/ts/WoltLabSuite/Core/Component/Attachment/List.ts +++ b/ts/WoltLabSuite/Core/Component/Attachment/List.ts @@ -3,10 +3,6 @@ import { CkeditorDropEvent } from "../File/Upload"; import { createAttachmentFromFile } from "./Entry"; import { listenToCkeditor } from "../Ckeditor/Event"; -// This import has the side effect of registering the `` -// element. Do not remove! -import "../File/woltlab-core-file"; - function fileToAttachment(fileList: HTMLElement, file: WoltlabCoreFileElement, editor: HTMLElement): void { fileList.append(createAttachmentFromFile(file, editor)); } diff --git a/ts/WoltLabSuite/Core/Component/File/Helper.ts b/ts/WoltLabSuite/Core/Component/File/Helper.ts index a16c877829..ed50b743cc 100644 --- a/ts/WoltLabSuite/Core/Component/File/Helper.ts +++ b/ts/WoltLabSuite/Core/Component/File/Helper.ts @@ -2,6 +2,10 @@ import WoltlabCoreFileElement from "WoltLabSuite/Core/Component/File/woltlab-cor import { getPhrase } from "WoltLabSuite/Core/Language"; import { formatFilesize } from "WoltLabSuite/Core/FileUtil"; +// This import has the side effect of registering the `` +// element. Do not remove! +import "WoltLabSuite/Core/Component/File/woltlab-core-file"; + export function trackUploadProgress(element: HTMLElement, file: WoltlabCoreFileElement): void { const progress = document.createElement("progress"); progress.classList.add("fileList__item__progress__bar"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/List.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/List.js index 8d12aeebe4..39033cc922 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/List.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Attachment/List.js @@ -1,4 +1,4 @@ -define(["require", "exports", "./Entry", "../Ckeditor/Event", "../File/woltlab-core-file"], function (require, exports, Entry_1, Event_1) { +define(["require", "exports", "./Entry", "../Ckeditor/Event"], function (require, exports, Entry_1, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setup = void 0; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Helper.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Helper.js index 22960c29af..bd68df5054 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Helper.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/File/Helper.js @@ -1,4 +1,4 @@ -define(["require", "exports", "WoltLabSuite/Core/Language", "WoltLabSuite/Core/FileUtil"], function (require, exports, Language_1, FileUtil_1) { +define(["require", "exports", "WoltLabSuite/Core/Language", "WoltLabSuite/Core/FileUtil", "WoltLabSuite/Core/Component/File/woltlab-core-file"], function (require, exports, Language_1, FileUtil_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.insertFileInformation = exports.fileInitializationFailed = exports.removeUploadProgress = exports.trackUploadProgress = void 0;