diff options
author | 2024-03-14 12:56:48 +0100 | |
---|---|---|
committer | 2024-03-14 17:10:40 -0700 | |
commit | 7310e134996a41a1e2a2dc1dbe9f60c75cdde8cf (patch) | |
tree | 0823a361a41403b7aa91a87fec83c98a832cc059 | |
parent | bf6d2867356bc598510480c43d18293dfffc0f49 (diff) | |
download | v2-7310e134996a41a1e2a2dc1dbe9f60c75cdde8cf.tar.gz v2-7310e134996a41a1e2a2dc1dbe9f60c75cdde8cf.tar.zst v2-7310e134996a41a1e2a2dc1dbe9f60c75cdde8cf.zip |
More trusted-types compatibility
-rw-r--r-- | internal/ui/static/js/app.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js index 2ce1a1e8..89f61c79 100644 --- a/internal/ui/static/js/app.js +++ b/internal/ui/static/js/app.js @@ -201,7 +201,7 @@ function toggleEntryStatus(element, toasting) { } } - link.innerHTML = iconElement.innerHTML; + link.replaceChildren(iconElement.content.cloneNode(true)); addIcon(link, label); link.dataset.value = newStatus; @@ -322,7 +322,7 @@ function toggleBookmark(parentElement, toasting) { } } - element.innerHTML = iconElement.innerHTML; + element.replaceChildren(iconElement.content.cloneNode(true)); addIcon(element, label); element.dataset.value = newStarStatus; }); @@ -353,7 +353,7 @@ function handleFetchOriginalContent() { document.querySelector(".entry-content").innerHTML = data.content; const entryReadingtimeElement = document.querySelector(".entry-reading-time"); if (entryReadingtimeElement) { - entryReadingtimeElement.innerHTML = data.reading_time; + entryReadingtimeElement.textContent = data.reading_time; } } }); @@ -533,7 +533,7 @@ function incrementUnreadCounter(n) { function updateUnreadCounterValue(callback) { document.querySelectorAll("span.unread-counter").forEach((element) => { const oldValue = parseInt(element.textContent, 10); - element.innerHTML = callback(oldValue); + element.textContent = callback(oldValue); }); if (window.location.href.endsWith('/unread')) { @@ -628,7 +628,7 @@ function showToast(label, iconElement) { const toastMsgElement = document.getElementById("toast-msg"); if (toastMsgElement) { - toastMsgElement.innerHTML = iconElement.innerHTML; + toastMsgElement.replaceChildren(iconElement.content.cloneNode(true)); addIcon(toastMsgElement, label); const toastElementWrapper = document.getElementById("toast-wrapper"); |