mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 20:12:19 +00:00
how this works: * rather than throw an expensive regular expression at each chat message, we start by checking to see if the users name exists. * then, by simple string manipulation we verify that the preceeding character before the alleged username is whitespace, the start of a line, or an '@' character. * FINALLY, we verify the following character is a non-word character using a regular expression. * then we cache the highlight status on the local `message` object, because for some reason, this function is called **every time a character is typed in the chatbox.** this seems like a hugh performance problem to me, need to see if there is a way to disable that or something
10 lines
709 B
Text
10 lines
709 B
Text
li(ng-repeat='message in group.chat', ng-class='{highlight: isUserMentioned(user,message), "own-message": user._id == message.uuid}')
|
|
a.label.chat-message(class='label-contributor-{{message.contributor.level}}', ng-class='{"label-npc": message.backer.npc}', ng-click='clickMember(message.uuid, true)')
|
|
span(tooltip='{{contribText(message.contributor, message.backer)}}') {{message.user}}
|
|
|
|
|
span(ng-bind-html="message.text | linky:'_blank'")
|
|
| -
|
|
span.muted.time
|
|
| {{relativeDate(message.timestamp, _currentTime) + ' '}}
|
|
a(ng-show='user.contributor.admin || message.uuid == user.id', ng-click='deleteChatMessage(group, message)')
|
|
i.icon-remove(tooltip='Delete')
|