X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=widgets.sh;h=f79d457303b672eeb0ea35ab00478d531dfba131;hb=ec97cc5e9c5d8b74786ac93b40b47af260c02e48;hp=cd9dda30ca344037e5db60751e9c8a990eec9bfe;hpb=5feb36c907d3a475363a573fcc52d7219e623bdf;p=serve0 diff --git a/widgets.sh b/widgets.sh index cd9dda3..f79d457 100644 --- a/widgets.sh +++ b/widgets.sh @@ -14,11 +14,12 @@ c_tags="$_DATA/.index/tags.cache"; c_tagcategories="$_DATA/.index/tagcategories. if [ ! -s "$c_tags" -o ! -s "$c_tagcategories" ] \ || [ "$(find "$_DATA/" -path '*/.index/meta' -newer "$c_tags")" ] then - w_tags="$( local cn=1 - find "$_DATA/" -path '*/.index/meta' -print0 \ - | xargs -r0 sed -r ' - s;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;; - s;,;\n;g;'"$UNSTRING" \ + w_tags="$( cn=1 + find "$_DATA/" -path '*/.index/meta' -exec \ + sed -E 's;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;; + s;,;\n;g;' \ + '{}' + \ + | UNSTRING \ | { sort; printf '\n'; } \ | while read -r tag; do [ "$tag" = "$otag" ] \ @@ -188,7 +189,7 @@ w_advsearch(){ $n "${t:+checked}" $n $n f="|${f#\~}|" - printf '*\n%s\n' "$w_tagcategories" \ + printf '*\n%s\n$\n' "$w_tagcategories" \ | while read -r category; do lbid="cat_${n}_${category}" @@ -217,6 +218,8 @@ w_advsearch(){ # printf '[option %s value="%s"\n%s]' "$t" "$tag" "$d" printf '[label [checkbox "tag_%s" "%s" %s] %s]' "$n" "$tag" "$t" "$d" done + d="${f##*\$:}" d="${d%%\|*}" + [ "$category" = \$ ] && printf '[input name="tag_%i" value="%s"]' "$n" "$(HTML "$d")" printf '\n]' done printf ']'