mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 15:38:14 +01:00
add shorts search support :3
This commit is contained in:
parent
cd1b480770
commit
2b67fb5274
1 changed files with 32 additions and 14 deletions
|
@ -767,7 +767,7 @@ white-space: nowrap;text-decoration: none;" href="/feeds/videos.xml?channel_id=<
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" id="search" placeholder="Search vids :3" style="margin-top: 2em;height: 1em;color: #fff;background: #111;border-radius: 1em;padding: 7px;margin-left: auto;margin-right: 1em;"> </div>
|
<input type="text" id="search" placeholder="Search :3" style="margin-top: 2em;height: 1em;color: #fff;background: #111;border-radius: 1em;padding: 7px;margin-left: auto;margin-right: 1em;"> </div>
|
||||||
|
|
||||||
|
|
||||||
<% } %>
|
<% } %>
|
||||||
|
@ -1376,7 +1376,7 @@ if (userID) {
|
||||||
|
|
||||||
document.getElementById('search').addEventListener('keyup', function () {
|
document.getElementById('search').addEventListener('keyup', function () {
|
||||||
var value = this.value.toLowerCase();
|
var value = this.value.toLowerCase();
|
||||||
var videos = document.querySelectorAll('.video');
|
var videos = document.querySelectorAll('.video, .shorts-video');
|
||||||
|
|
||||||
videos.forEach(function (video) {
|
videos.forEach(function (video) {
|
||||||
var text = video.textContent.toLowerCase();
|
var text = video.textContent.toLowerCase();
|
||||||
|
@ -1389,7 +1389,25 @@ document.getElementById('search').addEventListener('keyup', function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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
|
// @license-end
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue