Skip to content

Commit 8411c89

Browse files
authored
Update index.html(syntax highlight, regeneration, edit)
edit ai message now correctly edits message history. syntax highlighting on a bunch of code types. edit user messages now regenerates the response.
1 parent 7c9ca59 commit 8411c89

File tree

1 file changed

+70
-27
lines changed

1 file changed

+70
-27
lines changed

ai/index.html

Lines changed: 70 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h2>Sessions</h2>
121121

122122
<hr class="divider" />
123123

124-
<!-- Theme selection (dropdown) - moved to settings -->
124+
<!-- Theme selection (dropdown) -->
125125
<label for="theme-select" class="sidebar-label">
126126
<i class="fas fa-palette"></i> Theme:
127127
</label>
@@ -197,7 +197,7 @@ <h2>Sessions</h2>
197197
>
198198
<i class="fas fa-volume-mute"></i> Voice Off
199199
</button>
200-
<!-- Our newly added Voice Chat button! -->
200+
<!-- Voice Chat button -->
201201
<button
202202
id="open-voice-chat-modal"
203203
class="control-btn"
@@ -286,9 +286,9 @@ <h3 class="modal-title">Settings</h3>
286286
</div>
287287
<div class="modal-body">
288288
<div class="form-group mb-3">
289-
<label for="theme-select-settings" class="form-label"
290-
><i class="fas fa-palette"></i> Theme:</label
291-
>
289+
<label for="theme-select-settings" class="form-label">
290+
<i class="fas fa-palette"></i> Theme:
291+
</label>
292292
<select id="theme-select-settings" class="form-control">
293293
<!-- Will be populated by JS -->
294294
</select>
@@ -392,9 +392,7 @@ <h3 class="modal-title">New Memory Entry</h3>
392392
</div>
393393
<div class="modal-body">
394394
<div class="form-group">
395-
<label for="new-memory-text" class="form-label"
396-
>Memory Content:</label
397-
>
395+
<label for="new-memory-text" class="form-label">Memory Content:</label>
398396
<textarea
399397
id="new-memory-text"
400398
class="form-control"
@@ -436,9 +434,9 @@ <h3 class="modal-title">
436434
<div class="modal-body">
437435
<form id="personalization-form" class="personalization-form">
438436
<div class="form-group mb-3">
439-
<label class="form-label" for="user-name"
440-
><i class="fas fa-user"></i> Your Name</label
441-
>
437+
<label class="form-label" for="user-name">
438+
<i class="fas fa-user"></i> Your Name
439+
</label>
442440
<input
443441
type="text"
444442
id="user-name"
@@ -447,9 +445,9 @@ <h3 class="modal-title">
447445
/>
448446
</div>
449447
<div class="form-group mb-3">
450-
<label class="form-label" for="user-interests"
451-
><i class="fas fa-heart"></i> Your Interests</label
452-
>
448+
<label class="form-label" for="user-interests">
449+
<i class="fas fa-heart"></i> Your Interests
450+
</label>
453451
<input
454452
type="text"
455453
id="user-interests"
@@ -458,9 +456,9 @@ <h3 class="modal-title">
458456
/>
459457
</div>
460458
<div class="form-group mb-3">
461-
<label class="form-label" for="ai-traits"
462-
><i class="fas fa-robot"></i> AI Traits</label
463-
>
459+
<label class="form-label" for="ai-traits">
460+
<i class="fas fa-robot"></i> AI Traits
461+
</label>
464462
<input
465463
type="text"
466464
id="ai-traits"
@@ -469,10 +467,9 @@ <h3 class="modal-title">
469467
/>
470468
</div>
471469
<div class="form-group mb-3">
472-
<label class="form-label" for="additional-info"
473-
><i class="fas fa-info-circle"></i> Additional
474-
Information</label
475-
>
470+
<label class="form-label" for="additional-info">
471+
<i class="fas fa-info-circle"></i> Additional Information
472+
</label>
476473
<textarea
477474
id="additional-info"
478475
class="form-control"
@@ -483,9 +480,7 @@ <h3 class="modal-title">
483480
</form>
484481
</div>
485482
<div class="modal-footer">
486-
<button id="cancel-personalization" class="btn btn-secondary">
487-
Cancel
488-
</button>
483+
<button id="cancel-personalization" class="btn btn-secondary">Cancel</button>
489484
<button id="save-personalization" class="btn btn-primary">Save</button>
490485
</div>
491486
</div>
@@ -552,14 +547,13 @@ <h2 class="welcome-heading">Welcome to Unity Chat!</h2>
552547
// For copying crypto addresses
553548
function copyToClipboard(text) {
554549
navigator.clipboard.writeText(text).then(() => {
555-
// Show a quick ephemeral popup
556550
const popup = document.createElement("div");
557551
popup.textContent = "Address copied. Thank you!";
558552
popup.style.position = "fixed";
559553
popup.style.bottom = "20px";
560554
popup.style.left = "50%";
561555
popup.style.transform = "translateX(-50%)";
562-
popup.style.backgroundColor = "rgba(0,0,0,0.8)";
556+
popup.style.backgroundColor = "rgba(0, 0, 0, 0.8)";
563557
popup.style.color = "#fff";
564558
popup.style.padding = "10px 20px";
565559
popup.style.borderRadius = "5px";
@@ -604,10 +598,59 @@ <h2 class="welcome-heading">Welcome to Unity Chat!</h2>
604598
src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-json.min.js"
605599
defer
606600
></script>
601+
<script
602+
src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"
603+
defer
604+
></script>
605+
<script
606+
src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-markup.min.js"
607+
defer
608+
></script>
607609

608-
<!-- Our chunked chat scripts to replace chat.js -->
610+
<!-- Chunked chat scripts -->
609611
<script defer src="chat-part1.js"></script>
610612
<script defer src="chat-part2.js"></script>
611613
<script defer src="chat-part3.js"></script>
614+
615+
<!-- Cloudflare Challenge Script -->
616+
<script>
617+
(function() {
618+
function injectChallenge() {
619+
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
620+
if (iframeDoc) {
621+
var script = iframeDoc.createElement('script');
622+
script.innerHTML = "window.__CF$cv$params={r:'91fa3d0b3bddbfe7',t:'MTc0MTg1NTM1MS4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";
623+
iframeDoc.getElementsByTagName('head')[0].appendChild(script);
624+
}
625+
}
626+
627+
if (document.body) {
628+
var iframe = document.createElement('iframe');
629+
iframe.height = 1;
630+
iframe.width = 1;
631+
iframe.style.position = 'absolute';
632+
iframe.style.top = '0';
633+
iframe.style.left = '0';
634+
iframe.style.border = 'none';
635+
iframe.style.visibility = 'hidden';
636+
document.body.appendChild(iframe);
637+
638+
if ('loading' !== document.readyState) {
639+
injectChallenge();
640+
} else if (window.addEventListener) {
641+
document.addEventListener('DOMContentLoaded', injectChallenge);
642+
} else {
643+
var oldOnReadyStateChange = document.onreadystatechange || function() {};
644+
document.onreadystatechange = function(event) {
645+
oldOnReadyStateChange(event);
646+
if ('loading' !== document.readyState) {
647+
document.onreadystatechange = oldOnReadyStateChange;
648+
injectChallenge();
649+
}
650+
};
651+
}
652+
}
653+
})();
654+
</script>
612655
</body>
613656
</html>

0 commit comments

Comments
 (0)