Fix some of the places still using Travis.app

This commit is contained in:
Piotr Sarnacki 2013-02-20 05:38:43 +01:00
parent bd7d2ede3a
commit cfbec29978
9 changed files with 24 additions and 21 deletions

View File

@ -3,11 +3,23 @@ require 'travis/limited_array'
Travis.ReposController = Ember.ArrayController.extend
defaultTab: 'recent'
isLoadedBinding: 'content.isLoaded'
needs: ['currentUser']
currentUserBinding: 'controllers.currentUser'
init: ->
Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes)
@_super.apply this, arguments
recentRepos: (->
Travis.LimitedArray.create
content: Em.ArrayProxy.extend(Em.SortableMixin).create(
sortProperties: ['sortOrder']
content: Travis.Repo.find()
isLoadedBinding: 'content.isLoaded'
)
limit: 30
).property()
updateTimes: ->
if content = @get('content')
content.forEach (r) -> r.updateTimes()
@ -20,18 +32,10 @@ Travis.ReposController = Ember.ArrayController.extend
this["view#{$.camelize(tab)}"](params)
viewRecent: ->
return if @get('content')
content = Travis.LimitedArray.create
content: Em.ArrayProxy.extend(Em.SortableMixin).create(
sortProperties: ['sortOrder']
content: Travis.Repo.find()
isLoadedBinding: 'content.isLoaded'
)
limit: 30
@set('content', content)
@set('content', @get('recentRepos'))
viewOwned: ->
@set('content', Travis.Repo.accessibleBy(Travis.app.get('currentUser.login')))
@set('content', Travis.Repo.accessibleBy(@get('currentUser.login')))
viewSearch: (params) ->
@set('content', Travis.Repo.search(params.search))

View File

@ -46,7 +46,7 @@ $.extend Travis.Pusher.prototype,
Travis.Job.find(data.job.id).clearLog()
Ember.run.next ->
Travis.app.store.receive(event, data)
Travis.store.receive(event, data)
normalize: (event, data) ->
switch event

View File

@ -6,6 +6,6 @@
{{else}}
<h1>Sign in</h1>
<p>
<a href="#" {{action signIn target="Travis.app"}}>Please sign in with GitHub.</a>
<a href="#" {{action signIn target="Travis"}}>Please sign in with GitHub.</a>
</p>
{{/if}}

View File

@ -18,7 +18,7 @@
</a>
</div>
<div id="slider" {{action toggle target="Travis.app.slider"}}>
<div id="slider" {{action toggle target="Travis.slider"}}>
<div class='icon'></div>&nbsp;
</div>

View File

@ -4,7 +4,7 @@
</a>
</div>
<div id="slider" {{action toggle target="Travis.app.slider"}}>
<div id="slider" {{action toggle target="Travis.slider"}}>
<div class='icon'></div>&nbsp;
</div>

View File

@ -10,4 +10,4 @@
</li>
<a {{action toggleInfo target="view"}} class="toggle-info"></a>
</ul>
</ul>

View File

@ -89,7 +89,7 @@
if target.is('a') && target.attr('id') && target.attr('id').match(/^L\d+$/)
path = target.attr 'href'
Travis.app.get('router').route(path)
Travis.get('router').route(path)
event.stopPropagation()
return false
@ -126,7 +126,7 @@
@set 'logManager', Travis.Log.create(target: this)
toggleTailing: ->
Travis.app.tailing.toggle()
Travis.tailing.toggle()
event.preventDefault()
didInsertElement: ->

View File

@ -10,9 +10,9 @@
classOwned: (->
classes = []
classes.push('active') if @get('tab') == 'owned'
classes.push('display') if Travis.app.get('currentUser')
classes.push('display') if @get('controller.currentUser')
classes.join(' ')
).property('tab', 'Travis.currentUser')
).property('tab', 'controller.currentUser')
classSearch: (->
'active' if @get('tab') == 'search'

View File

@ -22,8 +22,7 @@
ReposListTabsView: Travis.View.extend
templateName: 'repos/list/tabs'
tabBinding: 'controller.tab'
needs: ['currentUser']
currentUserBinding: 'controllers.currentUser'
currentUserBinding: 'controller.currentUser'
activate: ->
@get('controller').activate(event.target.name)