1 Commits
v0.2.1 ... main

Author SHA1 Message Date
4ed915a2c0 Added some basic table sorting
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-08-13 23:20:42 -04:00
2 changed files with 31 additions and 4 deletions

View File

@@ -1,7 +1,34 @@
$ ->
# run foundation scripts
# let us know when javascript is running.
console.log('Ready.')
lastColumn = null
ascending = true
tableHeaders = $('th')
tableHeaders.click (e) ->
column = $(this).index()
table = $(this).closest('table')
if column is lastColumn
ascending = not ascending
else
ascending = true
lastColumn = column
sortTable(table, column, ascending)
sortTable = (table, column, ascending) ->
rows = table.find('tbody tr').get()
compareFunction = (a, b) ->
res = a.cells[column].textContent.localeCompare b.cells[column].textContent
if ascending then res else -res
rows.sort compareFunction
$(rows).detach().appendTo(table.find('tbody'))
return
averageResults = (results, decimals = 2) ->
avgScore = 0
minScore = Infinity

View File

@@ -8,9 +8,9 @@
<table class="table table-hover table-responsive">
<thead class="table-light">
<tr>
<th>Test name</th>
<th># Benchmarks</th>
<th>Last Updated</th>
<th data-sort="name">Test name</th>
<th data-sort="benchmark-count"># Benchmarks</th>
<th data-sort="updated'">Last Updated</th>
</tr>
</thead>
<tbody>