     @unsetClass "kdcustomhtml"
 
     {content, syntax, title} = data = @getData()
-
-    # @codeView = new NonEditableAceField defaultValue: Encoder.htmlDecode(content), autoGrow: yes, afterOpen: =>
-    #   syntax or= 'javascript'
-    #   @codeView.setTheme 'merbivore'
-    #   @codeView.setSyntax syntax
-    #
-    # @codeView.on 'sizes.height.change', ({height}) =>
-    #   @$('.wrapper').height height
 
     hjsSyntax = __aceSettings.aceToHighlightJsSyntaxMap[syntax]
 

    super options, data
    data = @getData()

    @codeView = new KDCustomHTMLView
      tagName  : "iframe"
      cssClass : "result-frame"
      name : "result-frame"
      attributes:
        src: "/beta.txt"
        # sandbox : "allow-scripts allow-same-origin"
        # srcdoc:"<html><head></head><body></body></html>"
    , data

    @on "CodeBinResultShouldReset",->
      # TODO reload the iframe

    @on "CodeBinSourceHasChanges",->

      ###

      !
      !
      !
      !

      !

      ###
      # this seemed to crash the server, switched off for safety --arvid
      if KD.isLoggedIn() and false

        {nickname}    = KD.whoami().profile

        @tempFileTimestamp = new Date().getTime()

        @tempFilePath = "/Users/#{nickname}/Sites/#{nickname}.koding.com/website/tempResult#{@tempFileTimestamp}.html"

        @tempFile     = FSHelper.createFile
          name        : nickname
          path        : @tempFilePath
          type        : "file"

        @tempFileContents = "<!DOCTYPE html><html><head><script src='js/prefixfree.min.js'></script><script src='//code.jquery.com/jquery-latest.js'></script><style>"+Encoder.htmlDecode(@getData().attachments[1].content)+"</style></head><body>"+Encoder.htmlDecode(@getData().attachments[0].content)+"<script type='text/javascript'>"+Encoder.htmlDecode(@getData().attachments[2].content)+"</script></body></html>"

        @tempFile.save @tempFileContents,->
          @codeView.attributes.src = "//#{nickname}.koding.com/tempResult#{@tempFileTimestamp}.html"

  viewAppended: ->


      title: "Run this"
      cssClass:"clean-gray result-button"
      click:=>
        @codeBinResultButton.setTitle "Reset"
        @codeBinResultView.show()
        @codeBinResultView.emit "CodeBinSourceHasChanges"

    @codeBinForkButton = new KDButtonView
      title: "Fork this"
      cssClass:"clean-gray fork-button"
      disabled:yes
      click:=>

  render:->
    super()
