alula-plugins 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -6,27 +6,25 @@ module Alula
6
6
  File.join(File.dirname(__FILE__), %w{.. .. .. plugins analytics})
7
7
  end
8
8
 
9
+ def self.version
10
+ Alula::Plugins::VERSION
11
+ end
12
+
9
13
  def self.install(options)
10
14
  return false unless options.kind_of?(Hash)
11
15
 
12
16
  options.each do |provider, opts|
13
- if provider == "gosquared"
14
- Alula::Plugin.addon(:body, ->(context) {<<-EOT
15
- <script type="text/javascript">
16
- var GoSquared={};
17
- GoSquared.acct = "#{opts}";
18
- (function(w){
19
- function gs(){
20
- w._gstc_lt=+(new Date); var d=document;
21
- var g = d.createElement("script"); g.type = "text/javascript"; g.async = true; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js";
22
- var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s);
23
- }
24
- w.addEventListener?w.addEventListener("load",gs,false):w.attachEvent("onload",gs);
25
- })(window);
26
- </script>
17
+ tracker = case provider
18
+ when "gosquared"
19
+ <<-EOT
20
+ <script type="text/javascript">var GoSquared={};GoSquared.acct="#{opts}",function(e){function t(){e._gstc_lt=+(new Date);var t=document,n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="//d1l6p2sc9645hc.cloudfront.net/tracker.js";var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}e.addEventListener?e.addEventListener("load",t,!1):e.attachEvent("onload",t)}(window);</script>
27
21
  EOT
28
- })
22
+ when "woopra"
23
+ <<-EOT
24
+ <script type="text/javascript">function woopraReady(e){return e.setDomain("#{opts}"),e.setIdleTimeout(3e5),e.track(),!1}(function(){var e=document.createElement("script");e.src=document.location.protocol+"//static.woopra.com/js/woopra.js",e.type="text/javascript",e.async=!0;var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();</script>
25
+ EOT
29
26
  end
27
+ Alula::Plugin.addon(:body, ->(context) { tracker }) if tracker
30
28
  end
31
29
  end
32
30
  end
@@ -6,6 +6,10 @@ module Alula
6
6
  File.join(File.dirname(__FILE__), %w{.. .. .. plugins disqus})
7
7
  end
8
8
 
9
+ def self.version
10
+ Alula::Plugins::VERSION
11
+ end
12
+
9
13
  def self.install(options)
10
14
  return false unless options.shortname
11
15
  # Force defer mode on script loading
@@ -6,6 +6,10 @@ module Alula
6
6
  File.join(File.dirname(__FILE__), %w{.. .. .. plugins emphasis})
7
7
  end
8
8
 
9
+ def self.version
10
+ Alula::Plugins::VERSION
11
+ end
12
+
9
13
  def self.install(options)
10
14
  # Force defer mode on script loading
11
15
  Alula::Plugin.script_load_mode = :defer
@@ -7,6 +7,10 @@ module Alula
7
7
  File.join(File.dirname(__FILE__), %w{.. .. .. plugins fancybox})
8
8
  end
9
9
 
10
+ def self.version
11
+ Alula::Plugins::VERSION
12
+ end
13
+
10
14
  def self.install(options)
11
15
  # Display license unless acknoledged
12
16
  unless options.kind_of?(Hash) and options['personal']
@@ -33,7 +37,7 @@ module Alula
33
37
 
34
38
  def content
35
39
  # FeedBuilder support, skip sublime extensions for feeds
36
- return super if self.context.item.metadata.renderer.class.to_s == "Alula::Generator::FeedBuilder"
40
+ return super if self.context.item.metadata.renderer.class.to_s == "Alula::FeedBuilder"
37
41
 
38
42
  image = attachment_url(@source, :image)
39
43
  thumbnail = attachment_url(@source, :thumbnail)
@@ -7,13 +7,17 @@ module Alula
7
7
  File.join(File.dirname(__FILE__), %w{.. .. .. plugins sublimevideo})
8
8
  end
9
9
 
10
+ def self.version
11
+ Alula::Plugins::VERSION
12
+ end
13
+
10
14
  def self.install(options)
11
15
  # Require valid sublime token present in configuration
12
16
  return false unless options.token
13
17
 
14
18
  # Register addons
15
19
  Alula::Plugin.addon :head, ->(context) {
16
- "<script src=\"http://cdn.sublimevideo.net/js/#{options.token}.js\"></script>" if context.item.content[/\<video/]
20
+ "<script src=\"http://cdn.sublimevideo.net/js/#{options.token}.js\" async></script>" if context.item.content[/\<video/]
17
21
  }
18
22
 
19
23
  # Register for image tags
@@ -22,7 +26,7 @@ module Alula
22
26
 
23
27
  def content
24
28
  # FeedBuilder support, skip sublime extensions for feeds
25
- return super if self.context.item.metadata.renderer.class.to_s == "Alula::Generator::FeedBuilder"
29
+ return super if self.context.item.metadata.renderer.class.to_s == "Alula::FeedBuilder"
26
30
 
27
31
  sublime_videotag(@source)
28
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alula-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-19 00:00:00.000000000 Z
12
+ date: 2012-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alula
@@ -76,7 +76,7 @@ files:
76
76
  - plugins/fancybox/assets/javascripts/jquery.fancybox.js
77
77
  - plugins/fancybox/assets/stylesheets/fancybox.css.erb
78
78
  - plugins/sublimevideo/assets/images/zoom_icon.png
79
- - plugins/sublimevideo/assets/javascripts/sublimevideo.js
79
+ - plugins/sublimevideo/assets/javascripts/sublimevideo.js.coffee
80
80
  - plugins/sublimevideo/assets/stylesheets/sublimevideo.css.erb
81
81
  homepage: ''
82
82
  licenses: []
@@ -1,3 +0,0 @@
1
- /*
2
- Empty Javascript file for SublimeVideo
3
- */