joosy 1.2.0.alpha.14 → 1.2.0.alpha.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gruntfile.coffee +42 -18
- data/README.md +16 -12
- data/bower.json +1 -1
- data/lib/extensions/form.js +592 -0
- data/lib/extensions/preloaders.js +193 -0
- data/lib/extensions/resources.js +667 -0
- data/lib/joosy.js +1141 -2680
- data/lib/joosy.rb +0 -5
- data/package.json +1 -1
- data/spec/helpers/helper.coffee +1 -1
- data/spec/joosy/core/joosy_spec.coffee +1 -28
- data/spec/joosy/core/modules/renderer_spec.coffee +0 -95
- data/spec/joosy/{core → extensions/form}/form_spec.coffee +2 -2
- data/spec/joosy/{core → extensions/form}/helpers/forms_spec.coffee +1 -1
- data/spec/joosy/{preloaders → extensions/preloaders}/caching_spec.coffee +0 -0
- data/spec/joosy/{preloaders → extensions/preloaders}/inline_spec.coffee +0 -0
- data/spec/joosy/{core/resource/generic_spec.coffee → extensions/resources/base_spec.coffee} +19 -20
- data/spec/joosy/{core/resource → extensions/resources}/collection_spec.coffee +4 -4
- data/spec/joosy/{core/resource → extensions/resources}/rest_collection_spec.coffee +4 -4
- data/spec/joosy/{core/resource → extensions/resources}/rest_spec.coffee +6 -7
- data/src/joosy.coffee +1 -2
- data/src/joosy/core/helpers/view.coffee +0 -8
- data/src/joosy/core/joosy.coffee +5 -44
- data/src/joosy/core/modules/renderer.coffee +10 -29
- data/src/joosy/core/{resource → resources}/watcher.coffee +2 -1
- data/src/joosy/{core → extensions/form}/form.coffee +3 -9
- data/src/joosy/{core → extensions/form}/helpers/form.coffee +2 -2
- data/src/joosy/extensions/form/index.coffee +1 -0
- data/src/joosy/{preloaders → extensions/preloaders}/caching.coffee +0 -0
- data/src/joosy/extensions/preloaders/index.coffee +1 -0
- data/src/joosy/{preloaders → extensions/preloaders}/inline.coffee +0 -0
- data/src/joosy/{core/resource/generic.coffee → extensions/resources/base.coffee} +21 -21
- data/src/joosy/{core/resource → extensions/resources}/collection.coffee +11 -11
- data/src/joosy/extensions/resources/index.coffee +1 -0
- data/src/joosy/{core/resource → extensions/resources}/rest.coffee +15 -12
- data/src/joosy/{core/resource → extensions/resources}/rest_collection.coffee +4 -2
- data/src/joosy/generators/base.coffee +1 -1
- metadata +25 -20
- data/src/joosy/core/preloader.coffee +0 -13
@@ -89,9 +89,6 @@ Joosy.Modules.Renderer =
|
|
89
89
|
# be passed as a context, not as a argument
|
90
90
|
assignContext = false
|
91
91
|
|
92
|
-
isResource = Joosy.Module.hasAncestor locals.constructor, Joosy.Resource.Generic
|
93
|
-
isCollection = Joosy.Module.hasAncestor locals.constructor, Joosy.Resource.Collection
|
94
|
-
|
95
92
|
if Object.isString template
|
96
93
|
if @__renderSection?
|
97
94
|
template = Joosy.Application.templater.resolveTemplate @__renderSection(), template, this
|
@@ -102,8 +99,8 @@ Joosy.Modules.Renderer =
|
|
102
99
|
else if !Object.isFunction template
|
103
100
|
throw new Error "#{Joosy.Module.__className @}> template (maybe @view) does not look like a string or lambda"
|
104
101
|
|
105
|
-
if !Object.isObject(locals) && Object.extended().constructor != locals.constructor
|
106
|
-
throw new Error "#{Joosy.Module.__className @}> locals (maybe @data?) not
|
102
|
+
if !Object.isObject(locals) && Object.extended().constructor != locals.constructor
|
103
|
+
throw new Error "#{Joosy.Module.__className @}> locals (maybe @data?) is not a hash"
|
107
104
|
|
108
105
|
renderers =
|
109
106
|
render: (template, locals={}) =>
|
@@ -116,11 +113,7 @@ Joosy.Modules.Renderer =
|
|
116
113
|
context = =>
|
117
114
|
data = {}
|
118
115
|
|
119
|
-
|
120
|
-
Joosy.Module.merge data, stack.locals.data
|
121
|
-
else
|
122
|
-
Joosy.Module.merge data, stack.locals
|
123
|
-
|
116
|
+
Joosy.Module.merge data, stack.locals
|
124
117
|
Joosy.Module.merge data, @__instantiateHelpers(), false
|
125
118
|
Joosy.Module.merge data, renderers
|
126
119
|
data
|
@@ -150,25 +143,13 @@ Joosy.Modules.Renderer =
|
|
150
143
|
|
151
144
|
morph.__bindings = []
|
152
145
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
binding = [locals, update]
|
161
|
-
locals.bind 'changed', update
|
162
|
-
stack.metamorphBindings.push binding
|
163
|
-
morph.__bindings.push binding
|
164
|
-
else
|
165
|
-
for key, object of locals
|
166
|
-
if locals.hasOwnProperty key
|
167
|
-
if object?.bind? && object?.unbind?
|
168
|
-
binding = [object, update]
|
169
|
-
object.bind 'changed', update
|
170
|
-
stack.metamorphBindings.push binding
|
171
|
-
morph.__bindings.push binding
|
146
|
+
for key, object of locals
|
147
|
+
if locals.hasOwnProperty key
|
148
|
+
if object?.bind? && object?.unbind?
|
149
|
+
binding = [object, update]
|
150
|
+
object.bind 'changed', update
|
151
|
+
stack.metamorphBindings.push binding
|
152
|
+
morph.__bindings.push binding
|
172
153
|
|
173
154
|
morph.outerHTML()
|
174
155
|
else
|
@@ -1,9 +1,3 @@
|
|
1
|
-
#= require joosy/core/joosy
|
2
|
-
#= require joosy/core/modules/module
|
3
|
-
#= require joosy/core/modules/log
|
4
|
-
#= require joosy/core/modules/events
|
5
|
-
#= require joosy/core/modules/container
|
6
|
-
|
7
1
|
#
|
8
2
|
# AJAXifies form including file uploads and stuff. Built on top of jQuery.Form.
|
9
3
|
#
|
@@ -94,7 +88,7 @@ class Joosy.Form extends Joosy.Module
|
|
94
88
|
# by returning false from your own error callback. Both of callbacks will run if
|
95
89
|
# you return true.
|
96
90
|
#
|
97
|
-
# @option options [Joosy.
|
91
|
+
# @option options [Joosy.Resources.Base] resource The resource to fill the form with
|
98
92
|
# @option options [String] resourceName The string to use as a resource name prefix for fields to match invalidation
|
99
93
|
# @option options [String] action Action URL for the form
|
100
94
|
# @option options [String] method HTTP method, for example PUT, that will passed in _method param
|
@@ -196,10 +190,10 @@ class Joosy.Form extends Joosy.Module
|
|
196
190
|
input.filter("[value='#{val}']").attr 'checked', 'checked'
|
197
191
|
else
|
198
192
|
input.val val
|
199
|
-
if val instanceof Joosy.
|
193
|
+
if val instanceof Joosy.Resources.RESTCollection
|
200
194
|
for entity, i in val.data
|
201
195
|
filler entity.data, @concatFieldName(scope, "[#{property}_attributes][#{i}]")
|
202
|
-
else if val instanceof Joosy.
|
196
|
+
else if val instanceof Joosy.Resources.REST
|
203
197
|
filler val.data, @concatFieldName(scope, "[#{property}_attributes][0]")
|
204
198
|
else if Object.isObject(val) || Object.isArray(val)
|
205
199
|
filler val, key
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#= require
|
1
|
+
#= require ../form
|
2
2
|
|
3
3
|
#
|
4
4
|
# Form helper
|
@@ -6,7 +6,7 @@
|
|
6
6
|
Joosy.helpers 'Application', ->
|
7
7
|
|
8
8
|
description = (resource, method, extendIds, idSuffix) ->
|
9
|
-
if Joosy.Module.hasAncestor resource.constructor, Joosy.
|
9
|
+
if Joosy.Module.hasAncestor resource.constructor, Joosy.Resources.Base
|
10
10
|
id = resource.id()
|
11
11
|
resource = resource.__entityName
|
12
12
|
|
@@ -0,0 +1 @@
|
|
1
|
+
#= require_tree ./
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
#= require_tree ./
|
File without changes
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Basic data wrapper with triggering and entity name binding
|
3
3
|
#
|
4
4
|
# @example Basic usage
|
5
|
-
# class R extends Joosy.
|
5
|
+
# class R extends Joosy.Resources.Base
|
6
6
|
# @entity 'r'
|
7
7
|
#
|
8
8
|
# @beforeLoad (data) ->
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# @include Joosy.Modules.Log
|
19
19
|
# @include Joosy.Modules.Events
|
20
20
|
#
|
21
|
-
class Joosy.
|
21
|
+
class Joosy.Resources.Base extends Joosy.Module
|
22
22
|
@include Joosy.Modules.Log
|
23
23
|
@include Joosy.Modules.Events
|
24
24
|
|
@@ -34,7 +34,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
34
34
|
# ensure correct garbage collection.
|
35
35
|
#
|
36
36
|
@resetIdentity: ->
|
37
|
-
Joosy.
|
37
|
+
Joosy.Resources.Base.identity = {}
|
38
38
|
|
39
39
|
#
|
40
40
|
# Allows to modify data before it gets stored.
|
@@ -71,7 +71,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
71
71
|
#
|
72
72
|
class Clone extends this
|
73
73
|
|
74
|
-
if entity instanceof Joosy.
|
74
|
+
if entity instanceof Joosy.Resources.Base
|
75
75
|
Clone.__source = entity.memberPath()
|
76
76
|
Clone.__source += '/' + @::__entityName.pluralize() if @::__entityName
|
77
77
|
else
|
@@ -91,18 +91,18 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
91
91
|
# Sets the collection to use
|
92
92
|
#
|
93
93
|
# @note By default will try to seek for `EntityNamesCollection`.
|
94
|
-
# Will fallback to {Joosy.
|
94
|
+
# Will fallback to {Joosy.Resources.Collection}
|
95
95
|
#
|
96
96
|
# @param [Class] klass Class to assign as collection
|
97
97
|
#
|
98
98
|
@collection: (klass) -> @::__collection = -> klass
|
99
99
|
|
100
100
|
#
|
101
|
-
# Implements {Joosy.
|
101
|
+
# Implements {Joosy.Resources.Base.collection} default behavior.
|
102
102
|
#
|
103
103
|
__collection: ->
|
104
104
|
named = @__entityName.camelize().pluralize() + 'Collection'
|
105
|
-
if window[named] then window[named] else Joosy.
|
105
|
+
if window[named] then window[named] else Joosy.Resources.Collection
|
106
106
|
|
107
107
|
#
|
108
108
|
# Dynamically creates collection of inline resources.
|
@@ -111,9 +111,9 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
111
111
|
# to handle inline changes with triggers and all that resources stuff
|
112
112
|
#
|
113
113
|
# @example Basic usage
|
114
|
-
# class Zombie extends Joosy.
|
114
|
+
# class Zombie extends Joosy.Resources.Base
|
115
115
|
# @entity 'zombie'
|
116
|
-
# class Puppy extends Joosy.
|
116
|
+
# class Puppy extends Joosy.Resources.Base
|
117
117
|
# @entity 'puppy'
|
118
118
|
# @map 'zombies'
|
119
119
|
#
|
@@ -134,7 +134,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
134
134
|
throw new Error "#{Joosy.Module.__className @}> class can not be detected for '#{name}' mapping"
|
135
135
|
|
136
136
|
@beforeLoad (data) ->
|
137
|
-
klass = klass() unless Joosy.Module.hasAncestor(klass, Joosy.
|
137
|
+
klass = klass() unless Joosy.Module.hasAncestor(klass, Joosy.Resources.Base)
|
138
138
|
|
139
139
|
@__map(data, name, klass)
|
140
140
|
|
@@ -142,13 +142,13 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
142
142
|
# Wraps instance of resource inside shim-function allowing to track
|
143
143
|
# data changes. See class example
|
144
144
|
#
|
145
|
-
# @return [Joosy.
|
145
|
+
# @return [Joosy.Resources.Base]
|
146
146
|
#
|
147
147
|
@build: (data={}) ->
|
148
148
|
klass = @::__entityName
|
149
149
|
|
150
|
-
Joosy.
|
151
|
-
Joosy.
|
150
|
+
Joosy.Resources.Base.identity ||= {}
|
151
|
+
Joosy.Resources.Base.identity[klass] ||= {}
|
152
152
|
|
153
153
|
shim = ->
|
154
154
|
shim.__call.apply shim, arguments
|
@@ -169,11 +169,11 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
169
169
|
if Joosy.Application.identity
|
170
170
|
id = data[shim.__primaryKey]
|
171
171
|
|
172
|
-
if id? && Joosy.
|
173
|
-
shim = Joosy.
|
172
|
+
if id? && Joosy.Resources.Base.identity[klass][id]
|
173
|
+
shim = Joosy.Resources.Base.identity[klass][id]
|
174
174
|
shim.load data
|
175
175
|
else
|
176
|
-
Joosy.
|
176
|
+
Joosy.Resources.Base.identity[klass][id] = shim
|
177
177
|
@apply shim, [data]
|
178
178
|
else
|
179
179
|
@apply shim, [data]
|
@@ -200,7 +200,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
200
200
|
#
|
201
201
|
# @param [Object] data Data to store
|
202
202
|
#
|
203
|
-
# @return [Joosy.
|
203
|
+
# @return [Joosy.Resources.Base] Returns self
|
204
204
|
#
|
205
205
|
load: (data) ->
|
206
206
|
@__fillData data
|
@@ -215,7 +215,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
215
215
|
__get: (path) ->
|
216
216
|
target = @__callTarget path
|
217
217
|
|
218
|
-
if target[0] instanceof Joosy.
|
218
|
+
if target[0] instanceof Joosy.Resources.Base
|
219
219
|
return target[0](target[1])
|
220
220
|
else
|
221
221
|
return target[0][target[1]]
|
@@ -229,7 +229,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
229
229
|
__set: (path, value) ->
|
230
230
|
target = @__callTarget path
|
231
231
|
|
232
|
-
if target[0] instanceof Joosy.
|
232
|
+
if target[0] instanceof Joosy.Resources.Base
|
233
233
|
target[0](target[1], value)
|
234
234
|
else
|
235
235
|
target[0][target[1]] = value
|
@@ -251,7 +251,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
251
251
|
|
252
252
|
for part in path
|
253
253
|
target[part] ||= {}
|
254
|
-
if target instanceof Joosy.
|
254
|
+
if target instanceof Joosy.Resources.Base
|
255
255
|
target = target(part)
|
256
256
|
else
|
257
257
|
target = target[part]
|
@@ -261,7 +261,7 @@ class Joosy.Resource.Generic extends Joosy.Module
|
|
261
261
|
[@data, path]
|
262
262
|
|
263
263
|
#
|
264
|
-
# Wrapper for {Joosy.
|
264
|
+
# Wrapper for {Joosy.Resources.Base.build} magic
|
265
265
|
#
|
266
266
|
__call: (path, value) ->
|
267
267
|
if arguments.length > 1
|
@@ -3,14 +3,14 @@
|
|
3
3
|
# Turns JSON array into array of Resources and manages them.
|
4
4
|
#
|
5
5
|
# @note You should not use Collection directly. It will be
|
6
|
-
# automatically created by things like {Joosy.
|
7
|
-
# or {Joosy.
|
6
|
+
# automatically created by things like {Joosy.Resources.Base.map}
|
7
|
+
# or {Joosy.Resources.REST.find}.
|
8
8
|
#
|
9
9
|
# @example Basic sample
|
10
|
-
# class R extends Joosy.
|
10
|
+
# class R extends Joosy.Resources.Base
|
11
11
|
# @entity 'r'
|
12
12
|
#
|
13
|
-
# collection = new Joosy.
|
13
|
+
# collection = new Joosy.Resources.Collection(R)
|
14
14
|
#
|
15
15
|
# collection.load [{foo: 'bar'}, {foo: 'baz'}]
|
16
16
|
# collection.each (resource) ->
|
@@ -18,7 +18,7 @@
|
|
18
18
|
#
|
19
19
|
# @include Joosy.Modules.Events
|
20
20
|
#
|
21
|
-
class Joosy.
|
21
|
+
class Joosy.Resources.Collection extends Joosy.Module
|
22
22
|
@include Joosy.Modules.Events
|
23
23
|
|
24
24
|
#
|
@@ -63,7 +63,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
63
63
|
# If hash was given will seek for moodel name camelized and pluralized.
|
64
64
|
# @param [Boolean] notify Indicates whether to trigger 'changed' event
|
65
65
|
#
|
66
|
-
# @return [Joosy.
|
66
|
+
# @return [Joosy.Resources.Collection] Returns self.
|
67
67
|
#
|
68
68
|
load: (entities, notify=true) ->
|
69
69
|
if @__beforeLoad?
|
@@ -110,7 +110,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
110
110
|
#
|
111
111
|
# @param [Function] description Callback matcher
|
112
112
|
#
|
113
|
-
# @return [Joosy.
|
113
|
+
# @return [Joosy.Resources.Base]
|
114
114
|
#
|
115
115
|
find: (description) ->
|
116
116
|
@data.find description
|
@@ -123,7 +123,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
123
123
|
#
|
124
124
|
# @param [Integer] id Id to find
|
125
125
|
#
|
126
|
-
# @return [Joosy.
|
126
|
+
# @return [Joosy.Resources.Base]
|
127
127
|
#
|
128
128
|
findById: (id) ->
|
129
129
|
@data.find (x) -> x.id().toString() == id.toString()
|
@@ -133,7 +133,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
133
133
|
#
|
134
134
|
# @param [Integer] i Index
|
135
135
|
#
|
136
|
-
# @return [Joosy.
|
136
|
+
# @return [Joosy.Resources.Base]
|
137
137
|
#
|
138
138
|
at: (i) ->
|
139
139
|
@data[i]
|
@@ -145,7 +145,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
145
145
|
# @param [Resource] target Resource by itself
|
146
146
|
# @param [Boolean] notify Indicates whether to trigger 'changed' event
|
147
147
|
#
|
148
|
-
# @return [Joosy.
|
148
|
+
# @return [Joosy.Resources.Base] Removed element
|
149
149
|
#
|
150
150
|
remove: (target, notify=true) ->
|
151
151
|
if Object.isNumber target
|
@@ -165,7 +165,7 @@ class Joosy.Resource.Collection extends Joosy.Module
|
|
165
165
|
# @param [Integer] index Index to add to. If omited will be pushed to the end
|
166
166
|
# @param [Boolean] notify Indicates whether to trigger 'changed' event
|
167
167
|
#
|
168
|
-
# @return [Joosy.
|
168
|
+
# @return [Joosy.Resources.Base] Added element
|
169
169
|
#
|
170
170
|
add: (element, index=false, notify=true) ->
|
171
171
|
if typeof index is 'number'
|
@@ -0,0 +1 @@
|
|
1
|
+
#= require_tree ./
|
@@ -1,15 +1,18 @@
|
|
1
|
+
#= require ./base
|
2
|
+
#= require ./collection
|
3
|
+
|
1
4
|
#
|
2
5
|
# Resource with REST/JSON backend
|
3
6
|
#
|
4
|
-
class Joosy.
|
7
|
+
class Joosy.Resources.REST extends Joosy.Resources.Base
|
5
8
|
|
6
9
|
#
|
7
10
|
# Implements `@collection` default behavior.
|
8
|
-
# Changes the default fallback to Joosy.
|
11
|
+
# Changes the default fallback to Joosy.Resources.RESTCollection.
|
9
12
|
#
|
10
13
|
__collection: ->
|
11
14
|
named = @__entityName.camelize().pluralize() + 'Collection'
|
12
|
-
if window[named] then window[named] else Joosy.
|
15
|
+
if window[named] then window[named] else Joosy.Resources.RESTCollection
|
13
16
|
|
14
17
|
#
|
15
18
|
# Builds parents part of member path based on parents array
|
@@ -21,7 +24,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
21
24
|
#
|
22
25
|
@__parentsPath: (parents) ->
|
23
26
|
parents.reduce (path, parent) ->
|
24
|
-
path += if Joosy.Module.hasAncestor parent.constructor, Joosy.
|
27
|
+
path += if Joosy.Module.hasAncestor parent.constructor, Joosy.Resources.REST
|
25
28
|
parent.memberPath()
|
26
29
|
else
|
27
30
|
parent
|
@@ -30,7 +33,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
30
33
|
#
|
31
34
|
# Builds base path
|
32
35
|
#
|
33
|
-
# @param [Hash] options See {Joosy.
|
36
|
+
# @param [Hash] options See {Joosy.Resources.REST.find} for possible options
|
34
37
|
#
|
35
38
|
# @example Basic usage
|
36
39
|
# Resource.basePath() # /resources
|
@@ -51,7 +54,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
51
54
|
#
|
52
55
|
# Builds base path
|
53
56
|
#
|
54
|
-
# @see Joosy.
|
57
|
+
# @see Joosy.Resources.REST.basePath
|
55
58
|
#
|
56
59
|
basePath: (options={}) ->
|
57
60
|
@constructor.basePath options
|
@@ -60,7 +63,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
60
63
|
# Builds member path based on the given id.
|
61
64
|
#
|
62
65
|
# @param [String] id ID of entity to build member path for
|
63
|
-
# @param [Hash] options See {Joosy.
|
66
|
+
# @param [Hash] options See {Joosy.Resources.REST.find} for possible options
|
64
67
|
#
|
65
68
|
# @example Basic usage
|
66
69
|
# Resource.memberPath(1, from: 'foo') # /resources/1/foo
|
@@ -73,7 +76,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
73
76
|
#
|
74
77
|
# Builds member path
|
75
78
|
#
|
76
|
-
# @param [Hash] options See {Joosy.
|
79
|
+
# @param [Hash] options See {Joosy.Resources.REST.find} for possible options
|
77
80
|
#
|
78
81
|
# @example Basic usage
|
79
82
|
# resource.memberPath(from: 'foo') # /resources/1/foo
|
@@ -84,7 +87,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
84
87
|
#
|
85
88
|
# Builds collection path
|
86
89
|
#
|
87
|
-
# @param [Hash] options See {Joosy.
|
90
|
+
# @param [Hash] options See {Joosy.Resources.REST.find} for possible options
|
88
91
|
#
|
89
92
|
# @example Basic usage
|
90
93
|
# Resource.collectionPath() # /resources/
|
@@ -97,7 +100,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
97
100
|
#
|
98
101
|
# Builds collection path
|
99
102
|
#
|
100
|
-
# @see Joosy.
|
103
|
+
# @see Joosy.Resources.REST.collectionPath
|
101
104
|
#
|
102
105
|
collectionPath: (options={}) ->
|
103
106
|
@constructor.collectionPath options
|
@@ -217,7 +220,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
217
220
|
# @param [Function] callback Resulting callback
|
218
221
|
# (will receive retrieved Collection/Resource)
|
219
222
|
#
|
220
|
-
# @option options [Joosy.
|
223
|
+
# @option options [Joosy.Resources.REST] parent Sets the given resource as a base path
|
221
224
|
# i.e. /parents/1/resources
|
222
225
|
# @option options [String] parent Sets the given staring as a base path
|
223
226
|
# i.e. /trololo/resources
|
@@ -261,7 +264,7 @@ class Joosy.Resource.REST extends Joosy.Resource.Generic
|
|
261
264
|
#
|
262
265
|
# Refetches the data from backend and triggers `changed`
|
263
266
|
#
|
264
|
-
# @param [Hash] options See {Joosy.
|
267
|
+
# @param [Hash] options See {Joosy.Resources.REST.find} for possible options
|
265
268
|
# @param [Function] callback Resulting callback
|
266
269
|
#
|
267
270
|
reload: (options={}, callback=false) ->
|