onebox 1.9.12 → 1.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/onebox/engine/flickr_onebox.rb +38 -1
- data/lib/onebox/engine/typeform_onebox.rb +1 -1
- data/lib/onebox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 209e487fdbdcaee7a72c0c97a21df4dc5792d367e3b276d70621d6fcbb74e975
|
4
|
+
data.tar.gz: f53cda43c6b5fdcb90d42288ba87ceb3b5e0207f0dc94d60d31c3309b9401cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 497b004bb9077ae8e961321899af86bb7667d102f3c71ccfa39e2b337de63b2b23c0fb34b46c049353d4a72aef331dd2420a8cc96a6c8becf33842c63b3c3f80
|
7
|
+
data.tar.gz: 3896d227c14f6ab1d2381a75814514919182eefc2ec3a2bc359c11980890b929f9b38391d7d7b8675c4f8d06faeb03500b01cb78d73fb9dee4eec97f059fa3c3
|
data/Gemfile.lock
CHANGED
@@ -7,10 +7,47 @@ module Onebox
|
|
7
7
|
class FlickrOnebox
|
8
8
|
include Engine
|
9
9
|
include StandardEmbed
|
10
|
-
include OpengraphImage
|
11
10
|
|
12
11
|
matches_regexp(/^https?:\/\/www\.flickr\.com\/photos\//)
|
13
12
|
always_https
|
13
|
+
|
14
|
+
def to_html
|
15
|
+
og = get_opengraph
|
16
|
+
return album_html(og) if og.url =~ /\/sets\//
|
17
|
+
return image_html(og) if !og.image.nil?
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def album_html(og)
|
24
|
+
escaped_url = ::Onebox::Helpers.normalize_url_for_output(url)
|
25
|
+
album_title = "[Album] #{og.title}"
|
26
|
+
|
27
|
+
<<-HTML
|
28
|
+
<div class='onebox flickr-album'>
|
29
|
+
<a href='#{escaped_url}' target='_blank'>
|
30
|
+
<span class='outer-box' style='max-width:#{og.image_width}px'>
|
31
|
+
<span class='inner-box'>
|
32
|
+
<span class='album-title'>#{album_title}</span>
|
33
|
+
</span>
|
34
|
+
</span>
|
35
|
+
<img src='#{og.get_secure_image}' #{og.title_attr} height='#{og.image_height}' width='#{og.image_width}'>
|
36
|
+
</a>
|
37
|
+
</div>
|
38
|
+
HTML
|
39
|
+
end
|
40
|
+
|
41
|
+
def image_html(og)
|
42
|
+
escaped_url = ::Onebox::Helpers.normalize_url_for_output(url)
|
43
|
+
|
44
|
+
<<-HTML
|
45
|
+
<a href='#{escaped_url}' target='_blank' class="onebox">
|
46
|
+
<img src='#{og.get_secure_image}' #{og.title_attr} alt='Imgur' height='#{og.image_height}' width='#{og.image_width}'>
|
47
|
+
</a>
|
48
|
+
HTML
|
49
|
+
end
|
50
|
+
|
14
51
|
end
|
15
52
|
end
|
16
53
|
end
|
data/lib/onebox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-09-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|