A plugin to automatically adjust textarea height as text is entered. Makes use of the library found here: http://www.jacklmoore.com/autosize/

Project page
https://www.drupal.org/sandbox/modstore/2299225

Git
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/modstore/2299225.git jquery_autosize

Comments

gwprod’s picture

This code does not pass automated testing:

FILE: /var/www/drupal-7-pareview/pareview_temp/jquery_autosize.module
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 8 LINES
--------------------------------------------------------------------------------
5 | ERROR | [ ] Doc comment short description must start with a capital
| | letter
52 | ERROR | [x] Comments may not appear after statements
76 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks,
| | or question marks
78 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks,
| | or question marks
80 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks,
| | or question marks
82 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
82 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks,
| | or question marks
83 | ERROR | [ ] Concat operator must be surrounded by spaces
84 | ERROR | [ ] else must start on a new line
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Note, it is also less than 120 lines of code (both PHP and JS combined) and contains only 4 functions. This is not necessarily a blocker, however.

gwprod’s picture

The administrative settings form really ought to go in a dedicated include file (as people have a tendency to look for it).

Although it has jquery_update as a dependency, it doesn't specify which version (older versions are hard-coded to use jQuery < 1.7)

in jquery_autosize.js:

Drupal behaviors really should be written so that they only apply to elements that have not already had this behavior attached to them.

$('textarea').autosize();

Should be

$('textarea', context).autosize();

You might also want to add some sort of processed flag to elements that have been processed this way.

Looks like a useful module. I'd probably use it, myself.

modstore’s picture

Thanks for the feedback.

I've fixed those errors, created a dedicated include file, included version dependencies and updated the .js file to include the context.

gwprod’s picture

FILE: /var/www/drupal-7-pareview/pareview_temp/js/jquery_autosize.js
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/jquery_autosize.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
65 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
20 | WARNING | Line exceeds 80 characters; contains 81 characters
26 | WARNING | Line exceeds 80 characters; contains 86 characters
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/jquery_autosize.info
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
5 | ERROR | It's only necessary to declare files[] if they declare a class or
| | interface.
6 | ERROR | Declared file was not found
13 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

It is a good practice to pareview your repository after every push, I think.

Make sure to add/commit/push jquery_autosize.admin.inc

modstore’s picture

Errors sorted now, and I ran pareview this time. Cheers.

gwprod’s picture

I personally believe it looks a-ok.

modstore’s picture

Great, so what's the next step, just wait for a few more people to review?

gwprod’s picture

I think so, yes. This process is kind of ad-hoc. Eventually, someone with gumption will change it to RBTC. I have no gumption in this realm.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

modstore’s picture

Status: Needs review » Reviewed & tested by the community
MattWithoos’s picture

Status: Reviewed & tested by the community » Needs review

Hi, thankyou for your contribution!

Please review the Status documentation - for reasons I'm sure you can imagine and understand, it is not recommended that the Project Applicant themselves changes the status to RTBC. See here: https://www.drupal.org/node/156119

While the code looks good & short, unfortunately it is less than 120 lines & less than 5 functions. The module can still be manually promoted, however it means that you won't receive the git vetted status and won't be able to publish modules yourself.

However, please continue to think of new module ideas and come back sometime in the future with a longer one and we will be able to review it and give the access to make projects / modules.

Code too simple
This project does not demonstrate sufficient hook usage and/or API integration, therefore it is only eligible for a one-time promotion to a full project. You can find more info at Working with the Drupal API.

This is an important criterion so that code integrates well and can be improved over time. I encourage you to continue developing and gaining from the feedback available in the git approval process.

Thank you for you contributions and understanding.

modstore’s picture

I understand, thanks.

Might as well just promote this project then if that's possible. I think it could be useful to some people. And I will get larger module ready for review when I can.

Cheers.

MattWithoos’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +PAReview: Code too simple;

I've applied the Code Too Simple and Code Too Short tag for you, and changed the status to RTBC. I would recommend doing three manual reviews of other projects to help the PA issue queue in order to be seen quicker by the git admins - this is optional though.

There may be the chance that, if your reviews are detailed enough and demonstrate enough Drupal knowledge, the git admins may consider giving you git access - but that's up to them.

Thanks modstore.

MattWithoos’s picture

Issue tags: -PAReview: Code too simple; +PAReview: Code too simple; PAReview: Code too short;
MattWithoos’s picture

FYI PAReview is unhappy with a missing file doc comment:

Review of the 7.x-1.x branch (commit f286878):

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).

    FILE: /var/www/drupal-7-pareview/pareview_temp/js/jquery_autosize.js
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
    1 | ERROR | Missing file doc comment
    --------------------------------------------------------------------------------

I won't change the status though to avoid fussing between status changes again.

modstore’s picture

js doc comment added. Cheers.

klausi’s picture

Issue tags: -PAReview: Code too simple; PAReview: Code too short; +PAreview: single application approval

fixing tags.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Non-blocking issues:

  • The project page could use more information
  • You should delete the variable jquery_autosize_variant in a hook_uninstall()
  • You don't want to use hook_init(), hook_page_build() is more appropriate. Ideally you only need to load this library when there is a textarea being displayed. You might be able to use an _alter hook on the display settings for textareas and inject your javascript there.

I agree with the above reviewers that this code is too short to grant "git vetted user" status, so I'll promote this project instead, https://www.drupal.org/project/jquery_autosize

Thanks for your contribution, modstore!

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

modstore’s picture

Thanks guys, I appreciate it.

Status: Fixed » Closed (fixed)

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