mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
628 B
23 lines
628 B
window.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
var quotes = document.getElementsByClassName('quote');
|
|
|
|
var toggleHighlightPost = function(e) {
|
|
if (!this.hash) {
|
|
return; //non-post number board quote
|
|
}
|
|
var hash = this.hash.substring(1);
|
|
var anchor = document.getElementById(hash);
|
|
if (!anchor) {
|
|
return; //cross(board) quotes
|
|
}
|
|
var post = anchor.nextSibling;
|
|
post.classList.toggle('highlighted');
|
|
};
|
|
|
|
for (var i = 0; i < quotes.length; i++) {
|
|
quotes[i].addEventListener('mouseover', toggleHighlightPost, false);
|
|
quotes[i].addEventListener('mouseout', toggleHighlightPost, false);
|
|
}
|
|
|
|
});
|
|
|