ende 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/component.json +1 -1
- data/lib/assets/javascripts/aura/extensions/devise.js.coffee +7 -4
- data/lib/assets/javascripts/aura/extensions/routes.js.coffee +16 -8
- data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +10 -5
- data/lib/assets/javascripts/widgets/authenticator/main.js.coffee +4 -8
- data/lib/assets/javascripts/widgets/authenticator/presenter.js.coffee +4 -4
- data/lib/assets/javascripts/widgets/authenticator/states/default.html +1 -1
- data/lib/assets/javascripts/widgets/tray/main.js.coffee +26 -0
- data/lib/ende/version.rb +1 -1
- data/lib/tasks/component.thor +1 -1
- data/vendor/assets/javascripts/ende/build.js +10008 -8202
- data/vendor/components/KapIT-observe-utils/component.json +16 -0
- data/vendor/components/KapIT-observe-utils/lib/observe-utils.js +780 -0
- data/vendor/components/chaijs-assertion-error/component.json +18 -0
- data/vendor/components/chaijs-assertion-error/index.js +110 -0
- data/vendor/components/chaijs-chai/component.json +47 -0
- data/vendor/components/chaijs-chai/index.js +1 -0
- data/vendor/components/chaijs-chai/lib/chai/assertion.js +130 -0
- data/vendor/components/chaijs-chai/lib/chai/core/assertions.js +1270 -0
- data/vendor/components/chaijs-chai/lib/chai/interface/assert.js +1080 -0
- data/vendor/components/chaijs-chai/lib/chai/interface/expect.js +12 -0
- data/vendor/components/chaijs-chai/lib/chai/interface/should.js +76 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +94 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/addMethod.js +37 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/addProperty.js +40 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/flag.js +32 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getActual.js +19 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +25 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getMessage.js +49 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getName.js +20 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getPathValue.js +102 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/getProperties.js +35 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/index.js +108 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/inspect.js +320 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/objDisplay.js +48 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +51 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +54 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/test.js +26 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/transferFlags.js +44 -0
- data/vendor/components/chaijs-chai/lib/chai/utils/type.js +45 -0
- data/vendor/components/chaijs-chai/lib/chai.js +80 -0
- data/vendor/components/chaijs-deep-eql/component.json +18 -0
- data/vendor/components/chaijs-deep-eql/lib/eql.js +257 -0
- data/vendor/components/chaijs-type-detect/component.json +16 -0
- data/vendor/components/chaijs-type-detect/lib/type.js +142 -0
- data/vendor/components/component-bind/component.json +14 -0
- data/vendor/components/component-bind/index.js +24 -0
- data/vendor/components/component-delegate/component.json +19 -0
- data/vendor/components/component-delegate/index.js +42 -0
- data/vendor/components/component-event/component.json +13 -0
- data/vendor/components/component-event/index.js +40 -0
- data/vendor/components/component-jquery/component.json +14 -0
- data/vendor/components/component-jquery/index.js +9601 -0
- data/vendor/components/component-link-delegate/component.json +23 -0
- data/vendor/components/component-link-delegate/index.js +60 -0
- data/vendor/components/component-matches-selector/component.json +20 -0
- data/vendor/components/component-matches-selector/index.js +45 -0
- data/vendor/components/component-query/component.json +21 -0
- data/vendor/components/component-query/index.js +21 -0
- data/vendor/components/component-type/component.json +18 -0
- data/vendor/components/component-type/index.js +32 -0
- data/vendor/components/component-url/component.json +17 -0
- data/vendor/components/component-url/index.js +63 -0
- data/vendor/components/components-modernizr/component.json +18 -0
- data/vendor/components/components-modernizr/modernizr.js +1393 -0
- data/vendor/components/discore-closest/component.json +14 -0
- data/vendor/components/discore-closest/index.js +18 -0
- data/vendor/components/indefinido-advisable/component.json +21 -0
- data/vendor/components/indefinido-advisable/index.js +1 -0
- data/vendor/components/indefinido-advisable/lib/advisable.js +60 -0
- data/vendor/components/indefinido-indemma/component.json +40 -0
- data/vendor/components/indefinido-indemma/index.js +1 -0
- data/vendor/components/indefinido-indemma/lib/extensions/rivets.js +23 -0
- data/vendor/components/indefinido-indemma/lib/record/associable.js +217 -0
- data/vendor/components/indefinido-indemma/lib/record/maid.js +24 -0
- data/vendor/components/indefinido-indemma/lib/record/resource.js +104 -0
- data/vendor/components/indefinido-indemma/lib/record/rest.js +36 -0
- data/vendor/components/indefinido-indemma/lib/record/restfulable.js +326 -0
- data/vendor/components/indefinido-indemma/lib/record/scopable.js +279 -0
- data/vendor/components/indefinido-indemma/lib/record/translationable.js +19 -0
- data/vendor/components/indefinido-indemma/lib/record/validatable.js +216 -0
- data/vendor/components/indefinido-indemma/lib/record/validations/associated.js +30 -0
- data/vendor/components/indefinido-indemma/lib/record/validations/confirmation.js +19 -0
- data/vendor/components/indefinido-indemma/lib/record/validations/cpf.js +60 -0
- data/vendor/components/indefinido-indemma/lib/record/validations/presence.js +19 -0
- data/vendor/components/indefinido-indemma/lib/record/validations/remote.js +71 -0
- data/vendor/components/indefinido-indemma/lib/record.js +167 -0
- data/vendor/components/indefinido-indemma/vendor/sinon.js +4290 -0
- data/vendor/components/indefinido-indemma/vendor/stampit.js +392 -0
- data/vendor/components/indefinido-observable/component.json +25 -0
- data/vendor/components/indefinido-observable/components/cjohansen-sinon/sinon.js +4290 -0
- data/vendor/components/indefinido-observable/index.js +1 -0
- data/vendor/components/indefinido-observable/lib/adapters/rivets.js +26 -0
- data/vendor/components/indefinido-observable/lib/observable.js +320 -0
- data/vendor/components/indefinido-observable/vendor/shims/accessors-legacy.js +92 -0
- data/vendor/components/indefinido-observable/vendor/shims/accessors.js +173 -0
- data/vendor/components/indefinido-observable/vendor/shims/array.indexOf.js +8 -0
- data/vendor/components/indefinido-observable/vendor/shims/object.create.js +77 -0
- data/vendor/components/mikeric-rivets/component.json +15 -0
- data/vendor/components/mikeric-rivets/dist/rivets.js +1239 -0
- data/vendor/components/paulmillr-es6-shim/component.json +17 -0
- data/vendor/components/paulmillr-es6-shim/es6-shim.js +985 -0
- data/vendor/components/pluma-assimilate/component.json +25 -0
- data/vendor/components/pluma-assimilate/dist/assimilate.js +87 -0
- data/vendor/components/segmentio-extend/component.json +13 -0
- data/vendor/components/segmentio-extend/index.js +15 -0
- metadata +98 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0cf3f5dd5befd5a734932d109f270db9c6bfe9f
|
|
4
|
+
data.tar.gz: 399523b42c51a8bc83cd83562763563ea593f0e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24f55c7958fce14f3d3f089e673d2d950446988232e391775e41dd5ccd1ade140d22981f8a7dfdc589ba1745380dc415dff042e6f6e0c483ef10739a1c7dc24b
|
|
7
|
+
data.tar.gz: a88e41c9acc0faa041ed947d7e49100496d213e1058a0222668ed60e1a2c5e024e8a3a9782205c510b479840e3fd927801c759f96e21c2eafd88cdc4e4bf3986
|
data/component.json
CHANGED
|
@@ -162,7 +162,7 @@ define 'aura/extensions/devise', () ->
|
|
|
162
162
|
|
|
163
163
|
# Extension definition
|
|
164
164
|
name: 'devise'
|
|
165
|
-
version: '0.
|
|
165
|
+
version: '0.3.0'
|
|
166
166
|
initialize: (application) ->
|
|
167
167
|
|
|
168
168
|
core = application.core
|
|
@@ -192,7 +192,9 @@ define 'aura/extensions/devise', () ->
|
|
|
192
192
|
sandbox.session = session
|
|
193
193
|
|
|
194
194
|
define_routes: (router) ->
|
|
195
|
-
|
|
195
|
+
# TODO pass authenticable resource as a parameter to extension
|
|
196
|
+
router.define '/users/sign_in' , 'session.new'
|
|
197
|
+
router.define '/users/sign_out', 'session.destroy'
|
|
196
198
|
|
|
197
199
|
define_resources: (model) ->
|
|
198
200
|
|
|
@@ -213,10 +215,11 @@ define 'aura/extensions/devise', () ->
|
|
|
213
215
|
email: String
|
|
214
216
|
|
|
215
217
|
afterAppStart: (application) ->
|
|
216
|
-
|
|
218
|
+
{router, models} = application.core
|
|
219
|
+
@define_resources models
|
|
217
220
|
|
|
218
221
|
# TODO move to an external module
|
|
219
|
-
@define_routes
|
|
222
|
+
@define_routes router if router?
|
|
220
223
|
|
|
221
224
|
# Restore session if not already
|
|
222
225
|
# TODO Restore only when application is ready
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
define 'aura/extensions/routes',
|
|
1
|
+
define 'aura/extensions/routes', (routes) ->
|
|
2
2
|
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# TODO Remove .call null
|
|
6
|
+
# TODO Remove .call null
|
|
7
|
+
loader.require.call null, 'modernizr'
|
|
8
|
+
loader.require.call null, 'ened/vendor/assets/javascripts/lennon/lennon.js'
|
|
9
|
+
router = null
|
|
6
10
|
|
|
7
11
|
(application) ->
|
|
8
12
|
core = application.core
|
|
9
|
-
logger = application.logger
|
|
10
13
|
mediator = core.mediator
|
|
11
14
|
_ = core.util._
|
|
15
|
+
router = new Lennon
|
|
16
|
+
# TODO implement logger api for lennon or change lennon library
|
|
17
|
+
# logger: application.logger
|
|
18
|
+
publishEvent: (name, params) ->
|
|
19
|
+
# TODO better method parsing
|
|
20
|
+
params.method = "get"
|
|
21
|
+
mediator.emit name, params
|
|
12
22
|
|
|
13
|
-
application.router = router
|
|
14
|
-
application.route = (params) -> router.apply router, params
|
|
23
|
+
application.core.router = router
|
|
15
24
|
|
|
16
25
|
version: '0.1.0'
|
|
17
26
|
|
|
18
|
-
initialize: (application) ->
|
|
19
|
-
|
|
20
|
-
|
|
21
27
|
afterAppStart: (application) ->
|
|
28
|
+
router.process()
|
|
29
|
+
|
|
@@ -4,6 +4,7 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
|
4
4
|
|
|
5
5
|
# TODO Remove jquery and use core dependencies
|
|
6
6
|
jQuery = require 'jquery'
|
|
7
|
+
core = null
|
|
7
8
|
|
|
8
9
|
lifecycleable =
|
|
9
10
|
injection: (definition) ->
|
|
@@ -13,11 +14,11 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
|
13
14
|
# not only if type is object
|
|
14
15
|
for subwidget_name, suboptions of options
|
|
15
16
|
# TODO if isWidget subwidget_name
|
|
16
|
-
if $.type(suboptions) == 'object'
|
|
17
|
+
if $.type(suboptions) == 'object' and not suboptions instanceof jQuery
|
|
17
18
|
|
|
18
19
|
for name, suboption of suboptions
|
|
19
20
|
|
|
20
|
-
if $.type(suboption) == 'object'
|
|
21
|
+
if $.type(suboption) == 'object' and not suboption instanceof jQuery
|
|
21
22
|
|
|
22
23
|
for subname, subsuboption of suboption
|
|
23
24
|
options["#{subwidget_name}#{@capitalize name}#{@capitalize subname}"] = subsuboption
|
|
@@ -60,6 +61,8 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
|
60
61
|
@sandbox.on 'aura.sandbox.stop', (sandbox) =>
|
|
61
62
|
@stopped() if @sandbox.ref == sandbox.ref
|
|
62
63
|
|
|
64
|
+
inject: (name, options) -> core.inject name, options
|
|
65
|
+
|
|
63
66
|
stopped: ->
|
|
64
67
|
@$el.remove()
|
|
65
68
|
|
|
@@ -87,10 +90,12 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
|
87
90
|
injections = core.util._.map widgets, lifecycleable.injection, lifecycleable
|
|
88
91
|
return core.start injections
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
throw new TypeError "app.core.inject: No widget name provided"
|
|
93
|
+
if not name
|
|
94
|
+
throw new TypeError "app.core.inject: No widget name provided"
|
|
95
|
+
|
|
96
|
+
options.name = name
|
|
92
97
|
|
|
93
|
-
core.start
|
|
98
|
+
core.start [lifecycleable.injection name: name, options: options]
|
|
94
99
|
|
|
95
100
|
# Add support for element removal after stoping widget
|
|
96
101
|
# TODO replace Base.extend inheritance to stampit composition
|
|
@@ -20,9 +20,9 @@ define ['./states/index', './presenter'], (templates, presenter) ->
|
|
|
20
20
|
sandbox.logger.log "initialized!"
|
|
21
21
|
|
|
22
22
|
base =
|
|
23
|
-
status:
|
|
23
|
+
status: 'idle'
|
|
24
24
|
classes: =>
|
|
25
|
-
"#{@state} #{
|
|
25
|
+
"widget #{@state} #{base.status} authenticator"
|
|
26
26
|
toggle_state: (event) =>
|
|
27
27
|
@state = if @state == 'default' then 'passwords' else 'default'
|
|
28
28
|
false
|
|
@@ -32,8 +32,7 @@ define ['./states/index', './presenter'], (templates, presenter) ->
|
|
|
32
32
|
message: null
|
|
33
33
|
email: null
|
|
34
34
|
password: null
|
|
35
|
-
|
|
36
|
-
# button_label: 'Entrar'
|
|
35
|
+
button_label: 'Authenticate!'
|
|
37
36
|
|
|
38
37
|
# Authentication state
|
|
39
38
|
authenticate: (event) ->
|
|
@@ -53,8 +52,7 @@ define ['./states/index', './presenter'], (templates, presenter) ->
|
|
|
53
52
|
email: null
|
|
54
53
|
message: null
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
# button_label: 'Entrar'
|
|
55
|
+
button_label: 'Recuperar senha'
|
|
58
56
|
|
|
59
57
|
# Recovery state
|
|
60
58
|
recover: (event, models) ->
|
|
@@ -64,13 +62,11 @@ define ['./states/index', './presenter'], (templates, presenter) ->
|
|
|
64
62
|
recovered: (password) ->
|
|
65
63
|
base.status = 'success'
|
|
66
64
|
|
|
67
|
-
|
|
68
65
|
# Bind and unbind events depending on state
|
|
69
66
|
sandbox.on 'user.signed_in' , authenticator.authenticated
|
|
70
67
|
sandbox.on 'session.creation_unauthorized' , authenticator.unauthorized
|
|
71
68
|
sandbox.on 'user.password_recovered' , recoverer.recovered
|
|
72
69
|
|
|
73
|
-
|
|
74
70
|
# Will also initialize sandbox!
|
|
75
71
|
@$el.attr 'data-class', 'base.classes < base.status'
|
|
76
72
|
@presentation = presenter authenticator, recoverer, base
|
|
@@ -13,14 +13,14 @@ define ->
|
|
|
13
13
|
configurable: true
|
|
14
14
|
get: -> authenticator.message
|
|
15
15
|
set: (message) -> authenticator.message = message
|
|
16
|
-
classes:
|
|
17
|
-
configurable: true
|
|
18
|
-
value: ->
|
|
19
|
-
"widget authenticator #{authenticator.status}"
|
|
20
16
|
email:
|
|
21
17
|
configurable: true
|
|
22
18
|
set: (email) -> authenticator.email = email
|
|
23
19
|
get: -> authenticator.email
|
|
20
|
+
button_label:
|
|
21
|
+
configurable: true
|
|
22
|
+
set: (button_label) -> authenticator.button_label = button_label
|
|
23
|
+
get: -> authenticator.button_label
|
|
24
24
|
password:
|
|
25
25
|
configurable: true
|
|
26
26
|
set: (password) -> authenticator.password = password
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="message" data-html="authenticator.message"> </div>
|
|
2
2
|
<input type="email" data-value="authenticator.email" placeholder="Login" />
|
|
3
3
|
<input type="password" data-value="authenticator.password" placeholder="Password" />
|
|
4
|
-
<button data-on-click="authenticator.authenticate">
|
|
4
|
+
<button data-on-click="authenticator.authenticate" data-html="authenticator.button_label">
|
|
5
5
|
Authenticate!
|
|
6
6
|
</button>
|
|
7
7
|
<a data-on-click="base.toggle_state">Recuperar Senha</a>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
define ->
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
type: 'Base'
|
|
6
|
+
|
|
7
|
+
initialize: (options) ->
|
|
8
|
+
# TODO access omit method throuhgh underscore
|
|
9
|
+
widget_options = _.omit options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl'
|
|
10
|
+
|
|
11
|
+
# TODO remove jquery dependency
|
|
12
|
+
for name, suboptions of widget_options when $.type(suboptions) is "object"
|
|
13
|
+
@add suboptions.name || name, suboptions
|
|
14
|
+
|
|
15
|
+
@$el.addClass 'tray widget'
|
|
16
|
+
|
|
17
|
+
# TODO find a way to build the id based on content
|
|
18
|
+
@$el.attr 'id', options.identifier if options.identifier?
|
|
19
|
+
|
|
20
|
+
add: (name, options) ->
|
|
21
|
+
|
|
22
|
+
# TODO add widgets as childrens of the tray widget sandbox
|
|
23
|
+
element = jQuery '<div class="widget"></div>'
|
|
24
|
+
options.el = element
|
|
25
|
+
@$el.append element
|
|
26
|
+
@inject name, options
|
data/lib/ende/version.rb
CHANGED
data/lib/tasks/component.thor
CHANGED
|
@@ -57,7 +57,7 @@ COMPONENT
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
desc "build [PATH]", "Build components to PATH, defaulted to ./vendor/assets/components"
|
|
60
|
-
def build path="vendor/assets/
|
|
60
|
+
def build path="vendor/assets/javascripts/ende"
|
|
61
61
|
run "component build --out #{path}"
|
|
62
62
|
end
|
|
63
63
|
end
|