Add a feature to set the directory from the settings panel

This commit is contained in:
Seong Jae Lee
2014-11-09 22:06:22 -08:00
parent f28ce2de87
commit 391a5d8261
2 changed files with 25 additions and 22 deletions
+22 -22
View File
@@ -14,8 +14,8 @@ class NotationalVelocityView extends SelectListView
loadData: ->
@data = []
# TODO: remove this temporary hard-coded path
directory = '/Users/seongjae/github/notational-velocity/testdata'
# directory = '/Users/seongjae/github/notational-velocity/testdata'
directory = atom.config.get('notational-velocity.directory')
for filename in fs.readdirSync(directory)
filepath = path.join(directory, filename)
@@ -58,38 +58,38 @@ class NotationalVelocityView extends SelectListView
@div "#{content}", class: 'secondary-line'
confirmed: (item) ->
console.log 'confirmed #{item}'
# console.log 'confirmed #{item}'
atom.workspaceView.open(item.filepath)
destroy: ->
console.log 'destroy'
# console.log 'destroy'
@cancel()
@remove()
attach: ->
console.log 'attach'
# console.log 'attach'
@storeFocusedElement()
atom.workspaceView.append(this)
@focusFilterEditor()
cancel: ->
console.log 'cancel'
super
# cancel: ->
# console.log 'cancel'
# super
cancelled: ->
console.log 'cancelled'
super
# cancelled: ->
# console.log 'cancelled'
# super
setItems: (items=[]) ->
console.log 'setItems'
super(items)
# setItems: (items=[]) ->
# console.log 'setItems'
# super(items)
populateList: ->
console.log 'populateList'
super
# populateList: ->
# console.log 'populateList'
# super
selectItemView: (view) ->
console.log 'selectItemView'
super(view)
return unless view.length
console.log @list.indexOf(@list.find('.selected'))
# selectItemView: (view) ->
# console.log 'selectItemView'
# super(view)
# return unless view.length
# console.log @list.indexOf(@list.find('.selected'))
+3
View File
@@ -1,4 +1,7 @@
module.exports =
configDefaults:
directory: '/'
notationalVelocityView: null
activate: (state) ->