Save current JSON data instead of generated HTML. Reenabled tool click. re #73
This commit is contained in:
parent
6ee817710e
commit
b49432e3e1
12
index.php
12
index.php
|
@ -86,16 +86,6 @@
|
||||||
$(".fancyabout").fancybox(fancyBoxObject ('COPS <?php echo VERSION ?>', 'ajax'));
|
$(".fancyabout").fancybox(fancyBoxObject ('COPS <?php echo VERSION ?>', 'ajax'));
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
$(".headright").click(function(){
|
|
||||||
if ($("#tool").is(":hidden")) {
|
|
||||||
$("#tool").slideDown("slow");
|
|
||||||
$.cookie('toolbar', '1');
|
|
||||||
} else {
|
|
||||||
$("#tool").slideUp();
|
|
||||||
$.removeCookie('toolbar');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.when($.get('templates/default/header.html'),
|
$.when($.get('templates/default/header.html'),
|
||||||
$.get('templates/default/footer.html'),
|
$.get('templates/default/footer.html'),
|
||||||
$.get('templates/default/bookdetail.html'),
|
$.get('templates/default/bookdetail.html'),
|
||||||
|
@ -118,7 +108,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
templatePage = doT.template (page [0], undefined, defPage);
|
templatePage = doT.template (page [0], undefined, defPage);
|
||||||
var toto = "toto";
|
currentData = data [0];
|
||||||
|
|
||||||
updatePage (data [0]);
|
updatePage (data [0]);
|
||||||
history.replaceState(data [0], "", window.location);
|
history.replaceState(data [0], "", window.location);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div class="headcenter">
|
<div class="headcenter">
|
||||||
<h1>{{=it.title}}</h1>
|
<h1>{{=it.title}}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="tool">
|
<div id="tool" style="display: none">
|
||||||
<div style="float: left; width: 60%">
|
<div style="float: left; width: 60%">
|
||||||
<form action="index.php" method="get">
|
<form action="index.php" method="get">
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
|
|
17
util.js
17
util.js
|
@ -1,4 +1,4 @@
|
||||||
var templatePage, templateBookDetail, templateMain, result;
|
var templatePage, templateBookDetail, templateMain, currentData;
|
||||||
|
|
||||||
var isEink = /Kobo|Kindle|EBRD1101/i.test(navigator.userAgent);
|
var isEink = /Kobo|Kindle|EBRD1101/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
@ -32,12 +32,25 @@ function navigateTo (url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePage (data) {
|
function updatePage (data) {
|
||||||
result = templatePage (data);
|
currentData = data;
|
||||||
|
var result = templatePage (data);
|
||||||
document.title = data.title;
|
document.title = data.title;
|
||||||
$(".container").html (result);
|
$(".container").html (result);
|
||||||
|
|
||||||
|
if ($.cookie('toolbar') == 1) $("#tool").show ();
|
||||||
|
|
||||||
ajaxifyLinks ();
|
ajaxifyLinks ();
|
||||||
|
|
||||||
|
$(".headright").click(function(){
|
||||||
|
if ($("#tool").is(":hidden")) {
|
||||||
|
$("#tool").slideDown("slow");
|
||||||
|
$.cookie('toolbar', '1');
|
||||||
|
} else {
|
||||||
|
$("#tool").slideUp();
|
||||||
|
$.removeCookie('toolbar');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(".fancydetail").click(function(event){
|
$(".fancydetail").click(function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var url = $(this).attr("href");
|
var url = $(this).attr("href");
|
||||||
|
|
Loading…
Reference in a new issue