js/ui.js
/**
 * Selects a block producer, updating the ui elements showing its ranking.
 * */
Selects a block producer, updating the ui elements showing its ranking.
Selects a block producer updating the ui elements showing its ranking .
function selectBlockProducer() {
    let follows = document.getElementsByName('bpFollow')
    for (let i = 0, length = follows.length; i < length; i++) {
        if (follows[i].checked) {
            let rank = i + 1
            document.getElementById("following").innerText = "Following: ".concat(follows[i].value).concat(" | ").concat("Current rank: " + rank)
            favoriteBlockProducerName = follows[i].value
            favoriteBlockProducerCurrentRanking = rank
            follows[i].parentElement.parentElement.className = 'selected'
            if (rank <= SELECTED_BP_LIMIT) {
                document.getElementById("message").innerText = "Congratulations! Your favorite block producer is within the 21 elected"
            } else {
                document.getElementById("message").innerText = "Your favorite block producer is in standby!"
            }
        } else {
            follows[i].parentElement.parentElement.className = ''
        }
    }
}
function selectBlockProducer ( ) { let follows = document . getElementsByName ( 'bpFollow' ) for ( let i = 0 , length = follows . length ; i < length ; i ++ ) { if ( follows [ i ] . checked ) { let rank = i + 1 document . getElementById ( "following" ) . innerText = "Following: " . concat ( follows [ i ] . value ) . concat ( " | " ) . concat ( "Current rank: " + rank ) favoriteBlockProducerName = follows [ i ] . value favoriteBlockProducerCurrentRanking = rank follows [ i ] . parentElement . parentElement . className = 'selected' if ( rank <= SELECTED_BP_LIMIT ) { document . getElementById ( "message" ) . innerText = "Congratulations! Your favorite block producer is within the 21 elected" } else { document . getElementById ( "message" ) . innerText = "Your favorite block producer is in standby!" } } else { follows [ i ] . parentElement . parentElement . className = '' } } }
Selects a block producer, updating the ui elements showing its ranking.
Selects a block producer updating the ui elements showing its ranking .
// clearRankIcon(follows[i].parentElement.parentElement.childNodes[2])