2013-08-30 16:52:28 +03:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
|
2013-05-15 10:21:59 +03:00
|
|
|
<?php
|
2014-03-13 19:11:33 +02:00
|
|
|
/**
|
|
|
|
* COPS (Calibre OPDS PHP Server) epub reader
|
|
|
|
*
|
|
|
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
|
|
|
* @author Sébastien Lucas <sebastien@slucas.fr>
|
|
|
|
*/
|
2013-05-15 10:21:59 +03:00
|
|
|
|
|
|
|
require_once ("config.php");
|
|
|
|
require_once ("base.php");
|
2013-08-30 16:52:28 +03:00
|
|
|
require_once ("book.php");
|
2013-05-15 10:21:59 +03:00
|
|
|
require_once ("resources/php-epub-meta/epub.php");
|
|
|
|
|
|
|
|
header ("Content-Type: text/html;charset=utf-8");
|
|
|
|
|
2013-08-30 16:52:28 +03:00
|
|
|
$idData = getURLParam ("data", NULL);
|
|
|
|
$add = "data=$idData&";
|
|
|
|
if (!is_null (GetUrlParam (DB))) $add .= DB . "=" . GetUrlParam (DB) . "&";
|
|
|
|
$myBook = Book::getBookByDataId($idData);
|
|
|
|
|
|
|
|
$book = new EPub ($myBook->getFilePath ("EPUB", $idData));
|
2013-05-15 10:21:59 +03:00
|
|
|
$book->initSpineComponent ();
|
|
|
|
|
|
|
|
?>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<meta http-equiv="imagetoolbar" content="no" />
|
|
|
|
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
|
|
|
|
<title>COPS's Epub Reader</title>
|
2013-08-30 16:52:28 +03:00
|
|
|
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/monocle/scripts/monocore.js") ?>"></script>
|
|
|
|
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/monocle/scripts/monoctrl.js") ?>"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/monocle/styles/monocore.css") ?>" media="screen" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/monocle/styles/monoctrl.css") ?>" media="screen" />
|
2013-05-15 10:21:59 +03:00
|
|
|
<script type="text/javascript">
|
2014-03-13 19:11:33 +02:00
|
|
|
Monocle.DEBUG = true;
|
2013-05-15 10:21:59 +03:00
|
|
|
var bookData = {
|
|
|
|
getComponents: function () {
|
|
|
|
<?php echo "return [" . implode (", ", array_map (function ($comp) { return "'" . $comp . "'"; }, $book->components ())) . "];"; ?>
|
|
|
|
},
|
|
|
|
getContents: function () {
|
2014-03-20 10:12:42 +02:00
|
|
|
<?php echo "return [" . implode (", ", array_map (function ($content) { return "{title: '" . addslashes($content["title"]) . "', src: '". $content["src"] . "'}"; }, $book->contents ())) . "];"; ?>
|
2013-05-15 10:21:59 +03:00
|
|
|
},
|
2013-09-11 11:55:18 +03:00
|
|
|
getComponent: function (componentId) {
|
|
|
|
return { url: "epubfs.php?<?php echo $add ?>comp=" + componentId };
|
2013-05-15 10:21:59 +03:00
|
|
|
},
|
|
|
|
getMetaData: function(key) {
|
|
|
|
return {
|
2013-08-30 16:52:28 +03:00
|
|
|
title: "<?php echo $myBook->title ?>",
|
2013-05-15 10:21:59 +03:00
|
|
|
creator: "Inventive Labs"
|
|
|
|
}[key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
2014-01-11 19:51:07 +02:00
|
|
|
<script type="text/javascript" src="<?php echo getUrlWithVersion("styles/cops-monocle.js") ?>"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("styles/cops-monocle.css") ?>" media="screen" />
|
2013-05-15 10:21:59 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2013-05-15 15:16:09 +03:00
|
|
|
<div id="readerBg">
|
|
|
|
<div class="board"></div>
|
|
|
|
<div class="jacket"></div>
|
|
|
|
<div class="dummyPage"></div>
|
|
|
|
<div class="dummyPage"></div>
|
|
|
|
<div class="dummyPage"></div>
|
|
|
|
<div class="dummyPage"></div>
|
|
|
|
<div class="dummyPage"></div>
|
|
|
|
</div>
|
|
|
|
<div id="readerCntr">
|
|
|
|
<div id="reader"></div>
|
2013-05-15 13:11:47 +03:00
|
|
|
</div>
|
2013-05-15 10:21:59 +03:00
|
|
|
</body>
|
|
|
|
</html>
|