Page 1 of 1

Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 16:13
by tenuki
Problem: Webkit browsers fire their events too soon - so things like 'onkeyup' intermittently break because the event keycode hasn't been set yet depending on what else the computer is doing.

Symptom: You can see this in the chat window when people with those browsers type and it thinks they have pressed 'enter', so it posts the chat frequently when they haven't actually hit 'enter' resulting in fragmented and often single character posts. It's really really annoying. Webkit browsers constitute around 20% of the browsers on the internet and Chrome in particular is growing faster than anyone. So your chat script is annoying 20% of your user base.

Possible Solution:

Currently the chat text input html element has the property shown below

Code: Select all

onkeyup="if(window.event.keyCode == 13)){sendComment();}"
This is what is breaking on webkit browsers - to ensure the event get's called _after_ the page is updated and the event keycode is set you wrap it in a timeout set to zero.

replace above with:

Code: Select all

onkeyup="setTimeout(if(window.event.keyCode == 13)){sendComment();},0);"
and everything works properly for webkit browsers. (tested on chrome for a while by editing the html in the browser and didn't see the problem once after the edit went in) Your mileage may vary, but it seems like a relatively simple fix with a large positive impact.


Thanks!

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 16:19
by brandon
Thanks, Tenuki!

This fixes it for me, hope it makes it into the site.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 17:29
by Geekgirl
it's annoying way more than 20% of the users... it's a PITA for both us "alt-browser" users, AND for everyone who has to try to read it.

I don't really understand the content of your post, is this something we can do ourselves in the browser window before using chat? or is this a fix that can only be applied at the adagio end? (sorry for the n00b question)

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 17:30
by ilya
I've updated the code. Please let me know if the IM is better behaved.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 17:34
by tenuki
Geekgirl wrote:it's annoying way more than 20% of the users... it's a PITA for both us "alt-browser" users, AND for everyone who has to try to read it.

I don't really understand the content of your post, is this something we can do ourselves in the browser window before using chat? or is this a fix that can only be applied at the adagio end? (sorry for the n00b question)
both. :) if you select the text box element in chrome and choose 'inspect element' from the contextual menu you can make the change to your browsers html and it will work - but next time you reload/refresh the page it will be back to the old stuff.

long term fix is to fix it at teachat's end - which it appears Ilya has already done. :D

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 17:36
by tenuki
ilya wrote:I've updated the code. Please let me know if the IM is better behaved.
yeah!

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 24th, '10, 17:52
by Geekgirl
tenuki wrote: both. :) if you select the text box element in chrome and choose 'inspect element' from the contextual menu ...
thanks! I have one more forum where this is broken. I'll be able to use it there.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 25th, '10, 09:26
by Chip
OK, it seems perhaps this fix is wreaking havoc for IE.

Several things are not working coincidently after the fix. Pressing enter to enter an IM post does not work.

Also after clicking post, one must now left click on the box in order to begin typing the next entry ...

Also, I get this effect a lot ...

a
h
c
n
e
s

Thus having to refresh quite frequently (which also causes loss of work if posting a reply on the forum ... and forget to save).

A real pain!!!!!!!!!! :evil:

So, has the fix broken the IM for IE users??? Seems so.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 25th, '10, 14:26
by ilya
Please let me know if the new IE bug has been resolved.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 25th, '10, 14:57
by Chip
ilya wrote:Please let me know if the new IE bug has been resolved.
Nope ... :cry:

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 25th, '10, 22:04
by ilya
how about now?

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 25th, '10, 22:12
by Chip
did for a sec ... and then not.

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 26th, '10, 00:57
by tenuki
What version of IE?

Re: Fix for: Chat is broken for Safari/Chrome/webkit

Posted: Aug 26th, '10, 01:48
by Chip
8.0

The problem appears to be remedied.