Minor formatting changes
parent
22b9bbe702
commit
1a9360ca75
@ -1,52 +1,52 @@
|
|||||||
function toggle_parent(target) {
|
function toggle_parent(target) {
|
||||||
body = target.parentNode.parentNode.children[1];
|
body = target.parentNode.parentNode.children[1];
|
||||||
if (body.style.display === null || body.style.display === "") {
|
if (body.style.display === null || body.style.display === "") {
|
||||||
target.innerHTML = "[ + ]";
|
target.innerHTML = "[ + ]";
|
||||||
body.style.display = "none";
|
body.style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
target.innerHTML = "[ - ]";
|
target.innerHTML = "[ - ]";
|
||||||
body.style.display = "";
|
body.style.display = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle_comments(target) {
|
function toggle_comments(target) {
|
||||||
body = target.parentNode.parentNode.parentNode.children[1];
|
body = target.parentNode.parentNode.parentNode.children[1];
|
||||||
if (body.style.display === null || body.style.display === "") {
|
if (body.style.display === null || body.style.display === "") {
|
||||||
target.innerHTML = "[ + ]";
|
target.innerHTML = "[ + ]";
|
||||||
body.style.display = "none";
|
body.style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
target.innerHTML = "[ - ]";
|
target.innerHTML = "[ - ]";
|
||||||
body.style.display = "";
|
body.style.display = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function swap_comments(source) {
|
function swap_comments(source) {
|
||||||
if (source == "youtube") {
|
if (source == "youtube") {
|
||||||
get_youtube_comments();
|
get_youtube_comments();
|
||||||
} else if (source == "reddit") {
|
} else if (source == "reddit") {
|
||||||
get_reddit_comments();
|
get_reddit_comments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String.prototype.supplant = function(o) {
|
String.prototype.supplant = function (o) {
|
||||||
return this.replace(/{([^{}]*)}/g, function(a, b) {
|
return this.replace(/{([^{}]*)}/g, function (a, b) {
|
||||||
var r = o[b];
|
var r = o[b];
|
||||||
return typeof r === "string" || typeof r === "number" ? r : a;
|
return typeof r === "string" || typeof r === "number" ? r : a;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function show_youtube_replies(target, inner_text, sub_text) {
|
function show_youtube_replies(target, inner_text, sub_text) {
|
||||||
body = target.parentNode.parentNode.children[1];
|
body = target.parentNode.parentNode.children[1];
|
||||||
body.style.display = "";
|
body.style.display = "";
|
||||||
|
|
||||||
target.innerHTML = inner_text;
|
target.innerHTML = inner_text;
|
||||||
target.setAttribute("onclick", "hide_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')");
|
target.setAttribute("onclick", "hide_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')");
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide_youtube_replies(target, inner_text, sub_text) {
|
function hide_youtube_replies(target, inner_text, sub_text) {
|
||||||
body = target.parentNode.parentNode.children[1];
|
body = target.parentNode.parentNode.children[1];
|
||||||
body.style.display = "none";
|
body.style.display = "none";
|
||||||
|
|
||||||
target.innerHTML = sub_text;
|
target.innerHTML = sub_text;
|
||||||
target.setAttribute("onclick", "show_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')");
|
target.setAttribute("onclick", "show_youtube_replies(this, \'" + inner_text + "\', \'" + sub_text + "\')");
|
||||||
}
|
}
|
||||||
|
@ -1,133 +1,138 @@
|
|||||||
<div class="pure-u-1 pure-u-md-1-4">
|
<div class="pure-u-1 pure-u-md-1-4">
|
||||||
<div class="h-box">
|
<div class="h-box">
|
||||||
<% case item when %>
|
<% case item when %>
|
||||||
<% when SearchChannel %>
|
<% when SearchChannel %>
|
||||||
<a style="width:100%;" href="/channel/<%= item.ucid %>">
|
<a style="width:100%" href="/channel/<%= item.ucid %>">
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||||
<% else %>
|
<center>
|
||||||
<center>
|
<img style="width:56.25%" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
|
||||||
<img style="width:56.25%;" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
|
</center>
|
||||||
</center>
|
<% end %>
|
||||||
<% end %>
|
<p><%= item.author %></p>
|
||||||
<p><%= item.author %></p>
|
</a>
|
||||||
</a>
|
<p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
|
||||||
<p><%= translate(locale, "`x` subscribers", number_with_separator(item.subscriber_count)) %></p>
|
<p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p>
|
||||||
<p><%= translate(locale, "`x` videos", number_with_separator(item.video_count)) %></p>
|
<h5><%= item.description_html %></h5>
|
||||||
<h5><%= item.description_html %></h5>
|
<% when SearchPlaylist %>
|
||||||
<% when SearchPlaylist %>
|
<% if item.id.starts_with? "RD" %>
|
||||||
<% if item.id.starts_with? "RD" %>
|
<% url = "/mix?list=#{item.id}&continuation=#{item.thumbnail_id}" %>
|
||||||
<% url = "/mix?list=#{item.id}&continuation=#{item.thumbnail_id}" %>
|
|
||||||
<% else %>
|
|
||||||
<% url = "/playlist?list=#{item.id}" %>
|
|
||||||
<% end %>
|
|
||||||
<a style="width:100%;" href="<%= url %>">
|
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="thumbnail">
|
<% url = "/playlist?list=#{item.id}" %>
|
||||||
<img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
|
|
||||||
<p class="length"><%= number_with_separator(item.video_count) %> videos</p>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<p><%= item.title %></p>
|
|
||||||
</a>
|
<a style="width:100%" href="<%= url %>">
|
||||||
<p>
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
<div class="thumbnail">
|
||||||
</p>
|
<img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
|
||||||
<% when MixVideo %>
|
<p class="length"><%= number_with_separator(item.video_count) %> videos</p>
|
||||||
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
|
</div>
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
|
||||||
<% else %>
|
|
||||||
<div class="thumbnail">
|
|
||||||
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
|
||||||
<% if item.length_seconds != 0 %>
|
|
||||||
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
<p><%= item.title %></p>
|
||||||
<% end %>
|
</a>
|
||||||
<p><%= item.title %></p>
|
<p>
|
||||||
</a>
|
<b>
|
||||||
<p>
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
</b>
|
||||||
</p>
|
</p>
|
||||||
<% when PlaylistVideo %>
|
<% when MixVideo %>
|
||||||
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
|
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||||
<% else %>
|
<div class="thumbnail">
|
||||||
<div class="thumbnail">
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
||||||
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
<% if item.length_seconds != 0 %>
|
||||||
<% if item.responds_to?(:live_now) && item.live_now %>
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
||||||
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
<% end %>
|
||||||
<% elsif item.length_seconds != 0 %>
|
</div>
|
||||||
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
<p><%= item.title %></p>
|
||||||
<% end %>
|
</a>
|
||||||
<p><%= item.title %></p>
|
<p>
|
||||||
</a>
|
<b>
|
||||||
<p>
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
</b>
|
||||||
</p>
|
</p>
|
||||||
|
<% when PlaylistVideo %>
|
||||||
|
<a style="width:100%" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
|
||||||
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||||
|
<div class="thumbnail">
|
||||||
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
||||||
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
||||||
|
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
||||||
|
<% elsif item.length_seconds != 0 %>
|
||||||
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<p><%= item.title %></p>
|
||||||
|
</a>
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
<h5 class="pure-g">
|
<h5 class="pure-g">
|
||||||
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
||||||
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
||||||
<% elsif Time.now - item.published > 1.minute %>
|
<% elsif Time.now - item.published > 1.minute %>
|
||||||
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="pure-u-2-3"></div>
|
<div class="pure-u-2-3"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="pure-u-1-3" style="text-align: right">
|
<div class="pure-u-1-3" style="text-align:right">
|
||||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||||
</div>
|
</div>
|
||||||
</h5>
|
</h5>
|
||||||
<% else %>
|
|
||||||
<% if env.get("preferences").as(Preferences).thin_mode %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<a style="width:100%;" href="/watch?v=<%= item.id %>">
|
<% if !env.get("preferences").as(Preferences).thin_mode %>
|
||||||
<div class="thumbnail">
|
<a style="width:100%" href="/watch?v=<%= item.id %>">
|
||||||
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
<div class="thumbnail">
|
||||||
<% if env.get? "show_watched" %>
|
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
|
||||||
<form onsubmit="return false;" action="/watch_ajax?action_mark_watched=1&id=<%= item.id %>&referer=<%= env.get("current_page") %>" method="post">
|
<% if env.get? "show_watched" %>
|
||||||
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
<form onsubmit="return false" action="/watch_ajax?action_mark_watched=1&id=<%= item.id %>&referer=<%= env.get("current_page") %>" method="post">
|
||||||
<p class="watched">
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
||||||
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="#">
|
<p class="watched">
|
||||||
<button type="submit" style="all:unset">
|
<a onclick="mark_watched(this)" data-id="<%= item.id %>" href="#">
|
||||||
<i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
|
<button type="submit" style="all:unset">
|
||||||
onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
|
<i onmouseenter='this.setAttribute("class", "icon ion-ios-eye-off")'
|
||||||
class="icon ion-ios-eye">
|
onmouseleave='this.setAttribute("class", "icon ion-ios-eye")'
|
||||||
</i>
|
class="icon ion-ios-eye">
|
||||||
</button>
|
</i>
|
||||||
</a>
|
</button>
|
||||||
</p>
|
</a>
|
||||||
</form>
|
</p>
|
||||||
<% end %>
|
</form>
|
||||||
<% if item.responds_to?(:live_now) && item.live_now %>
|
<% end %>
|
||||||
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
|
||||||
<% elsif item.length_seconds != 0 %>
|
|
||||||
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<% end %>
|
|
||||||
<p><a href="/watch?v=<%= item.id %>"><%= item.title %></a></p>
|
|
||||||
<p>
|
|
||||||
<b><a style="width:100%;" href="/channel/<%= item.ucid %>"><%= item.author %></a></b>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h5 class="pure-g">
|
<% if item.responds_to?(:live_now) && item.live_now %>
|
||||||
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
<p class="length"><i class="icon ion-ios-play-circle"></i> <%= translate(locale, "LIVE") %></p>
|
||||||
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
<% elsif item.length_seconds != 0 %>
|
||||||
<% elsif Time.now - item.published > 1.minute %>
|
<p class="length"><%= recode_length_seconds(item.length_seconds) %></p>
|
||||||
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
<% end %>
|
||||||
<% else %>
|
</div>
|
||||||
<div class="pure-u-2-3"></div>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<p><a href="/watch?v=<%= item.id %>"><%= item.title %></a></p>
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
<a style="width:100%" href="/channel/<%= item.ucid %>"><%= item.author %></a>
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="pure-u-1-3" style="text-align: right">
|
<h5 class="pure-g">
|
||||||
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %>
|
||||||
</div>
|
<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5>
|
||||||
</h5>
|
<% elsif Time.now - item.published > 1.minute %>
|
||||||
<% end %>
|
<div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="pure-u-2-3"></div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="pure-u-1-3" style="text-align:right">
|
||||||
|
<%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
<% content_for "header" do %>
|
<% content_for "header" do %>
|
||||||
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
|
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
|
||||||
<title><% if config.default_home != "Popular" %><%= translate(locale, "Popular") %> - <% end %>Invidious</title>
|
<title>
|
||||||
|
<% if config.default_home != "Popular" %>
|
||||||
|
<%= translate(locale, "Popular") %> - Invidious
|
||||||
|
<% else %>
|
||||||
|
Invidious
|
||||||
|
<% end %>
|
||||||
|
</title>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= rendered "components/feed_menu" %>
|
<%= rendered "components/feed_menu" %>
|
||||||
|
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<% popular_videos.each_slice(4) do |slice| %>
|
<% popular_videos.each_slice(4) do |slice| %>
|
||||||
<% slice.each do |item| %>
|
<% slice.each do |item| %>
|
||||||
<%= rendered "components/item" %>
|
<%= rendered "components/item" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
<% content_for "header" do %>
|
<% content_for "header" do %>
|
||||||
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
|
<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>">
|
||||||
<title><% if config.default_home != "Top" %><%= translate(locale, "Top") %> - <% end %>Invidious</title>
|
<title>
|
||||||
|
<% if config.default_home != "Top" %>
|
||||||
|
<%= translate(locale, "Top") %> - Invidious
|
||||||
|
<% else %>
|
||||||
|
Invidious
|
||||||
|
<% end %>
|
||||||
|
</title>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= rendered "components/feed_menu" %>
|
<%= rendered "components/feed_menu" %>
|
||||||
|
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<% top_videos.each_slice(4) do |slice| %>
|
<% top_videos.each_slice(4) do |slice| %>
|
||||||
<% slice.each do |item| %>
|
<% slice.each do |item| %>
|
||||||
<%= rendered "components/item" %>
|
<%= rendered "components/item" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue