glow 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,92 +1,93 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- glow (0.0.10)
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.3)
12
- actionpack (= 3.2.3)
11
+ actionmailer (3.2.9)
12
+ actionpack (= 3.2.9)
13
13
  mail (~> 2.4.4)
14
- actionpack (3.2.3)
15
- activemodel (= 3.2.3)
16
- activesupport (= 3.2.3)
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.1)
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.2)
24
- activemodel (3.2.3)
25
- activesupport (= 3.2.3)
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.3)
28
- activemodel (= 3.2.3)
29
- activesupport (= 3.2.3)
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.3)
33
- activemodel (= 3.2.3)
34
- activesupport (= 3.2.3)
35
- activesupport (3.2.3)
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.0)
39
+ builder (3.0.4)
40
40
  erubis (2.7.0)
41
41
  hike (1.2.1)
42
- i18n (0.6.0)
42
+ i18n (0.6.1)
43
43
  journey (1.0.4)
44
- jquery-rails (2.0.2)
45
- railties (>= 3.2.0, < 5.0)
44
+ jquery-rails (2.1.3)
45
+ railties (>= 3.1.0, < 5.0)
46
46
  thor (~> 0.14)
47
- json (1.7.4)
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.6)
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.1)
60
+ rack-test (0.6.2)
61
61
  rack (>= 1.0)
62
- rails (3.2.3)
63
- actionmailer (= 3.2.3)
64
- actionpack (= 3.2.3)
65
- activerecord (= 3.2.3)
66
- activeresource (= 3.2.3)
67
- activesupport (= 3.2.3)
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.3)
70
- railties (3.2.3)
71
- actionpack (= 3.2.3)
72
- activesupport (= 3.2.3)
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 (~> 0.14.6)
77
- rake (0.9.2.2)
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.3)
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.14.6)
85
+ thor (0.16.0)
85
86
  tilt (1.3.3)
86
- treetop (1.4.10)
87
+ treetop (1.4.12)
87
88
  polyglot
88
89
  polyglot (>= 0.3.1)
89
- tzinfo (0.3.33)
90
+ tzinfo (0.3.35)
90
91
 
91
92
  PLATFORMS
92
93
  ruby
data/Rakefile CHANGED
@@ -22,6 +22,7 @@ end
22
22
 
23
23
  Bundler::GemHelper.install_tasks
24
24
 
25
+ desc 'compile glow.coffee to .js'
25
26
  task :compile do
26
27
  sh 'coffee -co vendor/assets/javascripts src/glow.coffee'
27
28
  end
@@ -1,3 +1,3 @@
1
1
  module Glow
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -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
@@ -12,6 +12,7 @@ class FlashController < ApplicationController
12
12
  respond_to do |wants|
13
13
  wants.js {
14
14
  flash[params[:type]] = params[:message]
15
+ head :ok
15
16
  }
16
17
  end
17
18
  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').html(flash.message); });
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: ✓ ' %></p>
8
- <p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓ '}, remote: true %></p>
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 utf8: ✓', format: :js %>'); return false;});
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
- if (type = xhr.getResponseHeader('X-Message-Type') && (message = xhr.getResponseHeader('X-Message'))) {
13
- return Glow.flash(type, message);
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.has_content?('utf8: ✓')
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.has_content?('ajax: ✓')
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
@@ -12,6 +12,7 @@ class FlashController < ApplicationController
12
12
  respond_to do |wants|
13
13
  wants.js {
14
14
  flash[params[:type].to_sym] = params[:message]
15
+ head :ok
15
16
  }
16
17
  end
17
18
  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').html(flash.message); });
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: ✓ ' %></p>
8
- <p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓ '}, remote: true %></p>
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 utf8: ✓', format: :js %>'); return false;});
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.has_content?('utf8: ✓')
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.has_content?('ajax: ✓')
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
@@ -12,6 +12,7 @@ class FlashController < ApplicationController
12
12
  respond_to do |wants|
13
13
  wants.js {
14
14
  flash[params[:type].to_sym] = params[:message]
15
+ head :ok
15
16
  }
16
17
  end
17
18
  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').html(flash.message); });
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: ✓ ' %></p>
8
- <p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓ '}, remote: true %></p>
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 utf8: ✓', format: :js %>'); return false;});
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.has_content?('utf8: ✓')
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.has_content?('ajax: ✓')
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.10
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-08-14 00:00:00.000000000 Z
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: 4248034504190271721
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: 4248034504190271721
223
+ hash: -3927576654263050558
225
224
  requirements: []
226
225
  rubyforge_project:
227
226
  rubygems_version: 1.8.24
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :glow do
3
- # # Task goes here
4
- # end