 	# 	)
 
 
-@App.FeedsView = Ember.View.extend {
+@App.FeedsView = Ember.View.extend
 	classNames: ['inmiddle']
-}
 
 @App.NewFeedView = Ember.View.extend
 	click: ->

	keyUp: (e)->
		url = @get('controller.newFeedUrl')
		view = @
		if e.keyCode == 13 && !!url
			$.post( '/v1/feeds', {url: url} ).done (json)->
					json = JSON.parse(json)
					$.get( 'v1/feeds/' + json.id ).done (json)->
						json = JSON.parse(json)
						items = json.feed.items.map((i)->
							o = Ember.Object.create().setProperties(i)
							o.set('selected', false)
						)
						feed = Ember.Object.create {
							title: json.feed.title
							url: url
							created_at: new Date()
							items: items
							selected: false
						}
						view.get('controller.content').pushObject( feed )
						view.set('controller.urlPrompt', false)
						view.set('controller.newFeedUrl', null)

		# if e.keyCode == 13 && !!url
		# 	@get('controller').newFeed {"url": encodeURIComponent(url)}
@App.FeedsController = Ember.ArrayController.extend
	newFeedUrl: null
	urlPrompt: false
	isProcessing: false
	selectFeed: (feed)->
		@get('content').forEach( (i)->
			i.set('selected', false)
