rDrama/files/assets/js/messages.js

19 lines
463 B
JavaScript
Raw Normal View History

2023-09-26 20:05:39 +00:00
const socket = io()
socket.on('insert_reply', function(data) {
const replies = document.getElementById(`replies-of-c_${data[0]}`)
if (replies) {
2024-03-08 05:35:37 +00:00
const html = data[1].replace(/data-src/g, 'src').replace(/data-nonce=".*?"/g, `data-nonce="${nonce}"`);
2024-03-08 05:30:01 +00:00
replies.insertAdjacentHTML('beforeend', html);
2023-09-26 20:05:39 +00:00
2024-03-08 05:21:15 +00:00
register_new_elements(replies.lastElementChild);
bs_trigger(replies.lastElementChild);
2024-03-08 05:18:45 +00:00
notifs = notifs + 1;
if (notifs == 1) {
flash();
}
2023-09-26 20:05:39 +00:00
}
})