Class: Onebox::Engine::SteamStoreWidgetOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::SteamStoreWidgetOnebox
- Includes:
- Onebox::Engine
- Defined in:
- lib/onebox/engine/steam_store_widget_onebox.rb
Constant Summary
Constants included from Onebox::Engine
Instance Attribute Summary
Attributes included from Onebox::Engine
Instance Method Summary collapse
-
#placeholder_html ⇒ Object
Placeholder is called at each interaction with editor, so do something less iframey.
-
#to_html ⇒ Object
DoTheSimplestThingThatCouldPossiblyWork.
Methods included from Onebox::Engine
engines, included, #initialize, #options, #options=
Instance Method Details
#placeholder_html ⇒ Object
Placeholder is called at each interaction with editor, so do something less iframey
19 20 21 22 23 24 25 |
# File 'lib/onebox/engine/steam_store_widget_onebox.rb', line 19 def placeholder_html = @url.gsub('/app/','/widget/') = .gsub('http:','https:') "<div style='width:100%; height:190px; display:block; background-color:black; color:white;'><div style='padding:10px;'><h2>Steam Store Widget onebox preview for: #{}</h2><p>Will be replaced with the real listing when posted.</p></div></div>" rescue @url end |
#to_html ⇒ Object
DoTheSimplestThingThatCouldPossiblyWork
9 10 11 12 13 14 15 16 |
# File 'lib/onebox/engine/steam_store_widget_onebox.rb', line 9 def to_html # Use the Steam support iframe widget over https = @url.gsub('/app/','/widget/') = .gsub('http:','https:') "<iframe class='steamstorewidget' src='#{}' frameborder='0' width='100%' height='190'></iframe>" rescue @url end |