mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00

* Forbid inserting object and iframe tags via PlainTextInput * Add optional browserMode parameter to Editor * Create new ts modules for three editor instances - note-creator for AddCards - browser-editor for the editor in the Browser - reviewer-editor for the EditCurrent * Revert "Forbid inserting object and iframe tags via PlainTextInput" This reverts commit ab90ae8194494d883a1863126496e2d8f332509e. * Refactor browserMode to editorMode * Move new editor variants inside /ts/editor directory * Fix typo
27 lines
656 B
TypeScript
27 lines
656 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
import { i18n } from ".";
|
|
import NoteCreator from "./NoteCreator.svelte";
|
|
import { promiseWithResolver } from "../lib/promise";
|
|
import { globalExport } from "../lib/globals";
|
|
|
|
const [uiPromise, uiResolve] = promiseWithResolver();
|
|
|
|
async function setupNoteCreator(): Promise<void> {
|
|
await i18n;
|
|
|
|
new NoteCreator({
|
|
target: document.body,
|
|
props: { uiResolve },
|
|
});
|
|
}
|
|
|
|
setupNoteCreator();
|
|
|
|
import * as editor from ".";
|
|
|
|
globalExport({
|
|
...editor,
|
|
uiPromise,
|
|
noteEditorPromise: uiPromise,
|
|
});
|