From cedfa90d766194a6c07f6b4289d55d712b499040 Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Sat, 10 Oct 2020 17:51:46 +0300 Subject: [PATCH 01/20] fix for #981 --- cps/static/css/caliBlur.css | 6 +++--- cps/static/js/main.js | 13 +++++++++++++ cps/templates/layout.html | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index 3bf07110..b7d86519 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -637,18 +637,18 @@ div[aria-label="Edit/Delete book"] > .btn > span:hover { color: var(--color-primary) } -.book { +/* .book { width: 225px; max-width: 225px; position: relative !important; - left: auto !important; + left: auto !important; top: auto !important; -webkit-transform: none !important; -ms-transform: none !important; transform: none !important; min-width: 225px; display: block -} +} */ #infscr-loading img, body > div.container-fluid > div > div.col-sm-10 > div.discover > div.isotope:after, body > div.container-fluid > div > div.col-sm-10 > div.discover > div.isotope:before { display: none diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 7312f08d..c04ec65e 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -187,6 +187,19 @@ $(function() { $(".load-more .row").isotope( "appended", $(data), null ); }); + // fix for infinite scroll on CaliBlur Theme (#981) + if ($(".load-more .row").length && $("body").hasClass("blur")) { + $(".col-sm-10").bind("scroll", function () { + if ( + $(this).scrollTop() + $(this).innerHeight() >= + $(this)[0].scrollHeight + ) { + $loadMore.infiniteScroll("loadNextPage"); + window.history.replaceState({}, null, $loadMore.infiniteScroll('getAbsolutePath')+1) + } + }); + } + $("#restart").click(function() { $.ajax({ dataType: "json", diff --git a/cps/templates/layout.html b/cps/templates/layout.html index c555f556..65867fe7 100644 --- a/cps/templates/layout.html +++ b/cps/templates/layout.html @@ -166,7 +166,7 @@ {% endif %} {% endfor %} {% if pagination.has_next %} -
  • {% endif %} From f574f8faf00342da222f38040a94e59d8764aa5a Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Sat, 10 Oct 2020 18:34:55 +0300 Subject: [PATCH 02/20] better js check --- cps/static/js/main.js | 51 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index c04ec65e..ff9cac08 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -172,32 +172,33 @@ $(function() { layoutMode : "fitColumns" }); - - var $loadMore = $(".load-more .row").infiniteScroll({ - debug: false, - // selector for the paged navigation (it will be hidden) - path : ".next", - // selector for the NEXT link (to page 2) - append : ".load-more .book" - //animate : true, # ToDo: Reenable function - //extraScrollPx: 300 - }); - $loadMore.on( "append.infiniteScroll", function( event, response, path, data ) { - $(".pagination").addClass("hidden"); - $(".load-more .row").isotope( "appended", $(data), null ); - }); - - // fix for infinite scroll on CaliBlur Theme (#981) - if ($(".load-more .row").length && $("body").hasClass("blur")) { - $(".col-sm-10").bind("scroll", function () { - if ( - $(this).scrollTop() + $(this).innerHeight() >= - $(this)[0].scrollHeight - ) { - $loadMore.infiniteScroll("loadNextPage"); - window.history.replaceState({}, null, $loadMore.infiniteScroll('getAbsolutePath')+1) - } + if ($('.next').length) { + var $loadMore = $(".load-more .row").infiniteScroll({ + debug: false, + // selector for the paged navigation (it will be hidden) + path : ".next", + // selector for the NEXT link (to page 2) + append : ".load-more .book" + //animate : true, # ToDo: Reenable function + //extraScrollPx: 300 }); + $loadMore.on( "append.infiniteScroll", function( event, response, path, data ) { + $(".pagination").addClass("hidden"); + $(".load-more .row").isotope( "appended", $(data), null ); + }); + + // fix for infinite scroll on CaliBlur Theme (#981) + if ($("body").hasClass("blur")) { + $(".col-sm-10").bind("scroll", function () { + if ( + $(this).scrollTop() + $(this).innerHeight() >= + $(this)[0].scrollHeight + ) { + $loadMore.infiniteScroll("loadNextPage"); + window.history.replaceState({}, null, $loadMore.infiniteScroll('getAbsolutePath')+1) + } + }); + } } $("#restart").click(function() { From e723aaa5f6715dffa36c8a5b3ff7434c502fefd2 Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Sun, 11 Oct 2020 21:56:49 +0300 Subject: [PATCH 03/20] fix for history state (+1 not needed) --- cps/static/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index ff9cac08..44a72b06 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -195,7 +195,7 @@ $(function() { $(this)[0].scrollHeight ) { $loadMore.infiniteScroll("loadNextPage"); - window.history.replaceState({}, null, $loadMore.infiniteScroll('getAbsolutePath')+1) + window.history.replaceState({}, null, $loadMore.infiniteScroll("getAbsolutePath")); } }); } From 9adcfa99f429245ea9d88751c8b2370622e8ca08 Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Sun, 11 Oct 2020 22:35:56 +0300 Subject: [PATCH 04/20] trigger infinite scroll script only on templates where .load-more class is present --- cps/static/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 44a72b06..c1f58b7f 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -172,7 +172,7 @@ $(function() { layoutMode : "fitColumns" }); - if ($('.next').length) { + if ($(".load-more").length && $(".next").length) { var $loadMore = $(".load-more .row").infiniteScroll({ debug: false, // selector for the paged navigation (it will be hidden) From 2ff286b672f7f3e04a1bfdd6a677ed8906d3d1cf Mon Sep 17 00:00:00 2001 From: Ghighi Date: Fri, 16 Oct 2020 00:43:57 +0300 Subject: [PATCH 05/20] natural solution, pagination is changing on new page --- cps/static/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cps/static/js/main.js b/cps/static/js/main.js index c1f58b7f..f2d7b929 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -183,7 +183,9 @@ $(function() { //extraScrollPx: 300 }); $loadMore.on( "append.infiniteScroll", function( event, response, path, data ) { - $(".pagination").addClass("hidden"); + if ($("body").hasClass("blur")) { + $(".pagination").addClass("hidden").html(() => $(response).find(".pagination").html()); + } $(".load-more .row").isotope( "appended", $(data), null ); }); From b9b8e3f632c464f63837ed2fa9412703410568ec Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sat, 31 Oct 2020 20:12:22 +0100 Subject: [PATCH 06/20] Update testresults --- test/Calibre-Web TestSummary_Linux.html | 838 ++++++++++++------------ 1 file changed, 409 insertions(+), 429 deletions(-) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 41225306..e2fa7bee 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
    -

    Start Time: 2020-10-10 07:47:35

    +

    Start Time: 2020-10-31 14:09:56

    -

    Stop Time: 2020-10-10 09:47:24

    +

    Stop Time: 2020-10-31 16:09:08

    -

    Duration: 1h 37 min

    +

    Duration: 1h 36 min

    @@ -102,12 +102,12 @@ - + TestAnonymous 13 - 12 + 13 + 0 0 - 1 0 Detail @@ -215,31 +215,11 @@ - +
    TestAnonymous - test_guest_restricted_settings_visibility
    - -
    - ERROR -
    - - - - + PASS @@ -1107,7 +1087,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - TestEditBooks + TestEditBooksList 3 3 0 @@ -1122,7 +1102,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye -
    TestEditBooks - test_edit_books_list
    +
    TestEditBooksList - test_edit_books_list
    PASS @@ -1131,7 +1111,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye -
    TestEditBooks - test_list_visibility
    +
    TestEditBooksList - test_list_visibility
    PASS @@ -1140,7 +1120,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye -
    TestEditBooks - test_merge_book
    +
    TestEditBooksList - test_merge_book
    PASS @@ -1341,7 +1321,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye
    Traceback (most recent call last):
    -  File "/home/matthias/Entwicklung/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 719, in test_upload_cover_hdd
    +  File "/home/matthias/Entwicklung/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 721, in test_upload_cover_hdd
         self.assertTrue(False, "Browser-Cache Problem: Old Cover is displayed instead of New Cover")
     AssertionError: False is not true : Browser-Cache Problem: Old Cover is displayed instead of New Cover
    @@ -1522,165 +1502,6 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - - TestCalibreHelper - 16 - 16 - 0 - 0 - 0 - - Detail - - - - - - - -
    TestCalibreHelper - test_author_sort
    - - PASS - - - - - - -
    TestCalibreHelper - test_author_sort_comma
    - - PASS - - - - - - -
    TestCalibreHelper - test_author_sort_junior
    - - PASS - - - - - - -
    TestCalibreHelper - test_author_sort_oneword
    - - PASS - - - - - - -
    TestCalibreHelper - test_author_sort_roman
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_Limit_Length
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_char_replacement
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_chinese_Characters
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_deg_eur_replacement
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_doubleS
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_finish_Dot
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_high23
    - - PASS - - - - - - -
    TestCalibreHelper - test_check_umlauts
    - - PASS - - - - - - -
    TestCalibreHelper - test_random_password
    - - PASS - - - - - - -
    TestCalibreHelper - test_split_authors
    - - PASS - - - - - - -
    TestCalibreHelper - test_whitespaces
    - - PASS - - - - - TestKoboSync 8 @@ -1689,13 +1510,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 0 - Detail + Detail - +
    TestKoboSync - test_kobo_about
    @@ -1704,7 +1525,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_shelves_add_remove_books
    @@ -1713,7 +1534,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_changed_book
    @@ -1722,7 +1543,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_invalid
    @@ -1731,7 +1552,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_reading_state
    @@ -1740,7 +1561,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_shelf
    @@ -1749,7 +1570,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_unchanged
    @@ -1758,7 +1579,7 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestKoboSync - test_sync_upload
    @@ -1776,13 +1597,13 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye 0 1 - Detail + Detail - +
    TestLdapLogin - test_LDAP_SSL
    @@ -1791,19 +1612,19 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - +
    TestLdapLogin - test_LDAP_SSL_CERTIFICATE
    - SKIP + SKIP
    -