Skip to content

Commit

Permalink
reddit-highlight-new-comments: fixed issue with media threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Farow committed Feb 12, 2019
1 parent 3dbb7d3 commit f11e2ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Download: [**Chrome**](https://chrome.google.com/webstore/detail/violentmonkey/j
| | [reddit-comment-vote-history.user.js](reddit-comment-vote-history.user.js) | saves the comments you vote on |
| | [reddit-custom-multireddit-buttons.user.js](reddit-custom-multireddit-buttons.user.js) | adds custom buttons to the multireddit list |
| | [reddit-custom-theme.user.js](reddit-custom-theme.user.js) | uses a subreddit stylesheet as a template |
| *u* | [reddit-fade-seen-links.user.js](reddit-fade-seen-links.user.js) | fades links that you have already seen |
| | [reddit-highlight-new-comments.user.js](reddit-highlight-new-comments.user.js) | highlights new comments since your last visit |
| | [reddit-fade-seen-links.user.js](reddit-fade-seen-links.user.js) | fades links that you have already seen |
| *u* | [reddit-highlight-new-comments.user.js](reddit-highlight-new-comments.user.js) | highlights new comments since your last visit |

<sup>Legend: *u* - recently updated, *n* - new</sup>

Expand Down
7 changes: 4 additions & 3 deletions reddit-highlight-new-comments.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/Farow/userscripts
// @description Highlights new comments since your last visit
// @include /https?:\/\/[a-z]+\.reddit\.com\/r\/[\w:+-]+\/comments\/[\da-z]/
// @version 2.0.0
// @version 2.0.1
// @require https://raw.githubusercontent.com/bgrins/TinyColor/master/tinycolor.js
// @grant GM_getValue
// @grant GM_setValue
Expand All @@ -15,6 +15,7 @@
/*
changelog:
2019-02-12 - 2.0.1 - fixed issue with media threads
2016-02-16 - 2.0.0
- removed better/worse comments
- removed option to use reddit's new comment highlighting, it is now removed
Expand All @@ -35,7 +36,7 @@ let HNC = {
return;
}

let thread = document.getElementById('siteTable').firstChild.className.match(/id-(t3_[^ ]+)/)[1],
let thread = document.getElementsByClassName('thing link')[0].className.match(/id-(t3_[^ ]+)/)[1],
now = Date.now()
;

Expand Down Expand Up @@ -449,7 +450,7 @@ HNC.ui = {
}

let comment_age = Date.parse(elements.time.getAttribute('dateTime')),
double_comment_age = comment_age - (Date.now() - comment_age) * 2;
double_comment_age = comment_age - (Date.now() - comment_age) * 2
;

elements[HNC.config.apply_on].setAttribute('style', HNC.generate_comment_style(comment_age, double_comment_age));
Expand Down

0 comments on commit f11e2ad

Please sign in to comment.