enable human readable sizes again/fix mobile design and add second sorting arrow
Co-Authored-By: David <contact@davidcraft.de>
This commit is contained in:
parent
132623891a
commit
ec47bdc3e8
3 changed files with 32 additions and 5 deletions
|
@ -8,14 +8,14 @@
|
|||
document.querySelector("h1").after(input);
|
||||
var items = [].slice.call(document.querySelectorAll("#list tbody tr"));
|
||||
function filterItems(item, filter) {
|
||||
return !item.querySelector("td").textContent.trim().includes(filter);
|
||||
return !item.querySelector("td").textContent.trim().toLowerCase().includes(filter);
|
||||
}
|
||||
input.addEventListener("keyup", function () {
|
||||
items.forEach((item) => {
|
||||
item.hidden = false;
|
||||
});
|
||||
items
|
||||
.filter((item) => filterItems(item, this.value.trim()))
|
||||
.filter((item) => filterItems(item, this.value.trim().toLowerCase()))
|
||||
.forEach((item) => {
|
||||
item.hidden = true;
|
||||
});
|
||||
|
@ -25,6 +25,16 @@
|
|||
tableDiv.id = "tableDiv";
|
||||
tableDiv.appendChild(document.querySelector("table"));
|
||||
document.getElementById("search").after(tableDiv);
|
||||
|
||||
var headers = document.querySelectorAll("th");
|
||||
headers.forEach((header) => {
|
||||
var links = header.querySelectorAll("a");
|
||||
var ascendingLink = document.createElement("a");
|
||||
ascendingLink.innerHTML = " ↑ ";
|
||||
ascendingLink.href = links[0].href;
|
||||
links[0].removeAttribute("href");
|
||||
links[1].after(ascendingLink);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Directory index</title>
|
||||
|
@ -109,6 +109,8 @@
|
|||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
line-height: 2.5rem;
|
||||
padding: 0.4rem;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
tr a {
|
||||
|
@ -147,13 +149,28 @@
|
|||
#box {
|
||||
padding-right: 1rem;
|
||||
padding-left: 1rem;
|
||||
margin: 2rem;
|
||||
margin: 0.5rem;
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 0rem;
|
||||
}
|
||||
|
||||
th {
|
||||
padding-right: 0rem;
|
||||
}
|
||||
|
||||
#search {
|
||||
font-size: 16px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
td {
|
||||
max-width: 10rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="box">
|
||||
|
|
|
@ -100,7 +100,7 @@ http {
|
|||
fancyindex off;
|
||||
fancyindex_localtime on;
|
||||
fancyindex_show_path on;
|
||||
fancyindex_exact_size on;
|
||||
fancyindex_exact_size off;
|
||||
fancyindex_show_dotfiles off;
|
||||
fancyindex_hide_symlinks off;
|
||||
fancyindex_case_sensitive on;
|
||||
|
|
Loading…
Reference in a new issue