17 lines
637 B
JavaScript
17 lines
637 B
JavaScript
|
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);
|
||
|
});
|