The b2 nice comments module is a very light weight extension for Drupal 7, enabling it will turn comment boxes into simple text areas, which will expand when user clicks on it. This way it will give a nice clean look for the page instead of displaying all the comment fields and instructions when not needed.

Here is a demo video http://www.screencast.com/t/MB13X6edtF4

Core: 7.x

Project URL: http://drupal.org/sandbox/bboldi/1230962

CommentFileSizeAuthor
#5 b2_nice_comments-1232020-5.patch6.26 KBtim.plunkett

Comments

bboldi’s picture

I have fixed the branch naming, and created a 6.x version.

pillarsdotnet’s picture

Will test shortly.

bboldi’s picture

Thanks!

tim.plunkett’s picture

Please mark one of your two applications as "closed (duplicate)": #1229776: [D7] b2 Drupal Plus or #1232020: [D7] b2 nice comments.
You only need to be reviewed and approved once.
Thanks!

tim.plunkett’s picture

Status: Needs review » Needs work
StatusFileSize
new6.26 KB

I started to review the code and make coding standards fixes, and after a while I realized I'd rewritten your whole module. Sorry for being so presumptuous, I had the best intentions.

There is a new naming convention for CSS files, the goal is to split up the functional from the aesthetic. I've also moved the display: none; from the module to the CSS for when JS is disabled.

Not many people have found hook_form_BASE_FORM_ID_alter(), as it is a new Drupal 7 function, but it allows you to find all comment forms without the use of strpos.

#attached allows you to add CSS and JS to a form directly, allowing others to conditionally unset it in another form_alter.

The magic ___ form_ids that you're using are largely unnecessary, as the jQuery can just find the sibling of whichever is clicked.
I've also converted the JS to use Drupal.behaviors, you can read more about the benefits of this here: http://drupal.org/node/171213#behaviors

The focus was being set twice, so I removed the extra one. I believe comment body is the normal default.
I'm not sure exactly what the conditional is at the bottom of the JS, but you should document it.

Please review these changes, and if you don't disagree with them, apply them. Then set back to "needs review" and you'll be pretty much ready to go.

A final note, I might consider removing b2 from the namespace, and just going with nice_comments. Putting your company's namespace in a module name is discouraged, and you are free to put that on the project page or in a README.txt. I know I generally shy away from modules named like this. However, this is my personal opinion, and will not affect your review.

bboldi’s picture

First of all: Thanks for the review, and thanks for taking the time to doing an in depth analysis of the module! Much appreciated, I have learned a lot! I will modify the module taking your suggestions into consideration, and submit it for a re-review when it's ready.

bboldi’s picture

Status: Needs work » Needs review

I have fixed the coding standard problems found by tim.plunkett . Please re-review the code.

Thanks!

tim.plunkett’s picture

Status: Needs review » Fixed

This is a really simple, but high quality module. Despite a little assist from me, you demonstrated your knowledge of the Drupal API, and I have given you full project creation rights. Use this ability carefully!
Thanks for your patience.

bboldi’s picture

Thank You!

tim.plunkett’s picture

Just to let you know, I just used your module as a demo at the Philadelphia Drupal meetup, as a demo of how to incorporate custom JS into a module. You're famous! :)

bboldi’s picture

Tim, You made my day :) Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Title: b2 nice comments » [D7] b2 nice comments
Issue summary: View changes