diff options
author | pacien | 2018-07-21 02:17:02 +0200 |
---|---|---|
committer | pacien | 2018-07-21 02:17:02 +0200 |
commit | 29eba60e321667b73f9c97d73e55be69b344ef1b (patch) | |
tree | 5e79d6e6b9f9533cdebd6a4bbf393b5030eb9f13 | |
parent | 67ee634c9e1037708519bd42d348243aa9cea468 (diff) | |
download | beamer-viewer-29eba60e321667b73f9c97d73e55be69b344ef1b.tar.gz |
Add noscript warning
-rw-r--r-- | index.html | 19 | ||||
-rw-r--r-- | pointless/viewer/screen.js | 6 | ||||
-rw-r--r-- | pointless/viewer/viewer.css | 6 | ||||
-rw-r--r-- | pointless/viewer/viewer.js | 4 |
4 files changed, 26 insertions, 9 deletions
@@ -12,6 +12,11 @@ | |||
12 | <meta charset="utf-8"> | 12 | <meta charset="utf-8"> |
13 | <link rel="icon" href="favicon.ico"> | 13 | <link rel="icon" href="favicon.ico"> |
14 | <link rel="stylesheet" type="text/css" href="pointless/viewer/viewer.css"> | 14 | <link rel="stylesheet" type="text/css" href="pointless/viewer/viewer.css"> |
15 | |||
16 | <noscript> | ||
17 | <style type="text/css">#fileSelect { display: none; }</style> | ||
18 | </noscript> | ||
19 | |||
15 | <title>Pointless Viewer</title> | 20 | <title>Pointless Viewer</title> |
16 | </head> | 21 | </head> |
17 | 22 | ||
@@ -38,12 +43,18 @@ | |||
38 | <code>\setbeameroption{show notes on second screen=right}</code>) | 43 | <code>\setbeameroption{show notes on second screen=right}</code>) |
39 | </p> | 44 | </p> |
40 | 45 | ||
41 | <p> | 46 | <p class="warning"> |
42 | Please select a PDF file to load. | 47 | <noscript>A web browser with JavaScript support is required to use this application.</noscript> |
43 | Slides will be opened in a new window. | ||
44 | </p> | 48 | </p> |
45 | 49 | ||
46 | <input id="fileInput" type="file" multiple="false"/> | 50 | <div id="fileSelect"> |
51 | <p> | ||
52 | Please select a PDF file to load. | ||
53 | Slides will be opened in a new window. | ||
54 | </p> | ||
55 | |||
56 | <input id="fileInput" type="file" multiple="false"/> | ||
57 | </div> | ||
47 | </div> | 58 | </div> |
48 | 59 | ||
49 | <div> | 60 | <div> |
diff --git a/pointless/viewer/screen.js b/pointless/viewer/screen.js index 9ba4574..4f5e5bf 100644 --- a/pointless/viewer/screen.js +++ b/pointless/viewer/screen.js | |||
@@ -19,6 +19,7 @@ class Screen { | |||
19 | this.pageTurnCount = 0; | 19 | this.pageTurnCount = 0; |
20 | 20 | ||
21 | this._registerListeners(); | 21 | this._registerListeners(); |
22 | this._hideWelcomeScreen(); | ||
22 | } | 23 | } |
23 | 24 | ||
24 | setPage(page) { | 25 | setPage(page) { |
@@ -36,6 +37,11 @@ class Screen { | |||
36 | }); | 37 | }); |
37 | } | 38 | } |
38 | 39 | ||
40 | _hideWelcomeScreen() { | ||
41 | const welcomeScreen = this.window.document.getElementById("welcomeScreen"); | ||
42 | welcomeScreen.style.display = "none"; | ||
43 | } | ||
44 | |||
39 | _getScreenSize(ratio) { | 45 | _getScreenSize(ratio) { |
40 | const windowRatio = this.window.innerWidth / this.window.innerHeight; | 46 | const windowRatio = this.window.innerWidth / this.window.innerHeight; |
41 | const horizontalScaleFactor = ratio / windowRatio; | 47 | const horizontalScaleFactor = ratio / windowRatio; |
diff --git a/pointless/viewer/viewer.css b/pointless/viewer/viewer.css index 09ef4e1..21bba3b 100644 --- a/pointless/viewer/viewer.css +++ b/pointless/viewer/viewer.css | |||
@@ -31,7 +31,6 @@ header span { | |||
31 | } | 31 | } |
32 | 32 | ||
33 | #welcomeScreen { | 33 | #welcomeScreen { |
34 | display: none; | ||
35 | max-height: 100%; | 34 | max-height: 100%; |
36 | min-width: 20rem; | 35 | min-width: 20rem; |
37 | overflow: auto; | 36 | overflow: auto; |
@@ -98,3 +97,8 @@ header span { | |||
98 | .notification:empty { | 97 | .notification:empty { |
99 | display: none; | 98 | display: none; |
100 | } | 99 | } |
100 | |||
101 | .warning { | ||
102 | font-weight: bold; | ||
103 | color: orangered; | ||
104 | } | ||
diff --git a/pointless/viewer/viewer.js b/pointless/viewer/viewer.js index e3a1043..f4cc348 100644 --- a/pointless/viewer/viewer.js +++ b/pointless/viewer/viewer.js | |||
@@ -9,15 +9,11 @@ | |||
9 | 9 | ||
10 | class Viewer { | 10 | class Viewer { |
11 | constructor() { | 11 | constructor() { |
12 | this.welcomeScreen = document.getElementById("welcomeScreen"); | ||
13 | this.fileInput = document.getElementById("fileInput"); | 12 | this.fileInput = document.getElementById("fileInput"); |
14 | |||
15 | this.welcomeScreen.style.display = "block"; | ||
16 | this._listenForInput(); | 13 | this._listenForInput(); |
17 | } | 14 | } |
18 | 15 | ||
19 | load(source) { | 16 | load(source) { |
20 | this.welcomeScreen.style.display = "none"; | ||
21 | pdfjsLib.getDocument(source).then(function(pdf) { | 17 | pdfjsLib.getDocument(source).then(function(pdf) { |
22 | const presentation = new Presentation(pdf); | 18 | const presentation = new Presentation(pdf); |
23 | }).catch(function(error) { | 19 | }).catch(function(error) { |