-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathgoogledoc.ejs
94 lines (87 loc) · 2.66 KB
/
googledoc.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!doctype html>
<html>
<head>
<title><%= title %></title>
<link rel="shortcut icon" href="/favicon.ico">
<style type="text/css">
body {
background-color: #EEEEEE;
margin: 0;
}
.iframe-wrapper {
height: 500vh;
margin: auto;
max-width: 834px;
width: 100%;
background: white;
box-shadow: 0 0 0 0.75pt #d1d1d1,0 0 3pt 0.75pt #ccc;
padding-top: 20px;
}
iframe {
margin: auto;
max-width: 794px;
width: 100%;
height: 100%;
border: none;
display: block;
}
p {
text-align: center;
padding: 15px;
margin: 0;
font-size: 12px;
font-family: 'Helvetica';
max-width: 700px;
margin: auto;
line-height: 1.4em;
}
p.warning {
font-size: 0.7em;
}
@media print {
body {
background: none;
}
p {
display: none;
}
.iframe-wrapper {
height: auto;
max-width: none;
box-shadow: none;
padding-top: 0;
width: 100%;
}
iframe {
width: 100%;
}
}
</style>
</head>
<body>
<div class="iframe-wrapper">
<iframe id="googledoc" src="/<%= hash %>/raw"></iframe>
<p>Published with <a href="http://gdoc.pub" target="_blank">The Google Doc Publisher</a></p>
<p class="warning">
Be aware that <a href="http://gdoc.pub" target="_blank">gdoc.pub</a> is <strong>not</strong> responsible for the document's content.<br/>
Something malicious? <a href="https://docs.google.com/abuse?id=<%=hash%>" target="_blank">Report abuse to Google</a> to block the access to the document.
</p>
</div>
<script type="text/javascript">
var iframe = document.getElementById('googledoc');
iframe.addEventListener('load', function(e){
document.title = iframe.contentWindow.document.title;
setTimeout(function(){
var height = iframe.contentWindow.document.body.offsetHeight+50;
document.getElementsByClassName('iframe-wrapper')[0].setAttribute('style', 'height: '+height+'px;');
}, 1000);
});
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36223212-9', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>