Merge branch 'master' into config

Conflicts:
	spec/app/project-spec.coffee
	src/extensions/wrap-guide/src/wrap-guide.coffee
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-12-14 14:14:50 -08:00
31 changed files with 1546 additions and 51 deletions

View File

@@ -2,4 +2,3 @@ window.keymap.bindKeys ".select-list .mini.editor input",
'enter': 'core:confirm',
'escape': 'core:cancel'
'meta-w': 'core:cancel'

View File

@@ -52,20 +52,14 @@ class Project
getFilePaths: ->
deferred = $.Deferred()
fs.getAllPathsAsync @getPath(), (paths) =>
fs.getAllFilePathsAsync @getPath(), (paths) =>
paths = paths.filter (path) => not @isPathIgnored(path)
deferred.resolve(paths)
deferred.promise()
isPathIgnored: (path) ->
lastSlash = path.lastIndexOf('/')
if lastSlash isnt -1
name = path.substring(lastSlash + 1)
else
name = path
for ignored in @ignoredNames
return true if name is ignored
for segment in path.split("/")
return true if _.contains(@ignoredNames, segment)
@ignoreRepositoryPath(path)

View File

@@ -15,13 +15,15 @@ class SelectList extends View
@viewClass: -> 'select-list'
maxItems: Infinity
scheduleTimeout: null
inputThrottle: 200
filteredArray: null
cancelling: false
initialize: ->
requireStylesheet 'select-list.css'
@miniEditor.getBuffer().on 'change', => @populateList()
@miniEditor.getBuffer().on 'change', => @schedulePopulateList()
@miniEditor.on 'focusout', => @cancel() unless @cancelling
@on 'core:move-up', => @selectPreviousItem()
@on 'core:move-down', => @selectNextItem()
@@ -36,6 +38,10 @@ class SelectList extends View
@confirmSelection() if $(e.target).closest('li').hasClass('selected')
e.preventDefault()
schedulePopulateList: ->
clearTimeout(@scheduleTimeout)
@scheduleTimeout = setTimeout((=> @populateList()), @inputThrottle)
setArray: (@array) ->
@populateList()
@selectItem(@list.find('li:first'))
@@ -43,12 +49,11 @@ class SelectList extends View
setError: (message) ->
if not message or message.length == ""
@error.text("")
@error.hide()
@error.text("").hide()
@removeClass("error")
else
@error.text(message)
@error.show()
@setLoading()
@error.text(message).show()
@addClass("error")
setLoading: (message) ->
@@ -113,8 +118,9 @@ class SelectList extends View
@confirmed(element) if element?
cancel: ->
@list.empty()
@cancelling = true
@cancelled()
@detach()
@cancelling = false
clearTimeout(@scheduleTimeout)