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.
25 lines
600 B
25 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);
|
|
}
|
|
});
|
|
|