]> git.plutz.net Git - serve0/blobdiff - templates/playctl.html.sh
styling for pagination links
[serve0] / templates / playctl.html.sh
index 62fe1d262a1e48105968636462a56cc0e3a6a2cb..5d0159791e04095245ae9eaad0fbfe5d0b584dab 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014 - 2016 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
 #
 # This file is part of Serve0
 # 
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-<form class="panel" id="search" style="display: block;" action="?" method="get" accept-charset="UTF-8">
+
+<input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
+<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" href="${_GET[w]:-${info:+?p=list&amp;${page_this}}${directory:+?p=browse&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)}">Dismiss</a>
+</form>
 
-  <a class="panel clearsearch" href="?">Clear All</a>
-  <a class="panel" href="${info:+?p=list&amp;${page_this}}${directory:+?p=tree&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</a>
+<input type=radio name=topmenu id=btn_playctl><label for=btn_playctl>Audio</label>
+<form class="panel switchable top playctl" id="advctl" action="?action=playctl" method="post">
+  <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
+  <fieldset class="volume">
+    <button type="submit" name="amp" value="off">Amp Off</button>
+    <button type="submit" name="amp" value="on">Amp On</button>
+  </fieldset>
+  <fieldset class="pasink">
+    $(pa_sinks |while read no name; do
+      printf '<button type="submit" name="pasink" value="%s">%s</button>' "$no" "$name"
+    done)
+  </fieldset>
+  <a class="panel toggle" href="#foot">Hide</a>
 </form>
 
+<input type=radio name=topmenu id=btn_preferences><label for=btn_preferences>Preferences</label>
+  $(. $_EXEC/templates/preferences.html.sh)
+
+<input type=radio name=topmenu id=btn_morelinks><label for=btn_morelinks>{+}</label>
+<div class="panel switchable top" id="morelinks">
+  <a class="panel toggle" href="#">Hide</a>
+
+  <a class="panel listview" href="?p=list">Index view</a>
+  <a class="panel treeview" href="?p=browse">Browse Folders</a>
+</div>
+
+
 <div id="playctl">
   <h1>$info</h1>
-  <a href="$video">Download</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 action="${actionuri}" method="post" class="playctl">
+    <input type="hidden" name="referrer" value="$(attribsafe "//${HTTP_HOST}${REQUEST_URI}")">
+    <fieldset class="playback">
+      <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>
+    </fieldset>
+    <fieldset class="volume">
+      $(for n in $(seq 0 5 100); do
+        printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' \
+          "$( [ "$n" = "$volume" ] && printf selected
+              [ "$n" = "$((volume - 10))" ] && printf llselected
+              [ "$n" = "$((volume -  5))" ] && printf  lselected
+              [ "$n" = "$((volume +  5))" ] && printf  gselected
+              [ "$n" = "$((volume + 10))" ] && printf ggselected
+           )" "$n"
+      done)
+    </fieldset>
   </form>
 
-  <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
+  <span class="info length">$(printf "%d:%02d min" $(($length / 60)) $(($length % 60)) )</span>
   <span class="info width" >Width: $width</span>
   <span class="info height">Height: $height</span><br>
   
   $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span> :g')
   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
+</div>
 
-  <form class="panel" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
-    <input type="hidden" name="length" value="$length">
-    <input type="hidden" name="width" value="$width">
-    <input type="hidden" name="height" value="$height">
-
-    $(
-    for cat in $(list_categories); do
-      printf '<p class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
-      catt="${cat}:"
-      [ "$catt" = "none:" ] && catt=''
-      
-      printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
-        printf '<option %s value="%s">%s</option>' \
-               "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
-               "$line" "${line#*:}"
-      done
-      printf '</select></p>'
-    done
-    )
+<form class="panel switchable bottom" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
+  <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
+  <input type="hidden" name="length" value="$length">
+  <input type="hidden" name="width" value="$width">
+  <input type="hidden" name="height" value="$height">
 
-    <p class="newtag additional">
-      <label class="additional">Additional Tags (one per line):</label>
-      <textarea name="tags" rows="4"></textarea>
-    </p>
-    <p class="newtag description">
-      <label class="description">Description:</label>
-      <textarea name="description" rows="4">$description</textarea>
-    </p>
-    <input type="submit" value="Edit!">
-    <input type="submit" name="trash" value="Delete Video">
+  $(
+  for cat in $(list_categories); do
+    printf '<fieldset class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
+    catt="${cat}:"
+    [ "$catt" = "none:" ] && catt=''
+    
+    printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
+      printf '<option %s value="%s">%s</option>' \
+             "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
+             "$line" "${line#*:}"
+    done
+    printf '</select></fieldset>'
+  done
+  )
 
-    <a class="panel toggle" href="#foot">Hide</a>
+  <fieldset class="newtag additional">
+    <label class="additional">Additional Tags (one per line):</label>
+    <textarea name="tags" rows="4"></textarea>
+  </fieldset>
+  <fieldset class="newtag description">
+    <label class="description">Description:</label>
+    <textarea name="description" rows="4">$description</textarea>
+  </fieldset>
+  <input type="submit" value="Edit!">
+  <input type="submit" name="trash" value="Delete Video">
 
-  </form>
-</div>
+  <a class="panel toggle" href="#foot">Hide</a>
+</form>
 
 <div class="panel footer" id="foot">
   <a class="panel toggle" href="#tagger">Edit Tags</a>
 </div>
+
+<span class="progress">
 EOF
 
 cnt=0
 progress \
 | while read p t; do
-  printf '<span class="progress"><span style="width: %d%%;">%s</span></span>\n' "${p}" "${t}"
+  printf '<span style="width: %d%%;">%d:%02d</span>\n' "${p}" "$(($t / 60))" "$(($t % 60))"
 done
 
+printf '</span>'
+
 # vi:set filetype=html: