   setupLayout()
   setupButtonHandlers()
 
-  for id in ["modelEditor", "assetsEditor", "actionsEditor", "layoutEditor"]
+  for id in ["modelEditor", "assetsEditor", "actionsEditor", "layoutEditor", "console"]
     editor = setupEditor(id)
     editors[id] = editor
 

    cache: false
    success: (data) -> 
      editor.setValue(data)
      # The new contect will be selected by default
      editor.selection.clearSelection() 

reloadCode = (callback) ->


  # Otherwise just load from the default "optics" directory
  if not loadedCode
    for [id, url] in [["modelEditor", "optics/model.json"], 
                      ["assetsEditor", "optics/assets.json"], 
                      ["actionsEditor", "optics/actions.js"],
                      ["layoutEditor", "optics/layout.json"]]
      loadIntoEditor(editors[id], url)

  currentConsole = "test";
  editors.console.setValue(currentConsole);
  editors.console.selection.clearSelection();
  editors.console.setReadOnly(true); 

  for id in ["modelEditor", "assetsEditor", "actionsEditor", "layoutEditor"]
    editors[id].getSession().on "change", -> notifyCodeChange()
