Class: Onebox::Engine::GoogleDocsOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::GoogleDocsOnebox
show all
- Includes:
- Onebox::Engine
- Defined in:
- lib/onebox/engine/google_docs_onebox.rb
Constant Summary
DEFAULT
Instance Attribute Summary
#cache, #timeout, #uri, #url
Class Method Summary
collapse
Instance Method Summary
collapse
engines, included, #initialize, #options, #options=, #placeholder_html
Class Method Details
.supported_endpoints ⇒ Object
6
7
8
|
# File 'lib/onebox/engine/google_docs_onebox.rb', line 6
def self.supported_endpoints
%w(spreadsheets document forms presentation)
end
|
Instance Method Details
#to_html ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/onebox/engine/google_docs_onebox.rb', line 13
def to_html
if document?
"<iframe class='gdocs-onebox document-onebox' src='https://docs.google.com/document/d/#{key}/pub?embedded=true' style='border: 0' width='800' height='600' frameborder='0' scrolling='yes' ></iframe>"
elsif spreadsheet?
"<iframe class='gdocs-onebox spreadsheet-onebox' src='https://docs.google.com/spreadsheet/ccc?key=#{key}&usp=sharing&rm=minimal' style='border: 0' width='800' height='600' frameborder='0' scrolling='yes' ></iframe>"
elsif presentation?
"<iframe class='gdocs-onebox presentation-onebox' src='https://docs.google.com/presentation/d/#{key}/embed?start=false&loop=false&delayms=3000' frameborder='0' width='960' height='749' allowfullscreen='true' mozallowfullscreen='true' webkitallowfullscreen='true'></iframe>"
elsif forms?
"<iframe class='gdocs-onebox forms-onebox' src='https://docs.google.com/forms/d/#{key}/viewform?embedded=true' width='760' height='500' frameborder='0' marginheight='0' marginwidth='0' scrolling='yes'>Loading...</iframe>"
end
end
|