# HG changeset patch # User nanaya # Date 1432458232 -32400 # Node ID ddb5458658d25baccae943a3d6ca2d9d663a3ea3 # Parent e122e4e55e75bd3ce8d109415b68c9020d1bc685 Sortable list \o/ diff -r e122e4e55e75 -r ddb5458658d2 index.php --- a/index.php Sun May 24 17:21:04 2015 +0900 +++ b/index.php Sun May 24 18:03:52 2015 +0900 @@ -1,5 +1,5 @@ " . link_to(dirname($uri) . "/", "[up]") . ""; + } + } + function file_rows($files, $is_dir) { global $dir, $uri; $file_rows = ""; $file_suffix = ""; + $list_file_prefix = ""; if ($is_dir) { $file_suffix = "/"; - - if ($uri !== "/") { - $file_rows .= "" . link_to(dirname($uri) . "/", "[up]") . ""; - } + $list_file_prefix = "0"; + } else { + $list_file_prefix = "1"; } foreach($files as $file) { $file_stat = @stat($dir . "/". $file); $file_rows .= ""; - $file_rows .= "".link_to($file . $file_suffix, $file . $file_suffix).""; + $file_rows .= "". $list_file_prefix . link_to($file . $file_suffix, $file . $file_suffix).""; $file_rows .= ""; - if ($is_dir) { $file_rows .= "[dir]"; } - else { $file_rows .= human_size($file_stat['size']); } + if ($is_dir) { $file_rows .= "0[dir]"; } + else { $file_rows .= "" . $file_stat["size"] . "" . human_size($file_stat['size']); } $file_rows .= ""; $file_rows .= "".h(strftime("%Y-%m-%d %H:%M %Z", $file_stat['mtime'])).""; @@ -145,8 +151,26 @@ padding: 2px 5px; } + i { + display: none; + } + + th span { + display: block; + text-decoration: underline; + } + th span.desc:after { + content: " ▼"; + } + th span.asc:after { + content: " ▲"; + } + @media (min-width: 768px) { - th { background: #ccc; } + th { + background: #ccc; + cursor: pointer; + } tr:nth-child(even) { background: #eee; } tr:hover { background: #ddd; } } @@ -176,13 +200,16 @@

Index of

- - - - - - - +
FileSizeDate
+ + + + + + + + + @@ -197,8 +224,8 @@ - +
FileSizeDate