Mercurial Hosting > lang
comparison src/chat.js @ 27:176a182c02cf
add view_course
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 Aug 2025 20:08:13 -0600 |
parents | 3a80ddafe5a4 |
children | 99b71a377f2c |
comparison
equal
deleted
inserted
replaced
26:d3f5448743bf | 27:176a182c02cf |
---|---|
46 let audio = audios[audios.length-1]; | 46 let audio = audios[audios.length-1]; |
47 audio.play(); | 47 audio.play(); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 function scrollToEnd() { | |
52 window.scrollTo(0, document.body.scrollHeight); | |
53 } | |
54 | |
51 function updateAi(html) { | 55 function updateAi(html) { |
52 hideWaitingAiIcon(); | 56 hideWaitingAiIcon(); |
53 document.querySelector('div[messages]').insertAdjacentHTML('beforeend',html); | 57 document.querySelector('div[messages]').insertAdjacentHTML('beforeend',html); |
54 handleMarkdown(); | 58 handleMarkdown(); |
55 document.querySelector('textarea').focus(); | 59 document.querySelector('textarea').focus(); |
56 window.scrollTo(0, document.body.scrollHeight); | 60 scrollToEnd(); |
57 /* | |
58 let scroll = aiDialog.querySelector('[scroll]'); | |
59 setTimeout(function(){ | |
60 scroll.scrollTo(0,scroll.scrollHeight); | |
61 }); | |
62 */ | |
63 playLastMessage(); | 61 playLastMessage(); |
64 } | 62 } |
65 | 63 |
66 const isMobile = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; | 64 const isMobile = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; |
67 | 65 |