NewCommentIndicator

is a simple script to add an indicator to newly-posted comments, both in the comments section at the bottom of articles, and on the message wall of users. It cannot modify Discussions comments.
== ==
== Configuration ==
You can optionally configure the script via window.newCommentIndicator in your site JS or personal JS (before the import).
;newThreshold (default 86400): The threshold for "newness", in seconds. For example with 86400, a comment is only considered new if it was posted within the last day. If a user views the comment after this time, an indicator is no longer shown. The default value is 86400 (1 day in seconds).
* For minutes, you can do 60 * minutes.
* For hours, you can do 60 * 60 * hours.
* For days, you can do 60 * 60 * 24 * days.
;hideViewed (default false): If true, once a user views a comment with a "new" indicator, the indicator will no longer appear the next time that comment is shown (i.e. on subsequent loads of the page), even if it was newly-posted. The indicator will be generated, but will be hidden with the new-comment-indicator-read class (you can choose to override this selector in CSS if you want to style the indicator in some way when a new comment has been read).
:This writes to your localStorage, with the key mw_NewCommentIndicator_states.
/* Default NewCommentIndicator config */
window.newCommentIndicator = {
 newThreshold: 86400,
 hideViewed: false
};
== Styles ==
The stylesheet may be imported optionally. If they are not present, the script will automatically import it for you. When this occurs, you can still override styles as if it were imported, because the stylesheet is always placed above your site CSS. Note however that - as opposed to using @import - this automatic import is non-blocking, and may introduce flicker, as the styles will be loaded in after the page has been displayed (however this is almost never an issue).
If you're importing the script with importArticles, it's preferred to include the styles alongside the script as this results in one less request, for example:
importArticles({ articles: [ "u:dev:MediaWiki:NewCommentIndicator.js", "u:dev:MediaWiki:NewCommentIndicator.css" ] });
The text within the indicator is displayed via a psuedo-element, and may be overridden via a CSS rule, as follows:
.new-comment-indicator:before {
 content: 'Woah!';
}
The style of the indicator may be overridden too, or completely reimplemented (rather than importing it, just to override it).
== Notes ==
* This script modifies the behaviour of the Timeago function in index-BhFE9Wap.js, making it return a valid machine-readable value for the attribute (by default this field contains a value that - depending on the user's locale - cannot always be accurately parsed by the User Agent).