Added a previous_page_button preference option and made switching between the first page and previous page buttons possible

This commit is contained in:
RadoslavL
2023-09-30 18:36:43 +03:00
parent 9996d00cb1
commit 5cdbc184c7
9 changed files with 42 additions and 4 deletions

View File

@@ -21,7 +21,8 @@
page_nav_html = IV::Frontend::Pagination.nav_ctoken(locale,
base_url: relative_url,
ctoken: next_continuation,
first_page: continuation.nil?
first_page: continuation.nil?,
previous_page_button: env.get("preferences").as(Preferences).previous_page_button
)
%>
@@ -41,6 +42,10 @@
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/channel/<%= ucid %>" />
<%- end -%>
<%- if env.get("preferences").as(Preferences).previous_page_button -%>
<script src="/js/pagination.js?v=<%= ASSET_COMMIT %>"></script>
<%- end -%>
<link rel="alternate" href="<%= youtube_url %>">
<title><%= author %> - Invidious</title>
<% end %>

View File

@@ -8,4 +8,14 @@
<%= page_nav_html %>
<script id="pagination-data" type="application/json">
<%=
{
"next_page" => translate(locale, "Next page"),
"prev_page" => translate(locale, "Previous page"),
"is_rtl" => locale_is_rtl?(locale)
}.to_json
%>
</script>
<script src="/js/watched_indicator.js"></script>

View File

@@ -189,6 +189,12 @@
</select>
<% end %>
</div>
<div class="pure-control-group">
<label for="previous_page_button"><%= translate(locale, "preferences_previous_page_button_label") %></label>
<input name="previous_page_button" id="previous_page_button" type="checkbox" <% if preferences.previous_page_button %>checked<% end %>>
</div>
<% if env.get? "user" %>
<div class="pure-control-group">
<label for="show_nick"><%= translate(locale, "preferences_show_nick_label") %></label>