Add fixed chat textarea option to AccessibilitySettings

Additionally, change 'send to center' to 'send to shift center'
This commit is contained in:
YH_KIM
2025-04-06 16:37:29 +09:00
parent ea570787c2
commit 4c47480b7e
10 changed files with 213 additions and 196 deletions

View File

@@ -379,7 +379,8 @@ export const languageChinese = {
"globalLoreBook": "全局世界书",
"globalRegexScript": "全局正则表达式",
"accessibility": "辅助功能",
"sendWithEnter": "使用 Enter 键发送",
"sendWithEnter": "使用 Enter 键发送取消检查时Shift + Enter更改为消息传送。",
"fixedChatTextarea": "固定聊天窗口底部",
"clickToEdit": "点击文字进行编辑",
"setNodePassword": "设置密码以提升安全性",
"inputNodePassword": "输入密码。如果忘记密码,请删除服务器文档中的 save/__password.txt 并重启服务器。",

View File

@@ -291,7 +291,8 @@ export const languageGerman = {
globalLoreBook: 'Lore Buch',
globalRegexScript: "Regex",
accessibility: "Barrierefreiheit",
sendWithEnter: "Mit Enter senden",
sendWithEnter: "Mit Enter senden(Umschalt + Enter beim Entpacken zu senden)",
fixedChatTextarea: "Unten im Chatfenster fixieren",
clickToEdit: "Text zum Bearbeiten anklicken",
setNodePassword: "Legen Sie Ihr Passwort für die Sicherheit fest",
inputNodePassword: "Geben Sie Ihr Passwort ein. Wenn Sie sich nicht erinnern können, entfernen Sie save/__password.txt in Ihren Serverdateien und starten Sie den Server neu",

View File

@@ -570,6 +570,7 @@ export const languageEnglish = {
globalRegexScript: "Global Regex",
accessibility: "Accessibility",
sendWithEnter: "Send with Enter Key",
fixedChatTextarea: "Fixed at the bottom of the chat window(When unchecked, Shift + Enter changes to send a message.)",
clickToEdit: "Click Text to Edit",
setNodePassword: "Set your password to security",
inputNodePassword: "Input your password. if you can't remember, remove save/__password.txt in your server files and restart the server.",

View File

@@ -341,7 +341,8 @@ export const languageSpanish = {
globalLoreBook: 'Libro de Lore Global',
globalRegexScript: "Regex Global",
accessibility: "Accesibilidad",
sendWithEnter: "Enviar con la Tecla Enter",
sendWithEnter: "Enviar con la Tecla Enter(Al desactivar la verificación, Shift + Enter cambia a Transmisión de Mensajes.)",
fixedChatTextarea: "Fijación en la parte inferior de la ventana de chat",
clickToEdit: "Haz Clic en el Texto para Editar",
setNodePassword: "Establece tu contraseña para la seguridad",
inputNodePassword: "Ingresa tu contraseña. si no la recuerdas, elimina save/__password.txt en tus archivos de servidor y reinicia el servidor.",

View File

@@ -517,7 +517,8 @@ export const languageKorean = {
"globalLoreBook": "글로벌 로어북",
"globalRegexScript": "글로벌 정규식",
"accessibility": "접근성",
"sendWithEnter": "엔터키로 메세지 보내기",
"sendWithEnter": "엔터키로 메세지 보내기(체크 해제시 Shift + Enter가 메세지 전송으로 변경.)",
"fixedChatTextarea": "채팅창 하단 고정",
"clickToEdit": "클릭해서 수정하기",
"setNodePassword": "보안을 위해 비밀번호를 정해주세요",
"inputNodePassword": "비밀번호를 입력해주세요. 기억이 안나신다면, save/__password를 지우고 서버를 재시작해주세요.",

View File

@@ -262,7 +262,8 @@ export const LanguageVietnamese = {
"globalLoreBook": "Sách truyền thuyết toàn cầu",
"globalRegexScript": "Regex toàn cầu",
"accessibility": "Khả năng tiếp cận",
"sendWithEnter": "Gửi bằng phím Enter",
"sendWithEnter": "Gửi bằng phím Enter(Shift + Enter chuyển sang gửi tin nhắn khi không kiểm tra.)",
"fixedChatTextarea": "Cố định ở dưới khung chat",
"clickToEdit": "Bấm vào văn bản để chỉnh sửa",
"setNodePassword": "Đặt mật khẩu của bạn để bảo mật",
"inputNodePassword": "Nhập mật khẩu của bạn. nếu bạn không nhớ, hãy xóa save/__password.txt trong tệp máy chủ của bạn và khởi động lại máy chủ.",

View File

@@ -384,7 +384,8 @@ export const languageChineseTraditional = {
"globalLoreBook": "全域 Lorebook",
"globalRegexScript": "全域正規表達式",
"accessibility": "輔助功能",
"sendWithEnter": "使用 Enter 鍵發送",
"sendWithEnter": "使用 Enter 鍵發送取消检查时Shift + Enter更改为消息传送。",
"fixedChatTextarea": "固定聊天窗口底部",
"clickToEdit": "點擊文字進行編輯",
"setNodePassword": "設定密碼以提升安全性",
"inputNodePassword": "輸入密碼。如果忘記密碼,請刪除伺服器文件中的 save/__password.txt 並重啟伺服器。",

View File

@@ -442,7 +442,10 @@
loadPages += 15
}
}}>
<div class="flex items-stretch mt-2 mb-2 w-full">
<div
class="{DBState.db.fixedChatTextarea ? 'sticky pt-2 pb-2 right-0 bottom-0 bg-bgcolor' : 'mt-2 mb-2'} flex items-stretch w-full"
style="{DBState.db.fixedChatTextarea ? 'z-index:29;' : ''}"
>
{#if DBState.db.useChatSticker && currentCharacter.type !== 'group'}
<div onclick={()=>{toggleStickers = !toggleStickers}}
class={"ml-4 bg-textcolor2 flex justify-center items-center w-12 h-12 rounded-md hover:bg-green-500 transition-colors "+(toggleStickers ? 'text-green-500':'text-textcolor')}>
@@ -455,8 +458,11 @@
bind:value={messageInput}
bind:this={inputEle}
onkeydown={(e) => {
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey) && !e.isComposing){
if(DBState.db.sendWithEnter){
if(e.key.toLocaleLowerCase() === "enter" && !e.isComposing){
if(DBState.db.sendWithEnter && (!e.shiftKey)){
send()
e.preventDefault()
}else if(!DBState.db.sendWithEnter && e.shiftKey){
send()
e.preventDefault()
}
@@ -580,7 +586,7 @@
oninput={()=>{updateInputSizeAll();updateInputTransateMessage(true)}}
placeholder={language.enterMessageForTranslateToEnglish}
style:height={inputTranslateHeight}
></textarea>
></textarea>
</div>
{/if}
@@ -753,7 +759,7 @@
{/if}
{#if openMenu}
<div class="absolute right-2 bottom-16 p-5 bg-darkbg flex flex-col gap-3 text-textcolor rounded-md" onclick={(e) => {
<div class="{DBState.db.fixedChatTextarea ? 'fixed' : 'absolute'} right-2 bottom-16 p-5 bg-darkbg flex flex-col gap-3 text-textcolor rounded-md" onclick={(e) => {
e.stopPropagation()
}}>
{#if DBState.db.characters[$selectedCharID].type === 'group'}

View File

@@ -1,7 +1,6 @@
<script lang="ts">
import Check from "src/lib/UI/GUI/CheckInput.svelte";
import { language } from "src/lang";
import { DBState } from 'src/ts/stores.svelte';
</script>
@@ -24,6 +23,10 @@
<Check bind:check={DBState.db.sendWithEnter} name={language.sendWithEnter}/>
</div>
<div class="flex items-center mt-2">
<Check bind:check={DBState.db.fixedChatTextarea} name={language.fixedChatTextarea}/>
</div>
<div class="flex items-center mt-2">
<Check bind:check={DBState.db.clickToEdit} name={language.clickToEdit}/>
</div>

View File

@@ -694,6 +694,7 @@ export interface Database{
}
globalscript: customscript[],
sendWithEnter:boolean
fixedChatTextarea:boolean
clickToEdit: boolean
koboldURL:string
advancedBotSettings:boolean