From 3e3a70ef3ea209edb6757b1da57254d94d11d053 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 6 Apr 2016 11:58:35 +0000 Subject: [PATCH] full page list for pagination, playctl in listview svn path=/trunk/; revision=113 --- actions/meta.sh | 2 +- actions/multitag.sh | 2 +- pages/common.sh | 1 + pages/list.sh | 14 ++++++--- templates/common.css.sh | 66 ++++++++++++++++++++++++++------------- templates/list.html.sh | 47 ++++++++++++++++++++++------ templates/playctl.html.sh | 2 +- 7 files changed, 97 insertions(+), 37 deletions(-) diff --git a/actions/meta.sh b/actions/meta.sh index 74ad014..f2e2431 100755 --- a/actions/meta.sh +++ b/actions/meta.sh @@ -51,7 +51,7 @@ ${tagacc}|${tags} ${description} EOF rm "${_DATA}/cache/$info.cache" 2>/dev/null - rm ${_DATA}/cache/*[0-9]\?* 2>/dev/null + rm ${_DATA}/cache/\?* 2>/dev/null rm ${_DATA}/cache/taglist 2>/dev/null fi diff --git a/actions/multitag.sh b/actions/multitag.sh index 2b30af8..c5a8df1 100755 --- a/actions/multitag.sh +++ b/actions/multitag.sh @@ -61,7 +61,7 @@ while [ -n "${_POST[tagsel$n]}" ]; do [ -z "$n" ] && n=0 || n=$(($n + 1)) done -rm "${_DATA}"/cache/*[0-9]\?* 2>/dev/null +rm "${_DATA}"/cache/\?* 2>/dev/null [ -n "${_POST[tags]}" ] && rm "${_DATA}"/cache/taglist 2>/dev/null redirect "?o=$order&s=$search&f=$filter&pn=$page" diff --git a/pages/common.sh b/pages/common.sh index 4242aab..0d33ee4 100755 --- a/pages/common.sh +++ b/pages/common.sh @@ -22,6 +22,7 @@ search="${_GET[s]}" order="${_GET[o]}" #validated page="${_GET[pn]}" #validated pagesize="${_COOKIE[pagesize]}" #validated +pagecount=0 page_link='' [ -n "$info" ] && page_link="i=$(urlsafe "$info")&" diff --git a/pages/list.sh b/pages/list.sh index eddbb8c..6cc5fdc 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -114,8 +114,8 @@ genlist(){ esac } -thumblist() { - cachebase="${pagesize}?o=${order}&s=${search//\//}&f=${filter//\//}&pn=${page}" +selectionlist() { + cachebase="?o=${order}&s=${search//\//}&f=${filter//\//}" cache="${_DATA}/cache/${cachebase}" if [ "$cache" -nt ${_DATA}/videos -a "$cache" -nt ${_DATA}/meta ]; then cat "$cache" @@ -142,10 +142,16 @@ thumblist() { debug "No search or filtering" cat fi \ - | sed -n "$page,$(($page + $pagesize - 1))p" \ | tee "$cache" - fi \ + fi +} + +thumblist() { + selectionlist \ + | sed -n "$page,$(($page + $pagesize - 1))p" \ | while read line; do _printVideo "$line" done } + +pagecount="$(( $(selectionlist | wc -l) / $pagesize ))" diff --git a/templates/common.css.sh b/templates/common.css.sh index 136f64c..a74e171 100755 --- a/templates/common.css.sh +++ b/templates/common.css.sh @@ -58,12 +58,35 @@ textarea { .pagination_nav { display: inline-block; - border: none; position: absolute; - right: 1em; - bottom: .25em; - width: 3.5em; - padding-top: .125em; + border: none; + right: 0; bottom: .25em; + padding: .125em .5em 0 0; +} + +.pagination_nav a { + display: none; + margin: 1ex 1px; + padding: 0 1ex; + text-decoration: none; +} + +.pagination_nav a.current { + display: inline; + color: #F66; + font-weight: bold; +} +.pagination_nav:hover { + position: fixed; + bottom: auto; + text-align: right; + background-color: #333; + border-bottom: 1px solid #FFF; + line-height: 1.75em; + transition: none; +} +.pagination_nav:hover a { + display: inline; } /* == Panels == */ @@ -73,24 +96,20 @@ textarea { display: block; width: 100%; margin: 0; - padding: .25em 1em; - padding-right: 4em; + padding: .25em .5em; background-color: #333; border-width: 1px; border-style: none none solid none; } -@media(min-width: 620px){ - .panel {padding-right: 8em;} - .pagination_nav { width: auto;} -} - a.panel { font-weight: bold; display: inline-block; border: none; width: auto; - padding-right: 1em; + padding: 0; + margin-right: 1em; + margin-bottom: 1ex; } .panel .help { display: block;} @@ -107,32 +126,36 @@ a.panel { .panel#foot { position: fixed; bottom: 0px; - min-height: 2em; border-style: solid none none none; } /* == Switchable Panels == */ -.panel#advfilter, -.panel#tagger, -.panel#preferences { +form.panel, +div.panel { z-index: 1; overflow: hidden; min-height: 0; max-height: 0; padding-top: 0; padding-bottom: 0; } -.panel#advfilter:target, -.panel#tagger:target, -.panel#preferences:target { + +.panel#search, +.panel#foot { + max-height: 100%; + z-index: 0; + padding: .25em 6em 0 .5em; +} + +.panel:target { max-height: 100%; overflow-y: scroll; } .panel#advfilter:target{ padding-bottom: 1em; } - /* == Panel Switches == */ +.panel#playctl a.panel, .panel#advfilter a.panel, .panel#preferences a.panel, .panel#tagger a.panel { @@ -225,6 +248,7 @@ a.panel { #advfilter .quicklinks * { display: block; word-wrap: break-word; + margin-bottom: .75em; } /* == Thumblist == */ diff --git a/templates/list.html.sh b/templates/list.html.sh index a5096d3..e54f3c2 100755 --- a/templates/list.html.sh +++ b/templates/list.html.sh @@ -1,4 +1,4 @@ -# Copyright 2014, 2015 Paul Hänsch +# Copyright 2014 - 2016 Paul Hänsch # # This file is part of Serve0 # @@ -19,25 +19,51 @@ cat < - - + Clear All Advanced + Player
- << - $(($page / $pagesize + 1)) - >> + $(seq 1 $pagecount \ + | while read pn; do + plink="$(($pn * $pagesize - $pagesize + 1))" + printf '%s\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn" + done + )
+
+ Hide +
+ + + + + + +
+ + +
+ $(for n in $(seq 0 5 100); do + printf '' "$([ "$volume" = "$n" ] && printf selected)" "$n" + done) +
+ +
+
+ +
    $(thumblist) @@ -52,9 +78,12 @@ cat < - << - $(($page / $pagesize + 1)) - >> + $(seq 1 $pagecount \ + | while read pn; do + plink="$(($pn * $pagesize - $pagesize + 1))" + printf '%s\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn" + done + ) diff --git a/templates/playctl.html.sh b/templates/playctl.html.sh index e1e2dfc..f073800 100755 --- a/templates/playctl.html.sh +++ b/templates/playctl.html.sh @@ -28,7 +28,7 @@ cat < Clear All - Dismiss + Dismiss
    -- 2.39.2