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);
|
document.querySelector("h1").after(input);
|
||||||
var items = [].slice.call(document.querySelectorAll("#list tbody tr"));
|
var items = [].slice.call(document.querySelectorAll("#list tbody tr"));
|
||||||
function filterItems(item, filter) {
|
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 () {
|
input.addEventListener("keyup", function () {
|
||||||
items.forEach((item) => {
|
items.forEach((item) => {
|
||||||
item.hidden = false;
|
item.hidden = false;
|
||||||
});
|
});
|
||||||
items
|
items
|
||||||
.filter((item) => filterItems(item, this.value.trim()))
|
.filter((item) => filterItems(item, this.value.trim().toLowerCase()))
|
||||||
.forEach((item) => {
|
.forEach((item) => {
|
||||||
item.hidden = true;
|
item.hidden = true;
|
||||||
});
|
});
|
||||||
|
@ -25,6 +25,16 @@
|
||||||
tableDiv.id = "tableDiv";
|
tableDiv.id = "tableDiv";
|
||||||
tableDiv.appendChild(document.querySelector("table"));
|
tableDiv.appendChild(document.querySelector("table"));
|
||||||
document.getElementById("search").after(tableDiv);
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Directory index</title>
|
<title>Directory index</title>
|
||||||
|
@ -109,6 +109,8 @@
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
line-height: 2.5rem;
|
line-height: 2.5rem;
|
||||||
|
padding: 0.4rem;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr a {
|
tr a {
|
||||||
|
@ -147,13 +149,28 @@
|
||||||
#box {
|
#box {
|
||||||
padding-right: 1rem;
|
padding-right: 1rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
margin: 2rem;
|
margin: 0.5rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
margin-bottom: 0rem;
|
margin-bottom: 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
padding-right: 0rem;
|
padding-right: 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
font-size: medium;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
max-width: 10rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div id="box">
|
<div id="box">
|
||||||
|
|
|
@ -100,7 +100,7 @@ http {
|
||||||
fancyindex off;
|
fancyindex off;
|
||||||
fancyindex_localtime on;
|
fancyindex_localtime on;
|
||||||
fancyindex_show_path on;
|
fancyindex_show_path on;
|
||||||
fancyindex_exact_size on;
|
fancyindex_exact_size off;
|
||||||
fancyindex_show_dotfiles off;
|
fancyindex_show_dotfiles off;
|
||||||
fancyindex_hide_symlinks off;
|
fancyindex_hide_symlinks off;
|
||||||
fancyindex_case_sensitive on;
|
fancyindex_case_sensitive on;
|
||||||
|
|
Loading…
Reference in a new issue