diff --git a/chat-core.js b/chat-core.js index 1cc5a38..cb7cbfb 100644 --- a/chat-core.js +++ b/chat-core.js @@ -3,7 +3,10 @@ async function pollinationsFetch(url, options = {}, { timeoutMs = 45000 } = {}) const controller = new AbortController(); const timer = setTimeout(() => controller.abort(new DOMException('timeout', 'AbortError')), timeoutMs); try { - const res = await fetch(url, { ...options, signal: controller.signal, cache: 'no-store' }); + const res = await fetch( + url, + { ...options, signal: controller.signal, cache: 'no-store' } + ); if (!res.ok) throw new Error(`HTTP ${res.status}`); return res; } finally { diff --git a/chat-init.js b/chat-init.js index afe331d..99f24fa 100644 --- a/chat-init.js +++ b/chat-init.js @@ -571,6 +571,14 @@ document.addEventListener("DOMContentLoaded", () => { chatInput.style.height = chatInput.scrollHeight + "px"; }); sendButton.addEventListener("click", handleSendMessage); + + // Send on Enter (newline with Shift+Enter) + chatInput.addEventListener('keydown', (e) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + handleSendMessage(); + } + }); sendButton.disabled = chatInput.value.trim() === ""; chatInput.dispatchEvent(new Event("input")); const initialSession = Storage.getCurrentSession(); diff --git a/index.html b/index.html index 0d2174f..43b4c94 100644 --- a/index.html +++ b/index.html @@ -424,14 +424,19 @@ - - - - - - - + + + + + + + + + + + +