+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { setup as setupAttachment } from "./Ckeditor/Attachment";
import { setup as setupMedia } from "./Ckeditor/Media";
import { setup as setupMention } from "./Ckeditor/Mention";
+/**
+ * Forwards upload requests from the editor to the attachment system.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { dispatchToCkeditor, listenToCkeditor } from "./Event";
import type { CKEditor } from "../Ckeditor";
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { getStoragePrefix } from "../../Core";
import { getPhrase } from "../../Language";
import { escapeHTML } from "../../StringUtil";
return Promise.resolve();
},
- // TODO: This should be longer, because exporting the data is potentially expensive.
- waitingTime: 2_000,
+ waitingTime: 15_000,
};
}
+/**
+ * Helper class to construct the CKEditor configuration.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { getPhrase } from "../../Language";
import type { EditorConfig } from "@ckeditor/ckeditor5-core/src/editor/editorconfig";
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import type { CKEditor } from "../Ckeditor";
import type { EditorConfig } from "@ckeditor/ckeditor5-core/src/editor/editorconfig";
import type { Features } from "./Configuration";
+/**
+ * Forwards upload requests from the editor to the media system.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { dispatchToCkeditor, listenToCkeditor } from "./Event";
type UploadResult = {
+/**
+ * Provides mention support for users and groups.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { prepareRequest } from "../../Ajax/Backend";
import { createFragmentFromHtml } from "../../Dom/Util";
+/**
+ * Inserts quotes into the editor.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { escapeHTML } from "../../StringUtil";
import { listenToCkeditor } from "./Event";
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+
import { dispatchToCkeditor } from "./Event";
import type { CKEditor } from "../Ckeditor";
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @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 });
+/**
+ * Forwards upload requests from the editor to the attachment system.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
define(["require", "exports", "./Event"], function (require, exports, Event_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @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 });
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;
+/**
+ * Helper class to construct the CKEditor configuration.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
define(["require", "exports", "../../Language"], function (require, exports, Language_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * Forwards upload requests from the editor to the media system.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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);
+/**
+ * Provides mention support for users and groups.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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 });
+/**
+ * Inserts quotes into the editor.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
define(["require", "exports", "../../StringUtil", "./Event"], function (require, exports, StringUtil_1, Event_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * 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 <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
define(["require", "exports", "./Event"], function (require, exports, Event_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });