Commenting standards are critically broken in tabledrag.js. As we all know, following commenting standards makes comment readable, and should be followed by all of Drupal core, especially considering how Drupal core is an example for contrib. The attached patch fixes all the broken commenting standards in tabledrag.js.

Comment should start with capital letters all the time, so as to distinguish it further from actual code. This is especially important for end line comments (comments that come on the same line as the code). For example, all the lines in tabledrag.js such as

<?php
    element = element.firstChild; // a table cell
?>

need to be changed to following commenting standards, as we can see with:

<?php
    element = element.firstChild; // A table cell
?>

The latter is clearly by far the much more readable of the two options, and the one we should be using.

Lastly, this patch makes tabledrag.js coding standards compliant, and since both awesome javascript and awesome coding standards contribute to Drupal's awesomeness, this patch has a double-awesomeness benefit in that it is not only fixing coding standards, it is also fixing javascript. This patch needs to be applied if Drupal is to keep up its reputation as the most awesome CMS in existence. Thank you.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Status: Needs review » Needs work

Missing a full stop at the end of the comment to go with the capital letter at the start.

cwgordon7’s picture

Status: Needs work » Needs review
FileSize
640 bytes

catch is right.

cwgordon7’s picture

Updated patch with simpletests.

cwgordon7’s picture

..bump?

floretan’s picture

Priority: Normal » Minor
Status: Needs review » Reviewed & tested by the community

Patch from #2 works. We don't need a test for this.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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