Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
support for more sites
Browse files Browse the repository at this point in the history
  • Loading branch information
benbalter committed Jan 31, 2015
1 parent c02598f commit c54522c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
9 changes: 6 additions & 3 deletions dist/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/script.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions dist/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class GitHubMentionHighlighter
mentions = []
for mention in $(".user-mention, .member-mention")
$mention = $(mention)
mentions.push $mention if $mention.text() == "@#{@username}"
mentions.push $mention if $mention.text() == "@#{@username()}"
mentions

teamMentions: ->
Expand All @@ -22,15 +22,16 @@ class GitHubMentionHighlighter
cache: true
success: (data) =>
members = data["members"]
mentions.push $mention if $.inArray(@username, members) != -1
mentions.push $mention if $.inArray(@username(), members) != -1
mentions

mentions: ->
$.merge @userMentions(), @teamMentions()

constructor: ->
@username = $(".supportocat a, #user-links .name").text().trim()
username: ->
@_username ||= $(".supportocat a, #user-links .name, .header-right .logged-in a").text().trim().replace("@", "")

constructor: ->
for $mention in @mentions()
$mention.addClass("highlight")
$mention.parents(".timeline-comment, .timeline-entry").addClass("highlight")
Expand Down
4 changes: 3 additions & 1 deletion src/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.timeline-comment:not(.current-user) .user-mention.highlight,
.timeline-comment:not(.current-user) .team-mention.highlight,
.timeline-entry .member-mention.highlight,
.timeline-entry .team-mention.highlight {
.timeline-entry .team-mention.highlight,
.markdown-body .user-mention.highlight,
.markdown-body .user-mention.highlight {
background: yellow !important;
}

Expand Down

0 comments on commit c54522c

Please sign in to comment.