diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-10-18 17:23:52 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-10-19 00:34:00 +0200 |
commit | 185433967e6680d7d5f8138b5241314c879042ac (patch) | |
tree | c483580f7344ccae55bae28969a9934894f79ec8 /apps/comments | |
parent | 70bd6cafd40dab7f5e4fd9c4aff49d60b0b5c608 (diff) | |
download | nextcloud-server-185433967e6680d7d5f8138b5241314c879042ac.tar.gz nextcloud-server-185433967e6680d7d5f8138b5241314c879042ac.zip |
display avatar (if enabled) alongside displaynames
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/comments')
-rw-r--r-- | apps/comments/css/comments.css | 4 | ||||
-rw-r--r-- | apps/comments/js/commentstabview.js | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css index 667f32871bb..796a550227b 100644 --- a/apps/comments/css/comments.css +++ b/apps/comments/css/comments.css @@ -64,6 +64,10 @@ line-height: 32px; } +#commentsTabView .comment .message .avatar { + display: inline-block; +} + #activityTabView li.comment.collapsed .activitymessage, #commentsTabView .comment.collapsed .message { white-space: pre-wrap; diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index e8bd4f82e9b..c4b2bd61d4e 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -257,10 +257,17 @@ for(var i in mentions) { var mention = '@' + mentions[i].mentionId; + var avatar = ''; + if(this._avatarsEnabled) { + avatar = '<div class="avatar" ' + + 'data-user="' + _.escape(mentions[i].mentionId) + '"' + +' data-user-display-name="' + + _.escape(mentions[i].mentionDisplayName) + '"></div>'; + } // escape possible regex characters in the name mention = mention.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - var displayName = '<b>'+ _.escape(mentions[i].mentionDisplayName)+'</b>'; + var displayName = avatar + ' <strong>'+ _.escape(mentions[i].mentionDisplayName)+'</strong>'; // replace every mention either at the start of the input or after a whitespace // followed by a non-word character. |