From b414d9196417872d5bca443fee09d0a6e6c9efb0 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 2 Nov 2021 18:55:56 +0400 Subject: [PATCH 1/3] Fix for #2162 (Epub viewer isn't displaying images) --- cps/web.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/web.py b/cps/web.py index 47b3b49b..8d3e4551 100644 --- a/cps/web.py +++ b/cps/web.py @@ -85,6 +85,8 @@ def add_security_headers(resp): resp.headers['Content-Security-Policy'] = "default-src 'self'" + ''.join([' '+host for host in config.config_trustedhosts.strip().split(',')]) + " 'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data:" if request.endpoint == "editbook.edit_book" or config.config_use_google_drive: resp.headers['Content-Security-Policy'] += " *" + elif request.endpoint == "web.read_book": + resp.headers['Content-Security-Policy'] += " blob:;style-src-elem 'self' blob: 'unsafe-inline';" resp.headers['X-Content-Type-Options'] = 'nosniff' resp.headers['X-Frame-Options'] = 'SAMEORIGIN' resp.headers['X-XSS-Protection'] = '1; mode=block' From c7df8a1a344f9b63783eb2b96cb27e1817887920 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 2 Nov 2021 18:57:28 +0400 Subject: [PATCH 2/3] Fix missing csrf token in series grid view --- cps/templates/grid.html | 1 + 1 file changed, 1 insertion(+) diff --git a/cps/templates/grid.html b/cps/templates/grid.html index ee623dc1..c9f3d0ae 100644 --- a/cps/templates/grid.html +++ b/cps/templates/grid.html @@ -8,6 +8,7 @@ {% endif %} {% endif %} + {% if charlist|length %} From 95371d0d7f22479f20cf764ed5e9b94dc37f4f28 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 2 Nov 2021 20:27:50 +0400 Subject: [PATCH 3/3] Fix shelf grid ordering for inverted order at page load Ordering buttons now visible on medium size screens --- cps/static/js/filter_grid.js | 10 ++++++---- cps/templates/author.html | 2 +- cps/templates/grid.html | 10 ++++------ cps/templates/index.html | 2 +- cps/templates/list.html | 10 ++++------ cps/templates/search.html | 2 +- cps/templates/shelf.html | 2 +- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/cps/static/js/filter_grid.js b/cps/static/js/filter_grid.js index 7043131a..d84cf57a 100644 --- a/cps/static/js/filter_grid.js +++ b/cps/static/js/filter_grid.js @@ -21,10 +21,11 @@ var $list = $("#list").isotope({ itemSelector: ".book", layoutMode: "fitRows", getSortData: { - title: ".title", - } + title: ".title" + }, }); + $("#desc").click(function() { if (direction === 0) { return; @@ -37,9 +38,10 @@ $("#desc").click(function() { url: getPath() + "/ajax/view", data: "{\"" + page + "\": {\"dir\": \"desc\"}}", }); + // invert sorting order to make already inverted start order working $list.isotope({ sortBy: "name", - sortAscending: true + sortAscending: !$list.data('isotope').options.sortAscending }); direction = 0; }); @@ -58,7 +60,7 @@ $("#asc").click(function() { }); $list.isotope({ sortBy: "name", - sortAscending: false + sortAscending: !$list.data('isotope').options.sortAscending }); direction = 1; }); diff --git a/cps/templates/author.html b/cps/templates/author.html index d82b2ebd..4ae2df42 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -22,7 +22,7 @@ {% if author is not none %}

{{_("In Library")}}

{% endif %} -