Clickable table headers change sort direction

Make table headers clickable, for changing sorting direction of the entries.
Clicking on the name of the headers selects ascending direction, clicking on
the arrow next to it, chooses descending direction. The arrow symbol, for
simplicity, is an Unicode down-arrow symbol, which all reasonably modern
browsers should display fine. Also, most text-only browsers will show the
arrow correctly when running on Unicode-compatible terminals.
pull/8/head
Adrian Perez de Castro 2013-10-25 12:19:27 +03:00
parent 1226d363be
commit 9b3cdb5583
2 changed files with 10 additions and 10 deletions

View File

@ -65,9 +65,9 @@ static const u_char t06_list1[] = ""
"\n"
"<thead>"
"<tr>"
"<th>File Name</th>"
"<th>File Size</th>"
"<th>Date</th>"
"<th><a href=\"?C=N&O=A\">File Name</a>&nbsp;<a href=\"?C=N&O=D\">&nbsp;↓&nbsp;</a></th>"
"<th><a href=\"?C=S&O=A\">File Size</a>&nbsp;<a href=\"?C=S&O=D\">&nbsp;↓&nbsp;</a></th>"
"<th><a href=\"?C=M&O=A\">Date</a>&nbsp;<a href=\"?C=M&O=D\">&nbsp;↓&nbsp;</a></th>"
"</tr>"
"</thead>"
"\n"
@ -87,12 +87,12 @@ static const u_char t08_foot1[] = ""
"</html>"
;
#define NFI_TEMPLATE_SIZE (0 \
+ nfi_sizeof_ssz(t05_body2) \
+ nfi_sizeof_ssz(t06_list1) \
+ nfi_sizeof_ssz(t07_list2) \
+ nfi_sizeof_ssz(t08_foot1) \
+ nfi_sizeof_ssz(t01_head1) \
+ nfi_sizeof_ssz(t02_head2) \
+ nfi_sizeof_ssz(t03_head3) \
+ nfi_sizeof_ssz(t04_body1) \
+ nfi_sizeof_ssz(t05_body2) \
+ nfi_sizeof_ssz(t06_list1) \
+ nfi_sizeof_ssz(t07_list2) \
+ nfi_sizeof_ssz(t08_foot1) \
)

View File

@ -63,9 +63,9 @@
<thead>
<tr>
<th>File Name</th>
<th>File Size</th>
<th>Date</th>
<th><a href="?C=N&O=A">File Name</a>&nbsp;<a href="?C=N&O=D">&nbsp;&nbsp;</a></th>
<th><a href="?C=S&O=A">File Size</a>&nbsp;<a href="?C=S&O=D">&nbsp;&nbsp;</a></th>
<th><a href="?C=M&O=A">Date</a>&nbsp;<a href="?C=M&O=D">&nbsp;&nbsp;</a></th>
</tr>
</thead>