LESSWRONG
LW

Personal Blog

-23

Sorting Comments

by troll
24th Apr 2013
1 min read
11

-23

Personal Blog

-23

Sorting Comments
7jamesf
3troll
4Qiaochu_Yuan
6faul_sname
6troll
5endoself
2troll
5endoself
3Decius
11troll
0Vladimir_Nesov
New Comment
11 comments, sorted by
top scoring
Click to highlight new comments since: Today at 6:09 AM
[-]jamesf12y70
  1. Open thread
  2. There's not a "person who makes all the site changes people want". Site changes seem to always be on a volunteer basis (meaning, do it yourself if you want it badly).
Reply
[-]troll12y30

Open thread? What?

Nice! How do I go about adding a feature to the site that everyone can use?

Reply
[-]Qiaochu_Yuan12y40

This guy.

Reply
[-]faul_sname12y60

Open the web console. Paste the following in. Hit enter.

if(jQuery('.new-comment').length > 0) jQuery('.comment').not('.new-comment').children().filter('.entry').hide()
Reply
[-]troll12y60

Thanks!

Is there any way to make this a little more automatic for the future?

Reply
[-]endoself12y50

You can make it into a bookmarklet and add it to your bookmarks bar. I don't know what browser you're looking for, but you can google for specific instructions if you don't know how.

Reply
[-]troll12y20

Yup. I did that first thing.

But how do I sort the comments by new (and as a list?) Seeing only new comments is useful, but what about chronological ordering for all comments?

Reply
[-]endoself12y50
(function($) {if($('.new-comment').length > 0) { var time = function(c) { return parseInt(jQuery(c).find('.comment-date').attr('time')); }; var new_comments = $('.new-comment').sort(function(a, b) { return time(b) - time(a); }); $('.realcomment').after(new_comments); }})(jQuery);

This should work. I put the newest ones first, but you can switch that by changing

time(b) - time(a)

to

time(a) - time(b)
Reply
[-]Decius12y30

How does that differ from "Sort By:New"?

Reply
[-]troll12y110

That's in a tree. (new posts under old ones won't be before the old ones)

Reply
[-][anonymous]12y00

Flat instead of nested.

[This comment is no longer endorsed by its author]Reply
Moderation Log
More from troll
View more
Curated and popular this week
11Comments

I'd like to be able to sort comments as a list, too.

An example of this would be sorting comments by new as a list so all the comments you read will be new ones.