X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=list.sh;h=18799f3ec3af2f77442224ca7191d62aeca1d88f;hb=6505a2726aa04b8b0b37af689535bde67f99238a;hp=e8b7075f1f889ac3c4527dab07d9e475b4d005d9;hpb=d6c1406a5507f83acc0433189ad89d40560f1f08;p=serve0 diff --git a/list.sh b/list.sh index e8b7075..18799f3 100644 --- a/list.sh +++ b/list.sh @@ -17,7 +17,7 @@ list_item() { $(meta_info "$_DATA/$ITEM/$1") EOF printf '[div .list .file - [a href="%s" [img src="%s?a=thumbnail"][label %s]] + [a href="%s" [img src="%s?a=thumbnail"]][label %s] [span .time %i:%imin] [span .dim %ix%i] %s [checkbox "select" "%s" id="select_%s"][label for="select_%s" +] ]' \ @@ -77,9 +77,12 @@ list_filemeta(){ | if [ "$FILTER" ]; then sed -nr "$list_fex" elif [ "${SEARCH#!}" != "${SEARCH}" ]; then - grep -aviE "$(STRING "${SEARCH#!}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aviE "$(STRING "${SEARCH#!}" |sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1\\+;g; tx;')" else - grep -aiE "$(STRING "${SEARCH}" |sed -r 's;((^|[^\\])(\\\\)*)\+;\1\\+;g;')" + grep -aiE "$(STRING "${SEARCH}" \ + | sed -r ':x s;((^|[^\\])(\\\\)*)\+;\1 ;g; tx; + s;((^|[^\\])(\\\\)*)\\\+;\1+;g; + s; ;\\+;g;')" fi |cut -f6 | UNSTRING \ | while read -r fn; do printf '%s\n' "${base}/${fn%${CR}}" @@ -90,7 +93,7 @@ list_index(){ local meta (cd "$_DATA/$ITEM"; find ./ -path '*/.index/meta' - ) | while meta="$(line)"; do + ) | while read -r meta; do list_filemeta "${meta%/.index/meta}" done } @@ -159,8 +162,9 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n' [a #t_avsearch href="#advsearch" Advanced] [a #t_prefs href="#prefs" ⚙] ]' - w_prefs + w_bookmarks w_advsearch + w_prefs printf ' [form method=POST action="?a=multitag"' list_items \