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

View file

@ -91,7 +91,7 @@
$.get('templates/default/bookdetail.html'), $.get('templates/default/bookdetail.html'),
$.get('templates/default/main.html'), $.get('templates/default/main.html'),
$.get('templates/default/page.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]); templateBookDetail = doT.template (bookdetail [0]);
var defMain = { var defMain = {

View file

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