Format files and trim trailing whitespace

This commit is contained in:
Omar Roth 2019-03-23 14:05:13 -05:00
parent ce4b07d7d7
commit 0c6cede287
16 changed files with 101 additions and 101 deletions

View file

@ -965,8 +965,8 @@ post "/login" do |env|
end end
if cookie.extension if cookie.extension
cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host) cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host)
cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "") cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "")
end end
env.response.cookies << cookie env.response.cookies << cookie
end end
@ -2569,8 +2569,8 @@ get "/api/v1/stats" do |env|
next statistics.to_json next statistics.to_json
end end
statistics.to_json statistics.to_json
end end
get "/api/v1/captions/:id" do |env| get "/api/v1/captions/:id" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -2613,8 +2613,8 @@ get "/api/v1/captions/:id" do |env|
end end
end end
next response next response
end end
env.response.content_type = "text/vtt" env.response.content_type = "text/vtt"
@ -2723,7 +2723,7 @@ get "/api/v1/comments/:id" do |env|
reddit_thread = JSON.parse(reddit_thread.to_json).as_h reddit_thread = JSON.parse(reddit_thread.to_json).as_h
reddit_thread["comments"] = JSON.parse(comments.to_json) reddit_thread["comments"] = JSON.parse(comments.to_json)
next reddit_thread.to_json next reddit_thread.to_json
else else
response = { response = {
"title" => reddit_thread.title, "title" => reddit_thread.title,
@ -2731,10 +2731,10 @@ get "/api/v1/comments/:id" do |env|
"contentHtml" => content_html, "contentHtml" => content_html,
} }
next response.to_json next response.to_json
end
end end
end end
end
get "/api/v1/insights/:id" do |env| get "/api/v1/insights/:id" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -2821,8 +2821,8 @@ get "/api/v1/insights/:id" do |env|
"graphData" => graph_data, "graphData" => graph_data,
} }
next response.to_json next response.to_json
end end
get "/api/v1/videos/:id" do |env| get "/api/v1/videos/:id" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3027,8 +3027,8 @@ get "/api/v1/videos/:id" do |env|
end end
end end
video_info video_info
end end
get "/api/v1/trending" do |env| get "/api/v1/trending" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3075,8 +3075,8 @@ get "/api/v1/trending" do |env|
end end
end end
videos videos
end end
get "/api/v1/popular" do |env| get "/api/v1/popular" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3105,8 +3105,8 @@ get "/api/v1/popular" do |env|
end end
end end
videos videos
end end
get "/api/v1/top" do |env| get "/api/v1/top" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3148,8 +3148,8 @@ get "/api/v1/top" do |env|
end end
end end
videos videos
end end
get "/api/v1/channels/:ucid" do |env| get "/api/v1/channels/:ucid" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3353,8 +3353,8 @@ get "/api/v1/channels/:ucid" do |env|
end end
end end
channel_info channel_info
end end
["/api/v1/channels/:ucid/videos", "/api/v1/channels/videos/:ucid"].each do |route| ["/api/v1/channels/:ucid/videos", "/api/v1/channels/videos/:ucid"].each do |route|
get route do |env| get route do |env|
@ -3421,9 +3421,9 @@ get "/api/v1/channels/:ucid" do |env|
end end
end end
result result
end
end end
end
["/api/v1/channels/:ucid/latest", "/api/v1/channels/latest/:ucid"].each do |route| ["/api/v1/channels/:ucid/latest", "/api/v1/channels/latest/:ucid"].each do |route|
get route do |env| get route do |env|
@ -3470,9 +3470,9 @@ get "/api/v1/channels/:ucid" do |env|
end end
end end
response response
end
end end
end
["/api/v1/channels/:ucid/playlists", "/api/v1/channels/playlists/:ucid"].each do |route| ["/api/v1/channels/:ucid/playlists", "/api/v1/channels/playlists/:ucid"].each do |route|
get route do |env| get route do |env|
@ -3536,9 +3536,9 @@ get "/api/v1/channels/:ucid" do |env|
end end
end end
response response
end
end end
end
get "/api/v1/channels/search/:ucid" do |env| get "/api/v1/channels/search/:ucid" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3637,8 +3637,8 @@ get "/api/v1/channels/search/:ucid" do |env|
end end
end end
response response
end end
get "/api/v1/search" do |env| get "/api/v1/search" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3762,8 +3762,8 @@ get "/api/v1/search" do |env|
end end
end end
response response
end end
get "/api/v1/playlists/:plid" do |env| get "/api/v1/playlists/:plid" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -3862,8 +3862,8 @@ get "/api/v1/playlists/:plid" do |env|
}.to_json }.to_json
end end
response response
end end
get "/api/v1/mixes/:rdid" do |env| get "/api/v1/mixes/:rdid" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]? locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@ -4444,7 +4444,7 @@ error 500 do |env|
<a href="https://github.com/omarroth/invidious/issues"> <a href="https://github.com/omarroth/invidious/issues">
here here
</a> </a>
or send an email to or send an email to
<a href="mailto:omarroth@protonmail.com"> <a href="mailto:omarroth@protonmail.com">
omarroth@protonmail.com</a>. omarroth@protonmail.com</a>.
END_HTML END_HTML

