ende 0.2.19 → 0.2.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +0 -1
- data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +13 -4
- data/lib/assets/javascripts/aura/extensions/widget/napable.js.coffee +33 -0
- data/lib/assets/javascripts/widgets/content/main.js.coffee +5 -1
- data/lib/assets/javascripts/widgets/dialog/main.js.coffee +24 -9
- data/lib/ende/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 046a0ed43eae2200826c55b0c423d9e45b1656dc
|
4
|
+
data.tar.gz: 96018aaf998f600f8a7e434429d84ee6f2daa40d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a315647d6135e2830247174ad17294ead57b36cb9b1432dc78643325accc154afe520163d008734c103ac7eeae3ae13be4f1b69770911af0ec6364907f181dd2
|
7
|
+
data.tar.gz: 7aba13a1af67e58d416a8d10a787f3e978ca8325d60a1c18e8fbf1d84844a2b63696ba51ee7872d78b6a62c5c9371b1bfda67171ae3b85549775037096aeb1fe
|
data/README.md
CHANGED
@@ -102,25 +102,34 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
102
102
|
lifecycleable.capitalize = core.util.capitalize
|
103
103
|
|
104
104
|
# Add injection function for widgets
|
105
|
-
|
105
|
+
# TODO create a paremeter parser method
|
106
|
+
core.inject = (name, options, parent = core) ->
|
106
107
|
|
107
108
|
switch arguments.length
|
108
109
|
when 1
|
109
110
|
if jQuery.isArray name
|
110
111
|
widgets = name
|
111
112
|
injections = core.util._.map widgets, lifecycleable.injection, lifecycleable
|
112
|
-
return
|
113
|
+
return parent.start injections
|
113
114
|
else
|
114
115
|
options = name
|
115
|
-
|
116
|
+
parent.start [lifecycleable.injection name: options.name, options: options]
|
116
117
|
|
117
118
|
when 2
|
118
119
|
options.name ||= name
|
119
|
-
|
120
|
+
parent.start [lifecycleable.injection name: options.name, options: options]
|
121
|
+
when 3
|
122
|
+
if options?
|
123
|
+
options.name ||= name
|
124
|
+
else
|
125
|
+
options = name
|
126
|
+
|
127
|
+
parent.start [lifecycleable.injection name: options.name, options: options]
|
120
128
|
|
121
129
|
# TODO instead of using inject function, overwrite start function
|
122
130
|
application.sandbox.inject = (params...) ->
|
123
131
|
console.warn 'sandbox.inject will be deprecated, then you will use sandbox.start with object parameters'
|
132
|
+
params[2] = @ if params.length < 3
|
124
133
|
core.inject params...
|
125
134
|
|
126
135
|
# Add support for element removal after stoping widget
|
@@ -0,0 +1,33 @@
|
|
1
|
+
define 'aura/extensions/widget/napable', ->
|
2
|
+
|
3
|
+
'use strict'
|
4
|
+
|
5
|
+
napable =
|
6
|
+
bind: ->
|
7
|
+
@sandbox.on "#{@name}.#{@identifier}.sleep", napable.sleep, @
|
8
|
+
@sandbox.on "#{@name}.#{@identifier}.wake" , napable.wake , @
|
9
|
+
sleep: ->
|
10
|
+
@$el.addClass 'asleep'
|
11
|
+
@$el.removeClass 'awake'
|
12
|
+
wake: ->
|
13
|
+
@$el.addClass 'awake'
|
14
|
+
@$el.removeClass 'asleep'
|
15
|
+
|
16
|
+
extensions =
|
17
|
+
constructor: ->
|
18
|
+
extensions["super"].constructor.apply @, arguments
|
19
|
+
napable.bind.call @
|
20
|
+
|
21
|
+
# The purpose of this extension is allow parent widget to save
|
22
|
+
# memory by sending a sleep command to the child widgets
|
23
|
+
(application) ->
|
24
|
+
|
25
|
+
version: '0.1.0'
|
26
|
+
|
27
|
+
initialize: (application) ->
|
28
|
+
{core} = application
|
29
|
+
|
30
|
+
# Add support for element removal after stoping widget
|
31
|
+
# TODO replace Base.extend inheritance to stampit composition
|
32
|
+
core.Widgets.Base = core.Widgets.Base.extend extensions
|
33
|
+
extensions.super = core.Widgets.Base.__super__
|
@@ -10,7 +10,8 @@ define ->
|
|
10
10
|
|
11
11
|
@sandbox.on "content.#{@identifier}.load", @load, @
|
12
12
|
|
13
|
-
|
13
|
+
# TODO convert options to respective types and remove != 'false' comparison
|
14
|
+
if options.autoload and options.autoload != 'false'
|
14
15
|
delete options.autoload
|
15
16
|
@sandbox.emit "content.#{@identifier}.load"
|
16
17
|
|
@@ -37,6 +38,8 @@ define ->
|
|
37
38
|
|
38
39
|
# TODO move to handlers
|
39
40
|
load: (options) ->
|
41
|
+
_.invoke @sandbox._children, 'stop' if @sandbox._children?.length
|
42
|
+
|
40
43
|
# TODO move to anoter method
|
41
44
|
if @loads > 0
|
42
45
|
@html ''
|
@@ -50,6 +53,7 @@ define ->
|
|
50
53
|
@spinner = @sandbox.ui.loader @$el
|
51
54
|
@$el.addClass "loading"
|
52
55
|
@$el.removeClass "idle"
|
56
|
+
|
53
57
|
|
54
58
|
# TODO remove jQuery dependency
|
55
59
|
@loading = $.ajax(@request_options options).done(@loaded).fail(@failed).always(@ended)
|
@@ -32,9 +32,12 @@ define ->
|
|
32
32
|
render: (options) ->
|
33
33
|
{widget, content: child} = options
|
34
34
|
{sandbox, $el: el} = widget
|
35
|
+
identifier = child.identifier || child.resource || 'default'
|
36
|
+
|
35
37
|
@el = el
|
36
38
|
|
37
39
|
el.addClass 'hide' unless options.autoshow
|
40
|
+
el.addClass 'injecting'
|
38
41
|
|
39
42
|
sandbox.inject options.content
|
40
43
|
|
@@ -45,11 +48,17 @@ define ->
|
|
45
48
|
@hide()
|
46
49
|
false
|
47
50
|
|
48
|
-
|
51
|
+
# Positionate modal after widget insertions, when widget starts
|
52
|
+
# visible
|
53
|
+
@positionate() if options.autoshow
|
54
|
+
|
55
|
+
# TODO get identifier through sandbox method instead of generating here
|
56
|
+
sandbox.once "#{child.name}.#{identifier}.started", (widget) =>
|
57
|
+
el.removeClass 'injecting'
|
49
58
|
@positionate()
|
50
59
|
|
51
60
|
# TODO better close html creation and handling
|
52
|
-
el.prepend @close_template
|
61
|
+
el.prepend @close_template if options.closable
|
53
62
|
|
54
63
|
|
55
64
|
remove: ->
|
@@ -62,7 +71,7 @@ define ->
|
|
62
71
|
|
63
72
|
dialog: null
|
64
73
|
|
65
|
-
version: '0.1.
|
74
|
+
version: '0.1.1'
|
66
75
|
|
67
76
|
options:
|
68
77
|
|
@@ -80,7 +89,14 @@ define ->
|
|
80
89
|
overlay = require 'component-overlay'
|
81
90
|
@sandbox.util.extend dialog.prototype, dialog_extensions
|
82
91
|
|
92
|
+
# Initialize fundamental style
|
93
|
+
@$el.attr 'id', 'dialog'
|
94
|
+
options.size && @$el.addClass options.size
|
95
|
+
options.theme && @$el.addClass options.theme
|
96
|
+
|
97
|
+
|
83
98
|
widget_options = @extract_options()
|
99
|
+
|
84
100
|
@dialog = new dialog
|
85
101
|
widget: @, # TODO forward only element of the widget
|
86
102
|
autoshow: options.autoshow
|
@@ -94,11 +110,11 @@ define ->
|
|
94
110
|
# TODO better dialog implementation
|
95
111
|
options.closable && @dialog.closable()
|
96
112
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
113
|
+
if @identifier == 'default' or @identifier == @name
|
114
|
+
@identifier = widget_options.name
|
115
|
+
# TODO implement postaljs and filter children widgets by event
|
116
|
+
# emitter instead of widget resources
|
117
|
+
@identifier += '!' + widget_options.resource if widget_options.resource?
|
102
118
|
|
103
119
|
# TODO update dialog and remove this code when issue
|
104
120
|
# https://github.com/component/dialog/issues/9 is fixed
|
@@ -112,7 +128,6 @@ define ->
|
|
112
128
|
|
113
129
|
@_overlay = o
|
114
130
|
|
115
|
-
|
116
131
|
# TODO add deprecation warning messages to modal commands
|
117
132
|
@sandbox.on "modal.#{@identifier}.show" , @dialog.show , @dialog
|
118
133
|
@sandbox.on "modal.#{@identifier}.hide" , @dialog.hide , @dialog
|
data/lib/ende/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ende
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heitor Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- lib/assets/javascripts/aura/extensions/states.js.coffee
|
80
80
|
- lib/assets/javascripts/aura/extensions/widget/eventable.js.coffee
|
81
81
|
- lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee
|
82
|
+
- lib/assets/javascripts/aura/extensions/widget/napable.js.coffee
|
82
83
|
- lib/assets/javascripts/aura/extensions/widget/presentable.js.coffee
|
83
84
|
- lib/assets/javascripts/aura/presentable.js.coffee
|
84
85
|
- lib/assets/javascripts/config/initializers/jquery.js.coffee
|