Add a config item to avoid using Fancyapps.

For now the about box still use Fancyapps.

Reported by mcister and Northguy
This commit is contained in:
Sébastien Lucas 2012-12-10 06:06:45 +01:00
parent f9efdbf44f
commit 8906430b13
4 changed files with 37 additions and 4 deletions

View file

@ -220,7 +220,8 @@ class Page
return new PageSerieDetail ($id, $query, $n);
case Base::PAGE_OPENSEARCH_QUERY :
return new PageQueryResult ($id, $query, $n);
break;
case Base::PAGE_BOOK_DETAIL :
return new PageBookDetail ($id, $query, $n);
default:
$page = new Page ($id, $query, $n);
$page->idPage = "cops:catalog";
@ -402,6 +403,14 @@ class PageQueryResult extends Page
}
}
class PageBookDetail extends Page
{
public function InitializeContent ()
{
$this->title = "Book";
}
}
abstract class Base
{
const PAGE_INDEX = "index";
@ -417,6 +426,7 @@ abstract class Base
const PAGE_ALL_RECENT_BOOKS = "10";
const PAGE_ALL_TAGS = "11";
const PAGE_TAG_DETAIL = "12";
const PAGE_BOOK_DETAIL = "13";
const COMPATIBILITY_XML_ALDIKO = "aldiko";

View file

@ -110,4 +110,11 @@
* 0 : No
*/
$config['cops_author_split_first_letter'] = "1";
/*
* Enable of Fancyapps (for popups)
* 1 : Yes (enable)
* 0 : No
*/
$config['cops_use_fancyapps'] = "1";
?>

View file

@ -76,12 +76,14 @@
$("#search").slideUp();
});
<?php if ($config['cops_use_fancyapps'] == 1) { ?>
$(".fancycover").fancybox({
'type' : 'image',
prevEffect : 'none',
nextEffect : 'none'
<?php if ($isEink) echo ", openEffect : 'none', closeEffect : 'none', helpers : {overlay : null}"; ?>
});
<?php } ?>
$(".fancyabout").fancybox({
'type' : 'ajax',
@ -101,6 +103,9 @@
$(".bookdetail").click(function(){
var url = $(this).find("a").attr("href");
<?php if ($config['cops_use_fancyapps'] == 0) { ?>
window.location = url;
<?php } else { ?>
$('#content').load(url, function(data, stat, req){
$.fancybox( {
content: data,
@ -108,7 +113,7 @@
<?php if ($isEink) echo ", margin : [15, 35, 10, 10], openEffect : 'none', closeEffect : 'none', helpers : {overlay : null}"; ?>
} );
});
<?php } ?>
return false;
});
});
@ -179,6 +184,10 @@
<div id="content" style="display: none;"></div>
<div class="entries">
<?php
if ($page == Base::PAGE_BOOK_DETAIL)
{
include ("bookdetail.php");
}
foreach ($currentPage->entryArray as $entry) {
if (get_class ($entry) != "EntryBook") {
?>
@ -224,7 +233,7 @@
?>
</div>
<div class="bookdetail">
<a class="navigation" href="bookdetail.php?id=<?php echo $entry->book->id ?>" />
<a class="navigation" href="<?php if ($config['cops_use_fancyapps'] == 0) { echo 'index.php?page=13&amp;id=' . $entry->book->id; } else { echo 'bookdetail.php?id=' . $entry->book->id; } ?>" />
<div class="entryTitle st"><?php echo htmlspecialchars ($entry->title) ?> <span class="sp">(<?php echo date ('Y', $entry->book->pubdate) ?>)</span> <span class="sr"><?php echo $entry->book->getRating () ?></span></div>
<div class="entryContent sa"><?php echo localize("authors.title") . " : " . htmlspecialchars ($entry->book->getAuthorsName ()) ?></div>
<div class="entryContent"><?php echo localize("tags.title") . " : " . htmlspecialchars ($entry->book->getTagsName ()) ?></div>

View file

@ -28,7 +28,6 @@ color:white;
background-color:black;
width:100%;
height:32px;
margin-top:8px;
}
img
@ -94,6 +93,7 @@ clear:both;
.entries
{
background-color:lightgray;
margin-top: 5px;
}
.entry
@ -253,6 +253,13 @@ min-width: 400px;
color:black;
}
.entries > .bookpopup
{
background-color: white;
margin-bottom: 5px;
padding: 6px;
}
.content
{
line-height: 110%;