View file

@ -308,13 +308,13 @@ def template_youtube_comments(comments, locale)
<p> <p>
<b> <b>
<a class="#{child["authorIsChannelOwner"] == true ? "channel-owner" : ""}" href="#{child["authorUrl"]}">#{child["author"]}</a> <a class="#{child["authorIsChannelOwner"] == true ? "channel-owner" : ""}" href="#{child["authorUrl"]}">#{child["author"]}</a>
</b> </b>
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p> <p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
<span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span> <span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
| |
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "Youtube permalink of the comment")}">[YT]</a> <a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "Youtube permalink of the comment")}">[YT]</a>
| |
<i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])} <i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])}
END_HTML END_HTML
if child["creatorHeart"]? if child["creatorHeart"]?
@ -372,8 +372,8 @@ def template_reddit_comments(root, locale)
content = <<-END_HTML content = <<-END_HTML
<p> <p>
<a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a> <a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a>
<b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b> <b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b>
#{translate(locale, "`x` points", number_with_separator(score))} #{translate(locale, "`x` points", number_with_separator(score))}
#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))} #{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}
</p> </p>

View file

@ -62,7 +62,7 @@ class FilteredCompressHandler < Kemal::Handler
call_next env call_next env
{% else %} {% else %}
request_headers = env.request.headers request_headers = env.request.headers
if request_headers.includes_word?("Accept-Encoding", "gzip") if request_headers.includes_word?("Accept-Encoding", "gzip")
env.response.headers["Content-Encoding"] = "gzip" env.response.headers["Content-Encoding"] = "gzip"
env.response.output = Gzip::Writer.new(env.response.output, sync_close: true) env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)
@ -70,7 +70,7 @@ class FilteredCompressHandler < Kemal::Handler
env.response.headers["Content-Encoding"] = "deflate" env.response.headers["Content-Encoding"] = "deflate"
env.response.output = Flate::Writer.new(env.response.output, sync_close: true) env.response.output = Flate::Writer.new(env.response.output, sync_close: true)
end end
call_next env call_next env
{% end %} {% end %}
end end

View file

@ -300,7 +300,7 @@ def generate_captcha(key, db)
clock_svg = <<-END_SVG clock_svg = <<-END_SVG
<svg viewBox="0 0 100 100" width="200px"> <svg viewBox="0 0 100 100" width="200px">
<circle cx="50" cy="50" r="45" fill="#eee" stroke="black" stroke-width="2"></circle> <circle cx="50" cy="50" r="45" fill="#eee" stroke="black" stroke-width="2"></circle>
<text x="69" y="20.091" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 1</text> <text x="69" y="20.091" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 1</text>
<text x="82.909" y="34" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 2</text> <text x="82.909" y="34" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 2</text>
<text x="88" y="53" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 3</text> <text x="88" y="53" text-anchor="middle" fill="black" font-family="Arial" font-size="10px"> 3</text>

