changes
This commit is contained in:
parent
97c34e890a
commit
9352c8fbd7
@ -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>
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user