This repository has been archived on 2024-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
epubreader/templates/epubreader.php

299 lines
17 KiB
PHP
Raw Permalink Normal View History

2020-04-21 20:37:42 +00:00
<?php
2023-06-16 14:58:23 +00:00
/** @var array $_ */
/** @var OCP\IURLGenerator $urlGenerator */
$urlGenerator = $_['urlGenerator'];
$downloadLink = $_['downloadLink'];
$fileId = $_['fileId'];
$fileName = $_['fileName'];
$fileType = $_['fileType'];
$scope = $_['scope'];
$cursor = $_['cursor'];
$defaults = $_['defaults'];
$preferences = $_['preferences'];
$metadata = $_['metadata'];
$annotations = $_['annotations'];
$title = htmlentities(basename($downloadLink));
$revision = '0072';
2023-08-02 20:04:03 +00:00
$version = \OC::$server->getAppManager()->getAppVersion('epubreader').'.'.$revision;
2020-04-21 20:37:42 +00:00
2023-06-16 14:58:23 +00:00
/* Mobile safari, the new IE6 */
$idevice = (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')
|| strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')
|| strstr($_SERVER['HTTP_USER_AGENT'], 'iPod'));
2020-04-21 20:37:42 +00:00
2023-06-16 14:58:23 +00:00
/* Owncloud currently does not implement CSPv3, remove this test when it does */
$nonce = class_exists('\OC\Security\CSP\ContentSecurityPolicyNonceManager')
? \OC::$server->getContentSecurityPolicyNonceManager()->getNonce()
: 'nonce_not_implemented';
2020-04-21 20:37:42 +00:00
?>
<html dir="ltr">
2023-08-02 20:04:03 +00:00
<head class="session" data-nonce='<?php p($nonce); ?>' data-downloadlink='<?php print_unescaped($downloadLink); ?>' data-fileid='<?php print_unescaped($fileId); ?>' data-filetype='<?php print_unescaped($fileType); ?>' data-filename='<?php print_unescaped($fileName); ?>' data-version='<?php print_unescaped($version); ?>' data-basepath='<?php p($urlGenerator->linkToRoute('epubreader.page.showReader')); ?>' data-staticpath='<?php p($urlGenerator->linkTo('epubreader', '')); ?>' data-scope='<?php print_unescaped($scope); ?>' data-cursor='<?php print_unescaped($cursor); ?>' data-defaults='<?php print_unescaped($defaults); ?>' data-preferences='<?php print_unescaped($preferences); ?>' data-metadata='<?php print_unescaped($metadata); ?>' data-annotations='<?php print_unescaped($annotations); ?>'>
2020-04-21 20:37:42 +00:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
2023-08-02 20:04:03 +00:00
<!-- <base href="<?php p($urlGenerator->linkTo('epubreader', '')); ?>"> -->
2020-04-21 20:37:42 +00:00
<title>
2023-08-02 20:04:03 +00:00
<?php p($title); ?>
2020-04-21 20:37:42 +00:00
</title>
2023-08-02 20:04:03 +00:00
<link rel="shortcut icon" href="<?php p($urlGenerator->linkTo('epubreader', 'img/book.png')); ?>">
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/icomoon/style.css')); ?>?v=<?php p($version); ?>">
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/css/main.css')); ?>?v=<?php p($version); ?>">
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/css/sidebar.css')); ?>?v=<?php p($version); ?>">
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/css/popup.css')); ?>?v=<?php p($version); ?>">
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'js/lib/typedarray.min.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'js/lib/wgxpath.install.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/libs/jquery.min.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/bartaz/jquery.highlight.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/jquery/put-delete.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/sindresorhus/screenfull.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/libs/zip.min.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/epub.min.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/hooks.min.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/hooks/extensions/highlight.js')); ?>?v=<?php p($version); ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/reader.min.js')); ?>?v=<?php p($version); ?>"> </script>
2020-04-21 20:37:42 +00:00
2023-08-02 20:04:03 +00:00
<?php if ($idevice) { ?>
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/epubjs/css/idevice.css')); ?>?v=<?php p($version); ?>">
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'public/bgrins/spectrum.js')); ?>?v=<?php p($version); ?>"> </script>
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'public/bgrins/spectrum.css')); ?>?v=<?php p($version); ?>">
<?php } ?>
2020-04-21 20:37:42 +00:00
2023-08-02 20:04:03 +00:00
<script type="text/javascript" nonce="<?php p($nonce); ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'js/ready.js')); ?>?v=<?php p($version); ?>"> </script>
2020-04-21 20:37:42 +00:00
</head>
<body>
<div id="outerContainer">
<!-- sidebar -->
<div id="sidebar" class="sidebar">
<div id="panels" class="panels">
<div class="pull-left">
<button id="show-Toc" class="show_view icon-format_list_numbered open" title="Table of Contents" data-view="Toc"></button>
<button id="show-Bookmarks" class="show_view icon-turned_in" title="Bookmarks" data-view="Bookmarks"></button>
<button id="show-Search" class="show_view icon-search" title="Search" data-view="Search"></button>
<button id="show-Notes" class="show_view icon-comment" title="Notes" data-view="Notes"></button>
<button id="show-Settings" class="show_view icon-settings" title="Settings" data-view="Settings"></button>
</div>
<div class="pull-right">
<button id="hide-Sidebar" class="close_sidebar icon-arrow-left2" title="Close sidebar"></button>
</div>
</div>
<div id="views">
<div id="tocView" class="toc-view view open">
</div>
<div id="bookmarksView" class="bookmarks-view view">
<ul id="bookmarks" class="bookmarks">
</ul>
</div>
<div id="searchView" class="view search-view">
<div>
<div class="search-input">
<input id="searchBox" class="searchbox" placeholder="search..." type="input">
<span title="Clear">x</span>
<button id="clear_search" class="icon-cancel pull-right" title="Clear"></button>
</div>
<ul id="searchResults" class="search-results">
</ul>
</div>
</div>
<div id="notesView" class="notes-view view">
<div>
<div class="notes-input">
<textarea id="note-text" class="note-text" placeholder="Write note, press 'marker' button and select position in text to link note."></textarea>
<button id="note-anchor" class="note-anchor icon-room pull-right"></button>
</div>
<ol id="notes" class="notes">
</ol>
</div>
</div>
<div id="settingsView" class="settings-view view">
<fieldset class="settings-container" name="font-settings">
<legend>font</legend>
<div class="control-group">
<div>
<input type="checkbox" id="custom_font_family" name="font_family">
2023-08-02 20:04:03 +00:00
<label for="custom_font_family"><?php echo $l->t('custom font'); ?></label>
2020-04-21 20:37:42 +00:00
<select id="font_family" disabled="">
<option value="verdana, trebuchet, droid sans serif, sans, sans-serif"> sans </option>
<option value="georgia, times new roman, droid serif, serif"> serif </option>
2023-08-02 20:04:03 +00:00
<option value="monospace"><?php echo $l->t('monospace'); ?> </option>
2020-04-21 20:37:42 +00:00
</select>
</div>
<div>
<input type="checkbox" id="custom_font_size" name="font_size">
2023-08-02 20:04:03 +00:00
<label for="custom_font_size"><?php echo $l->t('font size'); ?></label>
2020-04-21 20:37:42 +00:00
<input type="number" id="font_size" value="100" min="50" max="150" disabled=""> %
</div>
<div>
<input type="checkbox" id="custom_font_weight" name="font_weight">
2023-08-02 20:04:03 +00:00
<label for="custom_font_weight"><?php echo $l->t('font weight'); ?></label>
2020-04-21 20:37:42 +00:00
<select id="font_weight" disabled="">
<option value="100">thin</option>
<option value="200">extra light</option>
<option value="300">light</option>
<option value="400">normal</option>
<option value="500">medium</option>
<option value="600">semi-bold</option>
<option value="700">bold</option>
<option value="800">extra bold</option>
<option value="900">black</option>
</select>
</div>
<div id="font_example" class="user font_example">
<div>
Et nos esse veri viri scire volemus
</div>
</div>
</div>
</fieldset>
<fieldset class="settings-container" name="colour-settings">
<legend>colors</legend>
<fieldset>
<legend>normal</legend>
<div class="control-group">
<input type="checkbox" id="use_custom_colors" name="use_custom_colors">
<label for="use_custom_colors">
2023-08-02 20:04:03 +00:00
<?php echo $l->t('Use custom colors'); ?>;
2020-04-21 20:37:42 +00:00
</label>
<div class="center-box">
<input type="color" id="day_color" value="#0a0a0a">
on
<input type="color" id="day_background" value="#f0f0f0">
</div>
<div id="day_example" class="day font_example">
<div>
Et nos esse veri viri scire volemus
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>night</legend>
<div class="control-group">
<div class="center-box nightshift">
2023-08-02 20:04:03 +00:00
<?php echo $l->t('night mode can be toggled by clicking the book title'); ?>;
2020-04-21 20:37:42 +00:00
</div>
<div class="center-box">
<input type="color" id="night_color" value="#454545">
on
<input type="color" id="night_background" value="#000000">
</div>
<div id="night_example" class="night font_example">
<div>
Et nos esse veri viri scire volemus
</div>
</div>
</div>
</fieldset>
</fieldset>
<fieldset class="settings-container" name="display-settings">
<legend>display</legend>
<fieldset>
<legend>page width</legend>
<div class="control-group center-box">
maximum <input type="number" id="page_width" value="72" min="25" max="200"> characters
</div>
<div class="control-group">
<input type="checkbox" id="maximize_page" name="maximize_page">
<label for="custom_margins">maximize page area</label>
</div>
</fieldset>
<div class="control-group">
<input type="checkbox" id="sidebarReflow" name="sidebarReflow">
<label for="sidebarReflow">
2023-08-02 20:04:03 +00:00
<?php echo $l->t('reflow text when sidebars are open'); ?>;
2020-04-21 20:37:42 +00:00
</label>
</div>
<div class="control-group">
<input type="checkbox" id="touch_nav" name="touch_nav">
<label for="touch_nav">
2023-08-02 20:04:03 +00:00
<?php echo $l->t('disable extra-wide page turn areas'); ?>;
2020-04-21 20:37:42 +00:00
</label>
</div>
<div class="control-group">
<input type="checkbox" id="page_turn_arrows" name="page_turn_arrows">
<label for="page_turn_arrows">
2023-08-02 20:04:03 +00:00
<?php echo $l->t('show page turn arrows'); ?>;
2020-04-21 20:37:42 +00:00
</label>
</div>
</fieldset>
</div>
</div> <!-- views -->
</div> <!-- sidebar -->
<!-- /sidebar -->
<!-- main -->
<div id="main">
<!-- titlebar -->
<div id="titlebar">
<div id="opener">
<a id="slider" class="icon-menu">
2023-08-02 20:04:03 +00:00
<?php p($l->t('menu')); ?>
2020-04-21 20:37:42 +00:00
</a>
</div>
2023-06-16 09:50:19 +00:00
<div id="metainfo">
2020-04-21 20:37:42 +00:00
<span id="book-title">
</span>
<span id="title-separator">
    
</span>
<span id="chapter-title">
</span>
</div>
<div id="title-controls">
<a id="note" class="icon-comment">
</a>
<a id="bookmark" class="icon-turned_in_not">
</a>
<a id="fullscreen" class="icon-fullscreen">
</a>
<a id="close" class="icon-exit" style="display:none">
</a>
</div>
</div>
<!-- /titlebar -->
<!-- divider -->
<div id="divider">
</div>
<!-- /divider -->
<!-- navigation + viewer -->
<div id="prev" class="arrow">
<div class="translucent">
</div>
</div>
<div id="viewer">
</div>
<div id="next" class="arrow">
<div class="translucent">
</div>
</div>
<div id="loader">
2023-08-02 20:04:03 +00:00
<img src="<?php p($urlGenerator->linkTo('epubreader', 'img/loading.gif')); ?>">
2020-04-21 20:37:42 +00:00
</div>
<!-- /navigation + viewer -->
</div>
<!-- /main -->
<div class="overlay">
</div>
</div>
</body>
</html>