fix chat player highlighting

- clicking on names now inserts them
- fix: if your name was @mentioned, followed by another @player, it didn't mark the line
This commit is contained in:
Jon Atkins 2013-04-01 19:11:25 +01:00
parent af4ee26575
commit 3a8ea9161b

View File

@ -281,9 +281,13 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
break; break;
case 'AT_PLAYER': case 'AT_PLAYER':
msgToPlayer = (markup[1].plain == ('@'+window.PLAYER.nickname)); var thisToPlayer = (markup[1].plain == ('@'+window.PLAYER.nickname));
var spanClass = msgToPlayer ? "pl_nudge_me" : (markup[1].team + " pl_nudge_player"); var spanClass = thisToPlayer ? "pl_nudge_me" : (markup[1].team + " pl_nudge_player");
msg += $('<div/>').html($('<span/>').attr('class', spanClass).text(markup[1].plain)).html(); msg += $('<div/>').html($('<span/>')
.attr('class', spanClass)
.attr('onclick',"window.chat.addNickname('"+markup[1].plain+"')")
.text(markup[1].plain)).html();
msgToPlayer = msgToPlayer || thisToPlayer;
break; break;
case 'PORTAL': case 'PORTAL':