commit stuff for piotr
This commit is contained in:
parent
0ee887c792
commit
e15b2d680f
|
@ -3,6 +3,7 @@ require 'ext/jquery'
|
||||||
|
|
||||||
# $.mockjaxSettings.log = false
|
# $.mockjaxSettings.log = false
|
||||||
# Ember.LOG_BINDINGS = true
|
# Ember.LOG_BINDINGS = true
|
||||||
|
|
||||||
@Travis = Em.Namespace.create
|
@Travis = Em.Namespace.create
|
||||||
CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala']
|
CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala']
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,27 @@ require 'helpers'
|
||||||
require 'travis/ticker'
|
require 'travis/ticker'
|
||||||
|
|
||||||
Travis.Controllers = Em.Namespace.create
|
Travis.Controllers = Em.Namespace.create
|
||||||
RepositoriesController: Em.ArrayController.extend()
|
RepositoriesController: Em.ArrayController.extend
|
||||||
RepositoryController: Em.ObjectController.extend(Travis.Urls.Repository)
|
contentBinding: 'layout.repositories'
|
||||||
BuildsController: Em.ArrayController.extend()
|
|
||||||
BuildController: Em.ObjectController.extend(Travis.Urls.Commit)
|
RepositoryController: Em.Controller.extend # Travis.Urls.Repository,
|
||||||
JobController: Em.ObjectController.extend(Travis.Urls.Commit)
|
repositoryBinding: 'layout.repository'
|
||||||
|
|
||||||
|
TabsController: Em.Controller.extend
|
||||||
|
repositoryBinding: 'layout.repository'
|
||||||
|
buildBinding: 'layout.build'
|
||||||
|
jobBinding: 'layout.job'
|
||||||
|
tabBinding: 'layout.tab'
|
||||||
|
|
||||||
|
BuildsController: Em.ArrayController.extend
|
||||||
|
contentBinding: 'layout.builds'
|
||||||
|
|
||||||
|
BuildController: Em.Controller.extend # Travis.Urls.Commit,
|
||||||
|
buildBinding: 'layout.build'
|
||||||
|
|
||||||
|
JobController: Em.Controller.extend # Travis.Urls.Commit,
|
||||||
|
jobBinding: 'layout.job'
|
||||||
|
|
||||||
QueuesController: Em.ArrayController.extend()
|
QueuesController: Em.ArrayController.extend()
|
||||||
UserController: Em.ObjectController.extend()
|
UserController: Em.ObjectController.extend()
|
||||||
HooksController: Em.ArrayController.extend()
|
HooksController: Em.ArrayController.extend()
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
Repository:
|
Repository:
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
"http://github.com/#{@get('slug')}"
|
"http://github.com/#{@getPath('repository.slug')}"
|
||||||
).property('slug'),
|
).property('repository.slug'),
|
||||||
|
|
||||||
urlGithubWatchers: (->
|
urlGithubWatchers: (->
|
||||||
"http://github.com/#{@get('slug')}/watchers"
|
"http://github.com/#{@get('slug')}/watchers"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
Travis.Layout = Em.Namespace.create()
|
Travis.Layout = Em.Namespace.create()
|
||||||
|
|
||||||
require 'layout/home'
|
require 'layout/home'
|
||||||
|
require 'layout/left'
|
||||||
require 'layout/sidebar'
|
require 'layout/sidebar'
|
||||||
require 'layout/profile'
|
require 'layout/profile'
|
||||||
require 'layout/stats'
|
require 'layout/stats'
|
||||||
|
|
|
@ -2,7 +2,7 @@ Travis.Layout.Base = Em.Object.extend
|
||||||
init: ->
|
init: ->
|
||||||
@parent = @get('parent')
|
@parent = @get('parent')
|
||||||
|
|
||||||
@setup(Array.prototype.slice.apply(arguments).concat(@get('name')))
|
@setup(Array.prototype.slice.apply(arguments).concat([@get('name'), 'top']))
|
||||||
@connect()
|
@connect()
|
||||||
|
|
||||||
setup: (controllers) ->
|
setup: (controllers) ->
|
||||||
|
@ -14,7 +14,7 @@ Travis.Layout.Base = Em.Object.extend
|
||||||
key = "#{$.camelize(name, false)}Controller"
|
key = "#{$.camelize(name, false)}Controller"
|
||||||
name = $.camelize(key)
|
name = $.camelize(key)
|
||||||
klass = Travis.Controllers[name] || Em.Controller
|
klass = Travis.Controllers[name] || Em.Controller
|
||||||
this[key] = klass.create(namespace: this, controllers: this)
|
this[key] = klass.create(layout: this, namespace: this, controllers: this)
|
||||||
|
|
||||||
@controller = this["#{$.camelize(@get('name'), false)}Controller"]
|
@controller = this["#{$.camelize(@get('name'), false)}Controller"]
|
||||||
@viewClass = Travis.Views["#{$.camelize(@get('name'))}Layout"]
|
@viewClass = Travis.Views["#{$.camelize(@get('name'))}Layout"]
|
||||||
|
@ -31,5 +31,6 @@ Travis.Layout.Base = Em.Object.extend
|
||||||
@topController.set('tab', @get('name'))
|
@topController.set('tab', @get('name'))
|
||||||
|
|
||||||
activate: (action, params) ->
|
activate: (action, params) ->
|
||||||
this["view#{$.camelize(action)}"](params)
|
@set('params', params)
|
||||||
|
this["view#{$.camelize(action)}"]()
|
||||||
|
|
||||||
|
|
|
@ -4,83 +4,67 @@ Travis.Layout.Home = Travis.Layout.Base.extend
|
||||||
name: 'home'
|
name: 'home'
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super('top', 'repositories', 'repository', 'tabs', 'builds', 'build', 'job')
|
@_super('repositories', 'repository', 'tabs', 'builds', 'build', 'job')
|
||||||
@connectLeft(Travis.Repository.find())
|
# Travis.Layout.Sidebar.create(parent: @controller)
|
||||||
Travis.Layout.Sidebar.create(homeController: @get('homeController'))
|
|
||||||
|
|
||||||
viewIndex: (params) ->
|
@controller.connectOutlet(outletName: 'left', name: 'repositories')
|
||||||
onceLoaded @repositories, =>
|
@controller.connectOutlet(outletName: 'main', name: 'repository')
|
||||||
repository = @repositories.get('firstObject')
|
@controller.connectOutlet(outletName: 'tabs', name: 'tabs')
|
||||||
@connectRepository(repository)
|
|
||||||
@connectTabs('current')
|
|
||||||
@connectBuild(repository.get('lastBuild'))
|
|
||||||
|
|
||||||
viewCurrent: (params) ->
|
@set('repositories', Travis.Repository.find())
|
||||||
@viewRepository params, (repository) =>
|
|
||||||
@connectTabs('current')
|
|
||||||
@connectBuild(repository.get('lastBuild'))
|
|
||||||
|
|
||||||
viewBuilds: (params) ->
|
activate: (action, params) ->
|
||||||
@viewRepository params, (repository) =>
|
@set('tab', if action == 'index' then 'current' else action)
|
||||||
@connectTabs('builds')
|
@_super(action, params)
|
||||||
@connectBuilds(repository.get('builds'))
|
|
||||||
|
|
||||||
viewBuild: (params) ->
|
viewIndex: ->
|
||||||
@viewRepository params
|
@bindRepository('repositories.firstObject')
|
||||||
@buildBy params.id, (build) =>
|
@bindBuild('repository.lastBuild')
|
||||||
@connectTabs('build', build)
|
@connectTab('build')
|
||||||
@connectBuild(build)
|
|
||||||
|
|
||||||
viewJob: (params) ->
|
viewCurrent: ->
|
||||||
@viewRepository params
|
@bindRepository('repositoryByParams')
|
||||||
@jobBy params.id, (job) =>
|
@bindBuild('repository.lastBuild')
|
||||||
@connectTabs('job', job.get('build'), job)
|
@connectTab('build')
|
||||||
@connectJob(job)
|
|
||||||
|
|
||||||
|
viewBuilds: ->
|
||||||
|
@bind('repository', 'repositoriesByParams.firstObject')
|
||||||
|
@bind('builds', 'repository.builds')
|
||||||
|
@connectTab('builds')
|
||||||
|
|
||||||
viewRepository: (params, callback) ->
|
viewBuild: ->
|
||||||
@repositoryBy params, (repository) =>
|
@bindRepository('repositoryByParams')
|
||||||
@connectRepository(repository)
|
@bindBuild('buildById')
|
||||||
callback(repository) if callback
|
@connectTab('build')
|
||||||
|
|
||||||
repositoryBy: (params, callback) ->
|
viewJob: ->
|
||||||
repositories = Travis.Repository.bySlug("#{params.owner}/#{params.name}")
|
@bindRepository('repositoryByParams')
|
||||||
onceLoaded repositories, =>
|
@bindJob('jobById')
|
||||||
callback(repositories.get('firstObject'))
|
@connectTab('job')
|
||||||
|
|
||||||
buildBy: (id, callback) =>
|
repositoryByParamsBinding: 'repositoriesByParams.firstObject'
|
||||||
build = Travis.Build.find(id)
|
|
||||||
onceLoaded build, =>
|
|
||||||
callback(build)
|
|
||||||
|
|
||||||
jobBy: (id, callback) ->
|
repositoriesByParams: (->
|
||||||
job = Travis.Job.find(id)
|
console.log('repositoriesByParams', @getPath('params.owner'), @getPath('params.name'))
|
||||||
onceLoaded job, =>
|
Travis.Repository.bySlug("#{params.owner}/#{params.name}") if params = @get('params')
|
||||||
callback(job)
|
).property('params')
|
||||||
|
|
||||||
|
buildById: (->
|
||||||
|
console.log('buildByParams', @getPath('params.id'))
|
||||||
|
Travis.Build.find(id) if id = @getPath('params.id')
|
||||||
|
).property('params.id')
|
||||||
|
|
||||||
connectLeft: (repositories) ->
|
jobById: (->
|
||||||
@repositories = repositories
|
console.log('jobByParams', @getPath('params.id'))
|
||||||
@homeController.connectOutlet(outletName: 'left', name: 'repositories', context: repositories)
|
Travis.Job.find(id) if id = @getPath('params.id')
|
||||||
|
).property('params.id')
|
||||||
|
|
||||||
connectRepository: (repository) ->
|
bindRepository: (from) ->
|
||||||
@repository = repository
|
Ember.oneWay(this, 'repository', from)
|
||||||
@homeController.connectOutlet(outletName: 'main', name: 'repository', context: repository)
|
|
||||||
|
|
||||||
connectTabs: (tab, build, job) ->
|
bindBuild: (from) ->
|
||||||
@tabsController.set('tab', tab)
|
Ember.oneWay(this, 'build', from)
|
||||||
@tabsController.set('repository', @repository)
|
|
||||||
@tabsController.set('build', build)
|
|
||||||
@tabsController.set('job', job)
|
|
||||||
@homeController.connectOutlet(outletName: 'tabs', name: 'tabs')
|
|
||||||
|
|
||||||
connectBuilds: (builds) ->
|
|
||||||
@homeController.connectOutlet(outletName: 'tab', name: 'builds', context: builds)
|
|
||||||
|
|
||||||
connectBuild: (build) ->
|
|
||||||
@homeController.connectOutlet(outletName: 'tab', name: 'build', context: build)
|
|
||||||
|
|
||||||
connectJob: (job) ->
|
|
||||||
@homeController.connectOutlet(outletName: 'tab', name: 'job', context: job)
|
|
||||||
|
|
||||||
|
connectTab: (tab) ->
|
||||||
|
@controller.connectOutlet(outletName: 'tab', name: tab)
|
||||||
|
|
||||||
|
|
16
assets/javascripts/app/layout/left.coffee
Normal file
16
assets/javascripts/app/layout/left.coffee
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
require 'layout/base'
|
||||||
|
|
||||||
|
Travis.Layout.Left = Travis.Layout.Base.extend
|
||||||
|
name: 'sidebar'
|
||||||
|
|
||||||
|
init: ->
|
||||||
|
@_super('repositories')
|
||||||
|
@parent = @get('parent')
|
||||||
|
@connectLeft(Travis.Repository.find())
|
||||||
|
|
||||||
|
connect: ->
|
||||||
|
@parent.connectOutlet(outletName: 'right', name: 'sidebar')
|
||||||
|
|
||||||
|
connectLeft: (repositories) ->
|
||||||
|
@parent.set('repositories', repositories)
|
||||||
|
@parent.connectOutlet(outletName: 'left', name: 'repositories', context: repositories)
|
|
@ -5,7 +5,7 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super('sponsors', 'workers', 'queues')
|
@_super('sponsors', 'workers', 'queues')
|
||||||
@homeController = @get('homeController')
|
@parent = @get('parent')
|
||||||
|
|
||||||
@connectSponsors(Travis.Sponsor.decks(), Travis.Sponsor.links())
|
@connectSponsors(Travis.Sponsor.decks(), Travis.Sponsor.links())
|
||||||
@connectWorkers(Travis.Worker.find())
|
@connectWorkers(Travis.Worker.find())
|
||||||
|
@ -14,13 +14,13 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend
|
||||||
Travis.Ticker.create(target: this, interval: Travis.INTERVALS.sponsors)
|
Travis.Ticker.create(target: this, interval: Travis.INTERVALS.sponsors)
|
||||||
|
|
||||||
connect: ->
|
connect: ->
|
||||||
@homeController.connectOutlet(outletName: 'right', name: 'sidebar')
|
@parent.connectOutlet(outletName: 'right', name: 'sidebar')
|
||||||
|
|
||||||
connectSponsors: (decks, links) ->
|
connectSponsors: (decks, links) ->
|
||||||
@sponsorsController = Em.Controller.create
|
@sponsorsController = Em.Controller.create
|
||||||
decks: Travis.Controllers.SponsorsController.create(perPage: 1, content: decks)
|
decks: Travis.Controllers.SponsorsController.create(perPage: 1, content: decks)
|
||||||
links: Travis.Controllers.SponsorsController.create(perPage: 6, content: links)
|
links: Travis.Controllers.SponsorsController.create(perPage: 6, content: links)
|
||||||
@homeController.set 'sponsors', @sponsorsController
|
@parent.set 'sponsors', @sponsorsController
|
||||||
|
|
||||||
tick: ->
|
tick: ->
|
||||||
@sponsorsController.get('decks').next()
|
@sponsorsController.get('decks').next()
|
||||||
|
@ -28,7 +28,7 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend
|
||||||
|
|
||||||
connectWorkers: (workers) ->
|
connectWorkers: (workers) ->
|
||||||
@workersController.set('content', workers)
|
@workersController.set('content', workers)
|
||||||
@homeController.set('workers', @workersController)
|
@parent.set('workers', @workersController)
|
||||||
|
|
||||||
connectQueues: (queues) ->
|
connectQueues: (queues) ->
|
||||||
queues = for queue in queues
|
queues = for queue in queues
|
||||||
|
@ -36,5 +36,5 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend
|
||||||
content: Travis.Job.queued(queue.name)
|
content: Travis.Job.queued(queue.name)
|
||||||
name: queue.display
|
name: queue.display
|
||||||
@queuesController.set('content', queues)
|
@queuesController.set('content', queues)
|
||||||
@homeController.set('queues', @queuesController)
|
@parent.set('queues', @queuesController)
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,35 @@
|
||||||
<table id="builds" class="list">
|
{{#with controller.builds}}
|
||||||
<thead>
|
<table id="builds" class="list">
|
||||||
<tr>
|
<thead>
|
||||||
<th>{{t builds.name}}</th>
|
<tr>
|
||||||
<th>{{t builds.commit}}</th>
|
<th>{{t builds.name}}</th>
|
||||||
<th>{{t builds.message}}</th>
|
<th>{{t builds.commit}}</th>
|
||||||
<th>{{t builds.duration}}</th>
|
<th>{{t builds.message}}</th>
|
||||||
<th>{{t builds.finished_at}}</th>
|
<th>{{t builds.duration}}</th>
|
||||||
</tr>
|
<th>{{t builds.finished_at}}</th>
|
||||||
</thead>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each build in content}}
|
{{#each build in content}}
|
||||||
{{#view Travis.Views.BuildsItemView contextBinding="build"}}
|
{{#view Travis.Views.BuildsItemView contextBinding="build"}}
|
||||||
<tr {{bindAttr class="view.color"}}>
|
<tr {{bindAttr class="view.color"}}>
|
||||||
<td class="number"><a {{bindAttr href="view.urlBuild"}}>{{number}}</a></td>
|
<td class="number"><a {{bindAttr href="view.urlBuild"}}>{{number}}</a></td>
|
||||||
<td class="commit"><a {{bindAttr href="view.urlGithubCommit"}}>{{formatCommit commit}}</a></td>
|
<td class="commit"><a {{bindAttr href="view.urlGithubCommit"}}>{{formatCommit commit}}</a></td>
|
||||||
<td class="message">{{{formatMessage commit.message short="true"}}}</td>
|
<td class="message">{{{formatMessage commit.message short="true"}}}</td>
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
||||||
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/view}}
|
{{/view}}
|
||||||
{{/each}}
|
{{else}}
|
||||||
</tbody>
|
Loading ...
|
||||||
</table>
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
||||||
{{t builds.show_more}}
|
{{t builds.show_more}}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
{{/with}}
|
||||||
|
|
|
@ -1,48 +1,50 @@
|
||||||
{{#unless isLoaded}}
|
{{#with controller.build}}
|
||||||
Loading ...
|
{{#unless isLoaded}}
|
||||||
{{else}}
|
Loading ...
|
||||||
<div id="build" {{bindAttr class="view.color"}}>
|
{{else}}
|
||||||
<dl id="summary">
|
<div id="build" {{bindAttr class="view.color"}}>
|
||||||
<div class="left">
|
<dl id="summary">
|
||||||
<dt>{{t builds.name}}</dt>
|
<div class="left">
|
||||||
<dd class="number"><a {{bindAttr href="view.urlBuild"}}>{{number}}</a></dd>
|
<dt>{{t builds.name}}</dt>
|
||||||
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
<dd class="number"><a {{bindAttr href="controller.view.urlBuild"}}>{{number}}</a></dd>
|
||||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
||||||
<dt>{{t builds.duration}}</dt>
|
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
||||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
<dt>{{t builds.duration}}</dt>
|
||||||
</div>
|
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<dt>{{t builds.commit}}</dt>
|
<dt>{{t builds.commit}}</dt>
|
||||||
<dd class="commit"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
<dd class="commit"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||||
{{#if commit.compareUrl}}
|
{{#if commit.compareUrl}}
|
||||||
<dt>{{t builds.compare}}</dt>
|
<dt>{{t builds.compare}}</dt>
|
||||||
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.authorName}}
|
{{#if commit.authorName}}
|
||||||
<dt>{{t builds.author}}</dt>
|
<dt>{{t builds.author}}</dt>
|
||||||
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{commit.authorName}}</a></dd>
|
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{commit.authorName}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.committerName}}
|
{{#if commit.committerName}}
|
||||||
<dt>{{t builds.committer}}</dt>
|
<dt>{{t builds.committer}}</dt>
|
||||||
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{commit.committerName}}</a></dd>
|
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{commit.committerName}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dt>{{t builds.message}}</dt>
|
<dt>{{t builds.message}}</dt>
|
||||||
<dd class="message">{{{formatMessage commit.message}}}</dd>
|
<dd class="message">{{{formatMessage commit.message}}}</dd>
|
||||||
|
|
||||||
{{#unless isMatrix}}
|
{{#unless isMatrix}}
|
||||||
<dt>{{t builds.config}}</dt>
|
<dt>{{t builds.config}}</dt>
|
||||||
<dd class="config">{{formatConfig config}}</dd>
|
<dd class="config">{{formatConfig config}}</dd>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
{{#if isMatrix}}
|
{{#if isMatrix}}
|
||||||
{{view Travis.Views.JobsView jobsBinding="view.requiredJobs" required="true"}}
|
{{view Travis.Views.JobsView jobsBinding="view.requiredJobs" required="true"}}
|
||||||
{{view Travis.Views.JobsView jobsBinding="view.allowedFailureJobs"}}
|
{{view Travis.Views.JobsView jobsBinding="view.allowedFailureJobs"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{view Travis.Views.LogView contextBinding="jobs.firstObject"}}
|
{{view Travis.Views.LogView contextBinding="jobs.firstObject"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
{{/with}}
|
||||||
|
|
|
@ -1,56 +1,58 @@
|
||||||
{{#if view.jobs.length}}
|
{{#with controller.build}}
|
||||||
{{#if view.required}}
|
{{#if jobs.length}}
|
||||||
<table id="jobs" class="list">
|
{{#if view.required}}
|
||||||
<caption>
|
<table id="jobs" class="list">
|
||||||
{{t jobs.build_matrix}}
|
<caption>
|
||||||
</caption>
|
{{t jobs.build_matrix}}
|
||||||
{{else}}
|
</caption>
|
||||||
<table id="allowed_failure_jobs" class="list">
|
{{else}}
|
||||||
<caption>
|
<table id="allowed_failure_jobs" class="list">
|
||||||
{{t jobs.allowed_failures}}
|
<caption>
|
||||||
<a title="What's this?" class="help" {{action toggleHelp}}></a>
|
{{t jobs.allowed_failures}}
|
||||||
</caption>
|
<a title="What's this?" class="help" {{action toggleHelp}}></a>
|
||||||
{{/if}}
|
</caption>
|
||||||
<thead>
|
{{/if}}
|
||||||
<tr>
|
<thead>
|
||||||
{{#each configKeys}}
|
<tr>
|
||||||
<th>{{this}}</th>
|
{{#each configKeys}}
|
||||||
|
<th>{{this}}</th>
|
||||||
|
{{/each}}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each job in view.jobs}}
|
||||||
|
{{#view Travis.Views.JobsItemView contextBinding="job"}}
|
||||||
|
<tr {{bindAttr class="view.color"}}>
|
||||||
|
<td class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></td>
|
||||||
|
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
||||||
|
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
||||||
|
{{#each configValues}}
|
||||||
|
<td>{{this}}</td>
|
||||||
|
{{/each}}
|
||||||
|
</tr>
|
||||||
|
{{/view}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tr>
|
</tbody>
|
||||||
</thead>
|
</table>
|
||||||
<tbody>
|
|
||||||
{{#each job in view.jobs}}
|
|
||||||
{{#view Travis.Views.JobsItemView contextBinding="job"}}
|
|
||||||
<tr {{bindAttr class="view.color"}}>
|
|
||||||
<td class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></td>
|
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
|
||||||
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
|
||||||
{{#each configValues}}
|
|
||||||
<td>{{this}}</td>
|
|
||||||
{{/each}}
|
|
||||||
</tr>
|
|
||||||
{{/view}}
|
|
||||||
{{/each}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{{#unless view.required}}
|
{{#unless view.required}}
|
||||||
<div id="allow_failure_help" class="context_help">
|
<div id="allow_failure_help" class="context_help">
|
||||||
<div class="context_help_caption">{{t "jobs.allowed_failures"}}</div>
|
<div class="context_help_caption">{{t "jobs.allowed_failures"}}</div>
|
||||||
<div class="context_help_body">
|
<div class="context_help_body">
|
||||||
<p>
|
<p>
|
||||||
Allowed Failures are items in your build matrix that are allowed to
|
Allowed Failures are items in your build matrix that are allowed to
|
||||||
fail without causing the entire build to be shown as failed. This lets you add
|
fail without causing the entire build to be shown as failed. This lets you add
|
||||||
in experimental and preparatory builds to test against versions or
|
in experimental and preparatory builds to test against versions or
|
||||||
configurations that you are not ready to officially support.
|
configurations that you are not ready to officially support.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You can define allowed failures in the build matrix as follows:
|
You can define allowed failures in the build matrix as follows:
|
||||||
</p>
|
</p>
|
||||||
<pre> matrix:
|
<pre> matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: ruby-head </pre>
|
- rvm: ruby-head </pre>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/unless}}
|
||||||
{{/unless}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/with}}
|
||||||
|
|
|
@ -1,37 +1,40 @@
|
||||||
<div {{bindAttr class="view.color"}}>
|
{{#with controller.job}}
|
||||||
<dl id="summary">
|
{{#if isLoaded}}
|
||||||
<div class="left">
|
<div {{bindAttr class="view.color"}}>
|
||||||
<dt>Job</dt>
|
<dl id="summary">
|
||||||
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></dd>
|
<div class="left">
|
||||||
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
<dt>Job</dt>
|
||||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></dd>
|
||||||
<dt>{{t jobs.duration}}</dt>
|
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
||||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
||||||
|
<dt>{{t jobs.duration}}</dt>
|
||||||
|
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right">
|
||||||
|
<dt>{{t jobs.commit}}</dt>
|
||||||
|
<dd class="commit-hash"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||||
|
{{#if commit.compareUrl}}
|
||||||
|
<dt>{{t jobs.compare}}</dt>
|
||||||
|
<dd class="compare_view"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||||
|
{{/if}}
|
||||||
|
{{#if commit.authorName}}
|
||||||
|
<dt>{{t jobs.author}}</dt>
|
||||||
|
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{commit.authorName}}</a></dd>
|
||||||
|
{{/if}}
|
||||||
|
{{#if commit.committerName}}
|
||||||
|
<dt>{{t jobs.committer}}</dt>
|
||||||
|
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{commit.committerName}}</a></dd>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<dt>{{t jobs.message}}</dt>
|
||||||
|
<dd class="commit-message">{{formatMessage commit.message}}</dd>
|
||||||
|
<dt>{{t jobs.config}}</dt>
|
||||||
|
<dd class="config">{{formatConfig config}}</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
{{view Travis.Views.LogView}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="right">
|
{{/with}}
|
||||||
<dt>{{t jobs.commit}}</dt>
|
|
||||||
<dd class="commit-hash"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
|
||||||
{{#if commit.compareUrl}}
|
|
||||||
<dt>{{t jobs.compare}}</dt>
|
|
||||||
<dd class="compare_view"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
|
||||||
{{/if}}
|
|
||||||
{{#if commit.authorName}}
|
|
||||||
<dt>{{t jobs.author}}</dt>
|
|
||||||
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{commit.authorName}}</a></dd>
|
|
||||||
{{/if}}
|
|
||||||
{{#if commit.committerName}}
|
|
||||||
<dt>{{t jobs.committer}}</dt>
|
|
||||||
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{commit.committerName}}</a></dd>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<dt>{{t jobs.message}}</dt>
|
|
||||||
<dd class="commit-message">{{formatMessage commit.message}}</dd>
|
|
||||||
<dt>{{t jobs.config}}</dt>
|
|
||||||
<dd class="config">{{formatConfig config}}</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
{{view Travis.Views.LogView}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<ul id="repositories">
|
<ul id="repositories">
|
||||||
{{#each repository in content}}
|
{{#each repository in controller.content}}
|
||||||
{{#view Travis.Views.RepositoriesItemView contextBinding="repository"}}
|
{{#view Travis.Views.RepositoriesItemView contextBinding="repository"}}
|
||||||
<li {{bindAttr class="view.classes"}}>
|
<li {{bindAttr class="view.classes"}}>
|
||||||
<a {{bindAttr href="view.urlRepository"}} class="current">{{slug}}</a>
|
<a {{bindAttr href="view.urlRepository"}} class="current">{{slug}}</a>
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
{{#unless isLoaded}}
|
{{#with controller.repository}}
|
||||||
Loading ...
|
{{#unless isLoaded}}
|
||||||
{{else}}
|
Loading ...
|
||||||
<div id="repository">
|
{{else}}
|
||||||
<h3>
|
<div id="repository">
|
||||||
<a {{bindAttr href="urlGithub"}}>{{slug}}</a>
|
<h3>
|
||||||
</h3>
|
<a {{bindAttr href="controller.urlGithub"}}>{{slug}}</a>
|
||||||
|
</h3>
|
||||||
|
|
||||||
<p class="description">{{description}}</p>
|
<p class="description">{{description}}</p>
|
||||||
|
|
||||||
<ul class="github-stats">
|
<ul class="github-stats">
|
||||||
<li class="language">{{last_build_language}}</li>
|
<li class="language">{{lastBuildLanguage}}</li>
|
||||||
<li><a class="watchers" title="Watches" {{bindAttr href="urlGithubWatchers"}}>{{stats.watchers}}</a></li>
|
<li><a class="watchers" title="Watches" {{bindAttr href="urlGithubWatchers"}}>{{stats.watchers}}</a></li>
|
||||||
<li><a class="forks" title="Forks" {{bindAttr href="urlGithubNetwork"}}>{{stats.forks}}</a></li>
|
<li><a class="forks" title="Forks" {{bindAttr href="urlGithubNetwork"}}>{{stats.forks}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
{{/with}}
|
||||||
|
|
|
@ -11,16 +11,20 @@
|
||||||
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
|
||||||
<h5><a {{bindAttr href="view.urlBranches"}}>{{t repositories.tabs.branches}}</a></h5>
|
<h5><a {{bindAttr href="view.urlBranches"}}>{{t repositories.tabs.branches}}</a></h5>
|
||||||
</li>
|
</li>
|
||||||
{{#if build}}
|
{{#with controller.build}}
|
||||||
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
{{#if isLoaded}}
|
||||||
<h5><a {{bindAttr href="view.urlBuild"}}>{{t repositories.tabs.build}} #{{build.number}}</a></h5>
|
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
|
||||||
</li>
|
<h5><a {{bindAttr href="view.urlBuild"}}>{{t repositories.tabs.build}} #{{number}}</a></h5>
|
||||||
{{/if}}
|
</li>
|
||||||
{{#if job}}
|
{{/if}}
|
||||||
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
{{/with}}
|
||||||
<h5><a {{bindAttr href="view.urlJob"}}>{{t repositories.tabs.job}} #{{job.number}}</a></h5>
|
{{#with controller.job}}
|
||||||
</li>
|
{{#if isLoaded}}
|
||||||
{{/if}}
|
<li id="tab_job" {{bindAttr class="view.classJob"}}>
|
||||||
|
<h5><a {{bindAttr href="view.urlJob"}}>{{t repositories.tabs.job}} #{{number}}</a></h5>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
{{/with}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="tools">
|
<div id="tools">
|
||||||
|
|
|
@ -15,19 +15,21 @@
|
||||||
templateName: 'builds/show'
|
templateName: 'builds/show'
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('controller.content.result'))
|
Travis.Helpers.colorForResult(@getPath('controller.build.result'))
|
||||||
).property('controller.content.result')
|
).property('controller.build.result')
|
||||||
|
|
||||||
requiredJobs: (->
|
requiredJobs: (->
|
||||||
@getPath('controller.content.jobs').filter((job) -> job.get('allow_failure') != true)
|
jobs = @getPath('controller.build.jobs')
|
||||||
).property('controller.content') # TODO same here with binding to 'context.data.job_ids'
|
jobs.filter((job) -> job.get('allow_failure') != true) if jobs
|
||||||
|
).property('controller.build.jobs')
|
||||||
|
|
||||||
allowedFailureJobs: (->
|
allowedFailureJobs: (->
|
||||||
@getPath('controller.content.jobs').filter((job) -> job.get('allow_failure'))
|
jobs = @getPath('controller.build.jobs')
|
||||||
).property('controller.content')
|
jobs.filter((job) -> job.get('allow_failure')) if jobs
|
||||||
|
).property('controller.build.jobs')
|
||||||
|
|
||||||
urlBuild: (->
|
urlBuild: (->
|
||||||
Travis.Urls.build(@getPath('context.repository'), @get('context'))
|
Travis.Urls.build(@getPath('context.repository'), @get('context'))
|
||||||
).property('controller.content.repository.id', 'controller.content.id')
|
).property('controller.build.repository.id', 'controller.build.id')
|
||||||
|
|
||||||
|
|
||||||
|
|
99
assets/javascripts/vendor/ember.js
vendored
99
assets/javascripts/vendor/ember.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -136,8 +136,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -1414,11 +1414,6 @@ function normalizeTuple(target, path) {
|
||||||
return TUPLE_RET;
|
return TUPLE_RET;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @private */
|
|
||||||
Ember.isGlobal = function(path) {
|
|
||||||
return IS_GLOBAL.test(path);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
|
@ -1482,7 +1477,8 @@ Ember.getPath = function(root, path) {
|
||||||
Ember.setPath = function(root, path, value, tolerant) {
|
Ember.setPath = function(root, path, value, tolerant) {
|
||||||
var keyName;
|
var keyName;
|
||||||
|
|
||||||
if (typeof root === 'string' && IS_GLOBAL.test(root)) {
|
if (typeof root === 'string') {
|
||||||
|
Ember.assert("Path '" + root + "' must be global if no root is given.", IS_GLOBAL.test(root));
|
||||||
value = path;
|
value = path;
|
||||||
path = root;
|
path = root;
|
||||||
root = null;
|
root = null;
|
||||||
|
@ -1536,7 +1532,7 @@ Ember.trySetPath = function(root, path, value) {
|
||||||
@returns Boolean
|
@returns Boolean
|
||||||
*/
|
*/
|
||||||
Ember.isGlobalPath = function(path) {
|
Ember.isGlobalPath = function(path) {
|
||||||
return !HAS_THIS.test(path) && IS_GLOBAL.test(path);
|
return IS_GLOBAL.test(path);
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -10632,9 +10628,17 @@ var get = Ember.get, set = Ember.set;
|
||||||
Ember.HistoryLocation = Ember.Object.extend({
|
Ember.HistoryLocation = Ember.Object.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
set(this, 'location', get(this, 'location') || window.location);
|
set(this, 'location', get(this, 'location') || window.location);
|
||||||
|
set(this, '_initialURL', get(this, 'location').pathname);
|
||||||
set(this, 'callbacks', Ember.A());
|
set(this, 'callbacks', Ember.A());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
@private
|
||||||
|
|
||||||
|
Used to give history a starting reference
|
||||||
|
*/
|
||||||
|
_initialURL: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
|
@ -10650,12 +10654,13 @@ Ember.HistoryLocation = Ember.Object.extend({
|
||||||
Uses `history.pushState` to update the url without a page reload.
|
Uses `history.pushState` to update the url without a page reload.
|
||||||
*/
|
*/
|
||||||
setURL: function(path) {
|
setURL: function(path) {
|
||||||
var state = window.history.state;
|
var state = window.history.state,
|
||||||
|
initialURL = get(this, '_initialURL');
|
||||||
|
|
||||||
if (path === "") { path = '/'; }
|
if (path === "") { path = '/'; }
|
||||||
// We only want pushState to be executed if we are passing
|
|
||||||
// in a new path, otherwise a new state will be inserted
|
if ((initialURL && initialURL !== path) || (state && state.path !== path)) {
|
||||||
// for the same path.
|
set(this, '_initialURL', null);
|
||||||
if (!state || (state && state.path !== path)) {
|
|
||||||
window.history.pushState({ path: path }, null, path);
|
window.history.pushState({ path: path }, null, path);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -11524,8 +11529,6 @@ Ember.ControllerMixin.reopen({
|
||||||
if (controller && context) { controller.set('content', context); }
|
if (controller && context) { controller.set('content', context); }
|
||||||
view = viewClass.create();
|
view = viewClass.create();
|
||||||
if (controller) { set(view, 'controller', controller); }
|
if (controller) { set(view, 'controller', controller); }
|
||||||
|
|
||||||
/* console.log(view, view.toString()) */
|
|
||||||
set(this, outletName, view);
|
set(this, outletName, view);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -11577,6 +11580,17 @@ var childViewsProperty = Ember.computed(function() {
|
||||||
return ret;
|
return ret;
|
||||||
}).property().cacheable();
|
}).property().cacheable();
|
||||||
|
|
||||||
|
var controllerProperty = Ember.computed(function(key, value) {
|
||||||
|
var parentView;
|
||||||
|
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
parentView = get(this, 'parentView');
|
||||||
|
return parentView ? get(parentView, 'controller') : null;
|
||||||
|
}
|
||||||
|
}).property().cacheable();
|
||||||
|
|
||||||
var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
|
var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
|
||||||
Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
|
Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
|
||||||
|
|
||||||
|
@ -12045,17 +12059,7 @@ Ember.View = Ember.Object.extend(Ember.Evented,
|
||||||
|
|
||||||
@type Object
|
@type Object
|
||||||
*/
|
*/
|
||||||
controller: Ember.computed(function(key, value) {
|
controller: controllerProperty,
|
||||||
var parentView;
|
|
||||||
|
|
||||||
if (arguments.length === 2) {
|
|
||||||
return value;
|
|
||||||
} else {
|
|
||||||
parentView = get(this, 'parentView');
|
|
||||||
return parentView ? get(parentView, 'controller') : null;
|
|
||||||
}
|
|
||||||
}).property().cacheable(),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A view may contain a layout. A layout is a regular template but
|
A view may contain a layout. A layout is a regular template but
|
||||||
supersedes the `template` property during rendering. It is the
|
supersedes the `template` property during rendering. It is the
|
||||||
|
@ -12120,20 +12124,22 @@ Ember.View = Ember.Object.extend(Ember.Evented,
|
||||||
to be re-rendered.
|
to be re-rendered.
|
||||||
*/
|
*/
|
||||||
_context: Ember.computed(function(key, value) {
|
_context: Ember.computed(function(key, value) {
|
||||||
var parentView, controller;
|
var parentView, context;
|
||||||
|
|
||||||
if (arguments.length === 2) {
|
if (arguments.length === 2) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIEW_PRESERVES_CONTEXT) {
|
if (VIEW_PRESERVES_CONTEXT) {
|
||||||
if (controller = get(this, 'controller')) {
|
if (Ember.meta(this).descs.controller !== controllerProperty) {
|
||||||
return controller;
|
if (context = get(this, 'controller')) {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parentView = get(this, '_parentView');
|
parentView = get(this, '_parentView');
|
||||||
if (parentView) {
|
if (parentView && (context = get(parentView, '_context'))) {
|
||||||
return get(parentView, '_context');
|
return context;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14803,6 +14809,12 @@ Ember.State = Ember.Object.extend(Ember.Evented,
|
||||||
return !get(this, 'childStates').length;
|
return !get(this, 'childStates').length;
|
||||||
}).cacheable(),
|
}).cacheable(),
|
||||||
|
|
||||||
|
/**
|
||||||
|
A boolean value indicating whether the state takes a context.
|
||||||
|
By default we assume all states take contexts.
|
||||||
|
*/
|
||||||
|
hasContext: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is the default transition event.
|
This is the default transition event.
|
||||||
|
|
||||||
|
@ -15323,7 +15335,6 @@ Ember.StateManager = Ember.State.extend(
|
||||||
|
|
||||||
send: function(event, context) {
|
send: function(event, context) {
|
||||||
Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
|
Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
|
||||||
if (arguments.length === 1) { context = {}; }
|
|
||||||
return this.sendRecursively(event, get(this, 'currentState'), context);
|
return this.sendRecursively(event, get(this, 'currentState'), context);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -15472,7 +15483,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
exitStates.shift();
|
exitStates.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
currentState.pathsCache[name] = {
|
currentState.pathsCache[path] = {
|
||||||
exitStates: exitStates,
|
exitStates: exitStates,
|
||||||
enterStates: enterStates,
|
enterStates: enterStates,
|
||||||
resolveState: resolveState
|
resolveState: resolveState
|
||||||
|
@ -15490,7 +15501,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
exitStates.unshift(state);
|
exitStates.unshift(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
useContext = context && (!get(state, 'isRoutable') || get(state, 'isDynamic'));
|
useContext = context && get(state, 'hasContext');
|
||||||
matchedContexts.unshift(useContext ? contexts.pop() : null);
|
matchedContexts.unshift(useContext ? contexts.pop() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15502,6 +15513,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
state = getPath(state, 'states.'+initialState);
|
state = getPath(state, 'states.'+initialState);
|
||||||
if (!state) { break; }
|
if (!state) { break; }
|
||||||
enterStates.push(state);
|
enterStates.push(state);
|
||||||
|
matchedContexts.push(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (enterStates.length > 0) {
|
while (enterStates.length > 0) {
|
||||||
|
@ -15732,9 +15744,10 @@ Ember.Routable = Ember.Mixin.create({
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
Check whether the route has dynamic segments
|
Check whether the route has dynamic segments and therefore takes
|
||||||
|
a context.
|
||||||
*/
|
*/
|
||||||
isDynamic: Ember.computed(function() {
|
hasContext: Ember.computed(function() {
|
||||||
var routeMatcher = get(this, 'routeMatcher');
|
var routeMatcher = get(this, 'routeMatcher');
|
||||||
if (routeMatcher) {
|
if (routeMatcher) {
|
||||||
return routeMatcher.identifiers.length > 0;
|
return routeMatcher.identifiers.length > 0;
|
||||||
|
@ -16339,7 +16352,7 @@ var get = Ember.get, getPath = Ember.getPath, set = Ember.set;
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
See Handlebars.helpers.actions for additional usage examples.
|
See Handlebars.helpers.action for additional usage examples.
|
||||||
|
|
||||||
|
|
||||||
## Changing View Hierarchy in Response To State Change
|
## Changing View Hierarchy in Response To State Change
|
||||||
|
@ -17959,7 +17972,7 @@ EmberHandlebars.registerHelper('with', function(context, options) {
|
||||||
|
|
||||||
Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
|
Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
|
||||||
|
|
||||||
if (Ember.isGlobal(path)) {
|
if (Ember.isGlobalPath(path)) {
|
||||||
Ember.bind(options.data.keywords, keywordName, path);
|
Ember.bind(options.data.keywords, keywordName, path);
|
||||||
} else {
|
} else {
|
||||||
normalized = normalizePath(this, path, options.data);
|
normalized = normalizePath(this, path, options.data);
|
||||||
|
@ -20114,8 +20127,8 @@ Ember.$(document).ready(
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1952,8 +1952,8 @@ Handlebars.VM = {
|
||||||
|
|
||||||
Handlebars.template = Handlebars.VM.template;
|
Handlebars.template = Handlebars.VM.template;
|
||||||
;
|
;
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -2090,8 +2090,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -3368,11 +3368,6 @@ function normalizeTuple(target, path) {
|
||||||
return TUPLE_RET;
|
return TUPLE_RET;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @private */
|
|
||||||
Ember.isGlobal = function(path) {
|
|
||||||
return IS_GLOBAL.test(path);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
|
@ -3436,7 +3431,8 @@ Ember.getPath = function(root, path) {
|
||||||
Ember.setPath = function(root, path, value, tolerant) {
|
Ember.setPath = function(root, path, value, tolerant) {
|
||||||
var keyName;
|
var keyName;
|
||||||
|
|
||||||
if (typeof root === 'string' && IS_GLOBAL.test(root)) {
|
if (typeof root === 'string') {
|
||||||
|
Ember.assert("Path '" + root + "' must be global if no root is given.", IS_GLOBAL.test(root));
|
||||||
value = path;
|
value = path;
|
||||||
path = root;
|
path = root;
|
||||||
root = null;
|
root = null;
|
||||||
|
@ -3490,7 +3486,7 @@ Ember.trySetPath = function(root, path, value) {
|
||||||
@returns Boolean
|
@returns Boolean
|
||||||
*/
|
*/
|
||||||
Ember.isGlobalPath = function(path) {
|
Ember.isGlobalPath = function(path) {
|
||||||
return !HAS_THIS.test(path) && IS_GLOBAL.test(path);
|
return IS_GLOBAL.test(path);
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -12586,9 +12582,17 @@ var get = Ember.get, set = Ember.set;
|
||||||
Ember.HistoryLocation = Ember.Object.extend({
|
Ember.HistoryLocation = Ember.Object.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
set(this, 'location', get(this, 'location') || window.location);
|
set(this, 'location', get(this, 'location') || window.location);
|
||||||
|
set(this, '_initialURL', get(this, 'location').pathname);
|
||||||
set(this, 'callbacks', Ember.A());
|
set(this, 'callbacks', Ember.A());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
@private
|
||||||
|
|
||||||
|
Used to give history a starting reference
|
||||||
|
*/
|
||||||
|
_initialURL: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
|
@ -12604,12 +12608,13 @@ Ember.HistoryLocation = Ember.Object.extend({
|
||||||
Uses `history.pushState` to update the url without a page reload.
|
Uses `history.pushState` to update the url without a page reload.
|
||||||
*/
|
*/
|
||||||
setURL: function(path) {
|
setURL: function(path) {
|
||||||
var state = window.history.state;
|
var state = window.history.state,
|
||||||
|
initialURL = get(this, '_initialURL');
|
||||||
|
|
||||||
if (path === "") { path = '/'; }
|
if (path === "") { path = '/'; }
|
||||||
// We only want pushState to be executed if we are passing
|
|
||||||
// in a new path, otherwise a new state will be inserted
|
if ((initialURL && initialURL !== path) || (state && state.path !== path)) {
|
||||||
// for the same path.
|
set(this, '_initialURL', null);
|
||||||
if (!state || (state && state.path !== path)) {
|
|
||||||
window.history.pushState({ path: path }, null, path);
|
window.history.pushState({ path: path }, null, path);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -13478,8 +13483,6 @@ Ember.ControllerMixin.reopen({
|
||||||
if (controller && context) { controller.set('content', context); }
|
if (controller && context) { controller.set('content', context); }
|
||||||
view = viewClass.create();
|
view = viewClass.create();
|
||||||
if (controller) { set(view, 'controller', controller); }
|
if (controller) { set(view, 'controller', controller); }
|
||||||
|
|
||||||
/* console.log(view, view.toString()) */
|
|
||||||
set(this, outletName, view);
|
set(this, outletName, view);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -13531,6 +13534,17 @@ var childViewsProperty = Ember.computed(function() {
|
||||||
return ret;
|
return ret;
|
||||||
}).property().cacheable();
|
}).property().cacheable();
|
||||||
|
|
||||||
|
var controllerProperty = Ember.computed(function(key, value) {
|
||||||
|
var parentView;
|
||||||
|
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
parentView = get(this, 'parentView');
|
||||||
|
return parentView ? get(parentView, 'controller') : null;
|
||||||
|
}
|
||||||
|
}).property().cacheable();
|
||||||
|
|
||||||
var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
|
var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
|
||||||
Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
|
Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
|
||||||
|
|
||||||
|
@ -13999,17 +14013,7 @@ Ember.View = Ember.Object.extend(Ember.Evented,
|
||||||
|
|
||||||
@type Object
|
@type Object
|
||||||
*/
|
*/
|
||||||
controller: Ember.computed(function(key, value) {
|
controller: controllerProperty,
|
||||||
var parentView;
|
|
||||||
|
|
||||||
if (arguments.length === 2) {
|
|
||||||
return value;
|
|
||||||
} else {
|
|
||||||
parentView = get(this, 'parentView');
|
|
||||||
return parentView ? get(parentView, 'controller') : null;
|
|
||||||
}
|
|
||||||
}).property().cacheable(),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A view may contain a layout. A layout is a regular template but
|
A view may contain a layout. A layout is a regular template but
|
||||||
supersedes the `template` property during rendering. It is the
|
supersedes the `template` property during rendering. It is the
|
||||||
|
@ -14074,20 +14078,22 @@ Ember.View = Ember.Object.extend(Ember.Evented,
|
||||||
to be re-rendered.
|
to be re-rendered.
|
||||||
*/
|
*/
|
||||||
_context: Ember.computed(function(key, value) {
|
_context: Ember.computed(function(key, value) {
|
||||||
var parentView, controller;
|
var parentView, context;
|
||||||
|
|
||||||
if (arguments.length === 2) {
|
if (arguments.length === 2) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIEW_PRESERVES_CONTEXT) {
|
if (VIEW_PRESERVES_CONTEXT) {
|
||||||
if (controller = get(this, 'controller')) {
|
if (Ember.meta(this).descs.controller !== controllerProperty) {
|
||||||
return controller;
|
if (context = get(this, 'controller')) {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parentView = get(this, '_parentView');
|
parentView = get(this, '_parentView');
|
||||||
if (parentView) {
|
if (parentView && (context = get(parentView, '_context'))) {
|
||||||
return get(parentView, '_context');
|
return context;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16757,6 +16763,12 @@ Ember.State = Ember.Object.extend(Ember.Evented,
|
||||||
return !get(this, 'childStates').length;
|
return !get(this, 'childStates').length;
|
||||||
}).cacheable(),
|
}).cacheable(),
|
||||||
|
|
||||||
|
/**
|
||||||
|
A boolean value indicating whether the state takes a context.
|
||||||
|
By default we assume all states take contexts.
|
||||||
|
*/
|
||||||
|
hasContext: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is the default transition event.
|
This is the default transition event.
|
||||||
|
|
||||||
|
@ -17277,7 +17289,6 @@ Ember.StateManager = Ember.State.extend(
|
||||||
|
|
||||||
send: function(event, context) {
|
send: function(event, context) {
|
||||||
Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
|
Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
|
||||||
if (arguments.length === 1) { context = {}; }
|
|
||||||
return this.sendRecursively(event, get(this, 'currentState'), context);
|
return this.sendRecursively(event, get(this, 'currentState'), context);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -17426,7 +17437,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
exitStates.shift();
|
exitStates.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
currentState.pathsCache[name] = {
|
currentState.pathsCache[path] = {
|
||||||
exitStates: exitStates,
|
exitStates: exitStates,
|
||||||
enterStates: enterStates,
|
enterStates: enterStates,
|
||||||
resolveState: resolveState
|
resolveState: resolveState
|
||||||
|
@ -17444,7 +17455,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
exitStates.unshift(state);
|
exitStates.unshift(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
useContext = context && (!get(state, 'isRoutable') || get(state, 'isDynamic'));
|
useContext = context && get(state, 'hasContext');
|
||||||
matchedContexts.unshift(useContext ? contexts.pop() : null);
|
matchedContexts.unshift(useContext ? contexts.pop() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17456,6 +17467,7 @@ Ember.StateManager = Ember.State.extend(
|
||||||
state = getPath(state, 'states.'+initialState);
|
state = getPath(state, 'states.'+initialState);
|
||||||
if (!state) { break; }
|
if (!state) { break; }
|
||||||
enterStates.push(state);
|
enterStates.push(state);
|
||||||
|
matchedContexts.push(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (enterStates.length > 0) {
|
while (enterStates.length > 0) {
|
||||||
|
@ -17686,9 +17698,10 @@ Ember.Routable = Ember.Mixin.create({
|
||||||
/**
|
/**
|
||||||
@private
|
@private
|
||||||
|
|
||||||
Check whether the route has dynamic segments
|
Check whether the route has dynamic segments and therefore takes
|
||||||
|
a context.
|
||||||
*/
|
*/
|
||||||
isDynamic: Ember.computed(function() {
|
hasContext: Ember.computed(function() {
|
||||||
var routeMatcher = get(this, 'routeMatcher');
|
var routeMatcher = get(this, 'routeMatcher');
|
||||||
if (routeMatcher) {
|
if (routeMatcher) {
|
||||||
return routeMatcher.identifiers.length > 0;
|
return routeMatcher.identifiers.length > 0;
|
||||||
|
@ -18293,7 +18306,7 @@ var get = Ember.get, getPath = Ember.getPath, set = Ember.set;
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
See Handlebars.helpers.actions for additional usage examples.
|
See Handlebars.helpers.action for additional usage examples.
|
||||||
|
|
||||||
|
|
||||||
## Changing View Hierarchy in Response To State Change
|
## Changing View Hierarchy in Response To State Change
|
||||||
|
@ -19913,7 +19926,7 @@ EmberHandlebars.registerHelper('with', function(context, options) {
|
||||||
|
|
||||||
Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
|
Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
|
||||||
|
|
||||||
if (Ember.isGlobal(path)) {
|
if (Ember.isGlobalPath(path)) {
|
||||||
Ember.bind(options.data.keywords, keywordName, path);
|
Ember.bind(options.data.keywords, keywordName, path);
|
||||||
} else {
|
} else {
|
||||||
normalized = normalizePath(this, path, options.data);
|
normalized = normalizePath(this, path, options.data);
|
||||||
|
@ -22068,8 +22081,8 @@ Ember.$(document).ready(
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Version: v0.9.8.1-451-g50ee26d
|
// Version: v0.9.8.1-468-g3097ea8
|
||||||
// Last commit: 50ee26d (2012-06-26 18:06:44 -0700)
|
// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user