From 00d16dff1f750839a45cc25203dc6546b3e273ee Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 21 Aug 2023 14:54:37 -0700 Subject: [PATCH] Add data-jump-time attribute to chapters component Allows automatically jumping to specified time instead of reloading the page. --- .../views/components/description_chapters_widget.ecr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/invidious/views/components/description_chapters_widget.ecr b/src/invidious/views/components/description_chapters_widget.ecr index ff2dbcc0..e02f29cf 100644 --- a/src/invidious/views/components/description_chapters_widget.ecr +++ b/src/invidious/views/components/description_chapters_widget.ecr @@ -6,20 +6,20 @@ <% chapters.each do | chapter | %> <%- start_in_seconds = chapter.start_ms.milliseconds.total_seconds.to_i %> -
+
<%- if !env.get("preferences").as(Preferences).thin_mode -%> - " alt="" /> + " alt="" data-onclick="jump_to_time" data-jump-time="<%=start_in_seconds%>"/> <%- else -%> -
+
<%- end -%>
<%- if start_in_seconds > 0 -%> -

<%-= recode_length_seconds(start_in_seconds) -%>

+

<%-= recode_length_seconds(start_in_seconds) -%>

<%- else -%> -

0:00

+

0:00

<%- end -%> -

<%-=chapter.title-%>

+

<%-=chapter.title-%>

<% end %>