enh: rich text input toggle option

This commit is contained in:
Timothy J. Baek
2024-10-25 21:31:18 -07:00
parent 8b61b39c75
commit adede5480d
4 changed files with 262 additions and 50 deletions

View File

@@ -30,6 +30,7 @@
// Interface
let defaultModelId = '';
let showUsername = false;
let richTextInput = true;
let landingPageMode = '';
let chatBubble = true;
@@ -125,6 +126,11 @@
saveSettings({ autoTags });
};
const toggleRichTextInput = async () => {
richTextInput = !richTextInput;
saveSettings({ richTextInput });
};
const toggleResponseAutoCopy = async () => {
const permission = await navigator.clipboard
.readText()
@@ -172,6 +178,7 @@
showEmojiInCall = $settings.showEmojiInCall ?? false;
voiceInterruption = $settings.voiceInterruption ?? false;
richTextInput = $settings.richTextInput ?? true;
landingPageMode = $settings.landingPageMode ?? '';
chatBubble = $settings.chatBubble ?? true;
widescreenMode = $settings.widescreenMode ?? false;
@@ -422,6 +429,28 @@
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">
{$i18n.t('Rich Text Input for Chat')}
</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
toggleRichTextInput();
}}
type="button"
>
{#if richTextInput === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
{/if}
</button>
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">