mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-23 23:29:31 +01:00
enh: copy formatted option
Co-Authored-By: Sebastian Whincop <123417897+macjedi42@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
let chatBubble = true;
|
||||
let chatDirection: 'LTR' | 'RTL' | 'auto' = 'auto';
|
||||
let ctrlEnterToSend = false;
|
||||
let copyFormatted = false;
|
||||
|
||||
let collapseCodeBlocks = false;
|
||||
let expandDetails = false;
|
||||
@@ -220,6 +221,11 @@
|
||||
}
|
||||
};
|
||||
|
||||
const toggleCopyFormatted = async () => {
|
||||
copyFormatted = !copyFormatted;
|
||||
saveSettings({ copyFormatted });
|
||||
};
|
||||
|
||||
const toggleChangeChatDirection = async () => {
|
||||
if (chatDirection === 'auto') {
|
||||
chatDirection = 'LTR';
|
||||
@@ -275,6 +281,7 @@
|
||||
richTextInput = $settings.richTextInput ?? true;
|
||||
promptAutocomplete = $settings.promptAutocomplete ?? false;
|
||||
largeTextAsFile = $settings.largeTextAsFile ?? false;
|
||||
copyFormatted = $settings.copyFormatted ?? false;
|
||||
|
||||
collapseCodeBlocks = $settings.collapseCodeBlocks ?? false;
|
||||
expandDetails = $settings.expandDetails ?? false;
|
||||
@@ -670,6 +677,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
<div class=" self-center text-xs">
|
||||
{$i18n.t('Copy Formatted Text')}
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||
on:click={() => {
|
||||
toggleCopyFormatted();
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if copyFormatted === 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">{$i18n.t('Always Collapse Code Blocks')}</div>
|
||||
|
||||
Reference in New Issue
Block a user