youthtree-helpers 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,18 @@ module YouthTree
3
3
  module AnalyticsHelper
4
4
 
5
5
  def clicky_snippet_js(site_id)
6
- return <<-END_OF_JS
6
+ value = <<-END_OF_JS
7
7
  var clicky = { log: function(){ return; }, goal: function(){ return; }};
8
8
  var clicky_site_id = #{site_id};
9
9
  (function() {
10
10
  var s = document.createElement('script');
11
11
  s.type = 'text/javascript';
12
12
  s.async = true;
13
- s.src = (document.location.protocol + '://static.getclicky.com/js');
13
+ s.src = (document.location.protocol + '//static.getclicky.com/js');
14
14
  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
15
15
  })();
16
16
  END_OF_JS
17
+ value.gsub(/^\s{10}/, '')
17
18
  end
18
19
 
19
20
  def clicky_analytics
@@ -21,7 +22,7 @@ module YouthTree
21
22
  content = ActiveSupport::SafeBuffer.new
22
23
  site_id = Settings.clicky.site_id.to_i;
23
24
  content << javascript_tag(clicky_snippet_js(site_id))
24
- static_image_tag = tag(:img, :width => 1, :height => 1, :src => "#{request.protocol}://in.getclicky.com/#{site_id}ns.gif")
25
+ static_image_tag = tag(:img, :width => 1, :height => 1, :src => "#{request.protocol}in.getclicky.com/#{site_id}ns.gif")
25
26
  content << content_tag(:noscript, content_tag(:div, static_image_tag, :class => 'clicky-tracker'))
26
27
  content
27
28
  end
@@ -38,7 +39,7 @@ module YouthTree
38
39
  end
39
40
 
40
41
  def google_analytics_snippet_js(identifier)
41
- return <<-END_OF_JS
42
+ value = <<-END_OF_JS
42
43
  var _gaq = _gaq || [];
43
44
  _gaq.push(['_setAccount', #{identifier.to_json}]);
44
45
  _gaq.push(['_trackPageview']);
@@ -49,6 +50,7 @@ module YouthTree
49
50
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
50
51
  })();
51
52
  END_OF_JS
53
+ value.gsub(/^\s{10}/, '')
52
54
  end
53
55
  end
54
56
  end
@@ -2,7 +2,7 @@ require 'active_support/concern'
2
2
 
3
3
  module YouthTree
4
4
  module Helpers
5
- VERSION = "0.1.2".freeze
5
+ VERSION = "0.1.3".freeze
6
6
 
7
7
  extend ActiveSupport::Autoload
8
8
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{youthtree-helpers}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darcy Laycock"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youthtree-helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darcy Laycock