jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
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.

26 lines
600 B

/* globals Tegaki */
function showTegakiReplay(e){
e.preventDefault(); //prevent nojs download fallback
Tegaki.open({
replayMode: true,
replayURL: e.target.href,
});
}
function addReplayListeners(elem) {
const replayLinks = Array.from(elem.getElementsByClassName('replay-tegaki'));
replayLinks.forEach(replayLink => {
replayLink.addEventListener('click', showTegakiReplay, false);
});
}
window.addEventListener('DOMContentLoaded', () => {
addReplayListeners(document);
});
window.addEventListener('addPost', e => {
if (!e.detail.hover) {
addReplayListeners(e.detail.post);
}
});