blog visitor frontend (pretty much) done!

This commit is contained in:
ari melody 2025-06-24 01:32:30 +01:00
parent 3d64333b4f
commit faf6095d16
Signed by: ari
GPG key ID: CF99829C92678188
16 changed files with 903 additions and 463 deletions

16
public/script/blogpost.js Normal file
View file

@ -0,0 +1,16 @@
import { hijackClickEvent } from "./main.js";
document.querySelectorAll('.comment-hover').forEach((/** @type {HTMLDivElement} */ comment) => {
/** @type {HTMLLinkElement} */
const commentDate = comment.querySelector('.comment-date');
hijackClickEvent(comment, commentDate);
});
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);
});