unpoly-rails 0.27.3 → 0.28.0
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.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -1
- data/dist/unpoly.css +29 -21
- data/dist/unpoly.js +291 -134
- data/dist/unpoly.min.css +1 -1
- data/dist/unpoly.min.js +3 -3
- data/lib/assets/javascripts/unpoly.js.coffee +1 -0
- data/lib/assets/javascripts/unpoly/browser.js.coffee +22 -5
- data/lib/assets/javascripts/unpoly/bus.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/flow.js.coffee +9 -6
- data/lib/assets/javascripts/unpoly/form.js.coffee +46 -49
- data/lib/assets/javascripts/unpoly/history.js.coffee +2 -2
- data/lib/assets/javascripts/unpoly/layout.js.coffee +3 -3
- data/lib/assets/javascripts/unpoly/modal.js.coffee +30 -2
- data/lib/assets/javascripts/unpoly/motion.js.coffee +6 -6
- data/lib/assets/javascripts/unpoly/navigation.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/popup.js.coffee +2 -2
- data/lib/assets/javascripts/unpoly/proxy.js.coffee +5 -9
- data/lib/assets/javascripts/unpoly/syntax.js.coffee +10 -6
- data/lib/assets/javascripts/unpoly/toast.js.coffee +66 -0
- data/lib/assets/javascripts/unpoly/tooltip.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/util.js.coffee +47 -21
- data/lib/assets/stylesheets/unpoly/toast.css.sass +33 -0
- data/lib/unpoly/rails/version.rb +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/app/assets/javascripts/integration_test.coffee +1 -0
- data/spec_app/app/assets/stylesheets/integration_test.sass +14 -0
- data/spec_app/app/controllers/application_controller.rb +8 -0
- data/spec_app/app/controllers/error_test_controller.rb +5 -0
- data/spec_app/app/views/error_test/trigger.erb +72 -0
- data/spec_app/app/views/error_test/unexpected_response.erb +3 -0
- data/spec_app/app/views/pages/start.erb +4 -0
- data/spec_app/config/routes.rb +2 -0
- data/spec_app/spec/javascripts/helpers/last_request.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/browser_spec.js.coffee +62 -0
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +116 -3
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +2 -2
- data/spec_app/spec/javascripts/up/modal_spec.js.coffee +88 -4
- data/spec_app/spec/javascripts/up/syntax_spec.js.coffee +27 -1
- data/spec_app/spec/javascripts/up/util_spec.js.coffee +12 -0
- metadata +8 -3
- data/lib/assets/stylesheets/unpoly/error.css.sass +0 -21
@@ -17,7 +17,7 @@ describe 'up.syntax', ->
|
|
17
17
|
|
18
18
|
describe 'destructors', ->
|
19
19
|
|
20
|
-
it 'allows
|
20
|
+
it 'allows compilers to return a function to call when the compiled element is destroyed', ->
|
21
21
|
destructor = jasmine.createSpy('destructor')
|
22
22
|
up.compiler '.child', ($element) ->
|
23
23
|
destructor
|
@@ -28,6 +28,32 @@ describe 'up.syntax', ->
|
|
28
28
|
up.destroy('.container')
|
29
29
|
expect(destructor).toHaveBeenCalled()
|
30
30
|
|
31
|
+
it 'allows compilers to return an array of functions to clal when the compiled element is destroyed', ->
|
32
|
+
destructor1 = jasmine.createSpy('destructor1')
|
33
|
+
destructor2 = jasmine.createSpy('destructor2')
|
34
|
+
up.compiler '.child', ($element) ->
|
35
|
+
[ destructor1, destructor2 ]
|
36
|
+
|
37
|
+
up.hello(affix('.container .child'))
|
38
|
+
expect(destructor1).not.toHaveBeenCalled()
|
39
|
+
expect(destructor2).not.toHaveBeenCalled()
|
40
|
+
|
41
|
+
up.destroy('.container')
|
42
|
+
expect(destructor1).toHaveBeenCalled()
|
43
|
+
expect(destructor2).toHaveBeenCalled()
|
44
|
+
|
45
|
+
it "does not consider a returned array to be a destructor unless it's comprised entirely of functions", ->
|
46
|
+
value1 = jasmine.createSpy('non-destructor')
|
47
|
+
value2 = 'two'
|
48
|
+
up.compiler '.child', ($element) ->
|
49
|
+
[ value1, value2 ]
|
50
|
+
|
51
|
+
up.hello(affix('.container .child'))
|
52
|
+
expect(value1).not.toHaveBeenCalled()
|
53
|
+
|
54
|
+
up.destroy('.container')
|
55
|
+
expect(value1).not.toHaveBeenCalled()
|
56
|
+
|
31
57
|
it 'runs all destructors if multiple compilers are applied to the same element', ->
|
32
58
|
destructor1 = jasmine.createSpy('destructor1')
|
33
59
|
up.compiler '.one', ($element) -> destructor1
|
@@ -2,6 +2,18 @@ describe 'up.util', ->
|
|
2
2
|
|
3
3
|
describe 'Javascript functions', ->
|
4
4
|
|
5
|
+
describe 'up.util.sequence', ->
|
6
|
+
|
7
|
+
it 'combines the given functions into a single function', ->
|
8
|
+
values = []
|
9
|
+
one = -> values.push('one')
|
10
|
+
two = -> values.push('two')
|
11
|
+
three = -> values.push('three')
|
12
|
+
sequence = up.util.sequence(one, two, three)
|
13
|
+
expect(values).toEqual([])
|
14
|
+
sequence()
|
15
|
+
expect(values).toEqual(['one', 'two', 'three'])
|
16
|
+
|
5
17
|
describe 'up.util.createElementFromHtml', ->
|
6
18
|
|
7
19
|
it 'parses a string that contains a serialized HTML document', ->
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unpoly-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -109,17 +109,18 @@ files:
|
|
109
109
|
- lib/assets/javascripts/unpoly/proxy.js.coffee
|
110
110
|
- lib/assets/javascripts/unpoly/rails.js.coffee
|
111
111
|
- lib/assets/javascripts/unpoly/syntax.js.coffee
|
112
|
+
- lib/assets/javascripts/unpoly/toast.js.coffee
|
112
113
|
- lib/assets/javascripts/unpoly/tooltip.js.coffee
|
113
114
|
- lib/assets/javascripts/unpoly/util.js.coffee
|
114
115
|
- lib/assets/stylesheets/unpoly-bootstrap3.css.sass
|
115
116
|
- lib/assets/stylesheets/unpoly-bootstrap3/modal-ext.css.sass
|
116
117
|
- lib/assets/stylesheets/unpoly.css.sass
|
117
118
|
- lib/assets/stylesheets/unpoly/close.css.sass
|
118
|
-
- lib/assets/stylesheets/unpoly/error.css.sass
|
119
119
|
- lib/assets/stylesheets/unpoly/flow.css.sass
|
120
120
|
- lib/assets/stylesheets/unpoly/link.css.sass
|
121
121
|
- lib/assets/stylesheets/unpoly/modal.css.sass
|
122
122
|
- lib/assets/stylesheets/unpoly/popup.css.sass
|
123
|
+
- lib/assets/stylesheets/unpoly/toast.css.sass
|
123
124
|
- lib/assets/stylesheets/unpoly/tooltip.css.sass
|
124
125
|
- lib/unpoly-rails.rb
|
125
126
|
- lib/unpoly/rails/engine.rb
|
@@ -145,6 +146,7 @@ files:
|
|
145
146
|
- spec_app/app/controllers/application_controller.rb
|
146
147
|
- spec_app/app/controllers/binding_test_controller.rb
|
147
148
|
- spec_app/app/controllers/css_test_controller.rb
|
149
|
+
- spec_app/app/controllers/error_test_controller.rb
|
148
150
|
- spec_app/app/controllers/form_test/basics_controller.rb
|
149
151
|
- spec_app/app/controllers/form_test/uploads_controller.rb
|
150
152
|
- spec_app/app/controllers/pages_controller.rb
|
@@ -156,6 +158,8 @@ files:
|
|
156
158
|
- spec_app/app/views/css_test/popup.erb
|
157
159
|
- spec_app/app/views/css_test/popup_contents.erb
|
158
160
|
- spec_app/app/views/css_test/tooltip.erb
|
161
|
+
- spec_app/app/views/error_test/trigger.erb
|
162
|
+
- spec_app/app/views/error_test/unexpected_response.erb
|
159
163
|
- spec_app/app/views/form_test/basics/new.erb
|
160
164
|
- spec_app/app/views/form_test/submission_result.erb
|
161
165
|
- spec_app/app/views/form_test/uploads/new.erb
|
@@ -226,6 +230,7 @@ files:
|
|
226
230
|
- spec_app/spec/javascripts/helpers/trigger.js.coffee
|
227
231
|
- spec_app/spec/javascripts/helpers/wait_until_dom_ready.js.coffee
|
228
232
|
- spec_app/spec/javascripts/support/jasmine.yml
|
233
|
+
- spec_app/spec/javascripts/up/browser_spec.js.coffee
|
229
234
|
- spec_app/spec/javascripts/up/bus_spec.js.coffee
|
230
235
|
- spec_app/spec/javascripts/up/flow_spec.js.coffee
|
231
236
|
- spec_app/spec/javascripts/up/form_spec.js.coffee
|
@@ -1,21 +0,0 @@
|
|
1
|
-
.up-error
|
2
|
-
background-color: #c30
|
3
|
-
color: white
|
4
|
-
padding: 10px
|
5
|
-
font-family: arial, helvetica, sans-serif
|
6
|
-
font-size: 14px
|
7
|
-
line-height: 18px
|
8
|
-
position: fixed
|
9
|
-
left: 0
|
10
|
-
bottom: 0
|
11
|
-
max-width: 100%
|
12
|
-
box-sizing: border-box
|
13
|
-
z-index: 99999999
|
14
|
-
|
15
|
-
.up-error-variable
|
16
|
-
background-color: rgba(0, 0, 0, 0.3)
|
17
|
-
padding: 1px 3px
|
18
|
-
border-radius: 2px
|
19
|
-
font-weight: normal
|
20
|
-
max-width: 100px
|
21
|
-
overflow: hidden
|