glow 0.0.10 → 0.0.11
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.
- data/Gemfile.lock +41 -40
- data/Rakefile +1 -0
- data/lib/glow/version.rb +1 -1
- data/src/glow.coffee +1 -1
- data/test/rails3/app/controllers/flash_controller.rb +1 -0
- data/test/rails3/app/views/flash/show.html.erb +4 -4
- data/test/rails3/public/javascripts/glow.js +9 -2
- data/test/rails3/spec/integration/flash_spec.rb +10 -5
- data/test/rails31/app/controllers/flash_controller.rb +1 -0
- data/test/rails31/app/views/flash/show.html.erb +4 -4
- data/test/rails31/spec/integration/flash_spec.rb +10 -5
- data/test/rails32/app/controllers/flash_controller.rb +1 -0
- data/test/rails32/app/views/flash/show.html.erb +4 -4
- data/test/rails32/spec/integration/flash_spec.rb +10 -5
- data/vendor/assets/javascripts/glow.js +6 -1
- metadata +4 -5
- data/lib/tasks/glow_tasks.rake +0 -4
data/Gemfile.lock
CHANGED
@@ -1,92 +1,93 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
glow (0.0.
|
4
|
+
glow (0.0.11)
|
5
5
|
jquery-rails
|
6
6
|
rails (>= 3.0.0, < 4.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.2.
|
12
|
-
actionpack (= 3.2.
|
11
|
+
actionmailer (3.2.9)
|
12
|
+
actionpack (= 3.2.9)
|
13
13
|
mail (~> 2.4.4)
|
14
|
-
actionpack (3.2.
|
15
|
-
activemodel (= 3.2.
|
16
|
-
activesupport (= 3.2.
|
14
|
+
actionpack (3.2.9)
|
15
|
+
activemodel (= 3.2.9)
|
16
|
+
activesupport (= 3.2.9)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
|
-
journey (~> 1.0.
|
19
|
+
journey (~> 1.0.4)
|
20
20
|
rack (~> 1.4.0)
|
21
21
|
rack-cache (~> 1.2)
|
22
22
|
rack-test (~> 0.6.1)
|
23
|
-
sprockets (~> 2.1
|
24
|
-
activemodel (3.2.
|
25
|
-
activesupport (= 3.2.
|
23
|
+
sprockets (~> 2.2.1)
|
24
|
+
activemodel (3.2.9)
|
25
|
+
activesupport (= 3.2.9)
|
26
26
|
builder (~> 3.0.0)
|
27
|
-
activerecord (3.2.
|
28
|
-
activemodel (= 3.2.
|
29
|
-
activesupport (= 3.2.
|
27
|
+
activerecord (3.2.9)
|
28
|
+
activemodel (= 3.2.9)
|
29
|
+
activesupport (= 3.2.9)
|
30
30
|
arel (~> 3.0.2)
|
31
31
|
tzinfo (~> 0.3.29)
|
32
|
-
activeresource (3.2.
|
33
|
-
activemodel (= 3.2.
|
34
|
-
activesupport (= 3.2.
|
35
|
-
activesupport (3.2.
|
32
|
+
activeresource (3.2.9)
|
33
|
+
activemodel (= 3.2.9)
|
34
|
+
activesupport (= 3.2.9)
|
35
|
+
activesupport (3.2.9)
|
36
36
|
i18n (~> 0.6)
|
37
37
|
multi_json (~> 1.0)
|
38
38
|
arel (3.0.2)
|
39
|
-
builder (3.0.
|
39
|
+
builder (3.0.4)
|
40
40
|
erubis (2.7.0)
|
41
41
|
hike (1.2.1)
|
42
|
-
i18n (0.6.
|
42
|
+
i18n (0.6.1)
|
43
43
|
journey (1.0.4)
|
44
|
-
jquery-rails (2.
|
45
|
-
railties (>= 3.
|
44
|
+
jquery-rails (2.1.3)
|
45
|
+
railties (>= 3.1.0, < 5.0)
|
46
46
|
thor (~> 0.14)
|
47
|
-
json (1.7.
|
47
|
+
json (1.7.5)
|
48
48
|
mail (2.4.4)
|
49
49
|
i18n (>= 0.4.0)
|
50
50
|
mime-types (~> 1.16)
|
51
51
|
treetop (~> 1.4.8)
|
52
52
|
mime-types (1.19)
|
53
|
-
multi_json (1.3.
|
53
|
+
multi_json (1.3.7)
|
54
54
|
polyglot (0.3.3)
|
55
55
|
rack (1.4.1)
|
56
56
|
rack-cache (1.2)
|
57
57
|
rack (>= 0.4)
|
58
58
|
rack-ssl (1.3.2)
|
59
59
|
rack
|
60
|
-
rack-test (0.6.
|
60
|
+
rack-test (0.6.2)
|
61
61
|
rack (>= 1.0)
|
62
|
-
rails (3.2.
|
63
|
-
actionmailer (= 3.2.
|
64
|
-
actionpack (= 3.2.
|
65
|
-
activerecord (= 3.2.
|
66
|
-
activeresource (= 3.2.
|
67
|
-
activesupport (= 3.2.
|
62
|
+
rails (3.2.9)
|
63
|
+
actionmailer (= 3.2.9)
|
64
|
+
actionpack (= 3.2.9)
|
65
|
+
activerecord (= 3.2.9)
|
66
|
+
activeresource (= 3.2.9)
|
67
|
+
activesupport (= 3.2.9)
|
68
68
|
bundler (~> 1.0)
|
69
|
-
railties (= 3.2.
|
70
|
-
railties (3.2.
|
71
|
-
actionpack (= 3.2.
|
72
|
-
activesupport (= 3.2.
|
69
|
+
railties (= 3.2.9)
|
70
|
+
railties (3.2.9)
|
71
|
+
actionpack (= 3.2.9)
|
72
|
+
activesupport (= 3.2.9)
|
73
73
|
rack-ssl (~> 1.3.2)
|
74
74
|
rake (>= 0.8.7)
|
75
75
|
rdoc (~> 3.4)
|
76
|
-
thor (
|
77
|
-
rake (0.
|
76
|
+
thor (>= 0.14.6, < 2.0)
|
77
|
+
rake (10.0.2)
|
78
78
|
rdoc (3.12)
|
79
79
|
json (~> 1.4)
|
80
|
-
sprockets (2.1
|
80
|
+
sprockets (2.2.1)
|
81
81
|
hike (~> 1.2)
|
82
|
+
multi_json (~> 1.0)
|
82
83
|
rack (~> 1.0)
|
83
84
|
tilt (~> 1.1, != 1.3.0)
|
84
|
-
thor (0.
|
85
|
+
thor (0.16.0)
|
85
86
|
tilt (1.3.3)
|
86
|
-
treetop (1.4.
|
87
|
+
treetop (1.4.12)
|
87
88
|
polyglot
|
88
89
|
polyglot (>= 0.3.1)
|
89
|
-
tzinfo (0.3.
|
90
|
+
tzinfo (0.3.35)
|
90
91
|
|
91
92
|
PLATFORMS
|
92
93
|
ruby
|
data/Rakefile
CHANGED
data/lib/glow/version.rb
CHANGED
data/src/glow.coffee
CHANGED
@@ -4,7 +4,7 @@ window.Glow =
|
|
4
4
|
$(document).ajaxComplete (evt, xhr, options) ->
|
5
5
|
type = xhr.getResponseHeader('X-Message-Type')
|
6
6
|
message = xhr.getResponseHeader('X-Message')
|
7
|
-
Glow.flash type, message if type and message
|
7
|
+
Glow.flash type, $('<div/>').html(message).text() if type and message
|
8
8
|
|
9
9
|
window.Flash =
|
10
10
|
fire: Glow.flash
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<script type="application/javascript">
|
2
2
|
// Flash handling
|
3
|
-
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').
|
3
|
+
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').text(flash.message); });
|
4
4
|
</script>
|
5
5
|
|
6
6
|
<p id="flash"><%= flash.map { |type, message| message }.join %></p>
|
7
|
-
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓
|
8
|
-
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓
|
7
|
+
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓' %></p>
|
8
|
+
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓'}, remote: true %></p>
|
9
9
|
<p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
|
10
10
|
|
11
11
|
<script type="application/javascript">
|
12
|
-
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery
|
12
|
+
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery ajax: ✓', format: :js %>'); return false;});
|
13
13
|
</script>
|
@@ -1,4 +1,6 @@
|
|
1
|
+
// Generated by CoffeeScript 1.3.3
|
1
2
|
(function() {
|
3
|
+
|
2
4
|
window.Glow = {
|
3
5
|
flash: function(type, message) {
|
4
6
|
return $(document).trigger('glow:flash', {
|
@@ -7,12 +9,16 @@
|
|
7
9
|
});
|
8
10
|
}
|
9
11
|
};
|
12
|
+
|
10
13
|
$(document).ajaxComplete(function(evt, xhr, options) {
|
11
14
|
var message, type;
|
12
|
-
|
13
|
-
|
15
|
+
type = xhr.getResponseHeader('X-Message-Type');
|
16
|
+
message = xhr.getResponseHeader('X-Message');
|
17
|
+
if (type && message) {
|
18
|
+
return Glow.flash(type, $('<div/>').html(message).text());
|
14
19
|
}
|
15
20
|
});
|
21
|
+
|
16
22
|
window.Flash = {
|
17
23
|
fire: Glow.flash,
|
18
24
|
success: function(message) {
|
@@ -25,4 +31,5 @@
|
|
25
31
|
return Glow.flash('error', message);
|
26
32
|
}
|
27
33
|
};
|
34
|
+
|
28
35
|
}).call(this);
|
@@ -5,13 +5,18 @@ describe "the flash view" do
|
|
5
5
|
it "redirects" do
|
6
6
|
visit root_path
|
7
7
|
click_on 'redirect'
|
8
|
-
page.
|
8
|
+
page.should have_content('utf8: ✓')
|
9
9
|
end
|
10
10
|
|
11
|
-
it "handles ajax" do
|
11
|
+
it "handles rails ajax" do
|
12
12
|
visit root_path
|
13
|
-
click_on 'ajax'
|
14
|
-
page.
|
13
|
+
click_on 'rails ajax'
|
14
|
+
page.should have_content('rails ajax: ✓')
|
15
15
|
end
|
16
|
-
end
|
17
16
|
|
17
|
+
it "handles jquery ajax" do
|
18
|
+
visit root_path
|
19
|
+
click_on 'jquery ajax'
|
20
|
+
page.should have_content('jquery ajax: ✓')
|
21
|
+
end
|
22
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<script type="application/javascript">
|
2
2
|
// Flash handling
|
3
|
-
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').
|
3
|
+
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').text(flash.message); });
|
4
4
|
</script>
|
5
5
|
|
6
6
|
<p id="flash"><%= flash.map { |type, message| message }.join %></p>
|
7
|
-
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓
|
8
|
-
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓
|
7
|
+
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓' %></p>
|
8
|
+
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓'}, remote: true %></p>
|
9
9
|
<p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
|
10
10
|
|
11
11
|
<script type="application/javascript">
|
12
|
-
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery
|
12
|
+
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery ajax: ✓', format: :js %>'); return false;});
|
13
13
|
</script>
|
@@ -5,13 +5,18 @@ describe "the flash view" do
|
|
5
5
|
it "redirects" do
|
6
6
|
visit root_path
|
7
7
|
click_on 'redirect'
|
8
|
-
page.
|
8
|
+
page.should have_content('utf8: ✓')
|
9
9
|
end
|
10
10
|
|
11
|
-
it "handles ajax" do
|
11
|
+
it "handles rails ajax" do
|
12
12
|
visit root_path
|
13
|
-
click_on 'ajax'
|
14
|
-
page.
|
13
|
+
click_on 'rails ajax'
|
14
|
+
page.should have_content('rails ajax: ✓')
|
15
15
|
end
|
16
|
-
end
|
17
16
|
|
17
|
+
it "handles jquery ajax" do
|
18
|
+
visit root_path
|
19
|
+
click_on 'jquery ajax'
|
20
|
+
page.should have_content('jquery ajax: ✓')
|
21
|
+
end
|
22
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<script type="application/javascript">
|
2
2
|
// Flash handling
|
3
|
-
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').
|
3
|
+
$(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').text(flash.message); });
|
4
4
|
</script>
|
5
5
|
|
6
6
|
<p id="flash"><%= flash.map { |type, message| message }.join %></p>
|
7
|
-
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓
|
8
|
-
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓
|
7
|
+
<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓' %></p>
|
8
|
+
<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓'}, remote: true %></p>
|
9
9
|
<p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
|
10
10
|
|
11
11
|
<script type="application/javascript">
|
12
|
-
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery
|
12
|
+
$('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery ajax: ✓', format: :js %>'); return false;});
|
13
13
|
</script>
|
@@ -5,13 +5,18 @@ describe "the flash view" do
|
|
5
5
|
it "redirects" do
|
6
6
|
visit root_path
|
7
7
|
click_on 'redirect'
|
8
|
-
page.
|
8
|
+
page.should have_content('utf8: ✓')
|
9
9
|
end
|
10
10
|
|
11
|
-
it "handles ajax" do
|
11
|
+
it "handles rails ajax" do
|
12
12
|
visit root_path
|
13
|
-
click_on 'ajax'
|
14
|
-
page.
|
13
|
+
click_on 'rails ajax'
|
14
|
+
page.should have_content('rails ajax: ✓')
|
15
15
|
end
|
16
|
-
end
|
17
16
|
|
17
|
+
it "handles jquery ajax" do
|
18
|
+
visit root_path
|
19
|
+
click_on 'jquery ajax'
|
20
|
+
page.should have_content('jquery ajax: ✓')
|
21
|
+
end
|
22
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
+
// Generated by CoffeeScript 1.3.3
|
1
2
|
(function() {
|
3
|
+
|
2
4
|
window.Glow = {
|
3
5
|
flash: function(type, message) {
|
4
6
|
return $(document).trigger('glow:flash', {
|
@@ -7,14 +9,16 @@
|
|
7
9
|
});
|
8
10
|
}
|
9
11
|
};
|
12
|
+
|
10
13
|
$(document).ajaxComplete(function(evt, xhr, options) {
|
11
14
|
var message, type;
|
12
15
|
type = xhr.getResponseHeader('X-Message-Type');
|
13
16
|
message = xhr.getResponseHeader('X-Message');
|
14
17
|
if (type && message) {
|
15
|
-
return Glow.flash(type, message);
|
18
|
+
return Glow.flash(type, $('<div/>').html(message).text());
|
16
19
|
}
|
17
20
|
});
|
21
|
+
|
18
22
|
window.Flash = {
|
19
23
|
fire: Glow.flash,
|
20
24
|
success: function(message) {
|
@@ -27,4 +31,5 @@
|
|
27
31
|
return Glow.flash('error', message);
|
28
32
|
}
|
29
33
|
};
|
34
|
+
|
30
35
|
}).call(this);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- lib/glow/filter.rb
|
76
76
|
- lib/glow/railtie.rb
|
77
77
|
- lib/glow/version.rb
|
78
|
-
- lib/tasks/glow_tasks.rake
|
79
78
|
- src/glow.coffee
|
80
79
|
- test/rails3/.rspec
|
81
80
|
- test/rails3/Gemfile
|
@@ -212,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
211
|
version: '0'
|
213
212
|
segments:
|
214
213
|
- 0
|
215
|
-
hash:
|
214
|
+
hash: -3927576654263050558
|
216
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
216
|
none: false
|
218
217
|
requirements:
|
@@ -221,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
220
|
version: '0'
|
222
221
|
segments:
|
223
222
|
- 0
|
224
|
-
hash:
|
223
|
+
hash: -3927576654263050558
|
225
224
|
requirements: []
|
226
225
|
rubyforge_project:
|
227
226
|
rubygems_version: 1.8.24
|
data/lib/tasks/glow_tasks.rake
DELETED