replace getPath/setPath with get/set now that ember supports it
This commit is contained in:
parent
0e10ad2e01
commit
0e52977417
|
@ -44,7 +44,7 @@ Ember.ENV.RAISE_ON_DEPRECATION = true
|
||||||
view.appendTo(@get('rootElement') || 'body')
|
view.appendTo(@get('rootElement') || 'body')
|
||||||
|
|
||||||
connectLayout: (name) ->
|
connectLayout: (name) ->
|
||||||
unless @getPath('layout.name') == name
|
unless @get('layout.name') == name
|
||||||
name = $.camelize(name)
|
name = $.camelize(name)
|
||||||
viewClass = Travis["#{name}Layout"]
|
viewClass = Travis["#{name}Layout"]
|
||||||
@layout = Travis["#{name}Controller"].create(parent: @controller)
|
@layout = Travis["#{name}Controller"].create(parent: @controller)
|
||||||
|
|
|
@ -47,15 +47,15 @@ Travis.RepositoryController = Travis.Controller.extend
|
||||||
@connectTab('job')
|
@connectTab('job')
|
||||||
|
|
||||||
repositoriesByParams: (->
|
repositoriesByParams: (->
|
||||||
Travis.Repository.bySlug("#{@getPath('params.owner')}/#{@getPath('params.name')}")
|
Travis.Repository.bySlug("#{@get('params.owner')}/#{@get('params.name')}")
|
||||||
).property('params.owner', 'params.name')
|
).property('params.owner', 'params.name')
|
||||||
|
|
||||||
buildById: (->
|
buildById: (->
|
||||||
Travis.Build.find(id) if id = @getPath('params.id')
|
Travis.Build.find(id) if id = @get('params.id')
|
||||||
).property('params.id')
|
).property('params.id')
|
||||||
|
|
||||||
jobById: (->
|
jobById: (->
|
||||||
Travis.Job.find(id) if id = @getPath('params.id')
|
Travis.Job.find(id) if id = @get('params.id')
|
||||||
).property('params.id')
|
).property('params.id')
|
||||||
|
|
||||||
connectTab: (tab) ->
|
connectTab: (tab) ->
|
||||||
|
@ -70,7 +70,7 @@ Travis.RepositoryController = Travis.Controller.extend
|
||||||
|
|
||||||
setParams: (params) ->
|
setParams: (params) ->
|
||||||
# TODO if we just @set('params', params) it will update the repositoriesByParams property
|
# TODO if we just @set('params', params) it will update the repositoriesByParams property
|
||||||
@setPath("params.#{key}", params[key]) for key, value of params
|
@set("params.#{key}", params[key]) for key, value of params
|
||||||
|
|
||||||
_bind: (to, from) ->
|
_bind: (to, from) ->
|
||||||
@bindings.push Ember.oneWay(this, to, from)
|
@bindings.push Ember.oneWay(this, to, from)
|
||||||
|
|
|
@ -61,7 +61,7 @@ Travis.reopen
|
||||||
@set('page', if @isLast() then 0 else @get('page') + 1)
|
@set('page', if @isLast() then 0 else @get('page') + 1)
|
||||||
|
|
||||||
pages: (->
|
pages: (->
|
||||||
length = @getPath('content.length')
|
length = @get('content.length')
|
||||||
if length then parseInt(length / @get('perPage') + 1) else 1
|
if length then parseInt(length / @get('perPage') + 1) else 1
|
||||||
).property('length')
|
).property('length')
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@ require 'travis/model'
|
||||||
jobs: DS.hasMany('Travis.Job', key: 'job_ids')
|
jobs: DS.hasMany('Travis.Job', key: 'job_ids')
|
||||||
|
|
||||||
config: (->
|
config: (->
|
||||||
Travis.Helpers.compact(@getPath('data.config'))
|
Travis.Helpers.compact(@get('data.config'))
|
||||||
).property('data.config')
|
).property('data.config')
|
||||||
|
|
||||||
isMatrix: (->
|
isMatrix: (->
|
||||||
@getPath('data.job_ids.length') > 1
|
@get('data.job_ids.length') > 1
|
||||||
).property('data.job_ids.length')
|
).property('data.job_ids.length')
|
||||||
|
|
||||||
requiredJobs: (->
|
requiredJobs: (->
|
||||||
|
|
|
@ -21,11 +21,11 @@ require 'travis/model'
|
||||||
log: DS.belongsTo('Travis.Artifact', key: 'log_id')
|
log: DS.belongsTo('Travis.Artifact', key: 'log_id')
|
||||||
|
|
||||||
config: (->
|
config: (->
|
||||||
Travis.Helpers.compact(@getPath('data.config'))
|
Travis.Helpers.compact(@get('data.config'))
|
||||||
).property('data.config')
|
).property('data.config')
|
||||||
|
|
||||||
sponsor: (->
|
sponsor: (->
|
||||||
@getPath('data.sponsor')
|
@get('data.sponsor')
|
||||||
).property('data.sponsor')
|
).property('data.sponsor')
|
||||||
|
|
||||||
configValues: (->
|
configValues: (->
|
||||||
|
|
|
@ -36,7 +36,7 @@ require 'travis/model'
|
||||||
).property('slug')
|
).property('slug')
|
||||||
|
|
||||||
lastBuildDuration: (->
|
lastBuildDuration: (->
|
||||||
duration = @getPath('data.last_build_duration')
|
duration = @get('data.last_build_duration')
|
||||||
duration = Travis.Helpers.durationFrom(@get('lastBuildStartedAt'), @get('lastBuildFinishedAt')) unless duration
|
duration = Travis.Helpers.durationFrom(@get('lastBuildStartedAt'), @get('lastBuildFinishedAt')) unless duration
|
||||||
duration
|
duration
|
||||||
).property('data.last_build_duration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
|
).property('data.last_build_duration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'travis/model'
|
||||||
link: DS.attr('string')
|
link: DS.attr('string')
|
||||||
|
|
||||||
image: (->
|
image: (->
|
||||||
"images/sponsors/#{@getPath('data.image')}"
|
"images/sponsors/#{@get('data.image')}"
|
||||||
).property('data.image')
|
).property('data.image')
|
||||||
|
|
||||||
Travis.Sponsor.reopenClass
|
Travis.Sponsor.reopenClass
|
||||||
|
|
|
@ -7,7 +7,7 @@ require 'travis/model'
|
||||||
lastSeenAt: DS.attr('string')
|
lastSeenAt: DS.attr('string')
|
||||||
|
|
||||||
payload: (->
|
payload: (->
|
||||||
@getPath('data.payload')
|
@get('data.payload')
|
||||||
).property('data.payload')
|
).property('data.payload')
|
||||||
|
|
||||||
number: (->
|
number: (->
|
||||||
|
@ -30,9 +30,9 @@ require 'travis/model'
|
||||||
).property('repository', 'job_id', 'state')
|
).property('repository', 'job_id', 'state')
|
||||||
|
|
||||||
repository: (->
|
repository: (->
|
||||||
@getPath('payload.repository.slug')
|
@get('payload.repository.slug')
|
||||||
).property('payload.repository.slug')
|
).property('payload.repository.slug')
|
||||||
|
|
||||||
job_id: (->
|
job_id: (->
|
||||||
@getPath('payload.job.id')
|
@get('payload.job.id')
|
||||||
).property('payload.job.id')
|
).property('payload.job.id')
|
||||||
|
|
|
@ -30,8 +30,8 @@ Travis.Store = DS.Store.extend
|
||||||
# _updateAssociations: (type, name, data) ->
|
# _updateAssociations: (type, name, data) ->
|
||||||
# Em.get(type, 'associationsByName').forEach (key, meta) =>
|
# Em.get(type, 'associationsByName').forEach (key, meta) =>
|
||||||
# if meta.kind == 'belongsTo' && id = data["#{key}_id"]
|
# if meta.kind == 'belongsTo' && id = data["#{key}_id"]
|
||||||
# parent = type.find(data.id).getPath("#{key}.data")
|
# parent = type.find(data.id).get("#{key}.data")
|
||||||
# ids = parent.getPath("data.#{name}_ids")
|
# ids = parent.get("data.#{name}_ids")
|
||||||
# parent.set("data.#{name}_ids", ids.concat(data.id)) # if ids && !(data.id in ids)
|
# parent.set("data.#{name}_ids", ids.concat(data.id)) # if ids && !(data.id in ids)
|
||||||
|
|
||||||
# _updateAssociations: (type, name, data) ->
|
# _updateAssociations: (type, name, data) ->
|
||||||
|
|
|
@ -9,15 +9,15 @@
|
||||||
commitBinding: 'build.commit'
|
commitBinding: 'build.commit'
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('build.result'))
|
Travis.Helpers.colorForResult(@get('build.result'))
|
||||||
).property('build.result')
|
).property('build.result')
|
||||||
|
|
||||||
urlBuild: (->
|
urlBuild: (->
|
||||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||||
).property('repository.slug', 'build.id')
|
).property('repository.slug', 'build.id')
|
||||||
|
|
||||||
urlGithubCommit: (->
|
urlGithubCommit: (->
|
||||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||||
).property('repository.slug', 'commit.sha')
|
).property('repository.slug', 'commit.sha')
|
||||||
|
|
||||||
BuildView: Em.View.extend
|
BuildView: Em.View.extend
|
||||||
|
@ -28,22 +28,22 @@
|
||||||
commitBinding: 'build.commit'
|
commitBinding: 'build.commit'
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('build.result'))
|
Travis.Helpers.colorForResult(@get('build.result'))
|
||||||
).property('build.result')
|
).property('build.result')
|
||||||
|
|
||||||
urlBuild: (->
|
urlBuild: (->
|
||||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||||
).property('repository.slug', 'build.id')
|
).property('repository.slug', 'build.id')
|
||||||
|
|
||||||
urlGithubCommit: (->
|
urlGithubCommit: (->
|
||||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||||
).property('repository.slug', 'commit.sha')
|
).property('repository.slug', 'commit.sha')
|
||||||
|
|
||||||
urlAuthor: (->
|
urlAuthor: (->
|
||||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
Travis.Urls.email(@get('commit.authorEmail'))
|
||||||
).property('commit.authorEmail')
|
).property('commit.authorEmail')
|
||||||
|
|
||||||
urlCommitter: (->
|
urlCommitter: (->
|
||||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
Travis.Urls.email(@get('commit.committerEmail'))
|
||||||
).property('commit.committerEmail')
|
).property('commit.committerEmail')
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
jobBinding: 'context'
|
jobBinding: 'context'
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
Travis.Helpers.colorForResult(@get('job.result'))
|
||||||
).property('job.result')
|
).property('job.result')
|
||||||
|
|
||||||
urlJob: (->
|
urlJob: (->
|
||||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||||
).property('repository.slug', 'job.id')
|
).property('repository.slug', 'job.id')
|
||||||
|
|
||||||
JobView: Em.View.extend
|
JobView: Em.View.extend
|
||||||
|
@ -26,23 +26,23 @@
|
||||||
commitBinding: 'job.commit'
|
commitBinding: 'job.commit'
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
Travis.Helpers.colorForResult(@get('job.result'))
|
||||||
).property('job.result')
|
).property('job.result')
|
||||||
|
|
||||||
urlJob: (->
|
urlJob: (->
|
||||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||||
).property('repository.slug', 'job.id')
|
).property('repository.slug', 'job.id')
|
||||||
|
|
||||||
urlGithubCommit: (->
|
urlGithubCommit: (->
|
||||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
Travis.Urls.githubCommit(@get('repository.slug'), @get('commit.sha'))
|
||||||
).property('repository.slug', 'commit.sha')
|
).property('repository.slug', 'commit.sha')
|
||||||
|
|
||||||
urlAuthor: (->
|
urlAuthor: (->
|
||||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
Travis.Urls.email(@get('commit.authorEmail'))
|
||||||
).property('commit.authorEmail')
|
).property('commit.authorEmail')
|
||||||
|
|
||||||
urlCommitter: (->
|
urlCommitter: (->
|
||||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
Travis.Urls.email(@get('commit.committerEmail'))
|
||||||
).property('commit.committerEmail')
|
).property('commit.committerEmail')
|
||||||
|
|
||||||
LogView: Em.View.extend
|
LogView: Em.View.extend
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
userBinding: 'controller.user'
|
userBinding: 'controller.user'
|
||||||
|
|
||||||
gravatarUrl: (->
|
gravatarUrl: (->
|
||||||
"http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=48&d=mm"
|
"http://www.gravatar.com/avatar/#{@get('user.gravatar')}?s=48&d=mm"
|
||||||
).property('user.gravatar')
|
).property('user.gravatar')
|
||||||
|
|
||||||
HooksView: Em.View.extend
|
HooksView: Em.View.extend
|
||||||
templateName: 'profile/hooks'
|
templateName: 'profile/hooks'
|
||||||
|
|
||||||
urlGithubAdmin: (->
|
urlGithubAdmin: (->
|
||||||
Travis.Urls.githubAdmin(@getPath('hook.slug'))
|
Travis.Urls.githubAdmin(@get('hook.slug'))
|
||||||
).property('hook.slug')
|
).property('hook.slug')
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
classOwned: (->
|
classOwned: (->
|
||||||
classes = []
|
classes = []
|
||||||
classes.push('active') if @get('tab') == 'owned'
|
classes.push('active') if @get('tab') == 'owned'
|
||||||
classes.push('display') if Em.getPath('Travis.currentUser')
|
classes.push('display') if Em.get('Travis.currentUser')
|
||||||
classes.join(' ')
|
classes.join(' ')
|
||||||
).property('tab', 'Travis.currentUser')
|
).property('tab', 'Travis.currentUser')
|
||||||
|
|
||||||
|
@ -26,19 +26,19 @@
|
||||||
).property('color', 'selected')
|
).property('color', 'selected')
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForResult(@getPath('repository.lastBuildResult'))
|
Travis.Helpers.colorForResult(@get('repository.lastBuildResult'))
|
||||||
).property('repository.lastBuildResult')
|
).property('repository.lastBuildResult')
|
||||||
|
|
||||||
selected: (->
|
selected: (->
|
||||||
'selected' if @getPath('repository.selected')
|
'selected' if @get('repository.selected')
|
||||||
).property('repository.selected')
|
).property('repository.selected')
|
||||||
|
|
||||||
urlRepository: (->
|
urlRepository: (->
|
||||||
Travis.Urls.repository(@getPath('repository.slug'))
|
Travis.Urls.repository(@get('repository.slug'))
|
||||||
).property('repository.slug')
|
).property('repository.slug')
|
||||||
|
|
||||||
urlLastBuild: (->
|
urlLastBuild: (->
|
||||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('repository.lastBuildId'))
|
Travis.Urls.build(@get('repository.slug'), @get('repository.lastBuildId'))
|
||||||
).property('repository.slug', 'repository.lastBuildId')
|
).property('repository.slug', 'repository.lastBuildId')
|
||||||
|
|
||||||
RepositoryView: Em.View.extend
|
RepositoryView: Em.View.extend
|
||||||
|
@ -47,17 +47,17 @@
|
||||||
repositoryBinding: 'controller.repository'
|
repositoryBinding: 'controller.repository'
|
||||||
|
|
||||||
class: (->
|
class: (->
|
||||||
'loading' unless @getPath('repository.isLoaded')
|
'loading' unless @get('repository.isLoaded')
|
||||||
).property('repository.isLoaded')
|
).property('repository.isLoaded')
|
||||||
|
|
||||||
urlGithub: (->
|
urlGithub: (->
|
||||||
Travis.Urls.githubRepository(@getPath('repository.slug'))
|
Travis.Urls.githubRepository(@get('repository.slug'))
|
||||||
).property('repository.slug'),
|
).property('repository.slug'),
|
||||||
|
|
||||||
urlGithubWatchers: (->
|
urlGithubWatchers: (->
|
||||||
Travis.Urls.githubWatchers(@getPath('repository.slug'))
|
Travis.Urls.githubWatchers(@get('repository.slug'))
|
||||||
).property('repository.slug'),
|
).property('repository.slug'),
|
||||||
|
|
||||||
urlGithubNetwork: (->
|
urlGithubNetwork: (->
|
||||||
Travis.Urls.githubNetwork(@getPath('repository.slug'))
|
Travis.Urls.githubNetwork(@get('repository.slug'))
|
||||||
).property('repository.slug'),
|
).property('repository.slug'),
|
||||||
|
|
|
@ -40,31 +40,31 @@
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
urlRepository: (->
|
urlRepository: (->
|
||||||
Travis.Urls.repository(@getPath('repository.slug'))
|
Travis.Urls.repository(@get('repository.slug'))
|
||||||
).property('repository.slug')
|
).property('repository.slug')
|
||||||
|
|
||||||
urlBuilds: (->
|
urlBuilds: (->
|
||||||
Travis.Urls.builds(@getPath('repository.slug'))
|
Travis.Urls.builds(@get('repository.slug'))
|
||||||
).property('repository.slug')
|
).property('repository.slug')
|
||||||
|
|
||||||
urlPullRequests: (->
|
urlPullRequests: (->
|
||||||
Travis.Urls.pullRequests(@getPath('repository.slug'))
|
Travis.Urls.pullRequests(@get('repository.slug'))
|
||||||
).property('repository.slug')
|
).property('repository.slug')
|
||||||
|
|
||||||
urlBranches: (->
|
urlBranches: (->
|
||||||
Travis.Urls.branches(@getPath('repository.slug'))
|
Travis.Urls.branches(@get('repository.slug'))
|
||||||
).property('repository.slug')
|
).property('repository.slug')
|
||||||
|
|
||||||
urlBuild: (->
|
urlBuild: (->
|
||||||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
|
||||||
).property('repository.slug', 'build.id')
|
).property('repository.slug', 'build.id')
|
||||||
|
|
||||||
urlJob: (->
|
urlJob: (->
|
||||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
|
||||||
).property('repository.slug', 'job.id')
|
).property('repository.slug', 'job.id')
|
||||||
|
|
||||||
urlStatusImage: (->
|
urlStatusImage: (->
|
||||||
Travis.Urls.statusImage(@getPath('repository.slug'), @getPath('branch.commit.branch'))
|
Travis.Urls.statusImage(@get('repository.slug'), @get('branch.commit.branch'))
|
||||||
).property('repository.slug', 'branch')
|
).property('repository.slug', 'branch')
|
||||||
|
|
||||||
markdownStatusImage: (->
|
markdownStatusImage: (->
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
# ).property('Travis.app.currentUser')
|
# ).property('Travis.app.currentUser')
|
||||||
|
|
||||||
gravatarUrl: (->
|
gravatarUrl: (->
|
||||||
"http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=24&d=mm"
|
"http://www.gravatar.com/avatar/#{@get('user.gravatar')}?s=24&d=mm"
|
||||||
).property('user.gravatar')
|
).property('user.gravatar')
|
||||||
|
|
||||||
# hrm. how to parametrize bindAttr?
|
# hrm. how to parametrize bindAttr?
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
classStats: (->
|
classStats: (->
|
||||||
'active' if @getPath('tab') == 'stats'
|
'active' if @get('tab') == 'stats'
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
classProfile: (->
|
classProfile: (->
|
||||||
if @getPath('tab') == 'profile' then 'profile active' else 'profile'
|
if @get('tab') == 'profile' then 'profile active' else 'profile'
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
showProfile: ->
|
showProfile: ->
|
||||||
|
|
|
@ -11,7 +11,7 @@ var BoundHelperView = Ember.View.extend(Ember._Metamorph, {
|
||||||
value: Ember.K,
|
value: Ember.K,
|
||||||
|
|
||||||
valueForRender: function() {
|
valueForRender: function() {
|
||||||
var value = this.value(Ember.getPath(this.context, this.property), this.options);
|
var value = this.value(Ember.get(this.context, this.property), this.options);
|
||||||
if (this.options.escaped) { value = Handlebars.Utils.escapeExpression(value); }
|
if (this.options.escaped) { value = Handlebars.Utils.escapeExpression(value); }
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
window.onTrue = (object, path, callback) ->
|
window.onTrue = (object, path, callback) ->
|
||||||
if object.getPath(path)
|
if object.get(path)
|
||||||
callback()
|
callback()
|
||||||
else
|
else
|
||||||
observer = ->
|
observer = ->
|
||||||
|
|
51
assets/javascripts/vendor/ember-data.js
vendored
51
assets/javascripts/vendor/ember-data.js
vendored
|
@ -102,7 +102,7 @@ DS.AdapterPopulatedRecordArray = DS.RecordArray.extend({
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.guidFor;
|
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor;
|
||||||
|
|
||||||
var Set = function() {
|
var Set = function() {
|
||||||
this.hash = {};
|
this.hash = {};
|
||||||
|
@ -229,7 +229,7 @@ DS.ManyArrayStateManager = Ember.StateManager.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.dirty = new Set();
|
this.dirty = new Set();
|
||||||
this.counter = getPath(this, 'manyArray.length');
|
this.counter = get(this, 'manyArray.length');
|
||||||
},
|
},
|
||||||
|
|
||||||
decrement: function(count) {
|
decrement: function(count) {
|
||||||
|
@ -248,7 +248,7 @@ DS.ManyArrayStateManager = Ember.StateManager.extend({
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, setPath = Ember.setPath;
|
var get = Ember.get, set = Ember.set, set = Ember.set;
|
||||||
|
|
||||||
DS.ManyArray = DS.RecordArray.extend({
|
DS.ManyArray = DS.RecordArray.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
|
@ -260,11 +260,11 @@ DS.ManyArray = DS.RecordArray.extend({
|
||||||
parentRecord: null,
|
parentRecord: null,
|
||||||
|
|
||||||
isDirty: Ember.computed(function() {
|
isDirty: Ember.computed(function() {
|
||||||
return getPath(this, 'stateManager.currentState.isDirty');
|
return get(this, 'stateManager.currentState.isDirty');
|
||||||
}).property('stateManager.currentState').cacheable(),
|
}).property('stateManager.currentState').cacheable(),
|
||||||
|
|
||||||
isLoaded: Ember.computed(function() {
|
isLoaded: Ember.computed(function() {
|
||||||
return getPath(this, 'stateManager.currentState.isLoaded');
|
return get(this, 'stateManager.currentState.isLoaded');
|
||||||
}).property('stateManager.currentState').cacheable(),
|
}).property('stateManager.currentState').cacheable(),
|
||||||
|
|
||||||
send: function(event, context) {
|
send: function(event, context) {
|
||||||
|
@ -381,7 +381,7 @@ DS.ManyArray = DS.RecordArray.extend({
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, fmt = Ember.String.fmt,
|
var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt,
|
||||||
removeObject = Ember.EnumerableUtils.removeObject;
|
removeObject = Ember.EnumerableUtils.removeObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -513,7 +513,7 @@ DS.Transaction = Ember.Object.extend({
|
||||||
Ember.assert("Once a record has changed, you cannot move it into a different transaction", !get(record, 'isDirty'));
|
Ember.assert("Once a record has changed, you cannot move it into a different transaction", !get(record, 'isDirty'));
|
||||||
|
|
||||||
var recordTransaction = get(record, 'transaction'),
|
var recordTransaction = get(record, 'transaction'),
|
||||||
defaultTransaction = getPath(this, 'store.defaultTransaction');
|
defaultTransaction = get(this, 'store.defaultTransaction');
|
||||||
|
|
||||||
Ember.assert("Models cannot belong to more than one transaction at a time.", recordTransaction === defaultTransaction);
|
Ember.assert("Models cannot belong to more than one transaction at a time.", recordTransaction === defaultTransaction);
|
||||||
|
|
||||||
|
@ -625,7 +625,7 @@ DS.Transaction = Ember.Object.extend({
|
||||||
@param {DS.Model} record
|
@param {DS.Model} record
|
||||||
*/
|
*/
|
||||||
remove: function(record) {
|
remove: function(record) {
|
||||||
var defaultTransaction = getPath(this, 'store.defaultTransaction');
|
var defaultTransaction = get(this, 'store.defaultTransaction');
|
||||||
defaultTransaction.adoptRecord(record);
|
defaultTransaction.adoptRecord(record);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -879,7 +879,7 @@ DS.Transaction = Ember.Object.extend({
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
/*globals Ember*/
|
/*globals Ember*/
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, fmt = Ember.String.fmt;
|
var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
||||||
|
|
||||||
var DATA_PROXY = {
|
var DATA_PROXY = {
|
||||||
get: function(name) {
|
get: function(name) {
|
||||||
|
@ -1012,7 +1012,7 @@ DS.Store = Ember.Object.extend({
|
||||||
_adapter: Ember.computed(function() {
|
_adapter: Ember.computed(function() {
|
||||||
var adapter = get(this, 'adapter');
|
var adapter = get(this, 'adapter');
|
||||||
if (typeof adapter === 'string') {
|
if (typeof adapter === 'string') {
|
||||||
return getPath(this, adapter, false) || getPath(window, adapter);
|
return get(this, adapter, false) || get(window, adapter);
|
||||||
}
|
}
|
||||||
return adapter;
|
return adapter;
|
||||||
}).property('adapter').cacheable(),
|
}).property('adapter').cacheable(),
|
||||||
|
@ -1834,7 +1834,7 @@ DS.Store = Ember.Object.extend({
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.guidFor;
|
var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This file encapsulates the various states that a record can transition
|
This file encapsulates the various states that a record can transition
|
||||||
|
@ -1863,7 +1863,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.g
|
||||||
string. You can determine a record's current state by getting its manager's
|
string. You can determine a record's current state by getting its manager's
|
||||||
current state path:
|
current state path:
|
||||||
|
|
||||||
record.getPath('stateManager.currentState.path');
|
record.get('stateManager.currentState.path');
|
||||||
//=> "created.uncommitted"
|
//=> "created.uncommitted"
|
||||||
|
|
||||||
The `DS.Model` states are themselves stateless. What we mean is that,
|
The `DS.Model` states are themselves stateless. What we mean is that,
|
||||||
|
@ -1949,7 +1949,7 @@ var get = Ember.get, set = Ember.set, getPath = Ember.getPath, guidFor = Ember.g
|
||||||
state in a more user-friendly way than examining its state path. For example,
|
state in a more user-friendly way than examining its state path. For example,
|
||||||
instead of doing this:
|
instead of doing this:
|
||||||
|
|
||||||
var statePath = record.getPath('stateManager.currentState.path');
|
var statePath = record.get('stateManager.currentState.path');
|
||||||
if (statePath === 'created.inFlight') {
|
if (statePath === 'created.inFlight') {
|
||||||
doSomething();
|
doSomething();
|
||||||
}
|
}
|
||||||
|
@ -2836,10 +2836,10 @@ DataProxy.prototype = {
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath, none = Ember.none;
|
var get = Ember.get, set = Ember.set, none = Ember.none;
|
||||||
|
|
||||||
var retrieveFromCurrentState = Ember.computed(function(key) {
|
var retrieveFromCurrentState = Ember.computed(function(key) {
|
||||||
return get(getPath(this, 'stateManager.currentState'), key);
|
return get(get(this, 'stateManager.currentState'), key);
|
||||||
}).property('stateManager.currentState').cacheable();
|
}).property('stateManager.currentState').cacheable();
|
||||||
|
|
||||||
DS.Model = Ember.Object.extend(Ember.Evented, {
|
DS.Model = Ember.Object.extend(Ember.Evented, {
|
||||||
|
@ -3194,7 +3194,7 @@ DS.Model.reopenClass({
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, getPath = Ember.getPath;
|
var get = Ember.get;
|
||||||
DS.Model.reopenClass({
|
DS.Model.reopenClass({
|
||||||
attributes: Ember.computed(function() {
|
attributes: Ember.computed(function() {
|
||||||
var map = Ember.Map.create();
|
var map = Ember.Map.create();
|
||||||
|
@ -3365,7 +3365,7 @@ DS.attr.transforms = {
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath,
|
var get = Ember.get, set = Ember.set,
|
||||||
none = Ember.none;
|
none = Ember.none;
|
||||||
|
|
||||||
var embeddedFindRecord = function(store, type, data, key, one) {
|
var embeddedFindRecord = function(store, type, data, key, one) {
|
||||||
|
@ -3390,7 +3390,7 @@ var hasAssociation = function(type, options, one) {
|
||||||
store = get(this, 'store');
|
store = get(this, 'store');
|
||||||
|
|
||||||
if (typeof type === 'string') {
|
if (typeof type === 'string') {
|
||||||
type = getPath(this, type, false) || getPath(window, type);
|
type = get(this, type, false) || get(window, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.length === 2) {
|
if (arguments.length === 2) {
|
||||||
|
@ -3428,7 +3428,7 @@ DS.belongsTo = function(type, options) {
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
var get = Ember.get, set = Ember.set;
|
||||||
var embeddedFindRecord = function(store, type, data, key) {
|
var embeddedFindRecord = function(store, type, data, key) {
|
||||||
var association = get(data, key);
|
var association = get(data, key);
|
||||||
return association ? store.loadMany(type, association).ids : [];
|
return association ? store.loadMany(type, association).ids : [];
|
||||||
|
@ -3452,7 +3452,7 @@ var hasAssociation = function(type, options) {
|
||||||
ids, id, association;
|
ids, id, association;
|
||||||
|
|
||||||
if (typeof type === 'string') {
|
if (typeof type === 'string') {
|
||||||
type = getPath(this, type, false) || getPath(window, type);
|
type = get(this, type, false) || get(window, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
key = options.key || get(this, 'namingConvention').keyToJSONKey(key);
|
key = options.key || get(this, 'namingConvention').keyToJSONKey(key);
|
||||||
|
@ -3474,7 +3474,7 @@ DS.hasMany = function(type, options) {
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var get = Ember.get, getPath = Ember.getPath;
|
var get = Ember.get;
|
||||||
|
|
||||||
DS.Model.reopenClass({
|
DS.Model.reopenClass({
|
||||||
typeForAssociation: function(name) {
|
typeForAssociation: function(name) {
|
||||||
|
@ -3491,7 +3491,7 @@ DS.Model.reopenClass({
|
||||||
typeList = map.get(type);
|
typeList = map.get(type);
|
||||||
|
|
||||||
if (typeof type === 'string') {
|
if (typeof type === 'string') {
|
||||||
type = getPath(this, type, false) || getPath(window, type);
|
type = get(this, type, false) || get(window, type);
|
||||||
meta.type = type;
|
meta.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3516,7 +3516,7 @@ DS.Model.reopenClass({
|
||||||
type = meta.type;
|
type = meta.type;
|
||||||
|
|
||||||
if (typeof type === 'string') {
|
if (typeof type === 'string') {
|
||||||
type = getPath(this, type, false) || getPath(window, type);
|
type = get(this, type, false) || get(window, type);
|
||||||
meta.type = type;
|
meta.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3837,7 +3837,7 @@ DS.fixtureAdapter = DS.FixtureAdapter.create();
|
||||||
(function() {
|
(function() {
|
||||||
/*global jQuery*/
|
/*global jQuery*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set, getPath = Ember.getPath;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
|
||||||
DS.RESTAdapter = DS.Adapter.extend({
|
DS.RESTAdapter = DS.Adapter.extend({
|
||||||
bulkCommit: false,
|
bulkCommit: false,
|
||||||
|
@ -4007,7 +4007,6 @@ DS.RESTAdapter = DS.Adapter.extend({
|
||||||
data: { ids: ids },
|
data: { ids: ids },
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
this.sideload(store, type, json, plural);
|
this.sideload(store, type, json, plural);
|
||||||
console.log(type, json, plural)
|
|
||||||
store.loadMany(type, json[plural]);
|
store.loadMany(type, json[plural]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -4087,7 +4086,7 @@ DS.RESTAdapter = DS.Adapter.extend({
|
||||||
sideloadedType = get(mappings, prop);
|
sideloadedType = get(mappings, prop);
|
||||||
|
|
||||||
if (typeof sideloadedType === 'string') {
|
if (typeof sideloadedType === 'string') {
|
||||||
sideloadedType = getPath(window, sideloadedType);
|
sideloadedType = get(window, sideloadedType);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ember.assert("Your server returned a hash with the key " + prop + " but you have no mapping for it", !!sideloadedType);
|
Ember.assert("Your server returned a hash with the key " + prop + " but you have no mapping for it", !!sideloadedType);
|
||||||
|
|
1212
assets/javascripts/vendor/ember.js
vendored
1212
assets/javascripts/vendor/ember.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user