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

View File

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