js/ui.js
/**
 * Searches among the list of block producers.
 * */
Searches among the list of block producers.
Searches among the list of block producers .
function search() {
    let nameColumn = 2
    let input, filter, table, tr, td, i
    input = document.getElementById("search")
    filter = input.value.toLowerCase()
    table = document.getElementById("bps")
    tr = table.getElementsByTagName("tr")
    for (i = 1; i < tr.length; i++) {
        td = tr[i].getElementsByTagName("td")[nameColumn]
        if (td) {
            if (td.innerHTML.toLowerCase().indexOf(filter) > -1) {
                tr[i].style.display = ""
            } else {
                tr[i].style.display = "none"
            }
        }
    }
}
function search ( ) { let nameColumn = 2 let input , filter , table , tr , td , i input = document . getElementById ( "search" ) filter = input . value . toLowerCase ( ) table = document . getElementById ( "bps" ) tr = table . getElementsByTagName ( "tr" ) for ( i = 1 ; i < tr . length ; i ++ ) { td = tr [ i ] . getElementsByTagName ( "td" ) [ nameColumn ] if ( td ) { if ( td . innerHTML . toLowerCase ( ) . indexOf ( filter ) > - 1 ) { tr [ i ] . style . display = "" } else { tr [ i ] . style . display = "none" } } } }
Searches among the list of block producers.
Searches among the list of block producers .
// Loop through all table rows, and hide those who don't match the search query