gittip/www.gittip.com — pull request #1631 by rummik (2013-10-30 00:35:09+00:00)
Title: JS cleanup

This PR depends on (and includes commits from) #1568. #1568 will need to be merged first (I'll rebase this against master afterward)

There's a few logic changes that will need to be tested prior to merge -- I can't go through and test these currently since `make run` is failing for me as I'm missing a couple dev packages that I won't be able to install until tonight.

Formatting changes (some of them):
- Moved curlies so they're no longer on their own line (for functions and if/else statements)
- Made sure indentation is 4-space
- Gave JSHint some cookies to make it happy
- We're no longer using leading `+` or `?` -- JSHint says it's bad, and doesn't have a `laxcomma` equivalent for either of these
- Sprinkled in some semicolons where they were missing
- Scraped off some extra semicolons
- Refactored some code so functions were not being conditionally defined (see `payments.js` lines 177-228, 344-384)
- Changed the way a few for loops work (see `horn.js` lines 38-39; `team.js` lines 48-49, 101-102
- Dropped what appeared to be an unnecessary `new` on `Gittip.team` in favor of just executing it. JSHint said it was weird before