]> git.plutz.net Git - serve0/commitdiff
tabbed interface
authorpaul <paul@plutz.net>
Wed, 12 Oct 2016 09:31:43 +0000 (09:31 +0000)
committerpaul <paul@plutz.net>
Wed, 12 Oct 2016 09:31:43 +0000 (09:31 +0000)
svn path=/trunk/; revision=152

static/common.css
templates/advfilter.html.sh
templates/list.html.sh
templates/playctl.html.sh
templates/tree.html.sh
templates/view.html.sh

index e6de713b632779c9205bb87b3c5db8df9f86e4d7..94c0c2904e6ec4d845fb3d903d3a84c9e248721d 100644 (file)
@@ -18,6 +18,7 @@
 
 * {
   -moz-box-sizing: border-box;
+  -webkit-box-sizing: border-box;
   box-sizing: border-box;
   -moz-transition: all .25s linear;
   transition: all .25s linear;
 
 body {
   padding: 0;
+  padding-top: 3em;
   margin: 0;
   background-color: #000;
   color: #DDD;
 }
+body.playctl { padding-top: 4.25em; }
 a { color: #EEE; }
 legend, label, .label { font-weight: bold; }
 
@@ -94,6 +97,40 @@ textarea {
 
 
 /* == Panels == */
+body:before {
+  position: absolute; display: block;
+  top: -1px; height: 2.25em; width: 100%;
+  background-color: #222;
+  margin: 0; padding: 0;
+  padding-top: .5em;
+  border-bottom: 1px solid #FFF;
+  content: '';
+}
+body.playctl:before {
+  top: -2px;
+  margin-top: 1.25em;
+  border-top: 1px solid #FFF;
+}
+
+input[name=topmenu] {display: none;}
+input[name=topmenu] + label {
+  position: relative;
+  top: -3em;
+  max-width: 25%;
+  margin: .5em 0 0 0;
+  display: inline-block;
+  text-decoration: none;
+  padding: .5em 1.5em;
+  line-height: 1.25em;
+  transition: none;
+  border: 1px none #FFF;
+}
+input[name=topmenu]:checked + label {
+  background-color: #333;
+  margin-left: -1px; margin-top: -1px;
+  border-style: solid solid none solid;
+}
+input[name=topmenu]:checked + label + * + input + label { margin-left: -1px; }
 
 .panel#search select { margin-right: .5em; }
 .panel#search:after {
@@ -113,10 +150,15 @@ textarea {
 }
 
 .panel#search, .panel.top {
-  position: relative; top: 0;
   border-style: none none solid none;
+  top: 2.75em;
 }
-.panel.top.switchable { position: absolute; }
+body.playctl .panel#search,
+body.playctl .panel.top { top: 4em; }
+
+
+.panel#search,
+.panel.top.switchable { position: absolute; min-height: 2.5em;}
 .panel#foot, .panel.bottom {
   position: fixed;
   bottom: 0;
@@ -124,25 +166,23 @@ textarea {
 }
 
 .panel.switchable {
+  display: none;
   max-height: 0;
   overflow: hidden;
   margin: 0; padding: 0;
   border-width: 0;
 }
+
+input[name=topmenu]:checked + label + .panel.switchable,
 .panel.switchable:target {
+  display: block;
   max-height: 80%;
-  overflow-y: scroll;
+  overflow-y: auto;
   padding: .25em .5em;
   border-width: 1px;
   z-index: 2;
 }
 
-body.playctl .panel#search,
-body.playctl .panel.top {
-  margin-top: 1.25em;
-  border-top: 1px solid #FFF;
-}
-
 .panel#search > a, .panel#foot > a,
 .panel.top > a, .panel.bottom > a{
   display: inline-block;
@@ -152,7 +192,7 @@ body.playctl .panel.top {
 }
 
 .panel.switchable.top a:first-of-type {
-  display: block;
+  display: block; display: none;
   margin-bottom: .5em;
   border-bottom: 1px solid #FFF;
 }
@@ -171,11 +211,11 @@ body.playctl .panel.top {
   display: inline-block;
   vertical-align: top;
   margin-top: 1em;
-  max-width: 48%;
 }
 
-.panel.switchable > fieldset.additional,
-.panel.switchable > fieldset.description {
+#tagger > fieldset { max-width: 48%;}
+#tagger > fieldset.additional,
+#tagger > fieldset.description {
   max-width: 100%;
 }
 
@@ -187,6 +227,10 @@ body.playctl .panel.top {
   border-radius: .25em;
   padding: .25em .5em;
 }
+#advfilter .filter .help {
+  display: block;
+  height: 0; overflow: hidden;
+}
 #advfilter .filter .tabcontainer {
   position: relative;
   width: 16em;
index 5d27f3b71ead367e2b14959137b91fab0780e2eb..3f8c6207bde7e153719e3a7a7bd5e8716bfd2abd 100755 (executable)
@@ -61,6 +61,7 @@ cat <<EOF
         action="?action=filter" method="post" accept-charset="UTF-8">
 
     <a class="panel toggle" href="#">Hide</a>
+    <a class="panel" href="?p=quicklinks">Most recent</a>
 
     <p class="help">Up to <strong>10</strong> filter boxes will appear as you start selecting tags. You can select <strong>multiple</strong> tags in each box by holding down the <strong>Ctrl</strong>-key. Click the "<strong>Filter!</strong>" button when you are ready.</p>
     $(filterbox {0..9})
index e25daf3c06274e41a41bd2727161313cda7a18e0..21dfd1189a976296d0b7ad170e893577e94018b5 100755 (executable)
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
+pages="$(
+seq 1 $(pagecount) \
+| while read pn; do
+  plink="$(($pn * $pagesize - $pagesize + 1))"
+  
+  case "$plink" in
+    $(($page - $pagesize))) class=previous;;
+    $page) class=current;;
+    $(($page + $pagesize))) class=next;;
+    * ) class='';;
+  esac
+
+  printf '<a class="%s" href="?%spn=%s">%s</a>\n' "$class" "$page_link" "$plink" "$pn"
+done
+)"
+
 cat <<EOF
