From 44ae5f08511877eccf8b76cdbf707d9f6e4d4b3b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 15 Jan 2021 18:40:22 +0100 Subject: [PATCH] Move data structures for the inline editor into a spearate module --- .../Core/Ui/Message/InlineEditor.ts | 23 +------------------ .../Core/Ui/Message/InlineEditor/Data.ts | 22 ++++++++++++++++++ .../Core/Ui/Message/InlineEditor/Data.js | 4 ++++ 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 ts/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.ts create mode 100644 wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.js diff --git a/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts index 90d0e37304..92bd5bee67 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts @@ -20,19 +20,7 @@ import * as UiDropdownReusable from "../Dropdown/Reusable"; import * as UiNotification from "../Notification"; import * as UiScroll from "../Scroll"; -interface MessageInlineEditorOptions { - canEditInline: boolean; - - className: string; - containerId: string; - dropdownIdentifier: string; - editorPrefix: string; - - messageSelector: string; - - // This is the legacy jQuery based class. - quoteManager: any; -} +import { ElementVisibility, ItemData, MessageInlineEditorOptions } from "./InlineEditor/Data"; interface ElementData { button: HTMLAnchorElement; @@ -44,15 +32,6 @@ interface ElementData { messageText: HTMLElement; } -interface ItemData { - item: "divider" | "editItem" | string; - label?: string; -} - -interface ElementVisibility { - [key: string]: boolean; -} - interface ValidationData { api: UiMessageInlineEditor; parameters: ArbitraryObject; diff --git a/ts/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.ts b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.ts new file mode 100644 index 0000000000..b872d11c84 --- /dev/null +++ b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.ts @@ -0,0 +1,22 @@ +export interface MessageInlineEditorOptions { + canEditInline: boolean; + + className: string; + containerId: string; + dropdownIdentifier: string; + editorPrefix: string; + + messageSelector: string; + + // This is the legacy jQuery based class. + quoteManager: any; +} + +export interface ItemData { + item: "divider" | "editItem" | string; + label?: string; +} + +export interface ElementVisibility { + [key: string]: boolean; +} diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.js new file mode 100644 index 0000000000..2ae92b6a8b --- /dev/null +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor/Data.js @@ -0,0 +1,4 @@ +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); -- 2.20.1