blog sidebar, some cosmetic changes
This commit is contained in:
parent
3da0249555
commit
3d64333b4f
15 changed files with 202 additions and 104 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue