lib/onebox/engine/trello_onebox.rb in onebox-2.2.14 vs lib/onebox/engine/trello_onebox.rb in onebox-2.2.15
- old
+ new
@@ -9,29 +9,26 @@
matches_regexp(/^https:\/\/trello\.com\/[bc]\/\W*/)
requires_iframe_origins "https://trello.com"
always_https
def to_html
- link = "https://trello.com/#{match[:type]}/#{match[:key]}.html"
-
+ src = "https://trello.com/#{match[:type]}/#{match[:key]}.html"
height = match[:type] == 'b' ? 400 : 200
<<-HTML
- <iframe src="#{link}" width="100%" height="#{height}" frameborder="0" style="border:0"></iframe>
+ <iframe src="#{src}" width="100%" height="#{height}" frameborder="0" style="border:0"></iframe>
HTML
end
def placeholder_html
::Onebox::Helpers.generic_placeholder_html
end
private
+
def match
return @match if defined?(@match)
-
@match = @url.match(%{trello\.com/(?<type>[^/]+)/(?<key>[^/]+)/?\W*})
-
- @match
end
end
end
end