Difference between revisions of "Widget:GoogleDoc"

From LNF Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
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. Document will display in "preview" mode, but the link can be set to open in preview (default), edit, or copy mode.
+
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. Select document/spreadsheets depending on google doc type.
  
 
== Using this widget ==
 
== Using this widget ==
Line 6: Line 6:
 
{{#widget:GoogleDoc
 
{{#widget:GoogleDoc
 
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
 
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
|function=copy/preview/edit
+
|type=document/spreadsheets
 +
|mode=copy/preview/edit
 
|width=800
 
|width=800
 
|height=400}}
 
|height=400}}
Line 34: Line 35:
  
 
     if(detectmob()){
 
     if(detectmob()){
         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>";
+
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/<!--{$type|default:document}-->/d/<!--{$key}-->/<!--{$mode|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}-->/<!--{$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>";
+
         document.getElementById('<!--{$key}-->').innerHTML = "<a href='https://docs.google.com/a/lnf.umich.edu/<!--{$type|default:document}-->/d/<!--{$key}-->/<!--{$mode|default:preview}-->' target='_blank'><b>Document Link</b></a><br><iframe  src='https://docs.google.com/a/lnf.umich.edu/<!--{$type|default:document}-->/d/<!--{$key}-->/preview?pli=1' frameborder='0' width='<!--{$width|escape:html|default:800}-->' height='<!--{$height|escape:html|default:400}-->'></iframe>";
 
     }
 
     }
  

Latest revision as of 08:46, 8 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. Select document/spreadsheets depending on google doc type.

Using this widget

{{#widget:GoogleDoc
|key=1pj6gRX6dnA0B8WZams5tumAVMdCyMoUNIxP5LZeA9AA
|type=document/spreadsheets
|mode=copy/preview/edit
|width=800
|height=400}}