[feat] change with enter
This commit is contained in:
@@ -278,5 +278,6 @@ export const languageEnglish = {
|
|||||||
charLoreBook: 'Character Lorebook',
|
charLoreBook: 'Character Lorebook',
|
||||||
globalLoreBook: 'Global Lorebook',
|
globalLoreBook: 'Global Lorebook',
|
||||||
globalRegexScript: "Global Regex",
|
globalRegexScript: "Global Regex",
|
||||||
accessibility: "Accessibility"
|
accessibility: "Accessibility",
|
||||||
|
sendWithEnter: "Send with Enter Key"
|
||||||
}
|
}
|
||||||
@@ -205,8 +205,10 @@
|
|||||||
bind:this={inputEle}
|
bind:this={inputEle}
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey)){
|
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey)){
|
||||||
send()
|
if($DataBase.sendWithEnter){
|
||||||
e.preventDefault()
|
send()
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(e.key.toLocaleLowerCase() === "m" && (e.ctrlKey)){
|
if(e.key.toLocaleLowerCase() === "m" && (e.ctrlKey)){
|
||||||
reroll()
|
reroll()
|
||||||
|
|||||||
@@ -20,3 +20,8 @@
|
|||||||
<Check bind:check={$DataBase.instantRemove}/>
|
<Check bind:check={$DataBase.instantRemove}/>
|
||||||
<span>{language.instantRemove}</span>
|
<span>{language.instantRemove}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.sendWithEnter}/>
|
||||||
|
<span>{language.sendWithEnter}</span>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -251,6 +251,9 @@ export function setDatabase(data:Database){
|
|||||||
if(checkNullish(data.globalscript)){
|
if(checkNullish(data.globalscript)){
|
||||||
data.globalscript = []
|
data.globalscript = []
|
||||||
}
|
}
|
||||||
|
if(checkNullish(data.sendWithEnter)){
|
||||||
|
data.sendWithEnter = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
changeLanguage(data.language)
|
changeLanguage(data.language)
|
||||||
@@ -481,6 +484,7 @@ export interface Database{
|
|||||||
model:string
|
model:string
|
||||||
}
|
}
|
||||||
globalscript: customscript[]
|
globalscript: customscript[]
|
||||||
|
sendWithEnter:boolean
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user