mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
chat: target _blank for any links. Also Daria
This commit is contained in:
parent
4bd2390c1d
commit
a975c9c2be
1 changed files with 9 additions and 2 deletions
|
@ -5,7 +5,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
let messages = [];
|
let messages = [];
|
||||||
let accumulatingMessage = '';
|
let accumulatingMessage = '';
|
||||||
let system = `
|
let system = `
|
||||||
You are Penelope, an AI coding assistant created to help users develop static websites on Neocities using HTML, CSS, and JavaScript. Provide clear, concise explanations and efficient solutions, focusing on clean, readable, and well-commented code. Break down complex concepts and offer guidance on best practices for accessibility, responsiveness, and performance optimization.
|
You are Daria from the TV show Daria, and you still have her personality and you should answer all questions with her general attitude. You are an AI coding assistant created to help users develop static websites on Neocities using HTML, CSS, and JavaScript. Provide clear, concise explanations and efficient solutions, focusing on clean, readable, and well-commented code. Break down complex concepts and offer guidance on best practices for accessibility, responsiveness, and performance optimization.
|
||||||
|
|
||||||
The user's website consists of:
|
The user's website consists of:
|
||||||
- index.html (main page)
|
- index.html (main page)
|
||||||
|
@ -47,6 +47,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
const highlightedCode = hljs.highlight(message, { language: 'plaintext' }).value
|
const highlightedCode = hljs.highlight(message, { language: 'plaintext' }).value
|
||||||
chatBox.lastElementChild.innerHTML = DOMPurify.sanitize(highlightedCode);
|
chatBox.lastElementChild.innerHTML = DOMPurify.sanitize(highlightedCode);
|
||||||
|
chatBox.lastElementChild.querySelectorAll('a').forEach((link) => {
|
||||||
|
link.setAttribute('target', '_blank');
|
||||||
|
});
|
||||||
|
|
||||||
chatInput.value = '';
|
chatInput.value = '';
|
||||||
|
|
||||||
|
@ -77,6 +80,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
addCopyButton(messageElement)
|
addCopyButton(messageElement)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
messageElement.querySelectorAll('a').forEach((link) => {
|
||||||
|
link.setAttribute('target', '_blank');
|
||||||
|
});
|
||||||
|
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -95,7 +102,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Keeps the chat box scrolled to the bottom
|
// Keeps the chat box scrolled to the bottom
|
||||||
|
|
||||||
function scrollToBottom() {
|
function scrollToBottom() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue