     mainView = KD.getSingleton "mainView"
     mainView.toggleFullscreen()
 
-  viewAppended:->
-
-    super
-    @_windowDidResize()
-
-  pistachio:->
-
-    """
-    <div class="kdview editor-main">
-      {{> @ace}}
-      <div class="editor-bottom-bar clearfix">
-        {{> @caretPosition}}
-        {{> @advancedSettings}}
-      </div>
-      {{> @findAndReplaceView}}
-    </div>
-    """
-
-  getAdvancedSettingsMenuItems:->
-
-    settings      :
-      type        : 'customView'
-      view        : new AceSettingsView
-        delegate  : @ace
-
   getSaveMenu:->
-
     "Save as..." :
       id         : 13
       parentId   : null
       callback   : =>
         @openSaveDialog closeAfter: no
-
-  _windowDidResize:->
-
-    height = @getHeight()
-    bottomBarHeight = @$('.editor-bottom-bar').height()
-    newHeight = height - bottomBarHeight
-    @ace.setHeight newHeight unless newHeight is 0
 
   openSaveDialog: (options = {}) ->
     { closeAfter }   = options


class AceView extends JView

  constructor:(options = {}, file)->

    options.advancedSettings ?= no

    super options, file

    @listenWindowResize()

    @caretPosition = new KDCustomHTMLView
      tagName       : "div"
      cssClass      : "caret-position section"
      partial       : "<span>1</span>:<span>1</span>"

    @ace = new Ace
      delegate        : @
      enableShortcuts : yes
    , file

    @advancedSettings = new KDButtonViewWithMenu
      style         : 'editor-advanced-settings-menu'
      icon          : yes
      iconOnly      : yes
      iconClass     : "cog"
      type          : "contextmenu"
      delegate      : this
      itemClass     : AceSettingsView
      click         : (pubInst, event)-> @contextMenu event
      menu          : @getAdvancedSettingsMenuItems.bind @
    @advancedSettings.disable()

    unless options.advancedSettings
      @advancedSettings.hide()

    @findAndReplaceView = new AceFindAndReplaceView delegate: @
    @findAndReplaceView.hide()

    @setViewListeners()

  setViewListeners:->
    @ace.on "ace.changeSetting", (setting, value)=>
      @ace["set#{setting.capitalize()}"]? value

    @ace.on "ace.requests.saveAs", (contents, options)=>
      @openSaveDialog options
