Restore Scrollbars in the blocks editor when using Firefox.

Made changes to blockly.js to accomidate for drawer.js instead of
toolbox.js in core

Change-Id: Idf002de5cbf46fc30517c716758127d11f5fdce0
Report Client Errors.

When an error is detected in the client, a page is shown to the user
requesting their feedback, which is then stored on the
server. Technical data on the error is included along with user input.

Change-Id: I42a70fafe7fc377e6d9d8faede5e70079322112c
component block generation change

There is now only one Blockly.Language object for the different types
of component blocks (events, methods, get/set, component literal). The
component blocks are differentiated by the information inside of the
mutator xml tag (component type, instance name, method/event type,
generic or not).

All set and get blocks for properties are now visible in the drawer.

Change-Id: Iec47e5872daca10020b6dcff8da560e189143934
Translates current ai2 projects to work with new blockly xml format

Change-Id: I9b00f358180737246ec53334d36844467fe9acfe
Fix embarrassing typo at the top of replmgr.js.

Change-Id: I114fa7b43dc60d4b405f8abacc05d77529a94f3c
- Interface Upgrade!

- Makes the top bar an actual toolbar.
- Animates the project structure tree collapse/expand
- Animate the DeckPanel
- (Andrew) Fixed and renamed Connect menu, rearanged consolidated UI.
- (Andrew) Cleaned up code.
- (Andrew) Added "Report a Problem" link now connects to google form.
- (Andrew) Changed Learn link to Guide link
- ActionDropDown not used yet.

Change-Id: Ieab115dfa976e8d23563d8d032d3dd9ad4fe3225
Update Documentation

Move documentation location (for components) back to the deployed
server. Update URLs to coincide with the re-categorization of
components.

Change-Id: I1bbc8de70cb126c3dfc9bb1957c014c9da390b7d
Flydown variable declarations, list all callers in procedure drawer, and drawer block relabelling

Patch 3 Summary:

Bug fixes for parameter renaming and other fixes/simplifications.

* Simplifications and fixes to procedure declarations:
  + Fixed procedure declaration parameters so that name edits are
    reflected in (1) all callers for the declaration and (2) any open
    mutator. This took 10 hours to figure out! Search for "Subtlelty"
    in languages/common/procedures.js to find out three reasons why
    this took so long.
  + Fixed major bug involving listing callers in flyout. Turns out its
    folly to search for associated proc decl, since can't necessarily
    find right workspace. But the xml has all info needed, so just
    ignore proc decls and use XML instead.
  + Disabled "Inlined Inputs" option on defreturn procedure declarations
    (interacts badly with vertical params)

* Many simplifications and fixes to local variable declarations:
  + Fixed local variable declaration parameters so that name edits are
    reflected in an open mutator.
  + Fixed local declaration expression compose() to be the same as that for local
    declaration statements.
  + Modified addDeclarationInputs_ to remove existing declarations,
    add new ones, and keep last two declarations (body and collapsed
    text) rather than recreating them.  This is now used by both
    domToMutation() and compose(), eliminating duplicated code.
  + Eliminated dummy declarations.

* Fixed problem with renaming lexicalVars and globals involving empty strings and
  internal spaces.  Without this fix, edits to parameter names don't propagate
  when name is deleted before being changed

* Fixed bug in renaming globals: can no longer have the same name.

* Made horizontal param flydowns go down and vertical parameter flydowns go to
  the right.

* Removed render() calls from local decls and proc decls. Empirically seem unnecessary.

Flydown variable declarations, list all callers in procedure drawer, and drawer block relabelling

Patch 2 Summary:

* Added context menu option to event handlers and procedures to toggle
  parameters between horizontal and vertical mode.
* Fixed problems with saving/loading procedure callers and blocks with
  vertical parameters.
* More sensible collapsed labels for procedure/variable/control drawers
* Fixed two problems with collapsed blocks:

  + In the move to Blockly version 1343, in Blockly.Xml.domToBlock, the call to
    setCollapsed was moved *before* the sub-blocks were constructed, but it has
    to be called *after* the sub-blocks are constructed! I fixed this.

  + The Blockly.Field init() method assumes it is called on a title element
    that is in an uncollapsed block. Surprisingly, the "trick" of quickly
    opening and closing a procedure declaration mutator can violate this
    assumption -- a mutator can be opened on a collapsed procedure declaration!
    In this case, the compose method of the declaration may want to create new
    titles on the collapsed block. These end up appearing above the block! I
    modified title creation so that it makes SVG elements have style
    display:none when titles are added to collapsed blocks.

Patch 1 Summary:

* All variable declarations changed to editable parameter fields with flydown
  (= mini-flyout) menu of getter/setter blocks.  This includes declarations in
  globals, locals, event handlers, procedures, and loop indices. The flydown
  appears on mouseover, and the field name is editable on mouse click.
  Note: the name "flydown" is misleading because it can be configured to show below
  the parameter field or to its right.

  Key files for this change are:
  + blocklyeditor/src/flydown.js: Blockly.Flydown, a subclass of Blockly.Flyout
  + blocklyeditor/src/field_flydown.js: Blockly.FieldFlydown, a subclass of
      Blockly.FieldTextInput that is not only editable on mouse click but spawns
      a flydown on mouse over.
  + blocklyeditor/src/field_parameter_flydown.js: Blockly.FieldParameterFlydown,
      a subclass of Blockly.FieldFlydown whose flydown contains getter and
      setter blocks for the variable named in the field. Used for parameter
      declarations in procedures, event handlers, local variables, and
      loop indices.
  + blocklyeditor/src/field_global_flydown.js: Blockly.FieldGlobalFlydown,
      a subclass of Blockly.FieldFlydown whose flydown contains getter and
      setter blocks for the global variable named in the field. Used for
      global variable definitions.
  + blocklyeditor/src/field_procedure_flydown.js:
      Blockly.FieldProcedureFlydown,
      a subclass of Blockly.FieldFlydown whose flydown contains the caller
      block for the variable named in the field. Not used yet, but will
      be used for the procedure name in procedure declarations.
  + lib/blockly/src/core/blockly.js: modified Blockly.hideChaff() method
      to hide single instance of Blockly.FieldFlydown.
  + lib/blockly/src/core/css.java: controls the look and feel of
      the flydown for Blockly.FieldProcedureFlydown using the CSS tags
      blocklyFieldParameter and blocklyFieldParameterFlydown in

