File tree 3 files changed +32
-5
lines changed
3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 8
8
document . querySelector ( "h1" ) . after ( input ) ;
9
9
var items = [ ] . slice . call ( document . querySelectorAll ( "#list tbody tr" ) ) ;
10
10
function filterItems ( item , filter ) {
11
- return ! item . querySelector ( "td" ) . textContent . trim ( ) . includes ( filter ) ;
11
+ return ! item . querySelector ( "td" ) . textContent . trim ( ) . toLowerCase ( ) . includes ( filter ) ;
12
12
}
13
13
input . addEventListener ( "keyup" , function ( ) {
14
14
items . forEach ( ( item ) => {
15
15
item . hidden = false ;
16
16
} ) ;
17
17
items
18
- . filter ( ( item ) => filterItems ( item , this . value . trim ( ) ) )
18
+ . filter ( ( item ) => filterItems ( item , this . value . trim ( ) . toLowerCase ( ) ) )
19
19
. forEach ( ( item ) => {
20
20
item . hidden = true ;
21
21
} ) ;
25
25
tableDiv . id = "tableDiv" ;
26
26
tableDiv . appendChild ( document . querySelector ( "table" ) ) ;
27
27
document . getElementById ( "search" ) . after ( tableDiv ) ;
28
+
29
+ var headers = document . querySelectorAll ( "th" ) ;
30
+ headers . forEach ( ( header ) => {
31
+ var links = header . querySelectorAll ( "a" ) ;
32
+ var ascendingLink = document . createElement ( "a" ) ;
33
+ ascendingLink . innerHTML = " ↑ " ;
34
+ ascendingLink . href = links [ 0 ] . href ;
35
+ links [ 0 ] . removeAttribute ( "href" ) ;
36
+ links [ 1 ] . after ( ascendingLink ) ;
37
+ } ) ;
28
38
</ script >
29
39
</ body>
30
40
</ html>
Original file line number Diff line number Diff line change 1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
< html >
3
3
< head >
4
4
< title > Directory index</ title >
109
109
border-bottom-width : 1px ;
110
110
border-bottom-style : solid;
111
111
line-height : 2.5rem ;
112
+ padding : 0.4rem ;
113
+ overflow-wrap : break-word;
112
114
}
113
115
114
116
tr a {
147
149
# box {
148
150
padding-right : 1rem ;
149
151
padding-left : 1rem ;
150
- margin : 2rem ;
152
+ margin : 0.5rem ;
153
+ margin-top : 1.5rem ;
151
154
margin-bottom : 0rem ;
152
155
}
153
156
154
157
th {
155
158
padding-right : 0rem ;
156
159
}
160
+
161
+ # search {
162
+ font-size : 16px ;
163
+ margin-left : auto;
164
+ margin-right : auto;
165
+ }
166
+
167
+ table {
168
+ font-size : medium;
169
+ }
170
+
171
+ td {
172
+ max-width : 10rem ;
173
+ }
157
174
}
158
175
</ style >
159
176
< div id ="box ">
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ http {
100
100
fancyindex off;
101
101
fancyindex_localtime on;
102
102
fancyindex_show_path on;
103
- fancyindex_exact_size on ;
103
+ fancyindex_exact_size off ;
104
104
fancyindex_show_dotfiles off;
105
105
fancyindex_hide_symlinks off;
106
106
fancyindex_case_sensitive on;
You can’t perform that action at this time.
0 commit comments