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.
20 lines
548 B
20 lines
548 B
window.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
const links = document.getElementsByClassName('post-quoters');
|
|
const messageBox = document.getElementById('message');
|
|
|
|
const addQuote = function(number) {
|
|
messageBox.value += `>>${number}\n`;
|
|
messageBox.scrollTop = messageBox.scrollHeight;
|
|
}
|
|
|
|
const quote = function(e) {
|
|
const quoteNum = this.textContent.replace('[Reply]', '').split(' ')[0].trim();
|
|
addQuote(quoteNum);
|
|
};
|
|
|
|
for (let i = 0; i < links.length; i++) {
|
|
links[i].addEventListener('click', quote, false);
|
|
}
|
|
|
|
});
|
|
|