1const botonesFiltros = document.querySelectorAll('.filtros_wrapper .filters .button'); 2const shows = document.querySelectorAll('.lista_shows .show'); 3const inputBuscar = document.querySelector('input[name="buscar"]'); 4const selectFiltro = document.getElementById('filtro_categoria'); 5 6if (selectFiltro != null && selectFiltro != 'undefined') { 7 selectFiltro.addEventListener('change', function(e) { 8 filtrarItems(); 9 }); 10} 11 12for (let i = 0; i < botonesFiltros.length; i++) { 13 botonesFiltros[i].addEventListener('click', function(e) { 14 botonesFiltros.forEach((boton) => { 15 boton.classList.remove('is-checked'); 16 }); 17 e.target.classList.add('is-checked'); 18 setTimeout(() => { 19 filtrarItems(); 20 }, 100); 21 }); 22} 23 24if (inputBuscar != null && inputBuscar != 'undefined') { 25 inputBuscar.addEventListener('input', function(e) { 26 filtrarItems(); 27 }); 28} 29 30function filtrarItems() 31{ 32 // búsqueda 33 const busqueda = inputBuscar.value.toLowerCase(); 34 35 // filtro 36 const filtro = selectFiltro.value.toLowerCase(); 37 38 // Loop 39 for (let i = 0; i < shows.length; i++) { 40 let show = shows[i]; 41 show.classList.remove('d-none'); 42 if (filtro != '*') { 43 if (!show.classList.contains(filtro)) { 44 show.classList.add('d-none'); 45 } 46 } 47 48 const wrapperTitulo = show.querySelector('.nombre'); 49 if (!wrapperTitulo.innerText.toLowerCase().includes(busqueda)) { 50 show.classList.add('d-none'); 51 } 52 } 53}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.