impress.php
2.72 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* ownCloud - Impress App
*
* @author Frank Karlitschek
* @copyright 2012 Frank Karlitschek frank@owncloud.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
Todo:
enable fullscreen presentation
*/
namespace OCA_Impress;
class Storage {
public static function getPresentations() {
$presentations=array();
$list=\OCP\Files::searchByMime('text/impress');
foreach($list as $l) {
$size=\OC\Files\Filesystem::filesize($l["path"]);
if ($size > 0) {
$info=pathinfo($l["path"]);
$mtime=\OC\Files\Filesystem::filemtime($l["path"]);
$entry=array('url'=>$l["path"],'name'=>$info['filename'],'size'=>$size,'mtime'=>$mtime);
$presentations[]=$entry;
}
}
return $presentations;
}
public static function showHeader($title) {
echo('
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<title>'.$title.'</title>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic" rel="stylesheet" />
<link href="'.\OCP\Util::linkToAbsolute('impress', 'css/player.css').'" rel="stylesheet" />
</head>
<body class="impress-not-supported">
<div class="fallback-message">
<p>Your browser <b>does not support the features required</b> by impress.js, so you are presented with a simplified version of this presentation.</p>
<p>For the best experience please use the latest <b>Chrome</b>, <b>Safari</b> or <b>Firefox</b> browser.</p>
</div>
<div id="impress">
');
}
public static function showFooter() {
echo('
<div class="hint">
<p>Make fullscreen and use a spacebar or arrow keys to navigate</p>
</div>
<script>
if ("ontouchstart" in document.documentElement) {
document.querySelector(".hint").innerHTML = "<p>Tap on the left or right to navigate</p>";
}
</script>
<script src="'.\OCP\Util::linkToAbsolute('impress', 'js/impress.js').'"></script>
<script>impress().init();</script>
<script>
</script>
</body></html>
');
}
}