View file

@ -64,7 +64,7 @@
<%= rendered "components/item" %> <%= rendered "components/item" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="pure-g h-box"> <div class="pure-g h-box">
<div class="pure-u-1 pure-u-md-1-5"> <div class="pure-u-1 pure-u-md-1-5">

View file

@ -1,4 +1,4 @@
<video style="outline:none;width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" <video style="outline:none;width:100%" playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>"
id="player" class="video-js" id="player" class="video-js"
onmouseenter='this["data-title"]=this["title"];this["title"]=""' onmouseenter='this["data-title"]=this["title"];this["title"]=""'
onmouseleave='this["title"]=this["data-title"];this["data-title"]=""' onmouseleave='this["title"]=this["data-title"];this["data-title"]=""'
@ -152,7 +152,7 @@ player.on('error', function(event) {
} }
player.currentTime(currentTime); player.currentTime(currentTime);
player.playbackRate(playbackRate); player.playbackRate(playbackRate);
if (!paused) { if (!paused) {
player.play(); player.play();
} }
@ -192,7 +192,7 @@ var bpb = player.getChild('bigPlayButton');
if (bpb) { if (bpb) {
bpb.hide(); bpb.hide();
player.ready(function() { player.ready(function() {
new Promise(function(resolve, reject) { new Promise(function(resolve, reject) {
setTimeout(() => resolve(1), 1); setTimeout(() => resolve(1), 1);

View file

@ -1,14 +1,14 @@
<% if user %> <% if user %>
<% if subscriptions.includes? ucid %> <% if subscriptions.includes? ucid %>
<p> <p>
<a id="subscribe" onclick="unsubscribe()" class="pure-button pure-button-primary" <a id="subscribe" onclick="unsubscribe()" class="pure-button pure-button-primary"
href="/subscription_ajax?action_remove_subscriptions=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>"> href="/subscription_ajax?action_remove_subscriptions=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>">
<b><%= translate(locale, "Unsubscribe") %> | <%= sub_count_text %></b> <b><%= translate(locale, "Unsubscribe") %> | <%= sub_count_text %></b>
</a> </a>
</p> </p>
<% else %> <% else %>
<p> <p>
<a id="subscribe" onclick="subscribe()" class="pure-button pure-button-primary" <a id="subscribe" onclick="subscribe()" class="pure-button pure-button-primary"
href="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>"> href="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>">
<b><%= translate(locale, "Subscribe") %> | <%= sub_count_text %></b> <b><%= translate(locale, "Subscribe") %> | <%= sub_count_text %></b>
</a> </a>
@ -16,7 +16,7 @@
<% end %> <% end %>
<% else %> <% else %>
<p> <p>
<a id="subscribe" class="pure-button pure-button-primary" <a id="subscribe" class="pure-button pure-button-primary"
href="/login?referer=<%= env.get("current_page") %>"> href="/login?referer=<%= env.get("current_page") %>">
<b><%= translate(locale, "Login to subscribe to `x`", author) %></b> <b><%= translate(locale, "Login to subscribe to `x`", author) %></b>
</a> </a>

View file

@ -4,13 +4,13 @@ if (subscribe_button.getAttribute('onclick')) {
} }
function subscribe(timeouts = 0) { function subscribe(timeouts = 0) {
subscribe_button = document.getElementById("subscribe"); subscribe_button = document.getElementById("subscribe");
if (timeouts > 10) { if (timeouts > 10) {
console.log("Failed to subscribe."); console.log("Failed to subscribe.");
return; return;
} }
var url = "/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>"; var url = "/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>";
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.responseType = "json"; xhr.responseType = "json";
@ -21,7 +21,7 @@ function subscribe(timeouts = 0) {
var fallback = subscribe_button.innerHTML; var fallback = subscribe_button.innerHTML;
subscribe_button.onclick = unsubscribe; subscribe_button.onclick = unsubscribe;
subscribe_button.innerHTML = '<b><%= translate(locale, "Unsubscribe").gsub("'", "\\'") %> | <%= sub_count_text %></b>' subscribe_button.innerHTML = '<b><%= translate(locale, "Unsubscribe").gsub("'", "\\'") %> | <%= sub_count_text %></b>'
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (xhr.readyState == 4) { if (xhr.readyState == 4) {
if (xhr.status != 200) { if (xhr.status != 200) {
@ -30,7 +30,7 @@ function subscribe(timeouts = 0) {
} }
} }
} }
xhr.ontimeout = function() { xhr.ontimeout = function() {
console.log("Subscribing timed out."); console.log("Subscribing timed out.");
@ -39,8 +39,8 @@ function subscribe(timeouts = 0) {
} }
function unsubscribe(timeouts = 0) { function unsubscribe(timeouts = 0) {
subscribe_button = document.getElementById("subscribe"); subscribe_button = document.getElementById("subscribe");
if (timeouts > 10) { if (timeouts > 10) {
console.log("Failed to subscribe"); console.log("Failed to subscribe");
return; return;

View file

@ -20,7 +20,7 @@
</label> </label>
<input type="file" id="import_youtube" name="import_youtube"> <input type="file" id="import_youtube" name="import_youtube">
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
<label for="import_freetube"><%= translate(locale, "Import FreeTube subscriptions (.db)") %></label> <label for="import_freetube"><%= translate(locale, "Import FreeTube subscriptions (.db)") %></label>
<input type="file" id="import_freetube" name="import_freetube"> <input type="file" id="import_freetube" name="import_freetube">
@ -35,7 +35,7 @@
<label for="import_newpipe"><%= translate(locale, "Import NewPipe data (.zip)") %></label> <label for="import_newpipe"><%= translate(locale, "Import NewPipe data (.zip)") %></label>
<input type="file" id="import_newpipe" name="import_newpipe"> <input type="file" id="import_newpipe" name="import_newpipe">
</div> </div>
<div class="pure-controls"> <div class="pure-controls">
<button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Import") %></button> <button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Import") %></button>
</div> </div>

View file

@ -10,13 +10,13 @@
<title><%= HTML.escape(video.title) %> - Invidious</title> <title><%= HTML.escape(video.title) %> - Invidious</title>
<style> <style>
#player { #player {
position: fixed; position: fixed;
right: 0; right: 0;
bottom: 0; bottom: 0;
min-width: 100%; min-width: 100%;
min-height: 100%; min-height: 100%;
width: auto; width: auto;
height: auto; height: auto;
z-index: -100; z-index: -100;
} }
</style> </style>

View file

@ -19,4 +19,4 @@
<%= rendered "components/item" %> <%= rendered "components/item" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>

View file

@ -31,7 +31,7 @@
<%= rendered "components/item" %> <%= rendered "components/item" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="pure-g h-box"> <div class="pure-g h-box">
<div class="pure-u-1 pure-u-md-1-5"> <div class="pure-u-1 pure-u-md-1-5">

View file

@ -5,15 +5,15 @@
<div class="h-box"> <div class="h-box">
<%= Markdown.to_html(<<-END_PRIVACY_POLICY <%= Markdown.to_html(<<-END_PRIVACY_POLICY
## Privacy ## Privacy
This document concerns what data you provide to this website, the purpose of the data, how the data is stored, and how the data can be removed. This document concerns what data you provide to this website, the purpose of the data, how the data is stored, and how the data can be removed.
### Data you directly provide ### Data you directly provide
Data that you provide to the website for the purpose of the site's operation (for example: an account name, account password, or channel subscription) will be stored in the website's database until the user decides to remove it. This data will not be intentionally shared with anyone or anything. Data that you provide to the website for the purpose of the site's operation (for example: an account name, account password, or channel subscription) will be stored in the website's database until the user decides to remove it. This data will not be intentionally shared with anyone or anything.
Information stored about a registered user is limited to: Information stored about a registered user is limited to:
- a list of session tokens for remaining logged in across devices - a list of session tokens for remaining logged in across devices
- the last time an account was updated (to provide accurate notifications) - the last time an account was updated (to provide accurate notifications)
- a list of video IDs identifying notifications from a user's subscriptions - a list of video IDs identifying notifications from a user's subscriptions
@ -23,51 +23,51 @@
- a hashed password if applicable (not present on google accounts) - a hashed password if applicable (not present on google accounts)
- a randomly generated token for providing an RSS feed of a user's subscriptions - a randomly generated token for providing an RSS feed of a user's subscriptions
- a list of video IDs identifying watched videos - a list of video IDs identifying watched videos
The above list reflects [this code](https://github.com/omarroth/invidious/blob/master/src/invidious/users.cr#L14-L51). The above list reflects [this code](https://github.com/omarroth/invidious/blob/master/src/invidious/users.cr#L14-L51).
Users can clear their watch history using the [clear watch history](/clear_watch_history) page. Users can clear their watch history using the [clear watch history](/clear_watch_history) page.
If a user is logged in with a Google account, no password will ever be stored. This website uses the session token provided by Google to identify a user, but does not store the information required to make requests on a user's behalf without their knowledge or consent. If a user is logged in with a Google account, no password will ever be stored. This website uses the session token provided by Google to identify a user, but does not store the information required to make requests on a user's behalf without their knowledge or consent.
### Data you passively provide ### Data you passively provide
When you request any resource from this website (for example: a page, a font, an image, or an API endpoint) information about the request may be logged. When you request any resource from this website (for example: a page, a font, an image, or an API endpoint) information about the request may be logged.
Information about a request is limited to: Information about a request is limited to:
- the time the request was made - the time the request was made
- the status code of the response - the status code of the response
- the method of the request - the method of the request
- the requested URL - the requested URL
- how long it took to complete the request. - how long it took to complete the request.
No identifying information is logged, such as the visitor's cookie, user-agent, or IP address. Here are a couple lines to serve as an example: No identifying information is logged, such as the visitor's cookie, user-agent, or IP address. Here are a couple lines to serve as an example:
``` ```
2019-01-19 16:37:47 +00:00 200 GET /api/v1/comments/xrlETJYzH-c?format=html&hl=en-US 1345.88ms 2019-01-19 16:37:47 +00:00 200 GET /api/v1/comments/xrlETJYzH-c?format=html&hl=en-US 1345.88ms
2019-01-19 16:37:53 +00:00 200 GET /vi/r5P-f5arPXE/maxres.jpg 1085.41ms 2019-01-19 16:37:53 +00:00 200 GET /vi/r5P-f5arPXE/maxres.jpg 1085.41ms
2019-01-19 16:37:54 +00:00 200 GET /watch 7.04ms 2019-01-19 16:37:54 +00:00 200 GET /watch 7.04ms
``` ```
This website does not store the visitor's user-agent or IP address and does not use fingerprinting, advertisements, or tracking of any form. This website does not store the visitor's user-agent or IP address and does not use fingerprinting, advertisements, or tracking of any form.
This website provides links to googlevideo.com to provide audio and video playback. googlevideo.com is owned by Google and is subject to their [privacy policy](https://policies.google.com/privacy). This website provides links to googlevideo.com to provide audio and video playback. googlevideo.com is owned by Google and is subject to their [privacy policy](https://policies.google.com/privacy).
### Data stored in your browser ### Data stored in your browser
This website uses browser cookies to authenticate registered users. This data consists of: This website uses browser cookies to authenticate registered users. This data consists of:
- An account token to keep you logged into the website between visits, which is sent when any page is loaded while you are logged in - An account token to keep you logged into the website between visits, which is sent when any page is loaded while you are logged in
This website also provides an option to store site preferences, such as the theme or locale, without an account. Using this feature will store a cookie in the visitor's browser containing their preferences. This cookie is sent on every request and does not contain any identifying information. This website also provides an option to store site preferences, such as the theme or locale, without an account. Using this feature will store a cookie in the visitor's browser containing their preferences. This cookie is sent on every request and does not contain any identifying information.
You can remove this data from your browser by logging out of this website, or by using your browser's cookie-related controls to delete the data. You can remove this data from your browser by logging out of this website, or by using your browser's cookie-related controls to delete the data.
### Removal of data ### Removal of data
To remove data stored in your browser, you can log out of the website, or you can use your browser's cookie-related controls to delete the data. To remove data stored in your browser, you can log out of the website, or you can use your browser's cookie-related controls to delete the data.
To remove data that has been stored in the website's database, you can use the [delete my account](/delete_account) page. To remove data that has been stored in the website's database, you can use the [delete my account](/delete_account) page.
END_PRIVACY_POLICY END_PRIVACY_POLICY
) )

View file

@ -8,7 +8,7 @@
<%= rendered "components/item" %> <%= rendered "components/item" %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="pure-g h-box"> <div class="pure-g h-box">
<div class="pure-u-1 pure-u-md-1-5"> <div class="pure-u-1 pure-u-md-1-5">

View file

@ -116,7 +116,7 @@
<div class="pure-u-1 pure-u-md-1-3"> <div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-usd"></i> <i class="icon ion-logo-usd"></i>
<a href="https://liberapay.com/omarroth">Liberapay</a> <a href="https://liberapay.com/omarroth">Liberapay</a>
/ /
<a href="https://patreon.com/omarroth">Patreon</a> <a href="https://patreon.com/omarroth">Patreon</a>
</div> </div>
<div class="pure-u-1 pure-u-md-1-3"> <div class="pure-u-1 pure-u-md-1-3">
@ -124,12 +124,12 @@
<a rel="jslicense" href="/licenses"> <a rel="jslicense" href="/licenses">
<%= translate(locale, "View JavaScript license information.") %> <%= translate(locale, "View JavaScript license information.") %>
</a> </a>
/ /
<i class="icon ion-ios-paper"></i> <i class="icon ion-ios-paper"></i>
<a href="/privacy"> <a href="/privacy">
<%= translate(locale, "View privacy policy.") %> <%= translate(locale, "View privacy policy.") %>
</a> </a>
</div> </div>
<div class="pure-u-1 pure-u-md-1-3"> <div class="pure-u-1 pure-u-md-1-3">
<i class="icon ion-logo-github"></i> <i class="icon ion-logo-github"></i>
<%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> <%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %>

View file

@ -18,7 +18,7 @@
<meta name="twitter:url" content="<%= host_url %>/watch?v=<%= video.id %>"> <meta name="twitter:url" content="<%= host_url %>/watch?v=<%= video.id %>">
<meta name="twitter:title" content="<%= HTML.escape(video.title) %>"> <meta name="twitter:title" content="<%= HTML.escape(video.title) %>">
<meta name="twitter:description" content="<%= description %>"> <meta name="twitter:description" content="<%= description %>">
<meta name="twitter:image" content="/vi/<%= video.id %>/hqdefault.jpg"> <meta name="twitter:image" content="<%= host_url %>/vi/<%= video.id %>/maxres.jpg">
<meta name="twitter:player" content="<%= host_url %>/embed/<%= video.id %>"> <meta name="twitter:player" content="<%= host_url %>/embed/<%= video.id %>">
<meta name="twitter:player:width" content="1280"> <meta name="twitter:player:width" content="1280">
<meta name="twitter:player:height" content="720"> <meta name="twitter:player:height" content="720">
@ -33,7 +33,7 @@
<div class="h-box"> <div class="h-box">
<h1> <h1>
<%= HTML.escape(video.title) %> <%= HTML.escape(video.title) %>
<% if params[:listen] %> <% if params[:listen] %>
<a title="<%=translate(locale, "Video mode")%>" href="/watch?<%= env.params.query %>&listen=0"> <a title="<%=translate(locale, "Video mode")%>" href="/watch?<%= env.params.query %>&listen=0">
<i class="icon ion-ios-videocam"></i> <i class="icon ion-ios-videocam"></i>
@ -53,7 +53,7 @@
<div class="pure-u-1 pure-u-md-1-5"> <div class="pure-u-1 pure-u-md-1-5">
<div class="h-box"> <div class="h-box">
<p><a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch video on Youtube") %></a></p> <p><a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch video on Youtube") %></a></p>
<form class="pure-form pure-form-stacked" action="/latest_version" method="get" rel="noopener" target="_blank"> <form class="pure-form pure-form-stacked" action="/latest_version" method="get" rel="noopener" target="_blank">
<div class="pure-control-group"> <div class="pure-control-group">
<label for="download_widget"><%= translate(locale, "Download as: ") %></label> <label for="download_widget"><%= translate(locale, "Download as: ") %></label>
@ -150,7 +150,7 @@
<% if params[:related_videos] %> <% if params[:related_videos] %>
<div class="h-box"> <div class="h-box">
<% if !rvs.empty? %> <% if !rvs.empty? %>
<div id="continue" <% if plid %>style="display:none"<% end %>> <div id="continue" <% if plid %>style="display:none"<% end %>>
<div class="pure-control-group"> <div class="pure-control-group">
@ -187,7 +187,7 @@
<script> <script>
<% if !rvs.empty? && !plid && params[:continue] %> <% if !rvs.empty? && !plid && params[:continue] %>
player.on('ended', function() { player.on('ended', function() {
location.assign("/watch?v=" location.assign("/watch?v="
+ "<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>" + "<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>"
+ "&continue=1" + "&continue=1"
<% if params[:listen] %> <% if params[:listen] %>
@ -206,7 +206,7 @@ player.on('ended', function() {
function continue_autoplay(target) { function continue_autoplay(target) {
if (target.checked) { if (target.checked) {
player.on('ended', function() { player.on('ended', function() {
location.assign("/watch?v=" location.assign("/watch?v="
+ "<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>" + "<%= rvs.select { |rv| rv["id"]? }[0]?.try &.["id"] %>"
+ "&continue=1" + "&continue=1"
<% if params[:listen] %> <% if params[:listen] %>
@ -270,10 +270,10 @@ function get_playlist(timeouts = 0) {
if (xhr.readyState == 4) { if (xhr.readyState == 4) {
if (xhr.status == 200) { if (xhr.status == 200) {
playlist.innerHTML = xhr.response.playlistHtml; playlist.innerHTML = xhr.response.playlistHtml;
if (xhr.response.nextVideo) { if (xhr.response.nextVideo) {
player.on('ended', function() { player.on('ended', function() {
location.assign("/watch?v=" location.assign("/watch?v="
+ xhr.response.nextVideo + xhr.response.nextVideo
+ "&list=<%= plid %>" + "&list=<%= plid %>"
<% if params[:listen] %> <% if params[:listen] %>
@ -355,7 +355,7 @@ function get_reddit_comments(timeouts = 0) {
contentHtml: xhr.response.contentHtml contentHtml: xhr.response.contentHtml
}); });
} else { } else {
<% if preferences && preferences.comments[1] == "youtube" %> <% if preferences && preferences.comments[1] == "youtube" %>
get_youtube_comments(); get_youtube_comments();
<% else %> <% else %>
comments.innerHTML = fallback; comments.innerHTML = fallback;
@ -416,7 +416,7 @@ function get_youtube_comments(timeouts = 0) {
comments.innerHTML = ""; comments.innerHTML = "";
} }
} else { } else {
<% if preferences && preferences.comments[1] == "youtube" %> <% if preferences && preferences.comments[1] == "youtube" %>
get_youtube_comments(); get_youtube_comments();
<% else %> <% else %>
comments.innerHTML = ""; comments.innerHTML = "";