1
0
forked from x/ContextOS
ContextOS/usr/travel.html
2018-05-22 22:13:34 +08:00

76 lines
1.4 KiB
HTML

<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<style>
th {
cursor:pointer;
background-color:lightgray;
}
.name {
padding-left:10px;
text-align:left;
}
.help {
padding-left:10px;
text-align:left;
}
.status {
padding-left:10px;
text-align:left;
}
.stream {
padding-left:10px;
text-align:left;
}
code {
font-size:14px;
}
</style>
</head>
<body>
<table>
<colgroup>{{range .append}}<col class="{{.}}">{{end}}</colgroup>
<tr>{{range .append}}<th class="{{.}}" onclick="list('{{.}}')">{{.}}</th>{{end}}</tr>
{{$meta := .}} {{$first := index .append 0}}
{{range $i, $k := index . $first}}
<tr>
{{range $key := index $meta "append"}}
{{if eq $key "name"}}
<td class="{{$key}}">
<code><a href="/travel?dir={{index $meta $key $i}}">{{index $meta $key $i}}</a></code>
</td>
{{else}}
<td class="{{$key}}">
<code>{{index $meta $key $i}}</code>
</td>
{{end}}
{{end}}
</tr>
{{end}}
</table>
<script>
function Cookie(name, value) {
if (value == undefined) {
var pattern = new RegExp(name+"=([^;]*);?");
var result = pattern.exec(document.cookie);
if (result && result.length > 0) {
return result[1];
}
return ""
}
document.cookie = name+"="+value;
return Cookie(name);
}
function list(what) {
Cookie("list", what);
Cookie("order", Cookie("order")*1 + 1)
location.assign(location.href)
}
</script>
</body>