Alert user on any new message
pacheco - July 13, 2006 - 02:45
| Project: | Chat Room |
| Version: | HEAD |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | pacheco |
| Status: | duplicate |
Jump to:
Description
this feature will make possible for people participate in a chat and also do something else, go to another windows and such...
the idea is change page title and focus thru javascript on any new message
don't know yet if it should be default or by user request, like using some checkbox like chatbox module does

#1
Do not force a focus change.
If the window does not have focus, simply indicate that there is a new chat line(s) by changing the window title back and forth, from what it actually is to e.g.:
guest01 says "Dave, how are you..."
Always use the first line that hasn't been seen (i.e. don't change this text every time a new line comes in).
The browser will handle cutting off the text when it's too long.
#2
i agree with dave on this one - just let the user know, don't grab focus.
#3
cool, i agree...
will code that, tks!
#4
ok, having some problem trying to implement that:
window.onfocus and window.onblur worked fine in FireFox
but IE has this weird thing about throwing an window.onblur if you change focus inside the window
like when you just click inside textentry box...
does anyone knows some workaround for that?
#5
Suggestion:
Blink the title whenever you're not in the chatroom textbox, versus not in the window/tab. Might be easier to code.
IE sucks. The onblur() works per element, I believe, and might need to be in the BODY tag. BODY onblur="whatever();"
Not sure.
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onblur.asp
#6
campfire does that using a litlle sound alert
will try to implement that too...
#7
just added visual alerts, please test it.
i've added focus handling on each UI element as a workaround for that window's events inconsistency between browsers.
when all elements looses focus and a new msg comes, title will toggle between "* New message" and page's title every one second.
#8
woohoo, nice work, i'll give it thorough going over tonight.
#9
ok, i've tested this and it works as advertised.
i've committed some changes to add the username of the first unseen message to the title bar.
i'll wait until someone else says they've tested it and its ok before moving to fixed.
well done paulo!
#10
cool, but don't mark as fixed yet
i will add sound alerts too... :)
#11
ok, great, i'll wait.
it would good if the sound was configurable per chatroom?
cheers
justin
#12
don't think so, UI elements (including sounds) should remain consistent in my opinion
it would be like having a diferent away icon for each chatroom
#13
hi paulo,
a agree with the consistency thing. i meant configurable as in "be able to turn it on or off". does that sound better?
#14
yeah, thats better, i was thinking about having another checkbox to let users turn sounds off too, like:
[_______________________] [Send]
[_] set my status to "away"
[_] turn sounds off
what do you think?
#15
Checkboxes? Eh.
I'd suggest simple links, like so:
[________________________] [Send]
Sound is on | off
Status is active | away
Whichever option is *not* true is linked so it can be clicked, i.e. if sound is on, "off" is linked and clickable and "on" is bold and not linked. Change via JS onClick.
That seems best for now, although I always wonder if we can't handle session-specific user settings better.
#16
there's now a specific issue for this ( http://drupal.org/node/82235 ), so i'm marking this as a duplicate.
can we continue the discussion there?