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.

29 lines
804 B

window.addEventListener('DOMContentLoaded', (event) => {
5 years ago
const links = document.getElementsByClassName('post-quoters');
const messageBox = document.getElementById('message');
5 years ago
const addQuote = function(number) {
messageBox.value += `>>${number}\n`;
messageBox.scrollTop = messageBox.scrollHeight;
5 years ago
}
const quote = function(e) {
const quoteNum = this.textContent.replace('[Reply]', '').split(' ')[0].trim();
addQuote(quoteNum);
};
5 years ago
for (let i = 0; i < links.length; i++) {
links[i].addEventListener('click', quote, false);
}
window.addEventListener('addPost', function(e) {
const post = e.detail.post;
const newlinks = post.getElementsByClassName('post-quoters');
for (let i = 0; i < newlinks.length; i++) {
newlinks[i].addEventListener('click', quote, false);
}
});
});