Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
7a30dbc8
Commit
7a30dbc8
authored
Mar 03, 2024
by
Carlos Daniel Vilaseca
Browse files
rf: added Element to variable names
parent
b986c2ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+8
-8
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+3
-3
No files found.
src/lib/components/chat/MessageInput.svelte
View file @
7a30dbc8
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
export let suggestionPrompts = [];
export let suggestionPrompts = [];
export let autoScroll = true;
export let autoScroll = true;
let chatTextArea:HTMLTextAreaElement
let chatTextArea
Element
:HTMLTextAreaElement
let filesInputElement;
let filesInputElement;
let promptsElement;
let promptsElement;
...
@@ -43,9 +43,9 @@
...
@@ -43,9 +43,9 @@
let speechRecognition;
let speechRecognition;
$: if (prompt) {
$: if (prompt) {
if (chatTextArea) {
if (chatTextArea
Element
) {
chatTextArea.style.height = '';
chatTextArea
Element
.style.height = '';
chatTextArea.style.height = Math.min(chatTextArea.scrollHeight, 200) + 'px';
chatTextArea
Element
.style.height = Math.min(chatTextArea
Element
.scrollHeight, 200) + 'px';
}
}
}
}
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
if (res) {
if (res) {
prompt = res.text;
prompt = res.text;
await tick();
await tick();
chatTextArea?.focus();
chatTextArea
Element
?.focus();
if (prompt !== '' && $settings?.speechAutoSend === true) {
if (prompt !== '' && $settings?.speechAutoSend === true) {
submitPrompt(prompt, user);
submitPrompt(prompt, user);
...
@@ -187,7 +187,7 @@
...
@@ -187,7 +187,7 @@
prompt = `${prompt}${transcript}`;
prompt = `${prompt}${transcript}`;
await tick();
await tick();
chatTextArea?.focus();
chatTextArea
Element
?.focus();
// Restart the inactivity timeout
// Restart the inactivity timeout
timeoutId = setTimeout(() => {
timeoutId = setTimeout(() => {
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
};
};
onMount(() => {
onMount(() => {
window.setTimeout(() => chatTextArea?.focus(), 0);
window.setTimeout(() => chatTextArea
Element
?.focus(), 0);
const dropZone = document.querySelector('body');
const dropZone = document.querySelector('body');
...
@@ -657,7 +657,7 @@
...
@@ -657,7 +657,7 @@
<textarea
<textarea
id="chat-textarea"
id="chat-textarea"
bind:this={chatTextArea}
bind:this={chatTextArea
Element
}
class=" dark:bg-gray-900 dark:text-gray-100 outline-none w-full py-3 px-3 {fileUploadEnabled
class=" dark:bg-gray-900 dark:text-gray-100 outline-none w-full py-3 px-3 {fileUploadEnabled
? ''
? ''
: ' pl-4'} rounded-xl resize-none h-[48px]"
: ' pl-4'} rounded-xl resize-none h-[48px]"
...
...
src/routes/(app)/+layout.svelte
View file @
7a30dbc8
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
let ollamaVersion = '';
let ollamaVersion = '';
let loaded = false;
let loaded = false;
let showShortcutsButton:HTMLButtonElement
let showShortcutsButton
Element
:HTMLButtonElement
let DB = null;
let DB = null;
let localDBChats = [];
let localDBChats = [];
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
if (isCtrlPressed && event.key === '/') {
if (isCtrlPressed && event.key === '/') {
event.preventDefault();
event.preventDefault();
console.log('showShortcuts');
console.log('showShortcuts');
showShortcutsButton.click();
showShortcutsButton
Element
.click();
}
}
});
});
...
@@ -203,7 +203,7 @@
...
@@ -203,7 +203,7 @@
<div class=" hidden lg:flex fixed bottom-0 right-0 px-3 py-3 z-10">
<div class=" hidden lg:flex fixed bottom-0 right-0 px-3 py-3 z-10">
<button
<button
id="show-shortcuts-button"
id="show-shortcuts-button"
bind:this={showShortcutsButton}
bind:this={showShortcutsButton
Element
}
class="text-gray-600 dark:text-gray-300 bg-gray-300/20 w-6 h-6 flex items-center justify-center text-xs rounded-full"
class="text-gray-600 dark:text-gray-300 bg-gray-300/20 w-6 h-6 flex items-center justify-center text-xs rounded-full"
on:click={() => {
on:click={() => {
showShortcuts = !showShortcuts;
showShortcuts = !showShortcuts;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment