Skip to content

Commit

Permalink
enable human readable sizes again/fix mobile design and add second so…
Browse files Browse the repository at this point in the history
…rting arrow

Co-Authored-By: David <contact@davidcraft.de>
  • Loading branch information
Zoey2936 and DavidCraftDev committed Jun 10, 2024
1 parent 1326238 commit 481e31b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
14 changes: 12 additions & 2 deletions rootfs/html/fancyindex/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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 = "&nbsp;↑&nbsp;";
ascendingLink.href = links[0].href;
links[0].removeAttribute("href");
links[0].after(ascendingLink);
});
</script>
</body>
</html>
21 changes: 19 additions & 2 deletions rootfs/html/fancyindex/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<title>Directory index</title>
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion rootfs/usr/local/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 481e31b

Please sign in to comment.