diff src/chat.html.luan @ 27:176a182c02cf

add view_course
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 Aug 2025 20:08:13 -0600
parents 3a80ddafe5a4
children 99b71a377f2c
line wrap: on
line diff
--- a/src/chat.html.luan	Fri Aug 01 17:12:03 2025 -0600
+++ b/src/chat.html.luan	Fri Aug 01 20:08:13 2025 -0600
@@ -82,18 +82,28 @@
 		</dialog>
 		<dialog system_prompt>
 			<h2>System Prompt</h2>
-			<div system_prompt>
+			<pre>
 <%				chat.output_system_prompt() %>
-			</div>
+			</pre>
+			<p><a href="view_course.html?course=<%=chat.course_id%>">View course</a></p>
 			<div buttons>
 				<button onclick="closeModal(this)">Close</button>
 			</div>
 		</dialog>
+		<input name=initialized style="display:none">
 		<script>
 			handleMarkdown();
+			setTimeout(function(){
+				let initialized = document.querySelector('[name=initialized]');
+				if( !initialized.value ) {
+					initialized.value = 'yes';
+					//alert('init');
+					scrollToEnd();
 <%	if added_message then %>
-			playLastMessage();
+					playLastMessage();
 <%	end %>
+				}
+			},10);
 		</script>
 	</body>
 </html>