diff --git a/config_default.php b/config_default.php index 5b4b93c..bd67f4a 100644 --- a/config_default.php +++ b/config_default.php @@ -139,7 +139,7 @@ /* * Filter on tags to book list - * Only works with the OPDS catalog for now + * Only works with the OPDS catalog * Usage : array ("I only want to see books using the tag : Tag1" => "Tag1", * "I only want to see books not using the tag : Tag1" => "!Tag1", * "I want to see every books" => "", @@ -194,5 +194,12 @@ "smtp.secure" => "", "address.from" => "cops@slucas.fr" ); + + /* + * Use filter in HTML catalog + * 1 : Yes (enable) + * 0 : No + */ + $config['cops_html_tag_filter'] = "1"; ?> \ No newline at end of file diff --git a/getJSON.php b/getJSON.php index d66ca4e..00cb0f5 100644 --- a/getJSON.php +++ b/getJSON.php @@ -80,7 +80,8 @@ "thumbnailUrl" => "fetch.php?height=70&id={0}&db={1}"), "config" => array ( "use_fancyapps" => $config ["cops_use_fancyapps"], - "max_item_per_page" => $config['cops_max_item_per_page'])); + "max_item_per_page" => $config['cops_max_item_per_page'], + "html_tag_filter" => $config['cops_html_tag_filter'])); } $out ["containsBook"] = 0; diff --git a/util.js b/util.js index b6e8d3a..fb4262c 100644 --- a/util.js +++ b/util.js @@ -23,7 +23,7 @@ function updateCookie (id) { } var name = $(id).attr('id'); var value = $(id).val (); - $.cookie(name, value); + $.cookie(name, value, { expires: 365 }); } function updateCookieFromCheckbox (id) { @@ -237,12 +237,14 @@ function updatePage (data) { debug_log (elapsed ()); - if ($.cookie('toolbar') === 1) { $("#tool").show (); } + if ($.cookie('toolbar') === '1') { $("#tool").show (); } if (currentData.containsBook === 1) { $("#sortForm").show (); - $("#filter ul").empty (); - updateFilters (); - handleFilterEvents (); + if (getCurrentOption ("html_tag_filter") === "1") { + $("#filter ul").empty (); + updateFilters (); + handleFilterEvents (); + } } else { $("#sortForm").hide (); } @@ -270,7 +272,7 @@ function updatePage (data) { } }); - if (getCurrentOption ("use_fancyapps") === 1) { + if (getCurrentOption ("use_fancyapps") === "1") { $(".fancydetail").click(function(event){ event.preventDefault(); before = new Date (); @@ -306,7 +308,7 @@ function updatePage (data) { function ajaxifyLinks () { if (isPushStateEnabled) { var links = $("a[href^='index']"); - if (getCurrentOption ("use_fancyapps") === 1) { links = links.not (".fancydetail"); } + if (getCurrentOption ("use_fancyapps") === "1") { links = links.not (".fancydetail"); } links.click (function (event) { event.preventDefault();