When you have a lot of comments and some subset are new, it can be a pain to look through and read only the new comments. This patch adds previous/next links next to each "new" notice for the comments using jQuery. I think it will be especially handy for big threads on drupal.org.

I stole this idea from the Texas Legislature's online bill viewer (see, e.g. this bill on redistricting as an example).

Comments

ChrisKennedy’s picture

Version: 6.x-dev » 5.x-dev

Btw, this patch is currently against d5 until comment.module is working again in HEAD.

ChrisKennedy’s picture

Status: Needs review » Needs work

I probably need to re-implement this to use html anchors rather than javascript, which will be easy.

ChrisKennedy’s picture

Version: 5.x-dev » 6.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.39 KB

Well, after looking into it for quite a while, it appears that implementing this in HTML would quite a fairly large refactoring of how the "new" link is eventually output and themed in Drupal. Keeping it as a js-only, gracefully degrading feature seems to be the best option.

Re-rolled patch against HEAD.

RobRoy’s picture

Status: Needs review » Needs work
StatusFileSize
new10.05 KB

Applies cleanly and works as intended but the UI and styling is a little funky. See screenshot.

  • There needs to be some spacing between the arrows and New
  • I don't think the first new comment should have a prev arrow and vice versa for the last
  • I'm not really sure I like where the arrows are positioned by default and think they would work better in the links DIV. Can you just append a Next new comment and/or Previous new comment as LI's with the links? I think that would be the easiest to understand

Good stuff man!

catch’s picture

Version: 6.x-dev » 7.x-dev

Don't think this will get into D6, and no longer applies.

Ideally it'd be good to have a solution both for this and: http://drupal.org/node/6371 - where the #new anchors disappear on multi-paged threads if just one page is viewed.

David_Rothstein’s picture

Hm, I just came across this... it appears there's a semi-duplicate issue at http://drupal.org/node/205515, which now has a working patch that implements the "next new comment" links entirely via HTML (no javascript).

I'm not marking this as a duplicate just yet (especially since it's older), but since this patch is now a year old and people seem to generally agree that the HTML approach is preferable to javascript in this case, it might be good to concentrate efforts over at the other issue.

ChrisKennedy’s picture

Assigned: ChrisKennedy » Unassigned
Status: Needs work » Closed (duplicate)

Nah it's a duplicate, and HTML is definitely preferable. I was just too lazy to re-implement.