blog sidebar, some cosmetic changes

This commit is contained in:
ari melody 2025-06-23 20:38:28 +01:00
parent 3da0249555
commit 3d64333b4f
Signed by: ari
GPG key ID: CF99829C92678188
15 changed files with 202 additions and 104 deletions

View file

@ -1,4 +1,4 @@
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('readystatechange', () => {
document.querySelectorAll('.comment-hover').forEach((/** @type {HTMLDivElement} */ comment) => {
/** @type {HTMLLinkElement} */
const commentBody = comment.querySelector('a.comment-body');
@ -16,4 +16,13 @@ document.addEventListener('DOMContentLoaded', () => {
comment.style.cursor = 'pointer';
comment.role = 'link';
});
document.getElementById('blog-copy-link').addEventListener('click', event => {
event.preventDefault();
if (navigator.clipboard === undefined) {
console.error("clipboard is not supported by this browser!");
return;
}
navigator.clipboard.writeText(location.protocol + "//" + location.host + location.pathname);
});
});