 
     #window.addEventListener 'resize', @on.resize
 
-    @editor.render @elems.editor, @elems.editorToolbar, ->
+    @editor.render @elems.editor, @elems.editorToolbar, =>
+     @_watchInterval = setInterval @on.watchChanges, 500
+     @_saveTemInterval = setInterval @on.saveTemporary, 1000
      callback()
 
    @listen 'folder', ->

           @span ".icon.icon-upload", null
         @$.elems.save = @button ".btn.btn-default",
          title: "Save file"
          on: {click: @$.on.save}
          ->
           @span ".icon.icon-download", null
         @$.elems.save = @button ".btn.btn-default",
          title: "Save file"
          on: {click: @$.on.saveAs}
          "SaveAs"

    return if not files?
    return if files.length <= 0
    file = files[0]
    @file =
     name: PATH.basename file, '.ds'
     path: file
    @editor.setText "#{FS.readFileSync file}"
    @_editorChanged = false
    @_changed = false
    @elems.save.style.display = 'inline-block'
    @elems.saveName.textContent = "#{@file.name}"

   @listen 'save', ->
    text = @removeTrailingSpace @editor.getText()
    @editor.setText text
    @content = text
    @send 'saveFileContent', content: text
   @listen 'saveAs', ->
   @listen 'print', ->
    @editor.on.print()
