diff options
-rw-r--r-- | .gitignore | 16 | ||||
-rw-r--r-- | appcache.js | 17 | ||||
-rw-r--r-- | beamer/viewer/init.js | 44 | ||||
-rw-r--r-- | beamer/viewer/presentation.js | 37 | ||||
-rw-r--r-- | beamer/viewer/screen/screen.js | 61 | ||||
-rw-r--r-- | beamer/viewer/screen/timer.js | 18 | ||||
-rw-r--r-- | beamer/viewer/stage/actions.js | 46 | ||||
-rw-r--r-- | beamer/viewer/stage/stage.js | 60 | ||||
-rw-r--r-- | beamer/viewer/viewer.css | 53 | ||||
-rw-r--r-- | beamer/viewer/viewer.js | 100 | ||||
-rw-r--r-- | index.html | 192 | ||||
-rw-r--r-- | licence.txt | 287 | ||||
-rw-r--r-- | license.md | 660 | ||||
-rw-r--r-- | popup.html | 28 | ||||
-rw-r--r-- | readme.md | 32 | ||||
-rw-r--r-- | todo.md | 48 |
16 files changed, 659 insertions, 1040 deletions
@@ -1,17 +1,5 @@ | |||
1 | # Beamer Viewer, a web-based PDF presentation viewer | 1 | # Beamer Viewer, a web-based PDF presentation viewer |
2 | # Copyright (C) 2018 Pacien TRAN-GIRARD | 2 | # Copyright 2018-2024 Pacien TRAN-GIRARD |
3 | # | 3 | # SPDX-License-Identifier: EUPL-1.2 |
4 | # This program is free software: you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU Affero General Public License as | ||
6 | # published by the Free Software Foundation, either version 3 of the | ||
7 | # License, or (at your option) any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU Affero General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU Affero General Public License | ||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | 4 | ||
17 | *.sty | 5 | *.sty |
diff --git a/appcache.js b/appcache.js index ee9e356..f6f7cca 100644 --- a/appcache.js +++ b/appcache.js | |||
@@ -1,19 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Beamer Viewer, a web-based PDF presentation viewer | 2 | * Beamer Viewer, a web-based PDF presentation viewer |
3 | * Copyright (C) 2018 Pacien TRAN-GIRARD | 3 | * Copyright 2018-2024 Pacien TRAN-GIRARD |
4 | * | 4 | * SPDX-License-Identifier: EUPL-1.2 |
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Affero General Public License as | ||
7 | * published by the Free Software Foundation, either version 3 of the | ||
8 | * License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | */ | 5 | */ |
18 | 6 | ||
19 | "use strict"; | 7 | "use strict"; |
@@ -24,7 +12,6 @@ class AppCache { | |||
24 | this.cacheName = "cache"; | 12 | this.cacheName = "cache"; |
25 | this.filesToCache = [ | 13 | this.filesToCache = [ |
26 | ".", | 14 | ".", |
27 | "popup.html", | ||
28 | "appcache.js", | 15 | "appcache.js", |
29 | "favicon.ico", | 16 | "favicon.ico", |
30 | "sample/demo.pdf", | 17 | "sample/demo.pdf", |
diff --git a/beamer/viewer/init.js b/beamer/viewer/init.js index 9192834..c8b1ccf 100644 --- a/beamer/viewer/init.js +++ b/beamer/viewer/init.js | |||
@@ -1,32 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Beamer Viewer, a web-based PDF presentation viewer | 2 | * Beamer Viewer, a web-based PDF presentation viewer |
3 | * Copyright (C) 2018 Pacien TRAN-GIRARD | 3 | * Copyright 2018-2024 Pacien TRAN-GIRARD |
4 | * | 4 | * SPDX-License-Identifier: EUPL-1.2 |
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Affero General Public License as | ||
7 | * published by the Free Software Foundation, either version 3 of the | ||
8 | * License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | */ | 5 | */ |
18 | 6 | ||
19 | "use strict"; | 7 | "use strict"; |
20 | 8 | ||
21 | const params = function() { | ||
22 | const queryDict = {}; | ||
23 | location.hash.substr(1).split("&").forEach(item => { | ||
24 | const pair = item.split("="); | ||
25 | queryDict[pair[0]] = pair[1]; | ||
26 | }); | ||
27 | return queryDict; | ||
28 | }(); | ||
29 | |||
30 | function isController() { | 9 | function isController() { |
31 | return window.opener == null || window.opener.location.href != window.location.href; | 10 | return window.opener == null || window.opener.location.href != window.location.href; |
32 | } | 11 | } |
@@ -39,28 +18,9 @@ function initCache() { | |||
39 | offlineCapableIndicator.style.visibility = "visible"; | 18 | offlineCapableIndicator.style.visibility = "visible"; |
40 | } | 19 | } |
41 | 20 | ||
42 | function checkPopupPermission() { | ||
43 | const popup = window.open("popup.html"); | ||
44 | |||
45 | if (popup == null) { | ||
46 | const warningMessage = document.getElementById("warning"); | ||
47 | warningMessage.textContent = "A pop-up blocker is active. Make sure to allow pop-ups on this website."; | ||
48 | } | ||
49 | } | ||
50 | |||
51 | function init() { | 21 | function init() { |
52 | initCache(); | 22 | initCache(); |
53 | checkPopupPermission(); | ||
54 | |||
55 | const viewer = new Viewer(); | 23 | const viewer = new Viewer(); |
56 | |||
57 | if ("file" in params) | ||
58 | viewer.load(params["file"]); | ||
59 | } | ||
60 | |||
61 | function load(file) { | ||
62 | location.hash = "file=" + file; | ||
63 | location.reload(); | ||
64 | } | 24 | } |
65 | 25 | ||
66 | if (isController()) | 26 | if (isController()) |
diff --git a/beamer/viewer/presentation.js b/beamer/viewer/presentation.js index 222a6d4..f7f47b2 100644 --- a/beamer/viewer/presentation.js +++ b/beamer/viewer/presentation.js | |||
@@ -1,19 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Beamer Viewer, a web-based PDF presentation viewer | 2 | * Beamer Viewer, a web-based PDF presentation viewer |
3 | * Copyright (C) 2018 Pacien TRAN-GIRARD | 3 | * Copyright 2018-2024 Pacien TRAN-GIRARD |
4 | * | 4 | * SPDX-License-Identifier: EUPL-1.2 |
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Affero General Public License as | ||
7 | * published by the Free Software Foundation, either version 3 of the | ||
8 | * License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | */ | 5 | */ |
18 | 6 | ||
19 | "use strict"; | 7 | "use strict"; |
@@ -25,12 +13,16 @@ class Presentation { | |||
25 | this.stage = this._setupStage(); | 13 | this.stage = this._setupStage(); |
26 | } | 14 | } |
27 | 15 | ||
16 | start() { | ||
17 | this.stage.start(); | ||
18 | } | ||
19 | |||
28 | _setupStage() { | 20 | _setupStage() { |
29 | const self = this; | 21 | return new Stage( |
30 | const onStageReadyCallback = function() { self._onStageReady(); }; | 22 | () => this._onStageReady(), |
31 | const onNextCallback = function() { self._onNext(); }; | 23 | () => this._onNext(), |
32 | const onPreviousCallback = function() { self._onPrevious(); }; | 24 | () => this._onPrevious(), |
33 | return new Stage(onStageReadyCallback, onNextCallback, onPreviousCallback); | 25 | ); |
34 | } | 26 | } |
35 | 27 | ||
36 | _onStageReady() { | 28 | _onStageReady() { |
@@ -48,10 +40,9 @@ class Presentation { | |||
48 | } | 40 | } |
49 | 41 | ||
50 | _setPage(pageIndex) { | 42 | _setPage(pageIndex) { |
51 | const self = this; | ||
52 | this.currentPageIndex = pageIndex; | 43 | this.currentPageIndex = pageIndex; |
53 | this.pdf.getPage(this.currentPageIndex).then(function(page) { | 44 | this.pdf |
54 | self.stage.setPage(page); | 45 | .getPage(this.currentPageIndex) |
55 | }) | 46 | .then(page => this.stage.setPage(page)) |
56 | } | 47 | } |
57 | } | 48 | } |
diff --git a/beamer/viewer/screen/screen.js b/beamer/viewer/screen/screen.js index c65ebc3..4bebab4 100644 --- a/beamer/viewer/screen/screen.js +++ b/beamer/viewer/screen/screen.js | |||
@@ -1,19 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Beamer Viewer, a web-based PDF presentation viewer | 2 | * Beamer Viewer, a web-based PDF presentation viewer |
3 | * Copyright (C) 2018 Pacien TRAN-GIRARD | 3 | * Copyright 2018-2024 Pacien TRAN-GIRARD |
4 | * | 4 | * SPDX-License-Identifier: EUPL-1.2 |
5 | * This program is free software: you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Affero General Public License as | ||
7 | * published by the Free Software Foundation, either version 3 of the | ||
8 | * License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Affero General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Affero General Public License | ||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | */ | 5 | */ |
18 | 6 | ||
19 | "use strict"; | 7 | "use strict"; |
@@ -42,10 +30,7 @@ class Screen { | |||
42 |