Online Sequencer Forums

Full Version: Auto-scroll problem in chat box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The chat box automatically scrolls to the bottom whenever somebody sends a message to it. It is a great inconvenience if I am reading previous messages higher up in the box and then the auto-scroll happens, which thus prevents me from reading the particular message. The issue is not so bad if somebody is sending a message once per half-minute; it is troublesome when people are consecutively sending messages. If I hold the scroll bar at the place where I want to read message, I can keep my place where I want to read; the auto-scroll still happens, but in about 0.2 of a second I go back to my held place (thankfully and fortunately), until somebody sends another message, and then this scenario repeats. This problem is not a bug, but it is troublesome nonetheless. Here is my proposed solution (ahem): include a check-box in the chat-box; this check-box would alternately enable and disable the auto-scroll feature. Simple. The auto-scroll feature is nice and useful, until I need to read previous chats in the chat-box (though I could look through chat logs, though I need to refresh the page to see new messages, and then I would need to switch to the chat-box to send a message, and then go back to the chat logs if need be, etc. etc.). The requested feature is needfully useful during high chat usage; otherwise, not so much. I would really like this feature to be added.
This is actually something I care about pls fix
i third this notion
I also agree with this.
I also choose this guy's dead wife
I have a fix for this (Thank Jacob_) but you have to manually do it since I am a noob when it comes to changing stuff with extensions like TamperMonkey.
Here's how you do it:

Go to Inspect Element -> Sources -> Look down and see "chat_frame.php" -> Go to it and press "onlinesequencer.net" -> forum -> jscripts -> ajaxchat.js?blabla -> Scroll down til you see this line of code:
" window.setTimeout(function() {
table.scrollTop = table.scrollHeight + 10000;
}, 100); "

Remove that and press Ctrl+S to save the file.
(01-30-2019, 08:29 AM)Void Wrote: [ -> ]I have a fix for this (Thank Jacob_) but you have to manually do it since I am a noob when it comes to changing stuff with extensions like TamperMonkey.
Here's how you do it:

Go to Inspect Element -> Sources -> Look down and see "chat_frame.php" -> Go to it and press "onlinesequencer.net" -> forum -> jscripts -> ajaxchat.js?blabla -> Scroll down til you see this line of code:
"         window.setTimeout(function() {
table.scrollTop = table.scrollHeight + 10000;
}, 100); "

Remove that and press Ctrl+S to save the file.

This solution works only for the selected browser tab/window. The problem persists if you open OS.net in a new tab/window. The temporary solution is good nonetheless. Well done, Void.
Good news. After hours of digging through the internet on how to make changes to sites locally, I've come across a permanent solution on how to do so! You can even create your own checkbox and do some javascript tweaking potentially for that checkbox enabled - disabled for auto-scroll on or off.

Here's a permanent solution on how to get auto-scroll off:

Open up Inspect Element -> Go to Sources -> Next to Page and Filesystem, press the arrow and go to "Overrides". -> Add a new folder to it, call it whatever it doesn't matter. Now Chrome will prompt you to give Developer Tools access and you press "Allow" and then refresh the page. Now like previously, go back to Inspect element and navigate to "Inspect Element -> Sources -> Look down and see "chat_frame.php" -> Go to it and press "onlinesequencer.net" -> forum -> jscripts -> ajaxchat.js?blabla -> Scroll down til you see this line of code:
" window.setTimeout(function() {
table.scrollTop = table.scrollHeight + 10000;
}, 100); " "

Change that to:

//window.setTimeout(function() {
//table.scrollTop = table.scrollHeight + 10000;
//}, 100);

And press Ctrl+S and then you may have to Refresh for the changes to take place. Now every time you refresh the page you will have auto-scroll feature off.
Also any element changes you make using Inspect Element will stay, and they update live so yeah be careful. Simply remove the //'s if you want auto-scroll disabled.

If you're good enough with CSS, you can possibly make a checkbox for the chat and do some scripting to set it on or off. Ask Frank with that. Smile

I hope you enjoy this and this is far better than any TamperMonkey extension tbh, wish I had known about this earlier.

EDIT: Don't forget to check "Enable Local Overrides" in the Overrides tab!

EDIt: Also, I just noticed that this only works when Inspect Element is open. Well you can have the chat open but if you don't have inspect element open you need to open it before opening the chat again... hmm
maybe I'll do this later but not now
Welp you press the little 3 dots at the top and set inspect element into a separate window, this way you can keep scripts running. Also oof after messing the ajax chat, by making a chat bot it accidentally spammed the entire chat and I was auto-muted for 10 minutes. Rip.