Commit ed89ef5f authored by Taddeüs Kroes's avatar Taddeüs Kroes

Make scores script more reliable

parent c901fe68
if table = document.querySelector '.match-editable'
inputs = table.getElementsByTagName 'input'
inputs = table.querySelectorAll 'input[type=number]'
rows = table.children[1].children
match_total = table.querySelector '.match-total'
match_avg = table.querySelector '.match-avg'
w = table.querySelector('tbody tr').getElementsByTagName('input').length
w = table.querySelectorAll('tbody input[type=number]').length
h = inputs.length / w
scores = []
sub = (row) -> rows[row].children[w + 1]
tot = (row) -> rows[row].children[w + 2]
sub = (row) -> rows[row].querySelector '.row-total'
tot = (row) -> rows[row].querySelector '.total'
num = (s) -> if s == '' or isNaN parseInt s then 0 else parseInt s
timer = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment