X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=widgets.sh;h=f825c12c8213678ab4bb74caab25a61cba128bea;hb=65f7fdd29c51ce924260a9aae21f29fa15154dcb;hp=cd9dda30ca344037e5db60751e9c8a990eec9bfe;hpb=fba69117d6069aa43f8ccafe2f7ad732205ee481;p=serve0 diff --git a/widgets.sh b/widgets.sh index cd9dda3..f825c12 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 + w_tags="$( cn=1 find "$_DATA/" -path '*/.index/meta' -print0 \ - | xargs -r0 sed -r ' + | xargs -0 -r sed -E ' s;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;; - s;,;\n;g;'"$UNSTRING" \ + 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 ']'