Blame view
sources/apps/impressionist/lib/impressionist.php
3.23 KB
|
42e4f8d60
|
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 |
<?php
/**
* ownCloud - Impressionist App + 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 Creation
*/
namespace OCA_Impressionist;
class Storage {
public static function getPresentations() {
$presentations=array();
$list=\OCP\Files::searchByMime('text/impress' );
foreach($list as $l) {
$info=pathinfo($l);
$size=\OC\Files\Filesystem::filesize($l);
$mtime=\OC\Files\Filesystem::filemtime($l);
$entry=array('url'=>$l,'name'=>$info['filename'],'size'=>$size,'mtime'=>$mtime);
$presentations[]=$entry;
}
return $presentations;
}
public static function showHeader() {
echo ('
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<title>'.$title.'</title>
<link href="'.\OCP\Util::linkToAbsolute('impressionist', '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>
<p>Note that Impressionist currently supports only -webkit browsers.</p>
</div>
<div class="impress">
');
}
public static function showFooter() {
echo('
<div class="hint">
<p>Make full screen and use a space bar 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('impressionist', 'js/impress.js').'"></script>
<script>impress().init();</script>
<script>
</script>
</body></html>
');
}
}
|