forked from rDrama/rDrama
master
parent
421b20c610
commit
57c62fad7b
|
@ -10,6 +10,7 @@ const box = document.getElementById('chat-window')
|
||||||
const textbox = document.getElementById('input-text')
|
const textbox = document.getElementById('input-text')
|
||||||
const icon = document.getElementById('favicon')
|
const icon = document.getElementById('favicon')
|
||||||
const vid = document.getElementById('vid').value
|
const vid = document.getElementById('vid').value
|
||||||
|
const vusername = document.getElementById('header--username').innerHTML
|
||||||
const site_name = document.getElementById('site_name').value
|
const site_name = document.getElementById('site_name').value
|
||||||
const slurreplacer = document.getElementById('slurreplacer').value
|
const slurreplacer = document.getElementById('slurreplacer').value
|
||||||
|
|
||||||
|
@ -64,8 +65,9 @@ socket.on('speak', function(json) {
|
||||||
setTimeout(flash, 500);
|
setTimeout(flash, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
let users = document.getElementsByClassName('userlink');
|
const users = document.getElementsByClassName('userlink');
|
||||||
let last_user = users[users.length-1].innerHTML;
|
const last_user = users[users.length-1].innerHTML;
|
||||||
|
const scrolled_down = (box.scrollHeight - box.scrollTop <= window.innerHeight)
|
||||||
|
|
||||||
if (last_user == json['username']) {
|
if (last_user == json['username']) {
|
||||||
document.getElementsByClassName('chat-line')[0].classList.remove('diff')
|
document.getElementsByClassName('chat-line')[0].classList.remove('diff')
|
||||||
|
@ -90,6 +92,7 @@ socket.on('speak', function(json) {
|
||||||
let line = document.getElementsByClassName('chat-line')[0].cloneNode(true)
|
let line = document.getElementsByClassName('chat-line')[0].cloneNode(true)
|
||||||
bs_trigger(line)
|
bs_trigger(line)
|
||||||
box.append(line)
|
box.append(line)
|
||||||
|
if (scrolled_down || json['username'] == vusername)
|
||||||
box.scrollTo(0, box.scrollHeight)
|
box.scrollTo(0, box.scrollHeight)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,6 @@
|
||||||
|
|
||||||
<script src="{{asset('js/lozad.js')}}"></script>
|
<script src="{{asset('js/lozad.js')}}"></script>
|
||||||
<script src="/assets/js/lite-youtube.js?v=241"></script>
|
<script src="/assets/js/lite-youtube.js?v=241"></script>
|
||||||
|
<script src="/chat.js?v=3042"></script>
|
||||||
<script src="/chat.js?v=3041"></script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
Reference in New Issue