Add a test for the 'html' pages.
Add a missing html utils file.

This contains helper methods for the index and login pages, and
should have been part of f1cedae3f3 which made the combination of
static files configurable.

Change-Id: I17e3cfd9323081fc75c66c13fd59514f5e089f58
Extend description in metapackage.

Tell developers to install the suggested packages so they can run tests.
Add support for running Javascript tests via jasmine-node.

Add a new test runner that picks up on *.spec.js files and runs them
under the jasmine runner. Also a collection of example test files.

Note this new requirement in the README and in the metapackage.

Change-Id: I174c92d306433eb66c6533b05d069ea3b1d019a6
Detect and fail test that fial to load modules.

For some reason the jasmine runner thinks this is a valid thing to
do, and just returns a PASS without running any tests if it happens.
Since this isn't very helpful, especialy since we can't see the output
due to our own wrapping stuff swallowing it for passing tests, ensure
that such failures are reported properly.

Change-Id: Icb02e41e6b672ef9413bb8b9010651edff1544a5
Add the start of JS tests for the search page.

Just basic import tests for now, but they help proove the system
and provide a base for getting more things done.

Change-Id: I2e032ad9cff4b86db9443bef569ef9c67058096b
Switch usage of $working_path to workingPath().

This shows better that it should be immutable, and prepares for
the class being split in two.

Change-Id: Ie4973cade7902f645132eb5ceaabab8ed7d8ba65
Split the GitRepository class to create a ReadOnly base class.

This allows a switch of read-only usages to using the read-only
base class, and then to have them use shared (read) locks. In turn,
this ought to reduce the number of requests that fail due to lock
conflicts, as the number of possible conflicts will be reduced.

This also switches all usages of the working_path (private) instance
variable to use the workingPath method. This is nicer than making it
protected and better shows that it should be an immutable member.

Change-Id: Ic029eb274b24d7ff3c277e5e967a1d566967a451
Fix variable existence check.

Change-Id: I5d0b92e06c6008424391a7d69cb61f8e3a39908a
Fix project selection from saerch results.

Previously this used the global projtab object to switch tabs,
however as of 4c2e45d2e19 the project tab is no longer global.
Instead introduce a method on the project page that achieves
the same result, and use that instead.

Change-Id: Iaa46af9e3896eb82a9167494d29d7c173e09c79f
Load the search page earlier.

There's no need to delay it until after the user's
information has been loaded.

Change-Id: Ie099fd3801a8ff867bb7325f2b159c40c9879f73
Corrent the file-name search's async flag.

If there were no projects, then there are no async results
to wait for.

Change-Id: Ia1c2e638be8ed1629608a9868e0ddd31c80bc9a8
Fix error handler creation.

Change-Id: I6b674faafebfe59f759cde2f374b53ebe9654848
Fix loading of null revision.

If the caller hasn't specified a revision we need a suitable
default. Currently '0' will error in the backend leaving us
with an empty file.

Change-Id: Ie883b0cac6787044b0c33e589ad8e72ca610f68b
Better AUTOSAVE load handling.

If the caller requests AUTOSAVE, but there isn't one,
don't show the user an empty file -- fall back to the
last save instead.

Change-Id: Ie45c34f30bc978754383e7e92d5440ec6a60a67e
Remove redundant variable.

Change-Id: I469da3aed57b683803b697d6042f92bd5e3c08ba
Let the selection range be specified before the file loads.

Build a cache of actions that need to be done once the file content
is loaded & then execute them after we're called back. This allows
callers that open the file to setup interactions that otherwise
would need to wait until it was fully loaoded.

Change-Id: Ie85fe92314719576f90619e22966d53df10d7a81
Add support for searching the contents of files.

This searches all the files in all the projects for the current
team, providing probably the most useful seach implemented thus far.

This uses git's grep function in plaintext mode (-F) avoiding the
need for users to understand about regular expressions, or get
potentially suprising results from searching for items containing
regex characters. Ideally I'd like to offer an advanced mode where
some form of wildcard or regex pattern is supported, but due to the
differences in JS and grep patterns, this isn't immediately doable.

Change-Id: I4ad7f4e26ba397ec45eb5364c3527ea5f782f381