mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Add mathjaxButton and htmlButton instead of more button
This commit is contained in:
parent
77de6c0288
commit
b5b9c79f1c
3 changed files with 35 additions and 17 deletions
|
@ -57,7 +57,6 @@ copy_bootstrap_icons(
|
||||||
"square-fill.svg",
|
"square-fill.svg",
|
||||||
"paperclip.svg",
|
"paperclip.svg",
|
||||||
"mic.svg",
|
"mic.svg",
|
||||||
"three-dots.svg",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,7 +65,9 @@ copy_mdi_icons(
|
||||||
icons = [
|
icons = [
|
||||||
"format-superscript.svg",
|
"format-superscript.svg",
|
||||||
"format-subscript.svg",
|
"format-subscript.svg",
|
||||||
|
"function-variant.svg",
|
||||||
"code-brackets.svg",
|
"code-brackets.svg",
|
||||||
|
"xml.svg",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import { bridgeCommand } from "anki/bridgecommand";
|
import { bridgeCommand } from "anki/bridgecommand";
|
||||||
|
|
||||||
import IconButton from "./IconButton.svelte";
|
import IconButton from "./IconButton.svelte";
|
||||||
import bracketsIcon from "./code-brackets.svg";
|
|
||||||
import paperclipIcon from "./paperclip.svg";
|
import paperclipIcon from "./paperclip.svg";
|
||||||
import micIcon from "./mic.svg";
|
import micIcon from "./mic.svg";
|
||||||
import threeDotsIcon from "./three-dots.svg";
|
import bracketsIcon from "./code-brackets.svg";
|
||||||
|
import functionIcon from "./function-variant.svg";
|
||||||
function onCloze(): void {
|
import xmlIcon from "./xml.svg";
|
||||||
bridgeCommand("cloze");
|
|
||||||
}
|
|
||||||
|
|
||||||
function onAttachment(): void {
|
function onAttachment(): void {
|
||||||
bridgeCommand("attach");
|
bridgeCommand("attach");
|
||||||
|
@ -18,23 +16,36 @@ function onRecord(): void {
|
||||||
bridgeCommand("record");
|
bridgeCommand("record");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onCloze(): void {
|
||||||
|
bridgeCommand("cloze");
|
||||||
|
}
|
||||||
|
|
||||||
function onMore(): void {
|
function onMore(): void {
|
||||||
bridgeCommand("more");
|
bridgeCommand("more");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const attachmentButton = {
|
||||||
|
component: IconButton,
|
||||||
|
icon: paperclipIcon,
|
||||||
|
onClick: onAttachment,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const recordButton = { component: IconButton, icon: micIcon, onClick: onRecord };
|
||||||
|
|
||||||
export const clozeButton = {
|
export const clozeButton = {
|
||||||
component: IconButton,
|
component: IconButton,
|
||||||
icon: bracketsIcon,
|
icon: bracketsIcon,
|
||||||
onClick: onCloze,
|
onClick: onCloze,
|
||||||
};
|
};
|
||||||
export const attachmentButton = {
|
|
||||||
|
export const mathjaxButton = {
|
||||||
component: IconButton,
|
component: IconButton,
|
||||||
icon: paperclipIcon,
|
icon: functionIcon,
|
||||||
onClick: onAttachment,
|
onClick: onMore,
|
||||||
};
|
};
|
||||||
export const recordButton = { component: IconButton, icon: micIcon, onClick: onRecord };
|
|
||||||
export const moreButton = {
|
export const htmlButton = {
|
||||||
component: IconButton,
|
component: IconButton,
|
||||||
icon: threeDotsIcon,
|
icon: xmlIcon,
|
||||||
onClick: onMore,
|
onClick: onMore,
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,13 @@ import {
|
||||||
|
|
||||||
import { forecolorButton, colorpickerButton } from "./color";
|
import { forecolorButton, colorpickerButton } from "./color";
|
||||||
|
|
||||||
import { clozeButton, attachmentButton, recordButton, moreButton } from "./extra";
|
import {
|
||||||
|
attachmentButton,
|
||||||
|
recordButton,
|
||||||
|
clozeButton,
|
||||||
|
mathjaxButton,
|
||||||
|
htmlButton,
|
||||||
|
} from "./extra";
|
||||||
|
|
||||||
const defaultButtons = [
|
const defaultButtons = [
|
||||||
[
|
[
|
||||||
|
@ -31,7 +37,7 @@ const defaultButtons = [
|
||||||
eraserButton,
|
eraserButton,
|
||||||
],
|
],
|
||||||
[forecolorButton, colorpickerButton],
|
[forecolorButton, colorpickerButton],
|
||||||
[clozeButton, attachmentButton, recordButton, moreButton],
|
[attachmentButton, recordButton, clozeButton, mathjaxButton, htmlButton],
|
||||||
];
|
];
|
||||||
|
|
||||||
class EditorToolbar extends HTMLElement {
|
class EditorToolbar extends HTMLElement {
|
||||||
|
|
Loading…
Reference in a new issue