module Onebox module Engine class SteamStoreWidgetOnebox include Engine matches_regexp(/^(https?:\/\/)?([\da-z\.-]+)(steampowered.com\/)(.)+\/?$/) # DoTheSimplestThingThatCouldPossiblyWork def to_html # Use the Steam support iframe widget over https widget_url = @url.gsub('/app/','/widget/') widget_url = widget_url.gsub('http:','https:') "" rescue @url end # Placeholder is called at each interaction with editor, so do something less iframey def placeholder_html widget_url = @url.gsub('/app/','/widget/') widget_url = widget_url.gsub('http:','https:') "

Steam Store Widget onebox preview for: #{widget_url}

Will be replaced with the real listing when posted.

" rescue @url end end end end