This commit is contained in:
Radon 2025-01-21 17:54:04 -06:00
parent 97c34e890a
commit 9352c8fbd7
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,7 @@ function toggleTheme() {
async function editMessage(messageId, content) {
const newContent = prompt("Edit message:", content);
if (newContent === null) {
return;
}
@ -253,6 +254,10 @@ async function loadMessages(forceUpdate = false, scrollLocation) {
const contentString =
doc.querySelector("span").textContent;
const isMultiline = contentString.match(
"\\n",
) && true || false;
if (
compareUsername ===
document.getElementById(
@ -264,6 +269,10 @@ async function loadMessages(forceUpdate = false, scrollLocation) {
editHtml =
`<button class="edit-button" title="Edit message" onclick="editMessage('${messageId}', '${contentString}')" style="display: inline;">📝</button>`;
}
// TODO: Add edit for multiline messages
if (isMultiline) {
editHtml = "";
}
messageDiv.innerHTML = `
<div class="message-header">
<div class="username">${username} ${timestamp} ${deleteHtml} ${editHtml}</div>

View File

@ -2,6 +2,7 @@
## Frontend
### High Priority
- Lazy load with pagination (frontend and backend)
- Edit support for multiline message
### Mid Priority
- Other embeds (Twitter posts, spotify tracks, soundcloud, github repos, instagram posts, other video platforms)
### Low Priority