 path = require 'path'
 fs = require 'fs-extra'
-{View, EditorView, $$} = require 'atom'
+{$, $$, View, EditorView} = require 'atom'
 remote = require 'remote'
 dialog = remote.require 'dialog'
 Q = require 'q'
+{openFile} = require '../utils/dialog'
 
 fsmkdirs = Q.denodeify fs.mkdirs
+
+# placeholder
+PH_ROOT = 'click here to select root path'
+PH_INDEX = 'the index page'
 
 module.exports =
 class RunOnServerView extends View

    @selectedRootPath.text '.'

    if atom.project.path
      fs.exists path.resolve(atom.project.path, 'index.html'), (exists)=>
        @selectedIndexFile.text 'index.html' if exists

    @httpPort.setText "3000"


      #note: use val method for input tag
      @selectedIndexFile.text path.relative(atom.project.path, destPath[0]) if destPath

  onClickRun: ->
    rootPath = path.resolve(atom.project.path, @selectedRootPath.text())
    destPath = path.resolve(atom.project.path, @selectedIndexFile.text())
    httpPort = parseInt @httpPort.getText()
    pushState = @find('#usingPushState').is(":checked")

    #TODO: validation

