From 5a87d62ee834dd0f5182d9a43b737d58b897309d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 6 Sep 2013 09:18:41 +0200 Subject: [PATCH] Fix JS problem on IE < 9.0. fix #89 --- book.php | 6 +++--- templates/default/bookdetail.html | 16 ++++++++-------- templates/default/footer.html | 8 ++++---- templates/default/header.html | 24 ++++++++++++------------ templates/default/main.html | 12 ++++++------ util.js | 11 ++++++----- 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/book.php b/book.php index 30638e3..cc2c5b6 100644 --- a/book.php +++ b/book.php @@ -604,7 +604,7 @@ function getJson ($complete = false) { $out ["currentPage"] = $currentPage->n; } if (!is_null (getURLParam ("complete")) || $complete) { - $out ["const"] = array ("version" => VERSION, "i18n" => array ( + $out ["c"] = array ("version" => VERSION, "i18n" => array ( "coverAlt" => localize("i18n.coversection"), "authorsTitle" => localize("authors.title"), "bookwordTitle" => localize("bookword.title"), @@ -634,9 +634,9 @@ function getJson ($complete = false) { "server_side_rendering" => useServerSideRendering (), "html_tag_filter" => $config['cops_html_tag_filter'])); if ($config['cops_thumbnail_handling'] == "1") { - $out ["const"]["url"]["thumbnailUrl"] = $out ["const"]["url"]["coverUrl"]; + $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"]; } else if (!empty ($config['cops_thumbnail_handling'])) { - $out ["const"]["url"]["thumbnailUrl"] = $config['cops_thumbnail_handling']; + $out ["c"]["url"]["thumbnailUrl"] = $config['cops_thumbnail_handling']; } } diff --git a/templates/default/bookdetail.html b/templates/default/bookdetail.html index 83f4b84..c130a50 100644 --- a/templates/default/bookdetail.html +++ b/templates/default/bookdetail.html @@ -2,7 +2,7 @@ {{? it.book.hasCover == 1}} - {{=it.const.i18n.coverAlt}} + {{=it.c.i18n.coverAlt}} {{?}} @@ -15,16 +15,16 @@
{{~}} -

{{=htmlspecialchars (it.title)}}

+

{{=htmlspecialchars (it.title)}}

-

{{=it.const.i18n.authorsTitle}}:

+

{{=it.c.i18n.authorsTitle}}:

{{~it.book.authors:author:i}} {{? i > 0}}, {{?}}{{=htmlspecialchars (author.name)}} {{~}}

{{? it.book.tagsName != ""}}

-

{{=it.const.i18n.tagsTitle}}:

+

{{=it.c.i18n.tagsTitle}}:

{{~it.book.tags:tag:i}} {{? i > 0}}, {{?}}{{=htmlspecialchars (tag.name)}} {{~}} @@ -32,22 +32,22 @@ {{?}} {{? it.book.seriesName != ""}}

-

{{=it.const.i18n.seriesTitle}} :

{{=htmlspecialchars (it.book.seriesCompleteName)}} +

{{=it.c.i18n.seriesTitle}} :

{{=htmlspecialchars (it.book.seriesCompleteName)}}

{{?}} {{? it.book.pubDate != ""}}

-

{{=it.const.i18n.pubdateTitle}}:

{{=it.book.pubDate}} +

{{=it.c.i18n.pubdateTitle}}:

{{=it.book.pubDate}}

{{?}} {{? it.book.languagesName != ""}}

-

{{=it.const.i18n.languagesTitle}}:

{{=it.book.languagesName}} +

{{=it.c.i18n.languagesTitle}}:

{{=it.book.languagesName}}

{{?}} {{? it.book.content != ""}}
-

{{=it.const.i18n.contentTitle}}

+

{{=it.c.i18n.contentTitle}}

