lib/onebox/engine/slides_onebox.rb in onebox-1.5.50 vs lib/onebox/engine/slides_onebox.rb in onebox-1.5.60
- old
+ new
@@ -4,29 +4,26 @@
include Engine
include StandardEmbed
matches_regexp(/^https?:\/\/slides\.com\/[\p{Alnum}_\-]+\/[\p{Alnum}_\-]+$/)
-
def to_html
- if uri.path =~ /^\/[\p{Alnum}_\-]+\/[\p{Alnum}_\-]+$/
- "<iframe src=\"//slides.com#{uri.path}/embed?style=light\" width=\"576\" height=\"420\" scrolling=\"no\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
- end
+ <<-HTML
+ <iframe src="//slides.com#{uri.path}/embed?style=light"
+ width="576"
+ height="420"
+ scrolling="no"
+ frameborder="0"
+ webkitallowfullscreen
+ mozallowfullscreen
+ allowfullscreen>
+ </iframe>"
+ HTML
end
def placeholder_html
- # get_opengraph_data
- "<img src='#{get_opengraph_data[:images].first}'>"
+ "<img src='#{raw[:image]}'>"
end
- private
-
- def get_opengraph_data
- return @opengraph_data if @opengraph_data
- response = Onebox::Helpers.fetch_response(url)
- html_doc = Nokogiri::HTML(response.body)
-
- @opengraph_data = parse_open_graph(html_doc, url)
- end
end
end
end