summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2022-06-09 00:30:34 +0200
committerSamantaz Fox <coding@samantaz.fr>2022-06-09 00:30:34 +0200
commit2313ca8f72cec823bfd7ec0d46107e6f8ba490a1 (patch)
tree5ff05751e359323bccc2576094f0caebd5d4f0a9 /src
parent7ad111e2f65c2688c7accb31ff75171c29f2cc26 (diff)
parenta402128a7d4a2d3dccbeeb553e5363447f501a37 (diff)
downloadinvidious-2313ca8f72cec823bfd7ec0d46107e6f8ba490a1.tar.gz
invidious-2313ca8f72cec823bfd7ec0d46107e6f8ba490a1.tar.bz2
invidious-2313ca8f72cec823bfd7ec0d46107e6f8ba490a1.zip
Merge pull request #3084 from AHOHNMYC/js-helpers-polyfills
JS refactoring part 2: helper functions, poyfills
Diffstat (limited to 'src')
-rw-r--r--src/invidious/comments.cr2
-rw-r--r--src/invidious/views/licenses.ecr14
-rw-r--r--src/invidious/views/template.ecr1
-rw-r--r--src/invidious/views/watch.ecr34
4 files changed, 33 insertions, 18 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index d8496978..15a15224 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -481,7 +481,7 @@ def template_reddit_comments(root, locale)
html << <<-END_HTML
<p>
- <a href="javascript:void(0)" data-onclick="toggle_parent">[ - ]</a>
+ <a href="javascript:void(0)" data-onclick="toggle_parent">[ − ]</a>
<b><a href="https://www.reddit.com/user/#{child.author}">#{child.author}</a></b>
#{translate_count(locale, "comments_points_count", child.score, NumberFormatting::Separator)}
<span title="#{child.created_utc.to_s(translate(locale, "%a %B %-d %T %Y UTC"))}">#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}</span>
diff --git a/src/invidious/views/licenses.ecr b/src/invidious/views/licenses.ecr
index 861913d0..25b24ed4 100644
--- a/src/invidious/views/licenses.ecr
+++ b/src/invidious/views/licenses.ecr
@@ -11,6 +11,20 @@
<table id="jslicense-labels1">
<tr>
<td>
+ <a href="/js/_helpers.js?v=<%= ASSET_COMMIT %>">_helpers.js</a>
+ </td>
+
+ <td>
+ <a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a>
+ </td>
+
+ <td>
+ <a href="/js/_helpers.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
<a href="/js/community.js?v=<%= ASSET_COMMIT %>">community.js</a>
</td>
diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr
index bd908dd6..4e2b29f0 100644
--- a/src/invidious/views/template.ecr
+++ b/src/invidious/views/template.ecr
@@ -17,6 +17,7 @@
<link rel="stylesheet" href="/css/grids-responsive-min.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/ionicons.min.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
+ <script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
</head>
<%
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index 783eff1d..d1fdcce2 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -278,24 +278,24 @@ we're going to need to do it here in order to allow for translations.
</div>
<% end %>
<p style="width:100%"><%= rv["title"] %></p>
- <h5 class="pure-g">
- <div class="pure-u-14-24">
- <% if rv["ucid"]? %>
- <b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></a></b>
- <% else %>
- <b style="width:100%"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></b>
- <% end %>
- </div>
-
- <div class="pure-u-10-24" style="text-align:right">
- <b class="width:100%"><%=
- views = rv["view_count"]?.try &.to_i?
- views ||= rv["view_count_short"]?.try { |x| short_text_to_number(x) }
- translate_count(locale, "generic_views_count", views || 0, NumberFormatting::Short)
- %></b>
- </div>
- </h5>
</a>
+ <h5 class="pure-g">
+ <div class="pure-u-14-24">
+ <% if rv["ucid"]? %>
+ <b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></a></b>
+ <% else %>
+ <b style="width:100%"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></b>
+ <% end %>
+ </div>
+
+ <div class="pure-u-10-24" style="text-align:right">
+ <b class="width:100%"><%=
+ views = rv["view_count"]?.try &.to_i?
+ views ||= rv["view_count_short"]?.try { |x| short_text_to_number(x) }
+ translate_count(locale, "generic_views_count", views || 0, NumberFormatting::Short)
+ %></b>
+ </div>
+ </h5>
<% end %>
<% end %>
</div>