Frontend Refactoring: HTML/CSS/JS getrennt, modulare Struktur
This commit is contained in:
1 parent
9f2f3fee1f
commit
19f926da05
7 files changed
+534
-294
No files matched your search
@@ -0,0 +1,28 @@
|
||||
// ── App Init ──
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// System Prompt Toggle
|
||||
$('#showSystem').addEventListener('change', () => {
|
||||
$('#systemPrompt').classList.toggle('visible', $('#showSystem').checked);
|
||||
});
|
||||
|
||||
// Send Button
|
||||
$('#send').addEventListener('click', sendMessage);
|
||||
|
||||
// Ctrl+Enter
|
||||
$('#input').addEventListener('keydown', (e) => {
|
||||
if (e.ctrlKey && e.key === 'Enter') sendMessage();
|
||||
});
|
||||
|
||||
// Auto-Resize Textarea
|
||||
$('#input').addEventListener('input', function () {
|
||||
this.style.height = 'auto';
|
||||
this.style.height = Math.min(this.scrollHeight, 150) + 'px';
|
||||
});
|
||||
|
||||
// Clear Button
|
||||
$('#clearBtn').addEventListener('click', clearChat);
|
||||
|
||||
// History laden
|
||||
loadHistory();
|
||||
});
|
||||
Reference in new issue
Block a user