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