little optimization : i18n is only transfered one time. re #73

This commit is contained in:
Sébastien Lucas 2013-06-16 15:21:21 +02:00
parent b49432e3e1
commit fccb7a9820
3 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,8 @@
$out ["maxPage"] = $currentPage->getMaxPage ();
$out ["currentPage"] = $currentPage->n;
}
$out ["i18n"] = array ("coverAlt" => localize("i18n.coversection"),
if (!is_null (getURLParam ("complete"))) {
$out ["i18n"] = array ("coverAlt" => localize("i18n.coversection"),
"authorsTitle" => localize("authors.title"),
"bookwordTitle" => localize("bookword.title"),
"tagsTitle" => localize("tags.title"),
@ -72,6 +73,7 @@
"contentTitle" => localize("content.summary"),
"sortorderAsc" => localize("search.sortorder.asc"),
"sortorderDesc" => localize("search.sortorder.desc"));
}
$out ["containsBook"] = 0;
if ($currentPage->containsBook ()) {

View File

@ -91,7 +91,7 @@
$.get('templates/default/bookdetail.html'),
$.get('templates/default/main.html'),
$.get('templates/default/page.html'),
$.getJSON('<?php echo "getJSON.php?" . str_replace ("&", "&amp;", $_SERVER["QUERY_STRING"]); ?>')).done(function(header, footer, bookdetail, main, page, data){
$.getJSON('<?php echo "getJSON.php?" . str_replace ("&", "&amp;", addURLParameter ($_SERVER["QUERY_STRING"], "complete", 1)); ?>')).done(function(header, footer, bookdetail, main, page, data){
templateBookDetail = doT.template (bookdetail [0]);
var defMain = {

View File

@ -32,6 +32,7 @@ function navigateTo (url) {
}
function updatePage (data) {
data ["i18n"] = currentData ["i18n"];
currentData = data;
var result = templatePage (data);
document.title = data.title;