+
+  <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">
 
@@ -28,45 +46,21 @@ cat <<EOF
     <!-- input type="submit" name="submit" value="Find" -->
 
     <a class="panel clearsearch" href="?">Clear</a>
-    <a class="panel toggle" href="#morelinks">More</a>
+  </form>
 
-    <div class="pagination_nav">
-      <label>Page:</label>
-EOF
+  <input type=radio name=topmenu id=btn_advfilter><label for=btn_advfilter>Advanced</label>
+  $(. $_EXEC/templates/advfilter.html.sh)
 
-  pages="$(
-  seq 1 $(pagecount) \
-  | while read pn; do
-    plink="$(($pn * $pagesize - $pagesize + 1))"
-    
-    case "$plink" in
-      $(($page - $pagesize))) class=previous;;
-      $page) class=current;;
-      $(($page + $pagesize))) class=next;;
-      * ) class='';;
-    esac
-
-    printf '<a class="%s" href="?%spn=%s">%s</a>\n' "$class" "$page_link" "$plink" "$pn"
-  done
-  )"
-  printf %s "$pages"
-      
-cat <<EOF
-    </div>
-  </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 toggle" href="#advfilter">Advanced</a>
-    <a class="panel toggle" href="#preferences">Preferences</a>
-
     <a class="panel treeview" href="?p=tree">Browse Folders</a>
-    <a class="panel" href="?p=quicklinks">Most recent</a>
-
     <a class="panel" href="?p=playctl">Player</a>
   </div>
-  $(. $_EXEC/templates/preferences.html.sh)
 
   <form action="?action=multitag" method="post" accept-charset="UTF-8">
     <input type="hidden" name="o" value="${order}">
