Mercurial Hosting > lang
diff src/chat.js @ 28:99b71a377f2c
audio for textarea
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 Aug 2025 20:04:35 -0600 |
parents | 176a182c02cf |
children | 505185272dd7 |
line wrap: on
line diff
--- a/src/chat.js Fri Aug 01 20:08:13 2025 -0600 +++ b/src/chat.js Sat Aug 02 20:04:35 2025 -0600 @@ -70,10 +70,15 @@ } } +let audio; + function fixTextarea(textarea) { textarea.style.height = 'initial'; textarea.style.height = (textarea.scrollHeight+2) + 'px'; textarea.parentNode.scrollIntoViewIfNeeded(false); + if( !audio ) + audio = document.querySelector('div[buttons] audio'); + audio.src = `/tts.mp3?lang=${lang}&text=${encodeURIComponent(textarea.value)}`; } function askAi() {