From fccb7a98204acfd1fd8aece421c9c3f97191913d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 16 Jun 2013 15:21:21 +0200 Subject: [PATCH] little optimization : i18n is only transfered one time. re #73 --- getJSON.php | 4 +++- index.php | 2 +- util.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/getJSON.php b/getJSON.php index ef59ebe..cdd5a4f 100644 --- a/getJSON.php +++ b/getJSON.php @@ -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 ()) { diff --git a/index.php b/index.php index fa39fb8..fb6e7ba 100644 --- a/index.php +++ b/index.php @@ -91,7 +91,7 @@ $.get('templates/default/bookdetail.html'), $.get('templates/default/main.html'), $.get('templates/default/page.html'), - $.getJSON('')).done(function(header, footer, bookdetail, main, page, data){ + $.getJSON('')).done(function(header, footer, bookdetail, main, page, data){ templateBookDetail = doT.template (bookdetail [0]); var defMain = { diff --git a/util.js b/util.js index ae31811..7f1ad5f 100644 --- a/util.js +++ b/util.js @@ -32,6 +32,7 @@ function navigateTo (url) { } function updatePage (data) { + data ["i18n"] = currentData ["i18n"]; currentData = data; var result = templatePage (data); document.title = data.title;