nginx-interactive-index: Only apply stripes to body

This commit is contained in:
Simon Bruder 2021-08-29 14:13:35 +02:00
parent f6d9bf82db
commit 77eab2497a
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -39,13 +39,13 @@ document.addEventListener('DOMContentLoaded', () => {
const collator = new Intl.Collator('kn', {numeric: true})
// transform plain text to table
document.querySelector('pre').outerHTML = '<table><tr><th>Name</th><th>Size</th></tr><tr><td><a href="..">..</a></td><td>-</td></tr>' + document.querySelector('pre').innerHTML
document.querySelector('pre').outerHTML = '<table><thead><tr><th>Name</th><th>Size</th></tr></thead><tbody><tr><td><a href="..">..</a></td><td>-</td></tr>' + document.querySelector('pre').innerHTML
.split('\n')
.filter(line => line !== '')
.filter(line => line !== '<a href="../">../</a>')
.map(processLine)
.sort(collator.compare)
.join('\n') + '</table>'
.join('\n') + '</tbody></table>'
let searchField = document.createElement('input')
searchField.id = 'search-field'