broadfield commited on
Commit
9f8f359
·
verified ·
1 Parent(s): cab89a4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +58 -1
index.html CHANGED
@@ -5,7 +5,64 @@
5
  <meta name="viewport" content="width=device-width" />
6
  <title>My static Space</title>
7
  <link rel="stylesheet" href="style.css" />
8
- </head>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  <body>
10
  <div class="card">
11
  <h1>Welcome to your static Space!</h1>
 
5
  <meta name="viewport" content="width=device-width" />
6
  <title>My static Space</title>
7
  <link rel="stylesheet" href="style.css" />
8
+ <script>
9
+
10
+ function run(url_in) {
11
+ let url = String(url_in)
12
+ console.log(url);
13
+
14
+ var framediv = document.getElementById('cap');
15
+ let child = framediv.lastElementChild;
16
+ while (child) {
17
+ framediv.removeChild(child);
18
+ child=framediv.lastElementChild;
19
+ }
20
+ const iframediv = document.createElement('iframe');
21
+ iframediv.src = 'https://docs.google.com/viewer?url=' + url +'&embedded=true';
22
+ iframediv.width = '100%';
23
+ iframediv.height = '1000px';
24
+ iframediv.frameborder="0";
25
+ framediv.appendChild(iframediv);
26
+ }
27
+ function () {
28
+ const urlParams = new URLSearchParams(window.location.search);
29
+ var p_pdf = urlParams.get('pdfurl')
30
+ var p_mod = urlParams.get('mod')
31
+ var p_len = urlParams.get('len')
32
+ var p_nos = urlParams.get('nos')
33
+ var p_wid = urlParams.get('wid')
34
+ var p_pau = urlParams.get('pau')
35
+ if (p_mod) {
36
+ console.log(p_mod)
37
+ } else {
38
+ p_mod = "en_US-joe-medium";
39
+ };
40
+ if (p_len) {
41
+ console.log(p_len)
42
+ } else {
43
+ p_len = "1";
44
+ };
45
+ if (p_nos) {
46
+ console.log(p_nos)
47
+ } else {
48
+ p_nos = "0.5";
49
+ };
50
+ if (p_wid) {
51
+ console.log(p_wid)
52
+ } else {
53
+ p_wid = "0.5";
54
+ };
55
+ if (p_pau) {
56
+ console.log(p_pau)
57
+ } else {
58
+ p_pau = "1";
59
+ };
60
+
61
+ run(p_pdf)
62
+ return [p_pdf, p_mod, p_len, p_nos, p_wid, p_pau];
63
+ }
64
+ </script>
65
+ </head>
66
  <body>
67
  <div class="card">
68
  <h1>Welcome to your static Space!</h1>