From: Alexander Ebert Date: Mon, 3 Apr 2023 16:26:25 +0000 (+0200) Subject: Add missing module level comments to the CKEditor API X-Git-Tag: 6.0.0_Alpha_1~300^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=44ec25bd4102c6e59de36234cdf43873f153d938;p=GitHub%2FWoltLab%2FWCF.git Add missing module level comments to the CKEditor API --- diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor.ts b/ts/WoltLabSuite/Core/Component/Ckeditor.ts index 83ac83a27d..f7c21f7f0f 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor.ts @@ -1,3 +1,17 @@ +/** + * The userland API for interactions with a CKEditor instance. + * + * The purpose of this implementation is to provide a stable and strongly typed + * API that can be reused in components. Access to the raw API of CKEditor is + * not exposed, if you feel that you need additional helper methods then please + * submit an issue. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { setup as setupAttachment } from "./Ckeditor/Attachment"; import { setup as setupMedia } from "./Ckeditor/Media"; import { setup as setupMention } from "./Ckeditor/Mention"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Attachment.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Attachment.ts index 7241dcb88b..7107e0060f 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Attachment.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Attachment.ts @@ -1,3 +1,12 @@ +/** + * Forwards upload requests from the editor to the attachment system. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { dispatchToCkeditor, listenToCkeditor } from "./Event"; import type { CKEditor } from "../Ckeditor"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Autosave.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Autosave.ts index b2e0b07f37..7af3745d55 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Autosave.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Autosave.ts @@ -1,3 +1,13 @@ +/** + * Periodically stores the editor contents to the local storage. Opening the + * same view again offers to restore the stored contents. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { getStoragePrefix } from "../../Core"; import { getPhrase } from "../../Language"; import { escapeHTML } from "../../StringUtil"; @@ -176,7 +186,6 @@ export function initializeAutosave(autosave: string, configuration: EditorConfig return Promise.resolve(); }, - // TODO: This should be longer, because exporting the data is potentially expensive. - waitingTime: 2_000, + waitingTime: 15_000, }; } diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts index b59aceccf6..10edf00c83 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts @@ -1,3 +1,12 @@ +/** + * Helper class to construct the CKEditor configuration. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { getPhrase } from "../../Language"; import type { EditorConfig } from "@ckeditor/ckeditor5-core/src/editor/editorconfig"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Event.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Event.ts index cd2483b3e8..e92ebb69a1 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Event.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Event.ts @@ -1,3 +1,13 @@ +/** + * Provides a strongly typed event interface for CKEditor on top of native DOM + * events to prevent memory leaks. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import type { CKEditor } from "../Ckeditor"; import type { EditorConfig } from "@ckeditor/ckeditor5-core/src/editor/editorconfig"; import type { Features } from "./Configuration"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Media.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Media.ts index dc3ecd5322..169c41ba04 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Media.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Media.ts @@ -1,3 +1,12 @@ +/** + * Forwards upload requests from the editor to the media system. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { dispatchToCkeditor, listenToCkeditor } from "./Event"; type UploadResult = { diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Mention.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Mention.ts index 95e5cdac17..e6f3793e7e 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Mention.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Mention.ts @@ -1,3 +1,12 @@ +/** + * Provides mention support for users and groups. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { prepareRequest } from "../../Ajax/Backend"; import { createFragmentFromHtml } from "../../Dom/Util"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Quote.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Quote.ts index d5556994cb..dc93720095 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Quote.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Quote.ts @@ -1,3 +1,12 @@ +/** + * Inserts quotes into the editor. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { escapeHTML } from "../../StringUtil"; import { listenToCkeditor } from "./Event"; diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.ts index 3ecf1feca4..b0f61bad1b 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.ts @@ -1,3 +1,14 @@ +/** + * Modifies the behavior of the 'Enter' key to submit the editor instead of + * starting a new paragraph. 'Shift' + 'Enter' can be used to create a line + * break. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ + import { dispatchToCkeditor } from "./Event"; import type { CKEditor } from "../Ckeditor"; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js index 7a250c56b8..9392572db3 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js @@ -1,3 +1,16 @@ +/** + * The userland API for interactions with a CKEditor instance. + * + * The purpose of this implementation is to provide a stable and strongly typed + * API that can be reused in components. Access to the raw API of CKEditor is + * not exposed, if you feel that you need additional helper methods then please + * submit an issue. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "tslib", "./Ckeditor/Attachment", "./Ckeditor/Media", "./Ckeditor/Mention", "./Ckeditor/Quote", "./Ckeditor/Autosave", "./Ckeditor/Configuration", "./Ckeditor/Event", "./Ckeditor/SubmitOnEnter", "../Devtools", "ckeditor5-bundle"], function (require, exports, tslib_1, Attachment_1, Media_1, Mention_1, Quote_1, Autosave_1, Configuration_1, Event_1, SubmitOnEnter_1, Devtools_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Attachment.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Attachment.js index 052106eb0b..602afc2a4e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Attachment.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Attachment.js @@ -1,3 +1,11 @@ +/** + * Forwards upload requests from the editor to the attachment system. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "./Event"], function (require, exports, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Autosave.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Autosave.js index 269c684bc7..5521bd31df 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Autosave.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Autosave.js @@ -1,3 +1,12 @@ +/** + * Periodically stores the editor contents to the local storage. Opening the + * same view again offers to restore the stored contents. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "../../Core", "../../Language", "../../StringUtil", "./Event"], function (require, exports, Core_1, Language_1, StringUtil_1, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -141,8 +150,7 @@ define(["require", "exports", "../../Core", "../../Language", "../../StringUtil" saveDraft(autosave, editor.data.get()); return Promise.resolve(); }, - // TODO: This should be longer, because exporting the data is potentially expensive. - waitingTime: 2000, + waitingTime: 15000, }; } exports.initializeAutosave = initializeAutosave; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js index ff3ea25c11..92bbcf431e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js @@ -1,3 +1,11 @@ +/** + * Helper class to construct the CKEditor configuration. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "../../Language"], function (require, exports, Language_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Event.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Event.js index 983a70f49e..f689552a65 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Event.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Event.js @@ -1,3 +1,12 @@ +/** + * Provides a strongly typed event interface for CKEditor on top of native DOM + * events to prevent memory leaks. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Media.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Media.js index 1e2bbf4494..d765e5ec70 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Media.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Media.js @@ -1,3 +1,11 @@ +/** + * Forwards upload requests from the editor to the media system. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Mention.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Mention.js index b594a34710..00d22952b1 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Mention.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Mention.js @@ -1,3 +1,11 @@ +/** + * Provides mention support for users and groups. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "../../Ajax/Backend", "../../Dom/Util", "./Event"], function (require, exports, Backend_1, Util_1, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Quote.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Quote.js index 8c59ed719c..9543b16451 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Quote.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Quote.js @@ -1,3 +1,11 @@ +/** + * Inserts quotes into the editor. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "../../StringUtil", "./Event"], function (require, exports, StringUtil_1, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.js index 513717ee2f..2c87427199 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/SubmitOnEnter.js @@ -1,3 +1,13 @@ +/** + * Modifies the behavior of the 'Enter' key to submit the editor instead of + * starting a new paragraph. 'Shift' + 'Enter' can be used to create a line + * break. + * + * @author Alexander Ebert + * @copyright 2001-2023 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.0 + */ define(["require", "exports", "./Event"], function (require, exports, Event_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true });