upjs-rails 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/up.css +16 -1
- data/dist/up.js +499 -88
- data/dist/up.min.css +1 -1
- data/dist/up.min.js +2 -1
- data/lib/assets/javascripts/up/browser.js.coffee +17 -1
- data/lib/assets/javascripts/up/bus.js.coffee +6 -4
- data/lib/assets/javascripts/up/flow.js.coffee +25 -16
- data/lib/assets/javascripts/up/form.js.coffee +11 -3
- data/lib/assets/javascripts/up/history.js.coffee +3 -4
- data/lib/assets/javascripts/up/link.js.coffee +47 -17
- data/lib/assets/javascripts/up/magic.js.coffee +36 -8
- data/lib/assets/javascripts/up/modal.js.coffee +6 -8
- data/lib/assets/javascripts/up/motion.js.coffee +9 -7
- data/lib/assets/javascripts/up/navigation.js.coffee +17 -7
- data/lib/assets/javascripts/up/popup.js.coffee +2 -4
- data/lib/assets/javascripts/up/proxy.js.coffee +179 -0
- data/lib/assets/javascripts/up/tooltip.js.coffee +6 -2
- data/lib/assets/javascripts/up/util.js.coffee +92 -6
- data/lib/assets/javascripts/up.js.coffee +4 -1
- data/lib/assets/stylesheets/up/error.css.sass +15 -0
- data/lib/assets/stylesheets/up/tooltip.css.sass +1 -0
- data/lib/upjs/rails/current_location.rb +2 -1
- data/lib/upjs/rails/version.rb +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/spec/javascripts/up/flow_spec.js.coffee +38 -9
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +2 -2
- data/spec_app/spec/javascripts/up/magic_spec.js.coffee +25 -1
- data/spec_app/spec/javascripts/up/navigation_spec.js.coffee +2 -2
- metadata +4 -2
@@ -41,7 +41,31 @@ describe 'up.magic', ->
|
|
41
41
|
|
42
42
|
up.destroy('.container')
|
43
43
|
expect(destructor).toHaveBeenCalled()
|
44
|
-
|
44
|
+
|
45
|
+
it 'parses an up-data attribute as JSON and passes the parsed object as a second argument to the initializer', ->
|
46
|
+
|
47
|
+
observeArgs = jasmine.createSpy()
|
48
|
+
up.awaken '.child', ($element, data) ->
|
49
|
+
observeArgs($element.attr('class'), data)
|
50
|
+
|
51
|
+
data = { key1: 'value1', key2: 'value2' }
|
52
|
+
|
53
|
+
$tag = affix(".child").attr('up-data', JSON.stringify(data))
|
54
|
+
up.ready($tag)
|
55
|
+
|
56
|
+
expect(observeArgs).toHaveBeenCalledWith('child', data)
|
57
|
+
|
58
|
+
it 'passes an empty object as a second argument to the initializer if there is no up-data attribute', ->
|
59
|
+
|
60
|
+
observeArgs = jasmine.createSpy()
|
61
|
+
up.awaken '.child', ($element, data) ->
|
62
|
+
observeArgs($element.attr('class'), data)
|
63
|
+
|
64
|
+
up.ready(affix(".child"))
|
65
|
+
|
66
|
+
expect(observeArgs).toHaveBeenCalledWith('child', {})
|
67
|
+
|
68
|
+
|
45
69
|
describe 'up.ready', ->
|
46
70
|
|
47
71
|
it 'should have tests'
|
@@ -19,7 +19,7 @@ describe 'up.navigation', ->
|
|
19
19
|
jasmine.Ajax.requests.mostRecent().respondWith
|
20
20
|
status: 200
|
21
21
|
contentType: 'text/html'
|
22
|
-
responseHeaders: { 'X-Up-
|
22
|
+
responseHeaders: { 'X-Up-Location': '/foo/' }
|
23
23
|
responseText: '<div class="main">new-text</div>'
|
24
24
|
expect($link).toHaveClass('up-current')
|
25
25
|
|
@@ -31,7 +31,7 @@ describe 'up.navigation', ->
|
|
31
31
|
jasmine.Ajax.requests.mostRecent().respondWith
|
32
32
|
status: 200
|
33
33
|
contentType: 'text/html'
|
34
|
-
responseHeaders: { 'X-Up-
|
34
|
+
responseHeaders: { 'X-Up-Location': '/foo' }
|
35
35
|
responseText: '<div class="main">new-text</div>'
|
36
36
|
expect($link).toHaveClass('up-current')
|
37
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2015-
|
11
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -131,10 +131,12 @@ files:
|
|
131
131
|
- lib/assets/javascripts/up/motion.js.coffee
|
132
132
|
- lib/assets/javascripts/up/navigation.js.coffee
|
133
133
|
- lib/assets/javascripts/up/popup.js.coffee
|
134
|
+
- lib/assets/javascripts/up/proxy.js.coffee
|
134
135
|
- lib/assets/javascripts/up/tooltip.js.coffee
|
135
136
|
- lib/assets/javascripts/up/util.js.coffee
|
136
137
|
- lib/assets/stylesheets/up.css
|
137
138
|
- lib/assets/stylesheets/up/close.css.sass
|
139
|
+
- lib/assets/stylesheets/up/error.css.sass
|
138
140
|
- lib/assets/stylesheets/up/follow.css.sass
|
139
141
|
- lib/assets/stylesheets/up/modal.css.sass
|
140
142
|
- lib/assets/stylesheets/up/popup.css.sass
|