1
0
Fork 0
mirror of https://github.com/LaQuay/TDTChannels.git synced 2025-05-31 09:49:25 +02:00

filter channels

This commit is contained in:
Marc 2019-02-03 19:10:08 +01:00
parent 5838c5d6f4
commit ddd9756bb6
2 changed files with 21 additions and 1 deletions
script/public

View file

@ -174,6 +174,24 @@ function checkIfWebsiteWorks(sUrl){
});
}
function filterChannelsList() {
var input, filter, div, li, a, i, txtValue;
input = document.getElementById("searchInput");
filter = input.value.toUpperCase();
div = document.getElementById("channel-list");
elements = div.getElementsByTagName("a");
for (i = 0; i < elements.length; i++) {
txtValue = elements[i].textContent || elements[i].innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
elements[i].style.display = "";
} else {
elements[i].style.display = "none";
}
}
}
function onChannelClick(channel){
channel = JSON.parse(channel);
reproduceVideo(channel['options'][0]['url'])