]> git.plutz.net Git - serve0/commitdiff
full page list for pagination, playctl in listview
authorpaul <paul@plutz.net>
Wed, 6 Apr 2016 11:58:35 +0000 (11:58 +0000)
committerpaul <paul@plutz.net>
Wed, 6 Apr 2016 11:58:35 +0000 (11:58 +0000)
svn path=/trunk/; revision=113

actions/meta.sh
actions/multitag.sh
pages/common.sh
pages/list.sh
templates/common.css.sh
templates/list.html.sh
templates/playctl.html.sh

index 74ad014e0ee124ba69a9766c7f8799b65af43c66..f2e24317288d6d9b8aabea5b1258d1332ac3e870 100755 (executable)
@@ -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
 
index 2b30af84159b789927dfa65c7e560a3e366d11b1..c5a8df12c4a3c12a456cac8b359eed1bbbfd4a61 100755 (executable)
@@ -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"
index 4242aab3807ae9738ba86f4a79d6ad42bab84762..0d33ee4e5336f20d2d2f4e5142ec3d72de50bfe3 100755 (executable)
@@ -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")&"
index eddbb8c63c87cea04ba220dd5a32d8c9e1e7bfe2..6cc5fdc946efcb45ec927aea1a0503765edafd22 100755 (executable)
@@ -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 ))"
index 136f64cf7d6c82c349f968e9a3fb4657729ea0ce..a74e1718cf0ae235f576f8b58dc63c9f66df07ce 100755 (executable)
@@ -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 == */
index a5096d3da65f23e8c582377da1c3afa2dace0262..e54f3c25d60ef0ebe35e43211f8d2dd813dbc190 100755 (executable)
@@ -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 <<EOF
   <form class="panel" id="search" action="?" method="get" accept-charset="UTF-8">
     <input type="text" name="s" value="$search" placeholder="Search">
 
-    <label for="o1" class="order">Order by:</label>
     <select class="order" size="1" name="o" id="o1">
+      <option class="label" selected disabled>Order by</option>
       <option>Name</option>
       <option>Date</option>
       <option>Length</option>
     </select>
-    <input type="submit" name="submit" value="Find">
+    <!-- input type="submit" name="submit" value="Find" -->
 
     <a class="panel clearsearch" href="?">Clear All</a>
     <a class="panel toggle" href="#advfilter">Advanced</a>
+    <a class="panel toggle" href="#playctl">Player</a>
 
     <div class="pagination_nav">
       <label>Page:</label>
-      <a href="?${page_prev}">&lt;&lt;</a>
-      <a href="?${page_this}">$(($page / $pagesize + 1))</a>
-      <a href="?${page_next}">&gt;&gt;</a>
+      $(seq 1 $pagecount \
+        | while read pn; do
+          plink="$(($pn * $pagesize - $pagesize + 1))"
+          printf '<a %s href="?%spn=%s">%s</a>\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn"
+        done
+       )
     </div>
   </form>
 
+  <div class="panel" id="playctl">
+     <a class="panel toggle" href="#">Hide</a>
+     <form action="?action=playctl" method="post">
+       <button type="submit" name="seek" value="-60">&lt;&lt;&lt;</button>
+       <button type="submit" name="seek" value="-10">&lt;&lt;</button>
+       <button type="submit" name="ctl" value="stop">&#x25a0;</button>
+       <button type="submit" name="ctl" value="pause">|| / &#x25b6;</button>
+       <button type="submit" name="seek" value="+10">&gt;&gt;</button>
+       <button type="submit" name="seek" value="+60">&gt;&gt;&gt;</button>
+       <br>
+       <button type="submit" name="amp" value="off">Amp Off</button>
+       <button type="submit" name="amp" value="on">Amp On</button>
+       <br>
+       $(for n in $(seq 0 5 100); do
+         printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' "$([ "$volume" = "$n" ] && printf selected)" "$n"
+       done)
+       <br>
+       <button type="submit" name="osd" value="progression">Progress</button>
+     </form>
+  </div>
+
+
   <form action="?action=multitag&${page_this}" method="post" accept-charset="UTF-8">
     <ul id="thumblist">
       $(thumblist)
@@ -52,9 +78,12 @@ cat <<EOF
 
     <div class="pagination_nav">
       <label>Page:</label>
-      <a href="?${page_prev}">&lt;&lt;</a>
-      <a href="?${page_this}">$(($page / $pagesize + 1))</a>
-      <a href="?${page_next}">&gt;&gt;</a>
+      $(seq 1 $pagecount \
+        | while read pn; do
+          plink="$(($pn * $pagesize - $pagesize + 1))"
+          printf '<a %s href="?%spn=%s">%s</a>\n' "$([ $plink = $page ] && printf class=current)" "$page_link" "$plink" "$pn"
+        done
+       )
     </div>
   </div>
 
index e1e2dfc433ff82e7ddc6e147750ff31c74e2d74c..f073800948af7e8c8e53fb0686a6cf828f3a1cda 100755 (executable)
@@ -28,7 +28,7 @@ cat <<EOF
   <input type="submit" name="submit" value="Find">
 
   <a class="panel clearsearch" href="?">Clear All</a>
-  <a class="panel" href="${info:+?p=list&amp;${page_this}}${info:-?p=tree&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</a>
+  <a class="panel" href="${info:+?p=list&amp;${page_this}}${directory:+?p=tree&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</a>
 
   <div class="pagination_nav">
     <label>Page:</label>