refactor-864370: Remote the 'make' command

Not sure it ever worked properly. Certainly doesn't now.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Auto mute command failures

cli.logErrors is normally true, but during testing we want to hide
expected errors. Previously we manually toggled it on per test file
basis, but with a tweak to helpers.js we can automatically toggle it
when the command is expected to fail.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Track websocket errors better

Now we report 404 errors (server not started with --websocket) to the
web page properly.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add remote unit tests

We previously attempted remote commands whenever we were loaded over
http, but the server could (and in many cases will) have been started
without the required flags. Take note of this.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add startup step for converters

Previously converters.js added all the internal converters. This makes
it hard to have converters that we don't want to include by default,
and everything else uses a startup() step, so we should conform.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add an html converter

Uses innerHTML. Not exported to Firefox.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Use context.update[Exec] more

2 places where we would have used context.update() and
context.updateExec() had they been available when they were written.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Make conversions less smart

Just like the dangers of content-type sniffing, so we shouldn't be
guessing at the type of data as we convert it.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Remove gclichrome

Was only an experiment, was commented out, and isn't useful.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Allow types without inheritance

Having to inherit from a type exported by GCLI is annoying because it
means a require step, and some fragility from inheritance. We have done
some work to allow a JSON like declaration of a type (much like how a
command is implemented) but previously it was only of any use if you
wanted to 'extend' the selection type. This change is more consistent
about copying properties allowing the implementation of any time using
a JSON structure.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Minor tidy-up

Unindent wrongly indented code.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Add addItems() API

Having [add|remove][Command|Type|Converter|etc] is nice, but we often
want to register a bunch of things so we add a module that pulls
together all the addFoo()/removeFoo() commands, and adds a addItems()
and removeItems().

A command, converter, etc declares what type of thing it is using the
'item' property which should be one of 'command', 'setting', 'field',
'type' or 'converter'.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Use items rather than startup/shutdown

Previously many modules has startup() and shutdown() functions which
was more verbose than it needed to be, and meant that we were wanting
mozcmd files to register stuff in a different way to GCLI itself.

This changeset is large but it just does the following:
* Adds "item:..." properties to commands/converters/etc
* Removes startup and shutdown functions in place of a items array
* Alters the calling of startup to use addItems on the exported items
* Breaks down large collections of commands/types into smaller units
* Removes places where commands were duplicated between the server and
  the client

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: default parent to root type

If the parent type isn't specified then assume that we're targeting
the basic top level type as a parent.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Fix incorrect file headers

We changed from BSD to ASF2.0 ages ago, but apparently some files got
missed out - I suspect they were branched off before the change or
something similar.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Remove motivate() naffness

Which also means we are returning a string rather than html.

Does not need review for mozilla-central.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
l10n-871697: Update l10n functions to sync with central

Proposal form flod to simplify and remove duplication from GCLI string
which we like, but which means we need to update the way the properties
file is created.

* Allow no comments, and add key name to previous comment
* Update initial comment
* Use a more data driven approach than the previous string manipulation
  approach

Signed-off-by: Joe Walker <jwalker@mozilla.com>
l10n-871697: Update strings to match central

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Minor updates

Trivia: Adding missing semi-colons, !== not !=, brace positioning, removal of
function names (debugger does a better job), documentation updates,
plus, an actual fix for selection types that protects against a
prediction having no actual value, only a name.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
refactor-864370: Fix Settings.getSetting bug

In GCLI settings names are short simple things, bug prefs in Firefox are
generally longer, so there is a prefix that we use when a GCLI setting
is stored in a Firefox pref. getSetting was failing to use this prefix.

Signed-off-by: Joe Walker <jwalker@mozilla.com>