almost finish CSS change. re #25

This commit is contained in:
Sébastien Lucas 2013-05-29 21:30:37 +02:00
parent f5ff23cf9d
commit faaf4ca43c
5 changed files with 100 additions and 4 deletions

View file

@ -107,7 +107,7 @@ class Book extends Base {
$urlParam = $this->getUri (); $urlParam = $this->getUri ();
if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB)); if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
$urlParam = str_replace ("&", "&", $urlParam); $urlParam = str_replace ("&", "&", $urlParam);
if ($permalink || $config['cops_use_fancyapps'] == 0) { if ($permalink || getCurrentOption ('use_fancyapps') == 0) {
return 'index.php' . $urlParam; return 'index.php' . $urlParam;
} else { } else {
return 'bookdetail.php' . $urlParam; return 'bookdetail.php' . $urlParam;

92
customize.php Normal file
View file

@ -0,0 +1,92 @@
<?php
/**
* COPS (Calibre OPDS PHP Server) HTML main script
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <sebastien@slucas.fr>
*
*/
require_once ("config.php");
require_once ("base.php");
header ("Content-Type:application/xhtml+xml;charset=utf-8");
$database = GetUrlParam (DB);
$use_fancybox = "";
if (getCurrentOption ("use_fancyapps") == 1) {
$use_fancybox = "checked='checked'";
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Customize COPS UI</title>
<script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery-1.9.1.min.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery.cookies.js") ?>"></script>
<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:400,300italic,800,300,400italic,600,600italic,700,700italic,800italic' />
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss ()) ?>" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/normalize/normalize.css") ?>" />
<script type="text/javascript">
function updateCookie (id) {
var name = $(id).attr('id');
var value = $(id).val ();
$.cookie(name, value);
}
function updateCookieFromCheckbox (id) {
var name = $(id).attr('id');
if ($(id).is(":checked"))
{
$.cookie(name, '1');
}
else
{
$.cookie(name, '0');
}
}
</script>
</head>
<body>
<div class="container">
<header>
<a class="headleft" href="index.php">
<img src="<?php echo getUrlWithVersion("images/home.png") ?>" alt="<?php echo localize ("home.alternate") ?>" />
</a>
<img class="headright" style="visibility: hidden;" id="searchImage" src="<?php echo getUrlWithVersion("images/setting64.png") ?>" alt="Settings and menu" />
<div class="headcenter">
<h1>Customize COPS UI</h1>
</div>
</header>
<section>
<article class="frontpage">
<h2>Style</h2>
<h4><select id="style" onchange="updateCookie (this);">
<?php
foreach (glob ("styles/*.css") as $filename) {
if (preg_match ('/styles\/style-(.*?)\.css/', $filename, $m)) {
$filename = $m [1];
}
$selected = "";
if (getCurrentOption ("style") == $filename) {
$selected = "selected='selected'";
}
echo "<option value='{$filename}' {$selected}>{$filename}</option>";
}
?>
</select></h4>
</article>
<article class="frontpage">
<h2>Use Fancybox</h2>
<h4><input type="checkbox" onchange="updateCookieFromCheckbox (this);" id="use_fancyapps" <?php echo $use_fancybox ?> /></h4>
</article>
</section>
<footer>
</footer>
</div>
</body>
</html>

BIN
images/theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

View file

@ -55,7 +55,7 @@
<title><?php echo htmlspecialchars ($currentPage->title) ?></title> <title><?php echo htmlspecialchars ($currentPage->title) ?></title>
<script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery-1.9.1.min.js") ?>"></script> <script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery-1.9.1.min.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery.cookies.js") ?>"></script> <script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery.cookies.js") ?>"></script>
<?php if ($config['cops_use_fancyapps'] == 1) { ?> <?php if (getCurrentOption ('use_fancyapps') == 1) { ?>
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/fancybox/jquery.fancybox.pack.js") ?>"></script> <script type="text/javascript" src="<?php echo getUrlWithVersion("resources/fancybox/jquery.fancybox.pack.js") ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/fancybox/jquery.fancybox.css") ?>" media="screen" /> <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/fancybox/jquery.fancybox.css") ?>" media="screen" />
<?php } ?> <?php } ?>
@ -80,7 +80,7 @@
}); });
}); });
<?php if ($config['cops_use_fancyapps'] == 1) { ?> <?php if (getCurrentOption ('use_fancyapps') == 1) { ?>
$(".fancycover").fancybox({ $(".fancycover").fancybox({
'type' : 'image', 'type' : 'image',
prevEffect : 'none', prevEffect : 'none',
@ -279,8 +279,11 @@
?> ?>
</section> </section>
<footer> <footer>
<div class="footleft">
<a href="customize.php"><img src="<?php echo getUrlWithVersion("images/theme.png") ?>" alt="<?php echo localize ("customize.title") ?>" /></a>
</div>
<div class="footright"> <div class="footright">
<a class="fancyabout" href="<?php if ($config['cops_use_fancyapps'] == 1) { echo "about.xml"; } else { echo $_SERVER["SCRIPT_NAME"] . str_replace ("&", "&amp;", addURLParameter ("?page=16", DB, $database)); } ?>"><img src="<?php echo getUrlWithVersion("images/info.png") ?>" alt="<?php echo localize ("about.title") ?>" /></a> <a class="fancyabout" href="<?php if (getCurrentOption ('use_fancyapps') == 1) { echo "about.xml"; } else { echo $_SERVER["SCRIPT_NAME"] . str_replace ("&", "&amp;", addURLParameter ("?page=16", DB, $database)); } ?>"><img src="<?php echo getUrlWithVersion("images/info.png") ?>" alt="<?php echo localize ("about.title") ?>" /></a>
</div> </div>
<?php <?php
if ($currentPage->isPaginated ()) { if ($currentPage->isPaginated ()) {

View file

@ -298,6 +298,7 @@
"i18n.dateGenerated":"Catalog generated on {0}", "i18n.dateGenerated":"Catalog generated on {0}",
"deeplevel.summary":"{0} broken up by authors, tags, etc. ", "deeplevel.summary":"{0} broken up by authors, tags, etc. ",
"about.title":"About COPS", "about.title":"About COPS",
"customize.title":"Customize COPS",
"about.summary":"Notes on using Calibre2Opds", "about.summary":"Notes on using Calibre2Opds",
"usage.intro":"The options are taken from the configuration file located at {0}", "usage.intro":"The options are taken from the configuration file located at {0}",
"language.title":"Language", "language.title":"Language",