#!/bin/sh
-list_item(){
+list_item() {
name="$(HTML "$1")"
path="$(HTML "$ITEM/$1")"
meta="$_DATA/$ITEM/.index/meta"
read -r length width height tags comment n <<-EOF
$(grep -m1 -F " $1" "$meta")
EOF
- printf '[div .list .file
- [a href="%s" [img src="%s?a=thumbnail"] %s]
- [span .time %i:%imin] [span .dim %ix%i] %s
- ]' \
- "$path" "$path" "$name" \
- "$((length / 60))" "$((length % 60))" \
- "$width" "$height" \
- "$(printf %s\\n "${tags#tags=}" |tr , ' ' |xargs printf '[span .tag %s]')"
+ printf '[div .list .file
+ [a href="%s" [img src="%s?a=thumbnail"][label %s]]
+ [span .time %i:%imin] [span .dim %ix%i] %s
+ ]' \
+ "$path" "$path" "$name" \
+ "$((length / 60))" "$((length % 60))" \
+ "$width" "$height" \
+ "$(printf %s\\n "${tags#tags=}" |tr , ' ' |xargs printf '[span .tag %s]')"
else
- printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"] %s]]' \
+ printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"][label %s]]]' \
"$path" "$path" "$name"
fi
}
-list_items(){
+list_items() {
mode="$(COOKIE mode |grep -m1 -xE 'index|browse' || printf browse )"
[ "$mode" = browse -a "$ITEM" ] && printf '..\n'
Name) sort -k 2;;
esac \
| cut -d/ -f2-
-
}
-list_paginate(){
+list_paginate() {
page="$(GET p |grep -xE '[0-9]+' || printf 1)"
printf '[div .itemlist '