diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index c20c8f4be..d76bdc550 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -82,7 +82,7 @@ _html = """ }
- +
@@ -1113,6 +1113,7 @@ class Editor: dupes=showDupes, paste=onPaste, cutOrCopy=onCutOrCopy, + htmlEdit=onHtmlEdit, ) diff --git a/ts/editor-toolbar/BUILD.bazel b/ts/editor-toolbar/BUILD.bazel index 440a1a23f..74455cf96 100644 --- a/ts/editor-toolbar/BUILD.bazel +++ b/ts/editor-toolbar/BUILD.bazel @@ -77,7 +77,7 @@ esbuild( "//ts:protobuf-shim.js", ], args = [ - "--global-name=anki", + "--global-name=editorToolbar", "--inject:ts/protobuf-shim.js", "--loader:.svg=text", ], diff --git a/ts/editor-toolbar/CommandIconButton.svelte b/ts/editor-toolbar/CommandIconButton.svelte index 633d824c8..b5efcaaa0 100644 --- a/ts/editor-toolbar/CommandIconButton.svelte +++ b/ts/editor-toolbar/CommandIconButton.svelte @@ -3,7 +3,7 @@ export const commandMap = writable(new Map()); - function updateButton(key: string): void { + function initializeButton(key: string): void { commandMap.update( (map: Map): Map => new Map([...map, [key, document.queryCommandState(key)]]) @@ -24,11 +24,11 @@ ); } - export function updateButtonActive() { + export function updateActiveButtons() { updateButtons((key: string): boolean => document.queryCommandState(key)); } - export function clearButtonActive() { + export function clearActiveButtons() { updateButtons((): boolean => false); } @@ -44,7 +44,7 @@ let active = false; if (activatable) { - updateButton(command); + initializeButton(command); commandMap.subscribe((map: Record): void => { active = map.get(command); diff --git a/ts/editor-toolbar/EditorToolbar.svelte b/ts/editor-toolbar/EditorToolbar.svelte index 51c101347..4fef8b702 100644 --- a/ts/editor-toolbar/EditorToolbar.svelte +++ b/ts/editor-toolbar/EditorToolbar.svelte @@ -1,11 +1,17 @@