alula-plugins 0.4.21 → 0.4.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,10 @@ module Alula
34
34
  <<-EOT
35
35
  var _gauges=_gauges||[];(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.id="gauges-tracker",e.setAttribute("data-site-id","#{opts}"),e.src="//secure.gaug.es/track.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
36
36
  EOT
37
+ when "cedexis"
38
+ <<-EOT
39
+ (function(e,t){var n=function(){var n=t.createElement("script");n.type="text/javascript",n.async="async",n.src="//"+(e.location.protocol==="https:"?"s3.amazonaws.com/cdx-radar/":"radar.cedexis.com/")+"01-#{opts}-radar10.min.js",t.body.appendChild(n)};e.addEventListener?e.addEventListener("load",n,!1):e.attachEvent&&e.attachEvent("onload",n)})(window,document);
40
+ EOT
37
41
  end
38
42
  Alula::Plugin.script(:body, tracker) if tracker
39
43
  end
@@ -0,0 +1,75 @@
1
+ require 'alula/core_ext/tags/image'
2
+ require 'alula/plugin'
3
+
4
+ module Alula
5
+ class Fresco < ImageTag
6
+ def self.path
7
+ File.join(File.dirname(__FILE__), %w{.. .. .. plugins fresco})
8
+ end
9
+
10
+ def self.version
11
+ Alula::Plugins::VERSION::STRING
12
+ end
13
+
14
+ def self.install(options)
15
+ # Display license unless acknoledged
16
+ unless options.kind_of?(Hash) and options['personal']
17
+ puts <<-ENDOFNOTICE
18
+ *** Fresco
19
+ Fresco is licensed under the terms of the Fresco License.
20
+ Usage on non-commercial websites is free.
21
+ Licenses are available for commercial use.
22
+
23
+ If you would like to use Fresco for commercial purposes,
24
+ you can purchase a license from http://www.frescojs.com/download
25
+
26
+ To remove this notice, please include following options in config.yml
27
+ ---
28
+ plugins:
29
+ fresco:
30
+ personal: true
31
+ ENDOFNOTICE
32
+ end
33
+
34
+ @@options = options
35
+
36
+ # Register for image tags
37
+ Alula::Tag.register :image, self
38
+ end
39
+
40
+ def content
41
+ # FeedBuilder support, skip sublime extensions for feeds
42
+ return super if self.context.item.metadata.renderer.class.to_s[/FeedBuilder/]
43
+
44
+ image = attachment_url(@source, :image)
45
+ thumbnail = attachment_url(@source, :thumbnail)
46
+ hires = hires_url(@source, :image)
47
+ info = info(@source, :image)
48
+ tn_info = info(@source, :thumbnail)
49
+
50
+ return super unless image and thumbnail
51
+
52
+ unless @options['alternative'] or @options['title']
53
+ @options['title'] = info(@source, :image).title
54
+ @options['alternative'] = info(@source, :image).title
55
+ end
56
+
57
+ tag = "<a"
58
+ tag += " class=\"img fresco fb_zoomable #{@options["classes"].join(" ")}\""
59
+ tag += " href=\"#{image}\""
60
+ tag += " data-width=\"#{info.width}\""
61
+ tag += " data-height=\"#{info.height}\""
62
+ tag += " data-hires=\"#{hires}\"" if context.site.config.attachments.image.hires and hires
63
+ tag += " data-fresco-group=\"#{context.item.id}\""
64
+ tag += " data-fresco-group-options=\"ui: 'inside', thumbnails:#{@@options['thumbnails'] ? "true" : "false"}\""
65
+ tag += " title=\"#{@options["title"]}\"" if @options["title"]
66
+ tag += " style=\"width: #{tn_info.width}px; height: #{tn_info.height}px;\""
67
+ tag += ">"
68
+ tag += imagetag(@source, :thumbnail, classes: [])
69
+ tag += " <span class=\"fb_zoom_icon\"></span>"
70
+ tag += "</a>"
71
+ end
72
+ end
73
+ end
74
+
75
+ Alula::Plugin.register :fresco, Alula::Fresco
@@ -3,7 +3,7 @@ module Alula
3
3
  module VERSION
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- PATCH = 21
6
+ PATCH = 22
7
7
  PRE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
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.21
4
+ version: 0.4.22
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-08-29 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alula
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.4.21
21
+ version: 0.4.22
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.4.21
29
+ version: 0.4.22
30
30
  description: Offers simple collection of basic plugins that are not necessary needed
31
31
  for every blog.
32
32
  email: mikko@owlforestry.com
@@ -39,6 +39,7 @@ files:
39
39
  - lib/alula/plugins/disqus.rb
40
40
  - lib/alula/plugins/emphasis.rb
41
41
  - lib/alula/plugins/fancybox.rb
42
+ - lib/alula/plugins/fresco.rb
42
43
  - lib/alula/plugins/sublimevideo.rb
43
44
  - lib/alula/plugins/version.rb
44
45
  - lib/alula/plugins.rb