ende 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assets/javascripts/aura/extensions/states.js.coffee +19 -10
  3. data/lib/assets/javascripts/config/load_components.js.coffee +12 -6
  4. data/lib/assets/javascripts/widgets/content/main.js.coffee +2 -0
  5. data/lib/assets/javascripts/widgets/list/main.js.coffee +1 -1
  6. data/lib/assets/javascripts/widgets/viewer/main.js.coffee +1 -1
  7. data/lib/ende/version.rb +1 -1
  8. data/vendor/assets/components/build.js +32401 -0
  9. data/vendor/assets/components/ende_build.js +33 -13
  10. data/vendor/components/indefinido-indemma/Readme.md +2 -2
  11. data/vendor/components/indefinido-indemma/build/development.js +4 -4
  12. data/vendor/components/indefinido-indemma/build/release.js +15 -8
  13. data/vendor/components/indefinido-indemma/build/test.js +4 -4
  14. data/vendor/components/indefinido-indemma/lib/record/queryable.js +1 -1
  15. data/vendor/components/indefinido-indemma/lib/record/restfulable.js +12 -5
  16. data/vendor/components/indefinido-indemma/lib/record/scopable.js +1 -1
  17. data/vendor/components/indefinido-indemma/lib/record.js +1 -1
  18. data/vendor/components/indefinido-indemma/spec/record/scopable_spec.js +1 -1
  19. data/vendor/components/indefinido-indemma/src/lib/record/queryable.coffee +1 -1
  20. data/vendor/components/indefinido-indemma/src/lib/record/restfulable.coffee +16 -4
  21. data/vendor/components/indefinido-indemma/src/lib/record/scopable.coffee +1 -1
  22. data/vendor/components/indefinido-indemma/src/lib/record.coffee +1 -1
  23. data/vendor/components/indefinido-indemma/src/spec/record/scopable_spec.coffee +1 -1
  24. data/vendor/components/indefinido-observable/lib/observable.js +1 -1
  25. data/vendor/components/indefinido-observable/vendor/shims/accessors.js +17 -4
  26. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeb1e113cf8c0b0728f31f8dfd4c50350e581011
4
- data.tar.gz: 70e038bea66f4b68321ef3b5e6320e07e699cb63
3
+ metadata.gz: d16802734857d0dd2c41903be9133eae36249ab9
4
+ data.tar.gz: 56497874bf1b5d72b063cb83cb794f726efed3a2
5
5
  SHA512:
6
- metadata.gz: 055f6631dbfed08d4bb071105d3c07cf75734fb98e37a129e1cf98a98e1b2a41bca2010b78b674f084a41d2dbe4b7045be4615d0bd7c7f0caa74af8140aab802
7
- data.tar.gz: 8bf7be6c35be1c2ac93bc6d2f31aa907dc6deb54376fcefa1589e00d3202ec521ee941e98a0217ad52550c76956068a7e54e1561dba42bba7344e2d2ad64ca61
6
+ metadata.gz: 6155c21110a59cbd24160b74c86f5c49c90413387d3b18251a329540829379c08bce9bca21ec718b2a8dd78a479d6a6528a3ab4111eee1570fd5820031c5d00b
7
+ data.tar.gz: 2f28469461acf1e97c2a6b4aa6061012658917033e912a431025939bbf2de2bc2bc3ded0e2c714ebeb40f220b3d33015e6f99ff8b5d73340b7cc5a2bf53de315
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- define 'aura/extensions/states', ['application/states'], (states) ->
3
+ define 'aura/extensions/states', ['states'], (states) ->
4
4
 
5
5
  (application) ->
6
6
  {core, logger} = application
@@ -33,24 +33,35 @@ define 'aura/extensions/states', ['application/states'], (states) ->
33
33
  flow =
34
34
 
35
35
  changed: (transition) ->
36
+ {domain} = application
36
37
  unormalized_widget_options = states[transition.to]
37
38
 
39
+ # TODO update aura and use native start method
40
+ # TODO move domain flow logic to a domain extension
41
+ #
42
+ domain_flow = domain?[transition.to]
43
+
38
44
  # TODO cache rendered widgets!
