Closed (fixed)
Project:
Chatroom
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2011 at 07:47 UTC
Updated:
19 Apr 2011 at 18:01 UTC
Jump to comment: Most recent
When I have a guest and that guest posts something, the title start flashing. Up to here, nothing wrong.
However, that guest name is something like this:
Alexis <div class="guest-user">guest-123</div>
I don't remember the exact class name, but that's something like this.
We could handle that problem in the JavaScript so it is done on the client's machine! (and that way we save cycles on the server)
document.title = Drupal.settings.chatroom.newMsg.name + ' says: ' + Drupal.settings.chatroom.newMsg.text;
I think that all we need to do is use the name up to the first '<'... Something like this (NOT TESTED!):
var name = Drupal.settings.chatroom.newMsg.name;
var p = name.find('<');
if(p) {
name = name.substr(0, p);
}
document.title = name + ' says: ' + Drupal.settings.chatroom.newMsg.text;
Thank you.
Alexis
Comments
Comment #1
Anonymous (not verified) commentedthanks for the report.
i'd prefer to send something without any html down to js in this case. i'll look at a patch to do that.
Comment #2
Anonymous (not verified) commentedlike this:
http://drupalcode.org/project/chatroom.git/commit/92dcd6f
Comment #3
AlexisWilke commentedThat looks good too. 8-)
Thank you for the fast response!
Alexis