Skip to content
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7b93138
first draft for navigation state preservation
psilabs-dev Mar 26, 2025
81cdda7
Merge pull request #37 from psilabs-dev/dev-1187-a
psilabs-dev Mar 27, 2025
6f65239
dont touch session state
psilabs-dev Mar 27, 2025
fa5a34e
add arc nav shortcuts, fix fullscreen click behavior
psilabs-dev Mar 27, 2025
258849b
disable archive hopping while in fullscreen
psilabs-dev Mar 27, 2025
4f6e78d
add support for switching between multiple datatables pages
psilabs-dev Mar 29, 2025
04e6e01
fix SO-63141448 access control checks issues
psilabs-dev Mar 29, 2025
2fe8485
add reader-help docs
psilabs-dev Mar 29, 2025
1a80c0c
disable navigation state when trigger r key
psilabs-dev Mar 29, 2025
17bfe27
extend shift jumping to ad keys
psilabs-dev Apr 1, 2025
85cda4c
Merge branch 'dev' into dev-1187
psilabs-dev Apr 8, 2025
c33c48c
Merge branch 'dev' into dev-1187
psilabs-dev Apr 13, 2025
52ece17
Merge branch 'dev' into dev-1187
psilabs-dev Apr 19, 2025
e46f3f5
fix iphone not working with navigation
psilabs-dev Apr 19, 2025
3d04c5e
remove browser back hack
psilabs-dev May 7, 2025
416d257
maybe this will fix the delays
psilabs-dev May 8, 2025
99f44f5
add icons
psilabs-dev May 8, 2025
190bfb6
optimize return to index
psilabs-dev May 8, 2025
0ebd2cb
Merge branch 'dev' into dev-1187
psilabs-dev May 8, 2025
968d372
prevent absolute options from blocking paginator
psilabs-dev May 8, 2025
83fd82b
make all return to index behavior consistent
psilabs-dev May 8, 2025
b169ce3
Merge branch 'dev' into dev-1187
psilabs-dev Jun 17, 2025
82f4238
Merge branch 'dev' into dev-1187
psilabs-dev Aug 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions locales/template/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,15 @@ msgstr "Your keyboard arrows (and the spacebar)"
msgid "Touching the left/right side of the image."
msgstr "Touching the left/right side of the image."

msgid "When reading an archive from search results, you can also navigate between archives using:"
msgstr "When reading an archive from search results, you can also navigate between archives using:"

msgid "The square bracket keys"
msgstr "The square bracket keys"

msgid "Reading past the first/last page"
msgstr "Reading past the first/last page"

msgid "Other keyboard shortcuts:"
msgstr "Other keyboard shortcuts:"

Expand All @@ -962,6 +971,9 @@ msgstr "R: open a random archive."
msgid "F: toggle fullscreen mode"
msgstr "F: toggle fullscreen mode"

msgid "shift+L/R: go to first page/last page"
msgstr "shift+L/R: go to first page/last page"

msgid "B: toggle bookmark"
msgstr "B: toggle bookmark"

Expand Down
12 changes: 12 additions & 0 deletions locales/template/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,15 @@ msgstr "键盘方向键(和空格键)"
msgid "Touching the left/right side of the image."
msgstr "点击图像的左/右侧。"

msgid "When reading an archive from search results, you can also navigate between archives using:"
msgstr "从搜索结果阅读时,您也可以尝试以下方式读前后档案:"

msgid "The square bracket keys"
msgstr "方括号键"

msgid "Reading past the first/last page"
msgstr "跨书翻页"

msgid "Other keyboard shortcuts:"
msgstr "其他键盘快捷键:"

Expand All @@ -934,6 +943,9 @@ msgstr "R:打开一个随机档案。"
msgid "F: toggle fullscreen mode"
msgstr "F:切换全屏模式"

msgid "shift+L/R: go to first page/last page"
msgstr "shift+箭头键:跳到首尾页"

msgid "B: toggle bookmark"
msgstr "B:切换书签"

