From 2b67fb52742bbcb9704a102d565afa2ba40a6807 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 13 Dec 2023 05:21:46 +0000 Subject: [PATCH] add shorts search support :3 --- html/channel.ejs | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/html/channel.ejs b/html/channel.ejs index 80b5a3ba..f897c286 100644 --- a/html/channel.ejs +++ b/html/channel.ejs @@ -767,7 +767,7 @@ white-space: nowrap;text-decoration: none;" href="/feeds/videos.xml?channel_id=< <% } %> - + <% } %> @@ -1375,21 +1375,39 @@ if (userID) { } document.getElementById('search').addEventListener('keyup', function () { - var value = this.value.toLowerCase(); - var videos = document.querySelectorAll('.video'); + var value = this.value.toLowerCase(); + var videos = document.querySelectorAll('.video, .shorts-video'); - videos.forEach(function (video) { - var text = video.textContent.toLowerCase(); - if (text.indexOf(value) > -1) { - video.style.visibility = 'visible'; - video.style.display = 'grid'; - } else { - video.style.visibility = 'hidden'; - video.style.display = 'none'; - } - }); - }); + videos.forEach(function (video) { + var text = video.textContent.toLowerCase(); + if (text.indexOf(value) > -1) { + video.style.visibility = 'visible'; + video.style.display = 'grid'; + } else { + video.style.visibility = 'hidden'; + video.style.display = 'none'; + } + }); +}); + + document.getElementById('search').addEventListener('keyup', function () { + var value = this.value.toLowerCase(); + var videos = document.querySelectorAll('.community-content'); + + videos.forEach(function (video) { + var text = video.textContent.toLowerCase(); + if (text.indexOf(value) > -1) { + video.style.visibility = 'visible'; + video.style.display = 'block'; + } else { + video.style.visibility = 'hidden'; + video.style.display = 'none'; + } + }); +}); + // @license-end +