Difference between revisions of "Widget:GoogleDoc"

From LNF Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<noinclude>__NOTOC__
 
<noinclude>__NOTOC__
This widget embeds an iframe and also provides a link for devices that don't support iFrames.  
+
This widget embeds an iframe and also provides a link for devices that don't support iFrames. Document will display in "preview" mode, but the link can be set to open in preview (default), edit, or copy mode.
  
 
== Using this widget ==
 
== Using this widget ==
Line 6: Line 6:
 
{{#widget:GoogleDoc
 
{{#widget:GoogleDoc
 
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
 
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
 +
|function=copy/preview/edit
 
|width=800
 
|width=800
 
|height=400}}
 
|height=400}}
Line 33: Line 34:
  
 
     if(detectmob()){
 
     if(detectmob()){
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/preview' target='_blank'><b>Document Link</b></a>";
+
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/<!--{$function|default:preview}-->' target='_blank'><b>Document Link</b></a>";
 
     } else {
 
     } else {
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/preview' target='_blank'><b>Document Link</b></a><br><iframe  src='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/preview?pli=1' frameborder='0' width='<!--{$width|escape:html|default:800}-->' height='<!--{$height|escape:html|default:400}-->'></iframe>";
+
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/<!--{$function|default:preview}-->' target='_blank'><b>Document Link</b></a><br><iframe  src='https://docs.google.com/a/lnf.umich.edu/document/d/<!--{$key}-->/preview?pli=1' frameborder='0' width='<!--{$width|escape:html|default:800}-->' height='<!--{$height|escape:html|default:400}-->'></iframe>";
 
     }
 
     }
  

Revision as of 20:30, 6 November 2016

This widget embeds an iframe and also provides a link for devices that don't support iFrames. Document will display in "preview" mode, but the link can be set to open in preview (default), edit, or copy mode.

Using this widget

{{#widget:GoogleDoc
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
|function=copy/preview/edit
|width=800
|height=400}}