onebox 1.8.55 → 1.8.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/onebox/engine/cloudapp_onebox.rb +1 -1
- data/lib/onebox/engine/five_hundred_px_onebox.rb +1 -1
- data/lib/onebox/engine/giphy_onebox.rb +1 -1
- data/lib/onebox/engine/image_onebox.rb +1 -1
- data/lib/onebox/engine/imgur_onebox.rb +1 -1
- data/lib/onebox/engine/opengraph_image.rb +1 -1
- data/lib/onebox/engine/whitelisted_generic_onebox.rb +6 -1
- data/lib/onebox/helpers.rb +1 -1
- data/lib/onebox/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 835936fbc3288c143ecf47888afdc1df5c40e61f
|
4
|
+
data.tar.gz: 17db8d91315a31880f6a9d975a0b887d5ec75448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d584e578cb053558fc2d224b36ecfc7ff4d550db38c2bbc0e6b96a4d4badc67174445d8c275adc5f5754bc85d99a81da1d7992a1a5cdc7e29295959a3962c612
|
7
|
+
data.tar.gz: efebc3e8fa1850e00a8c148842037eacb89d7cde2be8e856670080b493a85e971ee29d179356d63bf5068a87a56ebff31724f51434da1085d9cb41cb6014ffa3
|
@@ -47,7 +47,7 @@ module Onebox
|
|
47
47
|
escaped_url = ::Onebox::Helpers.normalize_url_for_output(og[:url])
|
48
48
|
|
49
49
|
<<-HTML
|
50
|
-
<a href='#{escaped_url}' target='_blank'>
|
50
|
+
<a href='#{escaped_url}' target='_blank' class='onebox'>
|
51
51
|
<img src='#{og[:image]}' #{Helpers.title_attr(og)} alt='CloudApp' width='480'>
|
52
52
|
</a>
|
53
53
|
HTML
|
@@ -10,7 +10,7 @@ module Onebox
|
|
10
10
|
def to_html
|
11
11
|
og = get_opengraph
|
12
12
|
escaped_src = ::Onebox::Helpers.normalize_url_for_output(og[:image])
|
13
|
-
"<img src='#{escaped_src}' width='#{og[:image_width]}' height='#{og[:image_height]}' #{Helpers.title_attr(og)}>"
|
13
|
+
"<img src='#{escaped_src}' width='#{og[:image_width]}' height='#{og[:image_height]}' class='onebox' #{Helpers.title_attr(og)}>"
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
@@ -12,7 +12,7 @@ module Onebox
|
|
12
12
|
escaped_url = ::Onebox::Helpers.normalize_url_for_output(oembed[:url])
|
13
13
|
|
14
14
|
<<-HTML
|
15
|
-
<a href="#{escaped_url}" target="_blank">
|
15
|
+
<a href="#{escaped_url}" target="_blank" class="onebox">
|
16
16
|
<img src="#{escaped_url}" width="#{oembed[:width]}" height="#{oembed[:height]}" #{Helpers.title_attr(oembed)}>
|
17
17
|
</a>
|
18
18
|
HTML
|
@@ -58,7 +58,7 @@ module Onebox
|
|
58
58
|
escaped_src = ::Onebox::Helpers.normalize_url_for_output(get_secure_link(og[:image]))
|
59
59
|
|
60
60
|
<<-HTML
|
61
|
-
<a href='#{escaped_url}' target='_blank'>
|
61
|
+
<a href='#{escaped_url}' target='_blank' class="onebox">
|
62
62
|
<img src='#{escaped_src}' #{Helpers.title_attr(og)} alt='Imgur' height='#{og[:image_height]}' width='#{og[:image_width]}'>
|
63
63
|
</a>
|
64
64
|
HTML
|
@@ -5,7 +5,7 @@ module Onebox
|
|
5
5
|
def to_html
|
6
6
|
og = get_opengraph
|
7
7
|
escaped_src = ::Onebox::Helpers.normalize_url_for_output(og[:image])
|
8
|
-
"<img src='#{escaped_src}' width='#{og[:image_width]}' height='#{og[:image_height]}' #{Helpers.title_attr(og)}>"
|
8
|
+
"<img src='#{escaped_src}' width='#{og[:image_width]}' height='#{og[:image_height]}' class='onebox' #{Helpers.title_attr(og)}>"
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
@@ -241,6 +241,11 @@ module Onebox
|
|
241
241
|
end
|
242
242
|
end
|
243
243
|
|
244
|
+
if Onebox::Helpers.blank?(d[:label_1]) && !Onebox::Helpers.blank?(d[:price_amount]) && !Onebox::Helpers.blank?(d[:price_currency])
|
245
|
+
d[:label_1] = "Price"
|
246
|
+
d[:data_1] = Sanitize.fragment(Onebox::Helpers.truncate("#{d[:price_currency].strip} #{d[:price_amount].strip}"))
|
247
|
+
end
|
248
|
+
|
244
249
|
d
|
245
250
|
end
|
246
251
|
end
|
@@ -308,7 +313,7 @@ module Onebox
|
|
308
313
|
width = data[:image_width] || data[:thumbnail_width] || data[:width]
|
309
314
|
height = data[:image_height] || data[:thumbnail_height] || data[:height]
|
310
315
|
|
311
|
-
"<img src='#{escaped_src}' alt='#{alt}' width='#{width}' height='#{height}'>"
|
316
|
+
"<img src='#{escaped_src}' alt='#{alt}' width='#{width}' height='#{height}' class='onebox'>"
|
312
317
|
end
|
313
318
|
|
314
319
|
def video_html
|
data/lib/onebox/helpers.rb
CHANGED
@@ -24,7 +24,7 @@ module Onebox
|
|
24
24
|
og = {}
|
25
25
|
|
26
26
|
doc.css('meta').each do |m|
|
27
|
-
if (m["property"] && m["property"][/^(?:og|article):(.+)$/i]) || (m["name"] && m["name"][/^(?:og|article):(.+)$/i])
|
27
|
+
if (m["property"] && m["property"][/^(?:og|article|product):(.+)$/i]) || (m["name"] && m["name"][/^(?:og|article|product):(.+)$/i])
|
28
28
|
value = (m["content"] || m["value"]).to_s
|
29
29
|
og[$1.tr('-:', '_').to_sym] ||= value unless Onebox::Helpers::blank?(value)
|
30
30
|
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.8.
|
4
|
+
version: 1.8.57
|
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: 2018-07-
|
13
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
413
|
version: '0'
|
414
414
|
requirements: []
|
415
415
|
rubyforge_project:
|
416
|
-
rubygems_version: 2.
|
416
|
+
rubygems_version: 2.6.13
|
417
417
|
signing_key:
|
418
418
|
specification_version: 4
|
419
419
|
summary: A gem for generating embeddable HTML previews from URLs.
|