2022-09-26 01:47:50 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
|
|
|
import CheckBox from "../../components/CheckBox.svelte";
|
|
|
|
import DropdownItem from "../../components/DropdownItem.svelte";
|
|
|
|
import IconButton from "../../components/IconButton.svelte";
|
|
|
|
import Popover from "../../components/Popover.svelte";
|
|
|
|
import WithFloating from "../../components/WithFloating.svelte";
|
|
|
|
import { bridgeCommand } from "../../lib/bridgecommand";
|
|
|
|
import * as tr from "../../lib/ftl";
|
|
|
|
import { shrinkImagesByDefault } from "../image-overlay/ImageOverlay.svelte";
|
2022-10-03 05:14:57 +02:00
|
|
|
import { closeHTMLTags } from "../plain-text-input/PlainTextInput.svelte";
|
2022-09-26 01:47:50 +02:00
|
|
|
import { cogIcon } from "./icons";
|
|
|
|
|
|
|
|
let showFloating = false;
|
|
|
|
|
|
|
|
function toggleShrinkImages(_evt: MouseEvent): void {
|
|
|
|
$shrinkImagesByDefault = !$shrinkImagesByDefault;
|
|
|
|
bridgeCommand("toggleShrinkImages");
|
|
|
|
showFloating = false;
|
|
|
|
}
|
2022-10-03 05:14:57 +02:00
|
|
|
|
|
|
|
function toggleCloseHTMLTags(_evt: MouseEvent): void {
|
|
|
|
$closeHTMLTags = !$closeHTMLTags;
|
|
|
|
bridgeCommand("toggleCloseHTMLTags");
|
|
|
|
showFloating = false;
|
|
|
|
}
|
2022-09-26 01:47:50 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<WithFloating
|
|
|
|
show={showFloating}
|
|
|
|
placement="bottom"
|
|
|
|
inline
|
|
|
|
on:close={() => (showFloating = false)}
|
|
|
|
>
|
2022-09-26 02:03:02 +02:00
|
|
|
<IconButton
|
|
|
|
slot="reference"
|
|
|
|
tooltip={tr.actionsOptions()}
|
|
|
|
--border-left-radius="5px"
|
|
|
|
--border-right-radius="5px"
|
|
|
|
on:click={() => (showFloating = !showFloating)}
|
|
|
|
>
|
|
|
|
{@html cogIcon}
|
|
|
|
</IconButton>
|
2022-09-26 01:47:50 +02:00
|
|
|
|
|
|
|
<Popover slot="floating" --popover-padding-inline="0">
|
|
|
|
<DropdownItem on:click={toggleShrinkImages}>
|
|
|
|
<CheckBox value={$shrinkImagesByDefault} />
|
|
|
|
<span class="d-flex-inline ps-3">{tr.editingShrinkImages()}</span>
|
|
|
|
</DropdownItem>
|
2022-10-03 05:14:57 +02:00
|
|
|
<DropdownItem on:click={toggleCloseHTMLTags}>
|
|
|
|
<CheckBox value={$closeHTMLTags} />
|
|
|
|
<span class="d-flex-inline ps-3">{tr.editingCloseHtmlTags()}</span>
|
|
|
|
</DropdownItem>
|
2022-09-26 01:47:50 +02:00
|
|
|
</Popover>
|
|
|
|
</WithFloating>
|