Sort the list of teams before making the selector.

This makes it vastly easier to find the team you're looking for
when there are several.

Change-Id: I097d9639ef616519cf93054c65f0411edafce8cb
Minor logic tidyups.

Simpler array length check, remove duplicate lookup.

Change-Id: Ieb912516895daf76858cc9f9274e3b54d310eac1
Whitespace tidyup comment.

Change-Id: I9a2c54db6f9a4de0a2254893de37eb39f36d22ac
Replace large if/elseif/else with switch.

This is clearer.

Change-Id: I80cb6247f87c05f79357d10d3c587925de609e80
Move description switch closer to usage.

The output from this is only used in the one condition that the item
name is empty. Move the switch after the check to clarify this, and
for a minor performance improvement.

Change-Id: Ia251a2b1aacc495d532a05f39cf78f7edeac5201
Break the Project Page classes into separate files.

This makes it vastly easier to work on them as each can be looked
at individually, and it's possible to establish a context within each
at the same time.

Change-Id: I0f1a35fb3bd3941b802af955a266ccf8a4873f28
Ensure the selection list isn't modified when undeleting files.

Create a new list from the modified selected files, rather than overwriting
the values in the original. This could otherwise have caused issues
if the selection was to be re-used for something (for instance if
the undeletion failed and the project file list wasn't refreshed).

Change-Id: I67eb934e8645a68cc4fa927c020b95ffb10af2a3
Separate the Edit classes into their own files.

Each of these is quite large, and easily justifies being in its own
file. This aids development by making each more accessible, and
doesn't affect production since all the static files are combined
for serving anyway.

Change-Id: Iacd823bf6b17e06cf001a9bfbb69424062cf0997
Add JSHint checking and tidyup based on it.

This adds config and ignore files for using JSHint to check our
JavaScript, and performs an initial round of tidying up based on
the output. This includes adding missing semicolons, tidying whitespace,
ensuring braces are present around blocks and removing unused variables.
In some places refactoring has occured to clarify logic and simplfiy tidyups.

No functionality changes are expected as a result of these changes.

Change-Id: I742db20d0ba4668b0e559e328598e995d352fa61
Remove redundant call to wrong function.

The update function being called turns out to actually be part of
MochiKit. It looks like this was intended to be the _list.update
call that is also present below, but was typod originally.

Change-Id: I10f1267cfacf263c7d9ab1f2207a5546eb24a80b
Fix some whitespace irregularities.

Change-Id: Ibfd765683adad44cabdcfbeea919c70a2e7970cc
Remove trailing comma from object creation.

This causes issues in IE7 and lower. Since this is has been live
like this since mid November it's interesting that no-one has yet
hit it, but still a good idea to fix it.

Change-Id: I6a579ba5e7929fc144fef4c883936ebd57f9ddf2
Fix typos in deletion success message.

Change-Id: I6ae6d8e85a2b050a39e07b065819fd6d16ac41b0
Fix call broken during tidyup.

I failed to notice that the status_options message's signature is
radically different to that for status_button.

Change-Id: I54f6b6a1278e69ea374f63c40b236f2ef8ca8c8b
Fix #2304: Print the name of the project we just exported.

This extends the existing printing of the revision exported to also
include the name of the project, which is a very useful thing to be
reminded of.

Change-Id: Ie5dd6e5c9ee255cf161d0822bb993bb6459a0532