anki/ts/deckoptions/AudioOptions.svelte

53 lines
1.7 KiB
Svelte
Raw Normal View History

2021-05-27 23:19:05 +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 * as tr from "lib/i18n";
import marked from "marked";
2021-05-27 23:19:05 +02:00
import TitledContainer from "./TitledContainer.svelte";
import Row from "./Row.svelte";
import Col from "./Col.svelte";
import HelpPopup from "./HelpPopup.svelte";
2021-05-27 23:19:05 +02:00
import CheckBox from "./CheckBox.svelte";
2021-05-28 23:59:20 +02:00
import RevertButton from "./RevertButton.svelte";
2021-05-27 23:19:05 +02:00
import type { DeckOptionsState } from "./lib";
export let state: DeckOptionsState;
let config = state.currentConfig;
let defaults = state.defaults;
</script>
<TitledContainer title={tr.deckConfigAudioTitle()}>
<Row>
<Col>
2021-05-29 00:33:59 +02:00
<CheckBox bind:value={$config.disableAutoplay}>
{tr.deckConfigDisableAutoplay()}
</CheckBox>
</Col>
<Col grow={false}>
2021-05-29 00:33:59 +02:00
<RevertButton
defaultValue={defaults.disableAutoplay}
bind:value={$config.disableAutoplay}
/>
</Col>
</Row>
2021-05-27 23:19:05 +02:00
<Row>
<Col>
2021-05-29 00:33:59 +02:00
<CheckBox bind:value={$config.skipQuestionWhenReplayingAnswer}>
{tr.schedulingAlwaysIncludeQuestionSideWhenReplaying()}
<HelpPopup
html={marked(tr.deckConfigAlwaysIncludeQuestionAudioTooltip())}
/>
</CheckBox>
</Col>
<Col grow={false}>
2021-05-29 00:33:59 +02:00
<RevertButton
defaultValue={defaults.skipQuestionWhenReplayingAnswer}
bind:value={$config.skipQuestionWhenReplayingAnswer}
/>
</Col>
</Row>
2021-05-27 23:19:05 +02:00
</TitledContainer>