mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 13:17:12 -05:00
50 lines
1 KiB
TypeScript
50 lines
1 KiB
TypeScript
import { bridgeCommand } from "anki/bridgecommand";
|
|
|
|
import IconButton from "./IconButton.svelte";
|
|
|
|
import paperclipIcon from "./paperclip.svg";
|
|
import micIcon from "./mic.svg";
|
|
import bracketsIcon from "./code-brackets.svg";
|
|
import functionIcon from "./function-variant.svg";
|
|
import xmlIcon from "./xml.svg";
|
|
|
|
function onAttachment(): void {
|
|
bridgeCommand("attach");
|
|
}
|
|
|
|
function onRecord(): void {
|
|
bridgeCommand("record");
|
|
}
|
|
|
|
function onCloze(): void {
|
|
bridgeCommand("cloze");
|
|
}
|
|
|
|
function onHtmlEdit(): void {
|
|
bridgeCommand("htmlEdit");
|
|
}
|
|
|
|
export const attachmentButton = {
|
|
component: IconButton,
|
|
icon: paperclipIcon,
|
|
onClick: onAttachment,
|
|
};
|
|
|
|
export const recordButton = { component: IconButton, icon: micIcon, onClick: onRecord };
|
|
|
|
export const clozeButton = {
|
|
component: IconButton,
|
|
icon: bracketsIcon,
|
|
onClick: onCloze,
|
|
};
|
|
|
|
export const mathjaxButton = {
|
|
component: IconButton,
|
|
icon: functionIcon,
|
|
};
|
|
|
|
export const htmlButton = {
|
|
component: IconButton,
|
|
icon: xmlIcon,
|
|
onClick: onHtmlEdit,
|
|
};
|