Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements/mention all color #2865

Merged
merged 2 commits into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rocketchat-mentions/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MentionsClient
mentions = mentions.join('|')
msg = msg.replace new RegExp("(?:^|\\s|\\n)(@(#{mentions}):?)[:.,\s]?", 'g'), (match, mention, username) ->
if username is 'all'
return match.replace mention, "<a class=\"mention-link mention-link-me\">#{mention}</a>"
return match.replace mention, "<a class=\"mention-link mention-link-me mention-link-all\">#{mention}</a>"

if not message.temp?
if not _.findWhere(message.mentions, {username: username})?
Expand Down
24 changes: 17 additions & 7 deletions packages/rocketchat-theme/assets/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -2473,6 +2473,10 @@ a.github-fork {
width: 100%;
top: 50%;
position: absolute;
border-radius: 2px;
}
.tick-all {
background-color: #9C27B0;
}
}

Expand Down Expand Up @@ -3776,14 +3780,20 @@ body:not(.is-cordova) {
position: fixed;
}

.mention-link.mention-link-me {
background-color: #008ce3;
border-radius: 4px;
padding: 0px 4px 2px 4px;
font-weight: bold;
color: white;
&:hover {
.mention-link {
&.mention-link-me, &.mention-link-all {
background-color: #008ce3;
border-radius: 4px;
padding: 0px 4px 2px 4px;
font-weight: bold;
color: white;
&:hover {
color: white;
}

&.mention-link-all {
background-color: #9C27B0;
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions packages/rocketchat-ui/lib/RoomManager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ RocketChat.Notifications.onUser 'message', (msg) ->
$('.messages-box .mention-link-me').each (index, item) ->
topOffset = $(item).offset().top + scrollTop
percent = 100 / totalHeight * topOffset
ticksBar.append('<div class="tick" style="top: '+percent+'%;"></div>')

if $(item).hasClass('mention-link-all')
ticksBar.append('<div class="tick tick-all" style="top: '+percent+'%;"></div>')
else
ticksBar.append('<div class="tick" style="top: '+percent+'%;"></div>')

open: open
close: close
Expand Down