File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 2
2
<title >History - Invidious</title >
3
3
<% end %>
4
4
5
+ <div class =" pure-g h-box" >
6
+ <div class =" pure-u-2-3" >
7
+ <h3 ><span id =" count" ><%= user.watched.size %> </span > videos</h3 >
8
+ </div >
9
+ <div class =" pure-u-1-3" style =" text-align :right ;" >
10
+ <h3 >
11
+ <a href =" /clear_watch_history" >Clear watch history</a >
12
+ </h3 >
13
+ </div >
14
+ </div >
15
+
5
16
<div class =" pure-g" >
6
17
<% watched.each_slice(4 ) do |slice | %>
7
18
<% slice.each do |item | %>
34
45
function mark_unwatched (target ) {
35
46
var tile = target .parentNode .parentNode .parentNode .parentNode ;
36
47
tile .style .display = " none" ;
48
+ var count = document .getElementById (" count" )
49
+ count .innerText = count .innerText - 1 ;
37
50
38
51
var url = " /mark_unwatched?redirect=false&id=" + target .getAttribute (" data-id" );
39
52
var xhr = new XMLHttpRequest ();
@@ -45,6 +58,7 @@ function mark_unwatched(target) {
45
58
xhr .onreadystatechange = function () {
46
59
if (xhr .readyState == 4 ) {
47
60
if (xhr .status != 200 ) {
61
+ count .innerText = count .innerText - 1 + 2 ;
48
62
tile .style .display = " " ;
49
63
}
50
64
}
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ function remove_subscription(target) {
57
57
xhr .onreadystatechange = function () {
58
58
if (xhr .readyState == 4 ) {
59
59
if (xhr .status != 200 ) {
60
+ count .innerText = count .innerText - 1 + 2 ;
60
61
row .style .display = " " ;
61
62
}
62
63
}
You can’t perform that action at this time.
0 commit comments