diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index 47658c33..97bd29d6 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -3,6 +3,7 @@ require 'ext/jquery' # $.mockjaxSettings.log = false # Ember.LOG_BINDINGS = true + @Travis = Em.Namespace.create CONFIG_KEYS: ['rvm', 'gemfile', 'env', 'otp_release', 'php', 'node_js', 'perl', 'python', 'scala'] diff --git a/assets/javascripts/app/controllers.coffee b/assets/javascripts/app/controllers.coffee index 9443744a..8e104620 100644 --- a/assets/javascripts/app/controllers.coffee +++ b/assets/javascripts/app/controllers.coffee @@ -2,11 +2,27 @@ require 'helpers' require 'travis/ticker' Travis.Controllers = Em.Namespace.create - RepositoriesController: Em.ArrayController.extend() - RepositoryController: Em.ObjectController.extend(Travis.Urls.Repository) - BuildsController: Em.ArrayController.extend() - BuildController: Em.ObjectController.extend(Travis.Urls.Commit) - JobController: Em.ObjectController.extend(Travis.Urls.Commit) + RepositoriesController: Em.ArrayController.extend + contentBinding: 'layout.repositories' + + RepositoryController: Em.Controller.extend # Travis.Urls.Repository, + 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() UserController: Em.ObjectController.extend() HooksController: Em.ArrayController.extend() diff --git a/assets/javascripts/app/helpers/urls.coffee b/assets/javascripts/app/helpers/urls.coffee index 1540a6ca..ae51bd96 100644 --- a/assets/javascripts/app/helpers/urls.coffee +++ b/assets/javascripts/app/helpers/urls.coffee @@ -16,8 +16,8 @@ Repository: urlGithub: (-> - "http://github.com/#{@get('slug')}" - ).property('slug'), + "http://github.com/#{@getPath('repository.slug')}" + ).property('repository.slug'), urlGithubWatchers: (-> "http://github.com/#{@get('slug')}/watchers" diff --git a/assets/javascripts/app/layout.coffee b/assets/javascripts/app/layout.coffee index 3370d703..c648a623 100644 --- a/assets/javascripts/app/layout.coffee +++ b/assets/javascripts/app/layout.coffee @@ -1,6 +1,7 @@ Travis.Layout = Em.Namespace.create() require 'layout/home' +require 'layout/left' require 'layout/sidebar' require 'layout/profile' require 'layout/stats' diff --git a/assets/javascripts/app/layout/base.coffee b/assets/javascripts/app/layout/base.coffee index 483012d0..039246fe 100644 --- a/assets/javascripts/app/layout/base.coffee +++ b/assets/javascripts/app/layout/base.coffee @@ -2,7 +2,7 @@ Travis.Layout.Base = Em.Object.extend init: -> @parent = @get('parent') - @setup(Array.prototype.slice.apply(arguments).concat(@get('name'))) + @setup(Array.prototype.slice.apply(arguments).concat([@get('name'), 'top'])) @connect() setup: (controllers) -> @@ -14,7 +14,7 @@ Travis.Layout.Base = Em.Object.extend key = "#{$.camelize(name, false)}Controller" name = $.camelize(key) 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"] @viewClass = Travis.Views["#{$.camelize(@get('name'))}Layout"] @@ -31,5 +31,6 @@ Travis.Layout.Base = Em.Object.extend @topController.set('tab', @get('name')) activate: (action, params) -> - this["view#{$.camelize(action)}"](params) + @set('params', params) + this["view#{$.camelize(action)}"]() diff --git a/assets/javascripts/app/layout/home.coffee b/assets/javascripts/app/layout/home.coffee index 97de4ec1..61daeeaf 100644 --- a/assets/javascripts/app/layout/home.coffee +++ b/assets/javascripts/app/layout/home.coffee @@ -4,83 +4,67 @@ Travis.Layout.Home = Travis.Layout.Base.extend name: 'home' init: -> - @_super('top', 'repositories', 'repository', 'tabs', 'builds', 'build', 'job') - @connectLeft(Travis.Repository.find()) - Travis.Layout.Sidebar.create(homeController: @get('homeController')) + @_super('repositories', 'repository', 'tabs', 'builds', 'build', 'job') + # Travis.Layout.Sidebar.create(parent: @controller) - viewIndex: (params) -> - onceLoaded @repositories, => - repository = @repositories.get('firstObject') - @connectRepository(repository) - @connectTabs('current') - @connectBuild(repository.get('lastBuild')) + @controller.connectOutlet(outletName: 'left', name: 'repositories') + @controller.connectOutlet(outletName: 'main', name: 'repository') + @controller.connectOutlet(outletName: 'tabs', name: 'tabs') - viewCurrent: (params) -> - @viewRepository params, (repository) => - @connectTabs('current') - @connectBuild(repository.get('lastBuild')) + @set('repositories', Travis.Repository.find()) - viewBuilds: (params) -> - @viewRepository params, (repository) => - @connectTabs('builds') - @connectBuilds(repository.get('builds')) + activate: (action, params) -> + @set('tab', if action == 'index' then 'current' else action) + @_super(action, params) - viewBuild: (params) -> - @viewRepository params - @buildBy params.id, (build) => - @connectTabs('build', build) - @connectBuild(build) + viewIndex: -> + @bindRepository('repositories.firstObject') + @bindBuild('repository.lastBuild') + @connectTab('build') - viewJob: (params) -> - @viewRepository params - @jobBy params.id, (job) => - @connectTabs('job', job.get('build'), job) - @connectJob(job) + viewCurrent: -> + @bindRepository('repositoryByParams') + @bindBuild('repository.lastBuild') + @connectTab('build') + viewBuilds: -> + @bind('repository', 'repositoriesByParams.firstObject') + @bind('builds', 'repository.builds') + @connectTab('builds') - viewRepository: (params, callback) -> - @repositoryBy params, (repository) => - @connectRepository(repository) - callback(repository) if callback + viewBuild: -> + @bindRepository('repositoryByParams') + @bindBuild('buildById') + @connectTab('build') - repositoryBy: (params, callback) -> - repositories = Travis.Repository.bySlug("#{params.owner}/#{params.name}") - onceLoaded repositories, => - callback(repositories.get('firstObject')) + viewJob: -> + @bindRepository('repositoryByParams') + @bindJob('jobById') + @connectTab('job') - buildBy: (id, callback) => - build = Travis.Build.find(id) - onceLoaded build, => - callback(build) + repositoryByParamsBinding: 'repositoriesByParams.firstObject' - jobBy: (id, callback) -> - job = Travis.Job.find(id) - onceLoaded job, => - callback(job) + repositoriesByParams: (-> + console.log('repositoriesByParams', @getPath('params.owner'), @getPath('params.name')) + Travis.Repository.bySlug("#{params.owner}/#{params.name}") if params = @get('params') + ).property('params') + buildById: (-> + console.log('buildByParams', @getPath('params.id')) + Travis.Build.find(id) if id = @getPath('params.id') + ).property('params.id') - connectLeft: (repositories) -> - @repositories = repositories - @homeController.connectOutlet(outletName: 'left', name: 'repositories', context: repositories) + jobById: (-> + console.log('jobByParams', @getPath('params.id')) + Travis.Job.find(id) if id = @getPath('params.id') + ).property('params.id') - connectRepository: (repository) -> - @repository = repository - @homeController.connectOutlet(outletName: 'main', name: 'repository', context: repository) + bindRepository: (from) -> + Ember.oneWay(this, 'repository', from) - connectTabs: (tab, build, job) -> - @tabsController.set('tab', tab) - @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) + bindBuild: (from) -> + Ember.oneWay(this, 'build', from) + connectTab: (tab) -> + @controller.connectOutlet(outletName: 'tab', name: tab) diff --git a/assets/javascripts/app/layout/left.coffee b/assets/javascripts/app/layout/left.coffee new file mode 100644 index 00000000..1400f3d1 --- /dev/null +++ b/assets/javascripts/app/layout/left.coffee @@ -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) diff --git a/assets/javascripts/app/layout/sidebar.coffee b/assets/javascripts/app/layout/sidebar.coffee index dc3b60e6..2eb788e8 100644 --- a/assets/javascripts/app/layout/sidebar.coffee +++ b/assets/javascripts/app/layout/sidebar.coffee @@ -5,7 +5,7 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend init: -> @_super('sponsors', 'workers', 'queues') - @homeController = @get('homeController') + @parent = @get('parent') @connectSponsors(Travis.Sponsor.decks(), Travis.Sponsor.links()) @connectWorkers(Travis.Worker.find()) @@ -14,13 +14,13 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend Travis.Ticker.create(target: this, interval: Travis.INTERVALS.sponsors) connect: -> - @homeController.connectOutlet(outletName: 'right', name: 'sidebar') + @parent.connectOutlet(outletName: 'right', name: 'sidebar') connectSponsors: (decks, links) -> @sponsorsController = Em.Controller.create decks: Travis.Controllers.SponsorsController.create(perPage: 1, content: decks) links: Travis.Controllers.SponsorsController.create(perPage: 6, content: links) - @homeController.set 'sponsors', @sponsorsController + @parent.set 'sponsors', @sponsorsController tick: -> @sponsorsController.get('decks').next() @@ -28,7 +28,7 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend connectWorkers: (workers) -> @workersController.set('content', workers) - @homeController.set('workers', @workersController) + @parent.set('workers', @workersController) connectQueues: (queues) -> queues = for queue in queues @@ -36,5 +36,5 @@ Travis.Layout.Sidebar = Travis.Layout.Base.extend content: Travis.Job.queued(queue.name) name: queue.display @queuesController.set('content', queues) - @homeController.set('queues', @queuesController) + @parent.set('queues', @queuesController) diff --git a/assets/javascripts/app/templates/builds/list.hbs b/assets/javascripts/app/templates/builds/list.hbs index 987dd52d..800e4ca9 100644 --- a/assets/javascripts/app/templates/builds/list.hbs +++ b/assets/javascripts/app/templates/builds/list.hbs @@ -1,31 +1,35 @@ - - - - - - - - - - +{{#with controller.builds}} +
{{t builds.name}}{{t builds.commit}}{{t builds.message}}{{t builds.duration}}{{t builds.finished_at}}
+ + + + + + + + + - - {{#each build in content}} - {{#view Travis.Views.BuildsItemView contextBinding="build"}} - - - - - - - - {{/view}} - {{/each}} - -
{{t builds.name}}{{t builds.commit}}{{t builds.message}}{{t builds.duration}}{{t builds.finished_at}}
{{number}}{{formatCommit commit}}{{{formatMessage commit.message short="true"}}}{{formatDuration duration}}{{formatTime finished_at}}
+ + {{#each build in content}} + {{#view Travis.Views.BuildsItemView contextBinding="build"}} + + {{number}} + {{formatCommit commit}} + {{{formatMessage commit.message short="true"}}} + {{formatDuration duration}} + {{formatTime finished_at}} + + {{/view}} + {{else}} + Loading ... + {{/each}} + + -

- -

+

+ +

+{{/with}} diff --git a/assets/javascripts/app/templates/builds/show.hbs b/assets/javascripts/app/templates/builds/show.hbs index a7298c61..94e8f397 100644 --- a/assets/javascripts/app/templates/builds/show.hbs +++ b/assets/javascripts/app/templates/builds/show.hbs @@ -1,48 +1,50 @@ -{{#unless isLoaded}} - Loading ... -{{else}} -
-
-
-
{{t builds.name}}
-
{{number}}
-
{{t builds.finished_at}}
-
{{formatTime finished_at}}
-
{{t builds.duration}}
-
{{formatDuration duration}}
-
+{{#with controller.build}} + {{#unless isLoaded}} + Loading ... + {{else}} +
+
+
+
{{t builds.name}}
+
{{number}}
+
{{t builds.finished_at}}
+
{{formatTime finished_at}}
+
{{t builds.duration}}
+
{{formatDuration duration}}
+
-
-
{{t builds.commit}}
-
{{formatCommit commit}}
- {{#if commit.compareUrl}} -
{{t builds.compare}}
-
{{pathFrom commit.compareUrl}}
- {{/if}} - {{#if commit.authorName}} -
{{t builds.author}}
-
{{commit.authorName}}
- {{/if}} - {{#if commit.committerName}} -
{{t builds.committer}}
-
{{commit.committerName}}
- {{/if}} -
+
+
{{t builds.commit}}
+
{{formatCommit commit}}
+ {{#if commit.compareUrl}} +
{{t builds.compare}}
+
{{pathFrom commit.compareUrl}}
+ {{/if}} + {{#if commit.authorName}} +
{{t builds.author}}
+
{{commit.authorName}}
+ {{/if}} + {{#if commit.committerName}} +
{{t builds.committer}}
+
{{commit.committerName}}
+ {{/if}} +
-
{{t builds.message}}
-
{{{formatMessage commit.message}}}
+
{{t builds.message}}
+
{{{formatMessage commit.message}}}
- {{#unless isMatrix}} -
{{t builds.config}}
-
{{formatConfig config}}
- {{/unless}} -
+ {{#unless isMatrix}} +
{{t builds.config}}
+
{{formatConfig config}}
+ {{/unless}} +
- {{#if isMatrix}} - {{view Travis.Views.JobsView jobsBinding="view.requiredJobs" required="true"}} - {{view Travis.Views.JobsView jobsBinding="view.allowedFailureJobs"}} - {{else}} - {{view Travis.Views.LogView contextBinding="jobs.firstObject"}} - {{/if}} -
-{{/unless}} + {{#if isMatrix}} + {{view Travis.Views.JobsView jobsBinding="view.requiredJobs" required="true"}} + {{view Travis.Views.JobsView jobsBinding="view.allowedFailureJobs"}} + {{else}} + {{view Travis.Views.LogView contextBinding="jobs.firstObject"}} + {{/if}} + + {{/unless}} +{{/with}} diff --git a/assets/javascripts/app/templates/jobs/list.hbs b/assets/javascripts/app/templates/jobs/list.hbs index 02d3e87d..696aba58 100644 --- a/assets/javascripts/app/templates/jobs/list.hbs +++ b/assets/javascripts/app/templates/jobs/list.hbs @@ -1,56 +1,58 @@ -{{#if view.jobs.length}} - {{#if view.required}} - - - {{else}} -
- {{t jobs.build_matrix}} -
- - {{/if}} - - - {{#each configKeys}} - +{{#with controller.build}} + {{#if jobs.length}} + {{#if view.required}} +
- {{t jobs.allowed_failures}} - -
{{this}}
+ + {{else}} +
+ {{t jobs.build_matrix}} +
+ + {{/if}} + + + {{#each configKeys}} + + {{/each}} + + + + {{#each job in view.jobs}} + {{#view Travis.Views.JobsItemView contextBinding="job"}} + + + + + {{#each configValues}} + + {{/each}} + + {{/view}} {{/each}} - - - - {{#each job in view.jobs}} - {{#view Travis.Views.JobsItemView contextBinding="job"}} - - - - - {{#each configValues}} - - {{/each}} - - {{/view}} - {{/each}} - -
+ {{t jobs.allowed_failures}} + +
{{this}}
{{number}}{{formatDuration duration}}{{formatTime finished_at}}{{this}}
{{number}}{{formatDuration duration}}{{formatTime finished_at}}{{this}}
+ + - {{#unless view.required}} -
-
{{t "jobs.allowed_failures"}}
-
-

- 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 - in experimental and preparatory builds to test against versions or - configurations that you are not ready to officially support. -

-

- You can define allowed failures in the build matrix as follows: -

-
 matrix:
-  allow_failures:
-    - rvm: ruby-head 
+ {{#unless view.required}} +
+
{{t "jobs.allowed_failures"}}
+
+

+ 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 + in experimental and preparatory builds to test against versions or + configurations that you are not ready to officially support. +

+

+ You can define allowed failures in the build matrix as follows: +

+
 matrix:
+    allow_failures:
+      - rvm: ruby-head 
+
-
- {{/unless}} -{{/if}} + {{/unless}} + {{/if}} +{{/with}} diff --git a/assets/javascripts/app/templates/jobs/show.hbs b/assets/javascripts/app/templates/jobs/show.hbs index 98f9dc4c..71d22a7b 100644 --- a/assets/javascripts/app/templates/jobs/show.hbs +++ b/assets/javascripts/app/templates/jobs/show.hbs @@ -1,37 +1,40 @@ -
-
-
-
Job
-
{{number}}
-
{{t jobs.finished_at}}
-
{{formatTime finished_at}}
-
{{t jobs.duration}}
-
{{formatDuration duration}}
+{{#with controller.job}} + {{#if isLoaded}} +
+
+
+
Job
+
{{number}}
+
{{t jobs.finished_at}}
+
{{formatTime finished_at}}
+
{{t jobs.duration}}
+
{{formatDuration duration}}
+
+ +
+
{{t jobs.commit}}
+
{{formatCommit commit}}
+ {{#if commit.compareUrl}} +
{{t jobs.compare}}
+
{{pathFrom commit.compareUrl}}
+ {{/if}} + {{#if commit.authorName}} +
{{t jobs.author}}
+
{{commit.authorName}}
+ {{/if}} + {{#if commit.committerName}} +
{{t jobs.committer}}
+
{{commit.committerName}}
+ {{/if}} +
+ +
{{t jobs.message}}
+
{{formatMessage commit.message}}
+
{{t jobs.config}}
+
{{formatConfig config}}
+
+ + {{view Travis.Views.LogView}}
- -
-
{{t jobs.commit}}
-
{{formatCommit commit}}
- {{#if commit.compareUrl}} -
{{t jobs.compare}}
-
{{pathFrom commit.compareUrl}}
- {{/if}} - {{#if commit.authorName}} -
{{t jobs.author}}
-
{{commit.authorName}}
- {{/if}} - {{#if commit.committerName}} -
{{t jobs.committer}}
-
{{commit.committerName}}
- {{/if}} -
- -
{{t jobs.message}}
-
{{formatMessage commit.message}}
-
{{t jobs.config}}
-
{{formatConfig config}}
-
- - {{view Travis.Views.LogView}} -
- + {{/if}} +{{/with}} diff --git a/assets/javascripts/app/templates/repositories/list.hbs b/assets/javascripts/app/templates/repositories/list.hbs index c6bc6526..b662c55b 100644 --- a/assets/javascripts/app/templates/repositories/list.hbs +++ b/assets/javascripts/app/templates/repositories/list.hbs @@ -1,5 +1,5 @@
diff --git a/assets/javascripts/app/views/build.coffee b/assets/javascripts/app/views/build.coffee index 5b162257..ed9ba590 100644 --- a/assets/javascripts/app/views/build.coffee +++ b/assets/javascripts/app/views/build.coffee @@ -15,19 +15,21 @@ templateName: 'builds/show' color: (-> - Travis.Helpers.colorForResult(@getPath('controller.content.result')) - ).property('controller.content.result') + Travis.Helpers.colorForResult(@getPath('controller.build.result')) + ).property('controller.build.result') requiredJobs: (-> - @getPath('controller.content.jobs').filter((job) -> job.get('allow_failure') != true) - ).property('controller.content') # TODO same here with binding to 'context.data.job_ids' + jobs = @getPath('controller.build.jobs') + jobs.filter((job) -> job.get('allow_failure') != true) if jobs + ).property('controller.build.jobs') allowedFailureJobs: (-> - @getPath('controller.content.jobs').filter((job) -> job.get('allow_failure')) - ).property('controller.content') + jobs = @getPath('controller.build.jobs') + jobs.filter((job) -> job.get('allow_failure')) if jobs + ).property('controller.build.jobs') urlBuild: (-> Travis.Urls.build(@getPath('context.repository'), @get('context')) - ).property('controller.content.repository.id', 'controller.content.id') + ).property('controller.build.repository.id', 'controller.build.id') diff --git a/assets/javascripts/vendor/ember.js b/assets/javascripts/vendor/ember.js index e00ef8fb..378bd8bd 100644 --- a/assets/javascripts/vendor/ember.js +++ b/assets/javascripts/vendor/ember.js @@ -1,5 +1,5 @@ -// Version: v0.9.8.1-451-g50ee26d -// Last commit: 50ee26d (2012-06-26 18:06:44 -0700) +// Version: v0.9.8.1-468-g3097ea8 +// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700) (function() { @@ -136,8 +136,8 @@ window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprec })(); -// Version: v0.9.8.1-451-g50ee26d -// Last commit: 50ee26d (2012-06-26 18:06:44 -0700) +// Version: v0.9.8.1-468-g3097ea8 +// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700) (function() { @@ -1414,11 +1414,6 @@ function normalizeTuple(target, path) { return TUPLE_RET; } -/** @private */ -Ember.isGlobal = function(path) { - return IS_GLOBAL.test(path); -}; - /** @private @@ -1482,7 +1477,8 @@ Ember.getPath = function(root, path) { Ember.setPath = function(root, path, value, tolerant) { 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; path = root; root = null; @@ -1536,7 +1532,7 @@ Ember.trySetPath = function(root, path, value) { @returns Boolean */ 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({ init: function() { set(this, 'location', get(this, 'location') || window.location); + set(this, '_initialURL', get(this, 'location').pathname); set(this, 'callbacks', Ember.A()); }, + /** + @private + + Used to give history a starting reference + */ + _initialURL: null, + /** @private @@ -10650,12 +10654,13 @@ Ember.HistoryLocation = Ember.Object.extend({ Uses `history.pushState` to update the url without a page reload. */ setURL: function(path) { - var state = window.history.state; + var state = window.history.state, + initialURL = get(this, '_initialURL'); + 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 - // for the same path. - if (!state || (state && state.path !== path)) { + + if ((initialURL && initialURL !== path) || (state && state.path !== path)) { + set(this, '_initialURL', null); window.history.pushState({ path: path }, null, path); } }, @@ -11524,8 +11529,6 @@ Ember.ControllerMixin.reopen({ if (controller && context) { controller.set('content', context); } view = viewClass.create(); if (controller) { set(view, 'controller', controller); } - - /* console.log(view, view.toString()) */ set(this, outletName, view); return view; @@ -11577,6 +11580,17 @@ var childViewsProperty = Ember.computed(function() { return ret; }).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; 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 */ - controller: 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(), - + controller: controllerProperty, /** A view may contain a layout. A layout is a regular template but supersedes the `template` property during rendering. It is the @@ -12120,20 +12124,22 @@ Ember.View = Ember.Object.extend(Ember.Evented, to be re-rendered. */ _context: Ember.computed(function(key, value) { - var parentView, controller; + var parentView, context; if (arguments.length === 2) { return value; } if (VIEW_PRESERVES_CONTEXT) { - if (controller = get(this, 'controller')) { - return controller; + if (Ember.meta(this).descs.controller !== controllerProperty) { + if (context = get(this, 'controller')) { + return context; + } } parentView = get(this, '_parentView'); - if (parentView) { - return get(parentView, '_context'); + if (parentView && (context = get(parentView, '_context'))) { + return context; } } @@ -14803,6 +14809,12 @@ Ember.State = Ember.Object.extend(Ember.Evented, return !get(this, 'childStates').length; }).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. @@ -15323,7 +15335,6 @@ Ember.StateManager = Ember.State.extend( send: function(event, context) { 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); }, @@ -15472,7 +15483,7 @@ Ember.StateManager = Ember.State.extend( exitStates.shift(); } - currentState.pathsCache[name] = { + currentState.pathsCache[path] = { exitStates: exitStates, enterStates: enterStates, resolveState: resolveState @@ -15490,7 +15501,7 @@ Ember.StateManager = Ember.State.extend( exitStates.unshift(state); } - useContext = context && (!get(state, 'isRoutable') || get(state, 'isDynamic')); + useContext = context && get(state, 'hasContext'); matchedContexts.unshift(useContext ? contexts.pop() : null); } @@ -15502,6 +15513,7 @@ Ember.StateManager = Ember.State.extend( state = getPath(state, 'states.'+initialState); if (!state) { break; } enterStates.push(state); + matchedContexts.push(undefined); } while (enterStates.length > 0) { @@ -15732,9 +15744,10 @@ Ember.Routable = Ember.Mixin.create({ /** @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'); if (routeMatcher) { return routeMatcher.identifiers.length > 0; @@ -16339,7 +16352,7 @@ var get = Ember.get, getPath = Ember.getPath, set = Ember.set; {{/each}} - See Handlebars.helpers.actions for additional usage examples. + See Handlebars.helpers.action for additional usage examples. ## 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); - if (Ember.isGlobal(path)) { + if (Ember.isGlobalPath(path)) { Ember.bind(options.data.keywords, keywordName, path); } else { normalized = normalizePath(this, path, options.data); @@ -20114,8 +20127,8 @@ Ember.$(document).ready( })(); -// Version: v0.9.8.1-451-g50ee26d -// Last commit: 50ee26d (2012-06-26 18:06:44 -0700) +// Version: v0.9.8.1-468-g3097ea8 +// Last commit: 3097ea8 (2012-07-04 14:42:40 -0700) (function() { diff --git a/public/javascripts/application.js b/public/javascripts/application.js index ffd947f9..678d65de 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1 +1 @@ -minispade.register('templates', "(function() {Ember.TEMPLATES['builds/list']=Ember.Handlebars.compile(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n {{#each build in content}}\\n {{#view Travis.Views.BuildsItemView contextBinding=\\\"build\\\"}}\\n \\n \\n \\n \\n \\n \\n \\n {{/view}}\\n {{/each}}\\n \\n
{{t builds.name}}{{t builds.commit}}{{t builds.message}}{{t builds.duration}}{{t builds.finished_at}}
{{number}}{{formatCommit commit}}{{{formatMessage commit.message short=\\\"true\\\"}}}{{formatDuration duration}}{{formatTime finished_at}}
\\n\\n

\\n \\n

\\n\");Ember.TEMPLATES['builds/show']=Ember.Handlebars.compile(\"{{#unless isLoaded}}\\n Loading ...\\n{{else}}\\n
\\n
\\n
\\n
{{t builds.name}}
\\n
{{number}}
\\n
{{t builds.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t builds.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t builds.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t builds.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t builds.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t builds.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t builds.message}}
\\n
{{{formatMessage commit.message}}}
\\n\\n {{#unless isMatrix}}\\n
{{t builds.config}}
\\n
{{formatConfig config}}
\\n {{/unless}}\\n
\\n\\n {{#if isMatrix}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.requiredJobs\\\" required=\\\"true\\\"}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.allowedFailureJobs\\\"}}\\n {{else}}\\n {{view Travis.Views.LogView contextBinding=\\\"jobs.firstObject\\\"}}\\n {{/if}}\\n
\\n{{/unless}}\\n\");Ember.TEMPLATES['jobs/list']=Ember.Handlebars.compile(\"{{#if view.jobs.length}}\\n {{#if view.required}}\\n \\n \\n {{else}}\\n
\\n {{t jobs.build_matrix}}\\n
\\n \\n {{/if}}\\n \\n \\n {{#each configKeys}}\\n \\n {{/each}}\\n \\n \\n \\n {{#each job in view.jobs}}\\n {{#view Travis.Views.JobsItemView contextBinding=\\\"job\\\"}}\\n \\n \\n \\n \\n {{#each configValues}}\\n \\n {{/each}}\\n \\n {{/view}}\\n {{/each}}\\n \\n
\\n {{t jobs.allowed_failures}}\\n \\n
{{this}}
{{number}}{{formatDuration duration}}{{formatTime finished_at}}{{this}}
\\n\\n {{#unless view.required}}\\n
\\n
{{t \\\"jobs.allowed_failures\\\"}}
\\n
\\n

\\n Allowed Failures are items in your build matrix that are allowed to\\n fail without causing the entire build to be shown as failed. This lets you add\\n in experimental and preparatory builds to test against versions or\\n configurations that you are not ready to officially support.\\n

\\n

\\n You can define allowed failures in the build matrix as follows:\\n

\\n
 matrix:\\n  allow_failures:\\n    - rvm: ruby-head 
\\n
\\n
\\n {{/unless}}\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/log']=Ember.Handlebars.compile(\"
{{{formatLog log.body}}}
\\n\\n{{#if sponsor.name}}\\n

\\n {{t builds.messages.sponsored_by}}\\n {{sponsor.name}}\\n

\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/show']=Ember.Handlebars.compile(\"
\\n
\\n
\\n
Job
\\n
{{number}}
\\n
{{t jobs.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t jobs.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t jobs.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t jobs.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t jobs.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t jobs.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t jobs.message}}
\\n
{{formatMessage commit.message}}
\\n
{{t jobs.config}}
\\n
{{formatConfig config}}
\\n
\\n\\n {{view Travis.Views.LogView}}\\n
\\n\\n\");Ember.TEMPLATES['layouts/home']=Ember.Handlebars.compile(\"
\\n {{outlet top}}\\n
\\n\\n
\\n
\\n \\n
\\n\\n \\n\\n
\\n {{outlet left}}\\n
\\n
\\n\\n
\\n {{outlet main}}\\n\\n {{outlet tabs}}\\n\\n
\\n {{outlet tab}}\\n
\\n\\n
\\n {{outlet right}}\\n
\\n
\\n\\n\");Ember.TEMPLATES['layouts/sidebar']=Ember.Handlebars.compile(\"\\n {{t layouts.application.fork_me}}\\n\\n\\n
\\n
 \\n
\\n\\n{{view templateName=\\\"sponsors/decks\\\"}}\\n{{view templateName=\\\"workers/list\\\" id=\\\"workers\\\"}}\\n{{view templateName=\\\"queues/list\\\" id=\\\"queues\\\"}}\\n{{view templateName=\\\"sponsors/links\\\"}}\\n\\n
\\n

{{t layouts.about.alpha}}

\\n

{{{t layouts.about.messages.alpha}}}

\\n
\\n\\n
\\n

{{t layouts.about.join}}

\\n \\n
\\n\");Ember.TEMPLATES['layouts/simple']=Ember.Handlebars.compile(\"
\\n {{outlet top}}\\n
\\n\\n
\\n {{outlet main}}\\n
\\n\\n\");Ember.TEMPLATES['layouts/top']=Ember.Handlebars.compile(\"\\n

Travis

\\n
\\n\\n\\n\");Ember.TEMPLATES['profile/hooks']=Ember.Handlebars.compile(\"{{#if content.length}}\\n \\n{{else}}\\n

Please wait while we sync with GitHub

\\n{{/if}}\\n\\n\");Ember.TEMPLATES['profile/show']=Ember.Handlebars.compile(\"

{{name}}

\\n\\n\\n
\\n
\\n {{t profiles.show.github}}:\\n
\\n
\\n {{login}}\\n
\\n
\\n {{t profiles.show.email}}:\\n
\\n
\\n {{email}}\\n
\\n
\\n {{t profiles.show.token}}:\\n
\\n
\\n {{token}}\\n
\\n
\\n\\n

\\n {{{t profiles.show.messages.notice}}}\\n

\\n\\n

{{t profiles.show.your_locale}}

\\n
\\n \\n \\n
\\n\\n

{{t profiles.show.your_repos}}

\\n

\\n {{{t profiles.show.message.your_repos}}}\\n \\n {{{t profiles.show.message.config}}}\\n \\n

\\n\\n{{outlet hooks}}\\n\");Ember.TEMPLATES['queues/list']=Ember.Handlebars.compile(\"{{#each queue in queues}}\\n

{{t queue}}: {{queue.name}}

\\n \\n{{/each}}\\n\");Ember.TEMPLATES['repositories/list']=Ember.Handlebars.compile(\"