diff --git a/ts/editor/ColorButtons.svelte b/ts/editor/ColorButtons.svelte index beea69bb3..45467d49e 100644 --- a/ts/editor/ColorButtons.svelte +++ b/ts/editor/ColorButtons.svelte @@ -8,10 +8,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import ButtonGroup from "components/ButtonGroup.svelte"; import ButtonGroupItem from "components/ButtonGroupItem.svelte"; import IconButton from "components/IconButton.svelte"; - import ColorPicker from "components/ColorPicker.svelte"; import WithShortcut from "components/WithShortcut.svelte"; + import WithColorHelper from "./WithColorHelper.svelte"; - import { squareFillIcon } from "./icons"; + import { textColorIcon, highlightColorIcon } from "./icons"; import { appendInParentheses } from "./helpers"; import "./color.css"; @@ -25,16 +25,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html document.documentElement.style.setProperty(foregroundColorKeyword, color); } - function wrapWithForecolor(): void { + const wrapWithForecolor = (color: string) => () => { document.execCommand("forecolor", false, color); } + const wrapWithBackcolor = (color: string) => () => { + document.execCommand("backcolor", false, color); + } + function setWithCurrentColor({ currentTarget }: Event): void { color = (currentTarget as HTMLInputElement).value; } + + + + + + + {@html textColorIcon} + {@html colorHelperIcon} + + + + + + + + + + {@html highlightColorIcon} + {@html colorHelperIcon} + + + + diff --git a/ts/editor/TemplateButtons.svelte b/ts/editor/TemplateButtons.svelte index 264399e72..3ee854e77 100644 --- a/ts/editor/TemplateButtons.svelte +++ b/ts/editor/TemplateButtons.svelte @@ -42,6 +42,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html tr.editingAttachPicturesaudiovideo(), shortcutLabel )} + iconSize={70} on:click={onAttachment} on:mount={createShortcut} > @@ -54,6 +55,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html @@ -164,6 +166,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html diff --git a/ts/editor/WithColorHelper.svelte b/ts/editor/WithColorHelper.svelte new file mode 100644 index 000000000..5fe2ab2f0 --- /dev/null +++ b/ts/editor/WithColorHelper.svelte @@ -0,0 +1,23 @@ + + + +
+ +
+ + diff --git a/ts/editor/icons.ts b/ts/editor/icons.ts index 1973235c6..978045565 100644 --- a/ts/editor/icons.ts +++ b/ts/editor/icons.ts @@ -23,7 +23,7 @@ export { default as outdentIcon } from "./text-indent-right.svg"; export { default as squareFillIcon } from "./square-fill.svg"; export { default as textColorIcon } from "./format-color-text.svg"; export { default as highlightColorIcon } from "./format-color-highlight.svg"; -export { default as colorHelper } from "./color-helper.svg"; +export { default as colorHelperIcon } from "./color-helper.svg"; export { default as paperclipIcon } from "./paperclip.svg"; export { default as micIcon } from "./mic.svg";