diff --git a/assets/js/watch.js b/assets/js/watch.js new file mode 100644 index 00000000..7301f075 --- /dev/null +++ b/assets/js/watch.js @@ -0,0 +1,48 @@ +function toggle_parent(target) { + body = target.parentNode.parentNode.children[1]; + if (body.style.display === null || body.style.display === "") { + target.innerHTML = "[ + ]"; + body.style.display = "none"; + } else { + target.innerHTML = "[ - ]"; + body.style.display = ""; + } +} + +function toggle_comments(target) { + body = target.parentNode.parentNode.parentNode.children[1]; + if (body.style.display === null || body.style.display === "") { + target.innerHTML = "[ + ]"; + body.style.display = "none"; + } else { + target.innerHTML = "[ - ]"; + body.style.display = ""; + } +} + +function swap_comments(source) { + comments = document.getElementById("comments"); + var fallback = comments.innerHTML; + comments.innerHTML = + '
- [ - ] + [ - ] #{child["author"]} @@ -158,7 +158,7 @@ def template_reddit_comments(root) content = <<-END_HTML
- [ - ] + [ - ] #{author} #{score} points #{recode_date(child.created_utc)} ago diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 4f842c4c..4eaaf9a6 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -22,6 +22,7 @@ + <%= rendered "components/player_sources" %>