Fix settings defaults.

Not entirely sure why these were wrong. The value specified here needs
to be the desired default _value_, not the default _label_ (as it
was previously).

Change-Id: Ifa2f8f911a6e8b5c97e82463850190e869302007
Make settings requests account for defaults.

This works better than requiring each usage to have to deal with
this themselves (which they previously didn't).

Change-Id: Iabbcd6b770df68119fe884b2ab3fef46984af908
Make the Jasmine runner error on syntax errors too.

Previously, these were treated as success.

Change-Id: I061d192f08484831b98f229830596d8f00ee4608
Remove duplicate lookup of list.

Also move the lookup higher up, which will be useful for
sorting it differently.

Change-Id: Idbc1a64b23f014222f5d913e6a1096d9ddc39915
Fix browser project selection list.

My change to the ProjSelect object (part of 2584c5f887788e274) to
accept a jQuery node wasn't mirrored in the Browser's usage. This
commit removes the additional parameter, and instead constructs the
jQuery node from the one we're passed anyway.

Change-Id: I77f96a7fa07c9b5496cbc4880203d2bece3995e8
Fix #1007: Add optional by-usage sorting of the projects list.

This further improves the use of Chosen as the selector, by making
it possible to select to have the project list sorted by usage,
rather than alphabetically (though this remains the default).

Note that using the raw usage-order-list like this is a bit rough
around the edges, as it means that a single use of a project takes
a while to filter out, but it's probably good enough for now.

Change-Id: I415455f9a33f7f1feb86377b0b5d110efa3cd39d
Add a doc comment on the class, fix comment alignment.

Change-Id: I3a4e0d09257915b69137e491729d1840be1d0c0f
Ensure the stored project usage doesn't grow too big.

Have the UsageSorter limit the number of entries that it keeps,
since we know it's operating on one list per team, 20 items seems
a reasonable default for now.

Change-Id: I49f9ce9a4d5f0c4b1eae971711ef29553460fcf5
Fix typo

Change-Id: I56cd14c09ab429b90f522074f9b916fcda07f63b
Whitespace & style tidyup.

Change-Id: Iba1a34248d0d3ffe005f6f798cfbeeb1dbd948b0
Apply errors to the right file.

Previously, an error in a file would be shown against the file that
was checked, rather than the file the error was actually in.

Change-Id: Ie13b9cc3fc775f0d4da9d86c2e21e3d5f074d1ec
Fix #1732: Mark errors on a document after navigating to it.

This isn't really the best fix -- ideally, we probably need an error
collection that's separate from the handling of the visual display
of the error, and that should then be subscribed to by both the edit
page and the errors view.

However, since that's a much larger & complicated change, instead
just have the errors page mark the errors on the document it
navigates to. Also have the edit tab postpone actually setting the
error markers until the editor is ready to ensure they appear correctly.

Change-Id: I57f08da4ca57be612535ea0562392a97ca646080
Move the jQuery JS tag to after the stylesheets.

All the performance tools say this is a good thing to do.

Change-Id: Iae7e0009083d22b0dd5a781a16bddf0e13ba16da
Simplfiy & optimise error loading.

Replace the array of files seen this load with a hash, using the
files names as keys. This allows for slightly nicer syntax, and
should be faster for projects with more files (if that ever happens).

Change-Id: I1beb3ed68a9af1e7aa0fd1e30457bfa754139c43
Fix #2088: Correct styling of 'Chosen' selector in the browser.

Force the text in it (and the fallback <select>) to be black, since
it has a white background.

Change-Id: Ief4b2cf51bc6da3f478ab8d366d8097d1066c74a
Add missing ;

Change-Id: I4f0062936241b6c11a371c54cce38429709c2b94
Improve exception to aid debugging.

Change-Id: I1862e51d69833643368438fd33078c8fe794a927
Create and use resize-and-save helper.

This isn't strictly needed here, but it makes things a little tidier,
and will be useful when I move the thumbnail creation into a separate
place (shortly).

Change-Id: I50a9bbd114cfd8f2415420fb4ef5803e0a3aff7c
Make team-status images live direclty after review.

This changes the post-review procedure for images such that (if valid)
they are copied into a configurable target folder so that they can
are made live immediately. This also moves the creation of the image
thumbnail to being part of this step, ensuring that the thumbnail
and the reviewed image that go live are the same.

Change-Id: I2d7d3ecc3ab652cc7a8e5aa93a13c99e95870999