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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c8a00f9099e20ceead5cc15b266194ec21b9146d9c1921ca76017f7653c038a1
4
- data.tar.gz: ea3d01bcb2411573bdaf1a48ba109e31cb4c85874bc882d3039df7c596fb420a
2
+ SHA1:
3
+ metadata.gz: 835936fbc3288c143ecf47888afdc1df5c40e61f
4
+ data.tar.gz: 17db8d91315a31880f6a9d975a0b887d5ec75448
5
5
  SHA512:
6
- metadata.gz: 4f8213dc2113c7c1db11577407da8f94d32311865a78a8ce28defa69d2a7e5caf3db4ddd6acad6f739b3d150c61aa2d55b782cc4b8dace11e3552c37b1f6a6da
7
- data.tar.gz: aafdcb06bc1f396350b1a76e921da84e115d1417922d71589dcb4f515001efc81c15170cb7fab4494620a3a411ad7cf6238c810326de2443b4c470d80e2a5b7f
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
@@ -18,7 +18,7 @@ module Onebox
18
18
  escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url)
19
19
 
20
20
  <<-HTML
21
- <a href="#{escaped_url}" target="_blank">
21
+ <a href="#{escaped_url}" target="_blank" class="onebox">
22
22
  <img src="#{escaped_url}">
23
23
  </a>
24
24
  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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "1.8.55"
4
+ VERSION = "1.8.57"
5
5
  end
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.55
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-17 00:00:00.000000000 Z
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.7.6
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.