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

Anonymous’s picture

thanks 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.

Anonymous’s picture

AlexisWilke’s picture

That looks good too. 8-)

Thank you for the fast response!
Alexis

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.