mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 22:39:28 -05:00
Add link to '/clear_watch_history' in '/feed/history'
This commit is contained in:
parent
65cc51766f
commit
89439e1775
@ -2,6 +2,17 @@
|
|||||||
<title>History - Invidious</title>
|
<title>History - Invidious</title>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="pure-g h-box">
|
||||||
|
<div class="pure-u-2-3">
|
||||||
|
<h3><span id="count"><%= user.watched.size %></span> videos</h3>
|
||||||
|
</div>
|
||||||
|
<div class="pure-u-1-3" style="text-align:right;">
|
||||||
|
<h3>
|
||||||
|
<a href="/clear_watch_history">Clear watch history</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<% watched.each_slice(4) do |slice| %>
|
<% watched.each_slice(4) do |slice| %>
|
||||||
<% slice.each do |item| %>
|
<% slice.each do |item| %>
|
||||||
@ -34,6 +45,8 @@
|
|||||||
function mark_unwatched(target) {
|
function mark_unwatched(target) {
|
||||||
var tile = target.parentNode.parentNode.parentNode.parentNode;
|
var tile = target.parentNode.parentNode.parentNode.parentNode;
|
||||||
tile.style.display = "none";
|
tile.style.display = "none";
|
||||||
|
var count = document.getElementById("count")
|
||||||
|
count.innerText = count.innerText - 1;
|
||||||
|
|
||||||
var url = "/mark_unwatched?redirect=false&id=" + target.getAttribute("data-id");
|
var url = "/mark_unwatched?redirect=false&id=" + target.getAttribute("data-id");
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
@ -45,6 +58,7 @@ function mark_unwatched(target) {
|
|||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState == 4) {
|
if (xhr.readyState == 4) {
|
||||||
if (xhr.status != 200) {
|
if (xhr.status != 200) {
|
||||||
|
count.innerText = count.innerText - 1 + 2;
|
||||||
tile.style.display = "";
|
tile.style.display = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ function remove_subscription(target) {
|
|||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState == 4) {
|
if (xhr.readyState == 4) {
|
||||||
if (xhr.status != 200) {
|
if (xhr.status != 200) {
|
||||||
|
count.innerText = count.innerText - 1 + 2;
|
||||||
row.style.display = "";
|
row.style.display = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user