From 3a030bfc7933228ab4405dbb706bd63edbf7bc31 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 21 Sep 2014 21:58:44 +0000 Subject: [PATCH] html/css cleanup svn path=/trunk/; revision=11 --- actions/meta.sh | 10 +- actions/watch.sh | 17 ++++ pages/videoview.sh | 31 +++--- templates/filterdiag.html.sh | 135 +++++++++++++++----------- templates/frame.html.sh | 7 +- templates/tagger.html.sh | 63 ++++++------- templates/videoview.css.sh | 178 ++++++++++++++++++++--------------- templates/videoview.html.sh | 8 +- templates/view.html.sh | 73 +++++++------- 9 files changed, 305 insertions(+), 217 deletions(-) create mode 100755 actions/watch.sh diff --git a/actions/meta.sh b/actions/meta.sh index a5f578c..605d809 100755 --- a/actions/meta.sh +++ b/actions/meta.sh @@ -1,7 +1,11 @@ #!/bin/zsh info="$_GET[\"i\"]" -file="{$DATA}/meta/$info.meta" +order="$_GET[\"o\"]" +search="$_GET[\"s\"]" +filter="$_GET[\"f\"]" +page="$_GET[\"p\"]" +file="${_DATA}/meta/$info.meta" cgi_post length="$_POST[\"length\"]" @@ -9,10 +13,6 @@ width="$_POST[\"width\"]" height="$_POST[\"height\"]" trash="$_POST[\"trash\"]" cancel="$_POST[\"cancel\"]" -filter="$_POST[\"f\"]" -search="$_POST[\"s\"]" -page="$_POST[\"p\"]" -order="$_POST[\"o\"]" tagacc="$_POST[\"tag\"]" tags="$(echo "$_POST[\"tags\"]" \ | sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;s:\\:\\\\:g;s//\>\;/g' diff --git a/actions/watch.sh b/actions/watch.sh new file mode 100755 index 0000000..cd1dd14 --- /dev/null +++ b/actions/watch.sh @@ -0,0 +1,17 @@ +#!/bin/zsh + +cgi_refdata +info="$_GET[\"i\"]" +order="$_REF[\"o\"]" +search="$_REF[\"s\"]" +filter="$_REF[\"f\"]" +page="$_REF[\"p\"]" + +watch_link='' +[ -n "$info" ] && watch_link="${watch_link}i=${info}&" +[ -n "$order" ] && watch_link="${watch_link}o=${order}&" +[ -n "$search" ] && watch_link="${watch_link}s=${search}&" +[ -n "$filter" ] && watch_link="${watch_link}f=${filter}&" +[ -n "$page" ] && watch_link="${watch_link}p=${page}" + +echo -n "Location: ?${watch_link}\n\n" diff --git a/pages/videoview.sh b/pages/videoview.sh index dacb524..ac3532b 100755 --- a/pages/videoview.sh +++ b/pages/videoview.sh @@ -24,6 +24,16 @@ order=$(echo "$_GET[\"o\"]" |egrep '^(Name|Date|Length)$') page=$(echo "$_GET[\"p\"]" |egrep '^[0-9]+$') [ -z "$page" ] && page=0 +page_link='' +[ -n "$info" ] && page_link="${page_link}i=${info}&" +[ -n "$order" ] && page_link="${page_link}o=${order}&" +[ -n "$search" ] && page_link="${page_link}s=${search}&" +[ -n "$filter" ] && page_link="${page_link}f=${filter}&" +page_prev="${page_link}p=$([ "$page" = 0 ] && echo 0 || echo $(($page - 1)) )" +page_next="${page_link}p=$(($page + 1))" +page_this="${page_link}p=$page" + + taglist=$( [ -r ${_DATA}/cache/taglist ] && cat ${_DATA}/cache/taglist ||\ for each in ${_DATA}/meta/*.meta; do @@ -90,17 +100,16 @@ _printVideo(){ tee "$cache" < - -
- $info
- - fake-mp4
- - ${minutes}min - ${width}x${height}
- - $(sed 's,|$,,;s,|, ,g' <<<"$tags") -
+ + + + $info + + fake-mp4 + + ${minutes}min + ${width}x${height}
+ $(echo "$tags" |sed -r 's:\|*([^|]+)\|*:\1:g') VIDEOend fi diff --git a/templates/filterdiag.html.sh b/templates/filterdiag.html.sh index 5fbf2c3..2ebb22e 100755 --- a/templates/filterdiag.html.sh +++ b/templates/filterdiag.html.sh @@ -1,69 +1,90 @@ #!/bin/zsh cat < -
- - Order by: - - Clear All - Advanced - - Page: << - $(($page + 1)) - >> - -
- + - + Up to 10 filter boxes will appear as you start selecting tags. You can select multiple tags in each box by holding down the Ctrl-key. Click the "Filter!" button when you are ready. + + $(for n in {0..9}; do + hideall="$(sed -rn "s;^([^:]+):.*$;hide('${n}_\\1')\\;;p" <<<"$taglist" |sort -u)hide('${n}_none');" + echo " +
+ and + Any + None + of the tags selected here: + Category: + + + $(sed -rn 's;^([^:]+):.*$;\1;p' <<<"$taglist" |sort -u |while read cat; do echo " + " + done) +
" + done) + +
+ Order by: + + +
+ + + FilterEnd # vi:set filetype=html: diff --git a/templates/frame.html.sh b/templates/frame.html.sh index 822659b..eae2968 100755 --- a/templates/frame.html.sh +++ b/templates/frame.html.sh @@ -36,11 +36,14 @@ cat < diff --git a/templates/tagger.html.sh b/templates/tagger.html.sh index 28fb1b8..2fd18f5 100755 --- a/templates/tagger.html.sh +++ b/templates/tagger.html.sh @@ -1,46 +1,45 @@ #!/bin/zsh cat < - Add Tags - - Page: - << - $(($page + 1)) - >> - + -