Fix thin mode

This commit is contained in:
Omar Roth
2019-03-27 11:31:05 -05:00
parent 63be05146d
commit 7a0f0ca5ce
5 changed files with 32 additions and 24 deletions

View File

@@ -3,7 +3,7 @@
<% case item when %>
<% when SearchChannel %>
<a style="width:100%;" href="/channel/<%= item.ucid %>">
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<center>
<img style="width:56.25%;" src="/ggpht<%= URI.parse(item.author_thumbnail).full_path %>"/>
@@ -21,7 +21,7 @@
<% url = "/playlist?list=#{item.id}" %>
<% end %>
<a style="width:100%;" href="<%= url %>">
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.thumbnail_id %>/mqdefault.jpg"/>
@@ -35,7 +35,7 @@
</p>
<% when MixVideo %>
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.mixes[0] %>">
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
@@ -51,7 +51,7 @@
</p>
<% when PlaylistVideo %>
<a style="width:100%;" href="/watch?v=<%= item.id %>&list=<%= item.playlists[0] %>">
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item.id %>/mqdefault.jpg"/>
@@ -74,7 +74,7 @@
<h5><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></h5>
<% end %>
<% else %>
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<a style="width:100%;" href="/watch?v=<%= item.id %>">
<div class="thumbnail">

View File

@@ -19,7 +19,7 @@
<div class="pure-u-1 pure-u-md-1-4">
<div class="h-box">
<a style="width:100%;" href="/watch?v=<%= item %>">
<% if env.get?("user") && env.get("user").as(User).preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= item %>/mqdefault.jpg"/>

View File

@@ -167,7 +167,7 @@
<% rvs.each do |rv| %>
<% if rv["id"]? %>
<a href="/watch?v=<%= rv["id"] %>">
<% if preferences && preferences.thin_mode %>
<% if env.get("preferences").as(Preferences).thin_mode %>
<% else %>
<div class="thumbnail">
<img class="thumbnail" src="/vi/<%= rv["id"] %>/mqdefault.jpg">
@@ -387,7 +387,7 @@ function get_youtube_comments(timeouts = 0) {
comments.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
var url = "/api/v1/comments/<%= video.id %>?format=html&hl=<%= env.get("preferences").as(Preferences).locale %>";
var url = "/api/v1/comments/<%= video.id %>?format=html&hl=<%= env.get("preferences").as(Preferences).locale %>&thin_mode=<%= env.get("preferences").as(Preferences).thin_mode %>";
var xhr = new XMLHttpRequest();
xhr.responseType = "json";
xhr.timeout = 20000;
@@ -445,7 +445,7 @@ function get_youtube_replies(target, load_more) {
body.innerHTML =
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
var url = '/api/v1/comments/<%= video.id %>?format=html&hl=<%= env.get("preferences").as(Preferences).locale %>&continuation=' +
var url = '/api/v1/comments/<%= video.id %>?format=html&hl=<%= env.get("preferences").as(Preferences).locale %>&thin_mode=<%= env.get("preferences").as(Preferences).thin_mode %>&continuation=' +
continuation;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';