* Component event handlers have been change to list event parameters
  horizontally rather than vertically, to save vertical space. In the future,
  how these are displayed will be configurable by user.

* Procedure drawer now lists caller blocks for all procedures declared
  in workspace. Getting this to work required a change to domToMutation
  for procedures_callnoreturn in blocklyeditory/src/language/common/procedures.js

* Control drawer changes (blocklyeditor/src/language/common/control.js)
  + Installed flydown index variable declarations in forRange and forEach loops
  + Abstracted over string labels on all blocks using constants defined in
    en/_messages.js
  + Renamed "for <i> start [] end [] step []" block to
    "for each <number> from [] to [] by []"
  + Renamed "for each <i> in list []" block to "for each <item> in list []"
  + Renamed "choose test [] then-return [] else-return []" to "if [] then []
    else []" (TODO: still needs to have a mutator like the "if" statement
    blocks).
  + Renamed "evaluate" block to "evaluate but ignore result"
  + Renamed "do {} then-return []" block to "do {} result []" and re-added this
    block to the Control drawer (who removed it?)
  + Remove "get" block (still in Variable drawer; no longer needed
    with parameter flydowns)

* Variable drawer changes:
  (blocklyeditor/src/language/common/lexical_variables.js)
  + Installed variable declaration flydowns in global definition and local
    variable declaration statements and expressions.
  + Abstracted over string labels on all blocks using constants defined in
    en/_messages.js
  + Cleaned up code, including refactoring to increase sharing between
    local_declaration_statement and local_declaration_expression.
  + Fixed bug: modified onchange for local declarations to keep localNames_
    instance variable updated when param is edited directly on declaration
    block.
  + In local variable statements/expression, changed both "in do" and "in
     return" to "scope" (shape distinguishes them). But maybe these should just
     be empty string?

* Procedure drawer changes:
  (blocklyeditor/src/language/common/procedures.js)
  + Installed variable declaration flydowns in both types of procedure declarations.
  + Fixed bug: Modified onchange for procedure declarations to keep arguments_ instance
    variable updated when param is edited directly on declaration block.
  + Removed get block (still in Variable drawer; no longer needed with parameter flydowns)
  + Removed "do {} then-return []" block since (1) it's in Control drawer and
    (2) it will be superseded in the context by Michael Phox's proc_defnoreturn mutator
    that allows adding a DO statement.
  + TODO: Abstract over string labels on all blocks using constants defined in en/_messages.js
  + TODO: Clean up code, including refactoring to increase sharing between
    procedures_defnoreturn and procedures_defreturn.

* Subtle but important bug fix to Blockly.FieldProcedure.onChange
  (blocklyeditor/src/field_procedures.js):
    if(!this.block.editable) => if(!this.block.editable_)
  Without this fix, procedure caller arg names don't work!

Change-Id: I4d7573cdafa68b7a3c9d4fc6541660641cac4e30
Load the blocks file after the .scm file is loaded

Change-Id: Ic4effb8a76ba6d5db013a54d68ae16131c346735
Changed connect menuitems names to AI Companion, Emulator and USB
Changed Gallary link to show up only when logged in as admin.

Change-Id: Ibc7210806ffdb6397140fe0a9f5410e1ce67a952
Name restrictions on local, global, and procedure names.

* Changed local, global, and procedure parameters to check that
  all satisfy the following regular grammar:

     <identifier> = <first><rest>*
     <first> = letter U charactersIn("_!$%&?^*~/+-.@>=<")
     <rest> = <first> U digit

  This is a simplified version of Kawa's identifiers. I don't see why we
  care about Java's identifiers, since only Kawa's are being used for
  global/local/procedure namespaces in runtime.scm.

  This grammar cheats a little -- any of the special characters in
  "+-.@" aren't allowed to start an identifier but can be anywhere
  else in the identifier. So the strategy is to add a legal prefix to
  any AI2 name to make it a legal Kawa name.

* Before doing the above check, user identifiers are first transformed
  by removing leading and trailing spaces and replacing nonempty sequences
  of internal spaces by an underscore ('_').

* Illegal identifiers are replaced by an identifiers of the form name<num>,
  where <num> is an integer > 2 or empty. One exception: the empty string
  is replaced by '_'.

* Modified the code generator to check for legality as desribed above.
  The following prefix tags are currently used (but can easily be changed):
  + local variables: $ (e.g. "sum" => "$sum")
  + global variables: g$ (e.g., "count" => "g$count")
  + procedure names: p$ (e.g., "factorial" => "p$factorial")

Change-Id: I3b5de2c3a7569a50c027cf062029d97542452aad