@@ -94,7 +88,6 @@ cat <<EOF
     </div>
   </div>
 
-  $(. $_EXEC/templates/advfilter.html.sh)
 EOF
 
 # vi:set filetype=html:
index ad1ed9346e9b43e7bf41283da5ee2b080e4555da..d530131c80557f447b320bcbbf735cf6946db729 100755 (executable)
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-<form class="panel top" 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 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>
 </form>
 
+<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">
+  <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=tree">Browse Folders</a>
+</div>
+
+
 <div id="playctl">
   <h1>$info</h1>
   <a href="$video">Download</a>
@@ -59,19 +86,6 @@ cat <<EOF
   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
 </div>
 
-<form class="panel switchable bottom playctl" id="advctl" action="?action=playctl" method="post">
-  <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>
-
 <form class="panel switchable bottom" 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">
@@ -108,7 +122,6 @@ cat <<EOF
 
 <div class="panel footer" id="foot">
   <a class="panel toggle" href="#tagger">Edit Tags</a>
-  <a class="panel toggle" href="#advctl">More</a>
 </div>
 
 <span class="progress">
index 9343fc49567c7be44e4efb043d44615c710eac2a..485bd19a94a6d6c224e950961f408c05742c063f 100755 (executable)
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-  <form class="panel top" id="search" 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">
-    <input type="submit" name="submit" value="Find">
-    <a class="panel clearsearch" href="?p=tree">Clear All</a>
 
-    <a class="panel toggle" href="#morelinks">More</a>
+    <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" -->
+
+    <a class="panel clearsearch" href="?">Clear</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 toggle" href="#advfilter">Advanced</a>
-    <a class="panel toggle" href="#preferences">Preferences</a>
-
     <a class="panel listview" href="?p=list">Index view</a>
-    <a class="panel" href="?p=quicklinks">Most recent</a>
     <a class="panel" href="?p=playctl">Player</a>
   </div>
 
-  $(. $_EXEC/templates/preferences.html.sh)
-
   <form action="?action=multitag&${page_this}" method="post" accept-charset="UTF-8">
     <ul id="thumblist">
       $(filelist)
index f0a23135b16df833bb9b59929cd0c6deab87d4dd..4c3e85be7cdb84e772f1525561130c21f0c42894 100755 (executable)
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-<form class="panel top" 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 clearsearch" href="?">Clear All</a>
-  <a class="panel" href="${info:+?p=list&amp;${page_this}#$(urlsafe $info)}${info:-?p=tree&amp;d=${directory}&amp;${page_this}}">Dismiss</a>
-
-  <div class="pagination_nav">
-    <label>Page:</label>
-    <a href="?p=view&amp;${page_prev}">&lt;&lt;</a>
-    <a href="?p=view&amp;${page_this}">$(($page + 1))</a>
-    <a href="?p=view&amp;${page_next}">&gt;&gt;</a>
-  </div>
+  <a class="panel" href="${info:+?p=list&amp;${page_this}}${directory:+?p=tree&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</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=tree">Browse Folders</a>
+</div>
+
+
 <div id="videoview">
   <h1>$info</h1>
 
@@ -46,58 +51,50 @@ cat <<EOF
     <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
   </video>
 
-  <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>'
+<form class="panel switchable bottom" 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 '<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
-    )
-
-    <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">
-
-    <a class="panel toggle" href="#foot">Hide</a>
-
-  </form>
-</div>
+    printf '</select></fieldset>'
+  done
+  )
+
+  <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">
+
+  <a class="panel toggle" href="#foot">Hide</a>
+</form>
 
 <div class="panel bottom" id="foot">
   <a class="panel toggle" href="#tagger">Edit Tags</a>
-
-  <div class="pagination_nav">
-    <label>Page:</label>
-    <a href="?${page_prev}">&lt;&lt;</a>
-    <a href="?${page_this}">$(($page + 1))</a>
-    <a href="?${page_next}">&gt;&gt;</a>
-  </div>
 </div>
 EOF