{{=it.book.content}}
{{?}} \ No newline at end of file diff --git a/templates/default/footer.html b/templates/default/footer.html index 46ca497..4e632fe 100644 --- a/templates/default/footer.html +++ b/templates/default/footer.html @@ -1,15 +1,15 @@ \ No newline at end of file diff --git a/templates/default/header.html b/templates/default/header.html index d1640f7..bcd45a0 100644 --- a/templates/default/header.html +++ b/templates/default/header.html @@ -1,18 +1,18 @@
-
+
- {{? it.const.config.server_side_rendering == 0}} + {{? it.c.config.server_side_rendering == 0}}
{{?}}

{{=it.title}}

-
+
-
@@ -26,21 +26,21 @@
- {{? it.const.config.server_side_rendering == 0}} + {{? it.c.config.server_side_rendering == 0}} diff --git a/templates/default/main.html b/templates/default/main.html index 2ca95fc..bcbd614 100644 --- a/templates/default/main.html +++ b/templates/default/main.html @@ -20,8 +20,8 @@
{{? entry.book.hasCover == 1}} - - {{=it.const.i18n.coverAlt}} + + {{=it.c.i18n.coverAlt}} {{?}} @@ -30,15 +30,15 @@ {{=data.name}}
{{~}} - +

{{=htmlspecialchars (entry.title)}} {{? entry.book.pubDate != ""}}({{=entry.book.pubDate}}){{?}} {{? entry.book.rating != ""}}{{=entry.book.rating}}{{?}}

-

{{=it.const.i18n.authorsTitle}} :

{{=htmlspecialchars (entry.book.authorsName)}}
- {{? entry.book.tagsName != ""}}

{{=it.const.i18n.tagsTitle}} :

{{=htmlspecialchars (entry.book.tagsName)}}
{{?}} - {{? entry.book.seriesName != ""}}

{{=it.const.i18n.seriesTitle}} :

{{=htmlspecialchars (entry.book.seriesName)}} ({{=entry.book.seriesIndex}})
{{?}} +

{{=it.c.i18n.authorsTitle}} :

{{=htmlspecialchars (entry.book.authorsName)}}
+ {{? entry.book.tagsName != ""}}

{{=it.c.i18n.tagsTitle}} :

{{=htmlspecialchars (entry.book.tagsName)}}
{{?}} + {{? entry.book.seriesName != ""}}

{{=it.c.i18n.seriesTitle}} :

{{=htmlspecialchars (entry.book.seriesName)}} ({{=entry.book.seriesIndex}})
{{?}}
{{?}} diff --git a/util.js b/util.js index e8b5051..14b8cd1 100644 --- a/util.js +++ b/util.js @@ -60,7 +60,7 @@ function retourMail(data, textStatus, jqXHR ) { function sendToMailAddress (component, dataid) { var email = $.cookie ('email'); if (!$.cookie ('email')) { - email = window.prompt (currentData.const.i18n.customizeEmail, ""); + email = window.prompt (currentData.c.i18n.customizeEmail, ""); $.cookie ('email', email, { expires: 365 }); } var url = 'sendtomail.php'; @@ -87,8 +87,8 @@ function isDefined(x) { function getCurrentOption (option) { if (!$.cookie (option)) { - if (currentData && currentData.const && currentData.const.config && currentData.const.config [option]) { - return currentData.const.config [option]; + if (currentData && currentData.c && currentData.c.config && currentData.c.config [option]) { + return currentData.c.config [option]; } } return $.cookie (option); @@ -218,6 +218,7 @@ function handleFilterEvents () { */ function navigateTo (url) { + $("h1").append (" "); before = new Date (); var jsonurl = url.replace ("index", "getJSON"); var cachedData = cache.get (jsonurl); @@ -236,7 +237,7 @@ function navigateTo (url) { function updatePage (data) { var result; filterList = {}; - data ["const"] = currentData ["const"]; + data ["c"] = currentData ["c"]; if (false && $("section").length && currentData.isPaginated === 0 && data.isPaginated === 0) { // Partial update (for now disabled) debug_log ("Partial update"); @@ -322,7 +323,7 @@ function link_Clicked (event) { before = new Date (); var jsonurl = url.replace ("index", "getJSON"); $.getJSON(jsonurl, function(data) { - data ["const"] = currentData ["const"]; + data ["c"] = currentData ["c"]; var detail = ""; if (data.page === "16") { detail = data.fullhtml;