39
45
  if unormalized_widget_options
40
46
  widgets_options = @normalize_widget_options unormalized_widget_options, transition
41
47
 
42
- # TODO update aura and use native start method
43
- # TODO move this logic to a domain extension
44
- {domain} = application
45
-
46
48
  injection = core.inject(widgets_options).fail flow.failed
47
49
 
48
- domain?[transition.to]?.ready ||= injection.done
50
+ # TODO let this code more legible
51
+ domain_flow?.ready ||= injection.then((widgets...) ->
52
+ # TODO use es6-shim promises
53
+ $.Deferred().resolveWith domain_flow, widgets
54
+ ).done
49
55
 
50
56
  # To prevent reinstation upon changing to this state for the
51
57
  # second time, delete stored configuration for this state
52
58
  delete states[transition.to]
53
59
 
60
+ if domain_flow and not domain_flow.ready
61
+ # TODO use es6-shim promises
62
+ domain_flow.ready = $.Deferred().resolveWith(domain_flow, []).done
63
+
64
+
54
65
  normalize_widget_options: (unormalized_widget_options, transition_widgets_options) ->
55
66
  widgets = []
56
67
 
@@ -130,8 +141,7 @@ define 'aura/extensions/states', ['application/states'], (states) ->
130
141
  if (application.startOptions.widgets)
131
142
  application.state = "default"
132
143
  else
133
- current_start = application.core.start
134
- application.core.start = ->
144
+ application.core.metabolize = ->
135
145
  # If any initialized flow changed the application state
136
146
  # before the widgets initialization, store its state pass
137
147
  # through the default state and go back to the old state
@@ -141,8 +151,7 @@ define 'aura/extensions/states', ['application/states'], (states) ->
141
151
  current_state = application.state if application.state != 'initialization'
142
152
  application.state = "default"
143
153
 
144
- application.core.start = current_start
145
- startup = current_start.apply @, arguments
154
+ startup = application.core.start.apply @, arguments
146
155
 
147
156
  application.state = current_state if current_state?
148
157
 
@@ -121,13 +121,19 @@ define 'config/load_components', ['application_components'], ->
121
121
  module = loader.loaders.discovered.apply @, params
122
122
 
123
123
  catch e
124
- # TODO better loggin support
125
- (app?.logger || console).warn "loader: Failed to load '#{params[0]}' with #{using}: \n Exception: '#{e.message}'. Trying with requirejs."
126
-
127
- loader.activate 'requirejs'
128
- module = loader.loaders.discovered.apply @, params unless module
124
+ if e.require
125
+ # TODO better loggin support
126
+ if app.debug
127
+ (app?.logger || console).warn "loader: Failed to load '#{params[0]}' with #{using}: \n Exception: '#{e.message}'. Trying with requirejs."
128
+
129
+ # Since it failed to load with component, try to load with requirejs
130
+ loader.activate 'requirejs'
131
+ unless module
132
+ module = loader.loaders.discovered.apply @, params
133
+ else
134
+ throw e
129
135
 
130
- # Always let requirjs active by default
136
+ # Always let requirejs active by default
131
137
  loader.activate 'requirejs'
132
138
 
133
139
  module
@@ -1,7 +1,9 @@
1
1
  define ->
2
2
 
3
3
  type: 'Base'
4
+
4
5
  version: '0.1.1'
6
+
5
7
  options:
6
8
  autoload: true
7
9
 
@@ -61,7 +61,7 @@ define ['./states/index', './presenter'], (templates, presenter) ->
61
61
 
62
62
  # Forward the models to the presenter
63
63
 
64
- model.all (records) ->
64
+ model.every (records) ->
65
65
 
66
66
  # Bind presenter to template
67
67
  presentation = presenter records, luna
@@ -256,7 +256,7 @@ define [
256
256
 
257
257
  else if @options.autofetch
258
258
 
259
- deferred = @scope.all()
259
+ deferred = @scope.every()
260
260
 
261
261
  else
262
262
 
data/lib/ende/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ende
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end