update reply cancel button with less clutter

This commit is contained in:
2026-05-16 18:22:18 +02:00
parent f4faffd4de
commit b96d97e213

View File

@@ -1078,7 +1078,7 @@ class CommentSystem {
el.muted = snap.muted; el.muted = snap.muted;
el.volume = snap.volume; el.volume = snap.volume;
if (!snap.paused) { if (!snap.paused) {
el.play().catch(() => {/* autoplay may be blocked */}); el.play().catch(() => {/* autoplay may be blocked */ });
} }
}); });
} }
@@ -1515,7 +1515,7 @@ class CommentSystem {
const urlToParse = href.startsWith('//') ? window.location.protocol + href : href; const urlToParse = href.startsWith('//') ? window.location.protocol + href : href;
const urlObj = new URL(urlToParse, siteOrigin); const urlObj = new URL(urlToParse, siteOrigin);
isSameSite = (urlObj.hostname === window.location.hostname); isSameSite = (urlObj.hostname === window.location.hostname);
} catch(e) {} } catch (e) { }
} }
// Shorten internal links if text matches the URL // Shorten internal links if text matches the URL
@@ -1917,7 +1917,7 @@ class CommentSystem {
<textarea placeholder="${placeholder}"${maxLenAttr}></textarea> <textarea placeholder="${placeholder}"${maxLenAttr}></textarea>
<div class="input-actions"> <div class="input-actions">
${counter} ${counter}
${parentId ? `<button class="cancel-reply">${cancelLabel}</button>` : ''} ${parentId ? `<button class="cancel-reply" title="${cancelLabel}"><i class="fa-solid fa-xmark"></i></button>` : ''}
<button class="submit-comment">${postLabel}</button> <button class="submit-comment">${postLabel}</button>
</div> </div>
</div> </div>
@@ -2244,7 +2244,7 @@ class CommentSystem {
contentEl.innerHTML = ` contentEl.innerHTML = `
<textarea class="edit-textarea">${currentContent}</textarea> <textarea class="edit-textarea">${currentContent}</textarea>
<div class="input-actions"> <div class="input-actions">
<button class="cancel-edit-btn">Cancel</button> <button class="cancel-edit-btn" title="Cancel"><i class="fa-solid fa-comment-slash"></i></button>
<button class="save-edit-btn">Save</button> <button class="save-edit-btn">Save</button>
</div> </div>
`; `;
@@ -3052,8 +3052,11 @@ class CommentSystem {
} }
textarea.focus(); textarea.focus();
}); });
const submitBtn = actions.querySelector('.submit-comment'); const referenceNode = actions.querySelector('.cancel-reply') ||
actions.insertBefore(trigger, submitBtn); actions.querySelector('.cancel-edit-btn') ||
actions.querySelector('.submit-comment') ||
actions.querySelector('.save-edit-btn');
actions.insertBefore(trigger, referenceNode);
actions.insertBefore(spoilerBtn, trigger); actions.insertBefore(spoilerBtn, trigger);
if (this.isAdmin) { if (this.isAdmin) {
const lockBtn = document.createElement('button'); const lockBtn = document.createElement('button');