Expand Down
25 changes: 25 additions & 0 deletions public/css/lrr.css
Original file line number Diff line number Diff line change
Expand Up @@ -828,4 +828,29 @@ div.fullscreen img {

body.infinite-scroll .fullscreen-infinite img {
margin: 0 auto !important;
}

/* Prevent absolute options from blocking the paginator */
@media (max-width: 768px) {
.absolute-options {
position: fixed !important;
z-index: 100;
}

.absolute-left {
bottom: 15px !important;
left: 10px !important;
top: auto !important;
}

.absolute-right {
bottom: 15px !important;
right: 10px !important;
top: auto !important;
}

/* Ensure the paginator isn't blocked */
.sn {
margin-bottom: 60px !important;
}
}
10 changes: 10 additions & 0 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Index.initializeAll = function () {
$(document).on("click.close-overlay", "#overlay-shade", LRR.closeOverlay);
$(document).on("click.thumbnail-bookmark-icon", ".thumbnail-bookmark-icon", Index.toggleBookmarkStatusByIcon);
$(document).on("click.title-bookmark-icon", ".title-bookmark-icon", Index.toggleBookmarkStatusByIcon);
$(document).on("click", ".swiper-wrapper .swiper-slide a[href*='/reader?id=']", function() {
sessionStorage.setItem('navigationState', 'carousel');
});

// 0 = List view
// 1 = Thumbnail view
Expand Down Expand Up @@ -716,6 +719,13 @@ Index.handleContextMenu = function (option, id) {
});
break;
case "read":
// Use the source that was stored when the context menu was opened
if (window.contextMenuSource === 'carousel') {
sessionStorage.setItem('navigationState', 'carousel');
} else {
sessionStorage.setItem('navigationState', 'datatables');
}

LRR.openInNewTab(new LRR.apiURL(`/reader?id=${id}`));
break;
case "download":
Expand Down
30 changes: 30 additions & 0 deletions public/js/index_datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ IndexTable.initializeAll = function () {
IndexTable.currentSearch = $(e.target).attr("search");
IndexTable.doSearch();
});

// Add click handler for datatables items to mark them as datatables navigation
// Exclude any elements that are inside .swiper-wrapper (carousel)
$(document).on("click", "a[href*='/reader?id=']", function() {
if ($(this).closest(".swiper-wrapper").length > 0) {
return;
}
sessionStorage.setItem('navigationState', 'datatables');
});

// Add a listen event to window.popstate to update the search accordingly
// if the user goes back using browser history
Expand Down Expand Up @@ -61,6 +70,9 @@ IndexTable.initializeAll = function () {
}
columns.push({ data: "tags", className: "tags itd", name: "tags", orderable: false, render: IndexTable.renderTags });

// Store the page size in localStorage for use in the reader
localStorage.setItem('datatablesPageSize', Index.pageSize.toString());

// Datatables configuration
IndexTable.dataTable = $(".datatables").DataTable({
serverSide: true,
Expand Down Expand Up @@ -101,6 +113,10 @@ IndexTable.doSearch = function (page) {
// This allows for the regular search bar to be used in conjunction with categories.
IndexTable.dataTable.column(".tags.itd").search(Index.selectedCategory);

// Store search parameters in localStorage for archive navigation
localStorage.setItem('currentSearch', IndexTable.currentSearch);
localStorage.setItem('selectedCategory', Index.selectedCategory);

// Update search input field
$("#search-input").val(IndexTable.currentSearch);
IndexTable.dataTable.search(IndexTable.currentSearch);
Expand Down Expand Up @@ -260,6 +276,20 @@ IndexTable.drawCallback = function () {
$(".itg").show();
}

// Store archive IDs in localStorage in the order they appear in the table
const archiveIds = [];
const archives = IndexTable.dataTable.rows().data();
for (let i = 0; i < archives.length; i++) {
archiveIds.push(archives[i].arcid);
}
localStorage.setItem('currArchiveIds', JSON.stringify(archiveIds));
localStorage.setItem('currDatatablesPage', pageInfo.page + 1);

// Clear previous/next archive IDs when changing pages manually
// to avoid navigation issues when using the browser back button
localStorage.removeItem('previousArchiveIds');
localStorage.removeItem('nextArchiveIds');

// Update url to contain all search parameters, and push it to the history
if (IndexTable.isComingFromPopstate) {
// But don't fire this if we're coming from popstate
Expand Down
Loading