-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 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 clearsearch" href="?">Clear All</a>
- <a class="panel advanced show" href="?p=filter">Advanced</a>
-
- <div class="pagination_nav">
- <label>Page:</label>
- <a href="?p=view&${page_prev}"><<</a>
- <a href="?p=view&${page_this}">$(($page + 1))</a>
- <a href="?p=view&${page_next}">>></a>
- </div>
+ <a class="panel" href="${info:+?p=list&${page_this}}${directory:+?p=browse&d=${directory}&${page_this}}#$(urlsafe $info)">Dismiss</a>
</form>
-<div class="panel" id="videoview">
- <a href="${info:+?p=list&${page_this}}${info:-?p=tree&d=${directory}&${page_this}}" class="panel">Dismiss</a>
- <h1>$info</h1>
-
- <div class="video">
- <a href="$video">Full</a>
- <video controls>
- <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
- </video>
- </div>
-
- <div class="tabcontainer">
- <input type="radio" class="tabhandle" name="viewmode" value="view" id="viewmeta" checked>
- <div class="videoinfo tabcontent">
- <label class="meta edit" for="editmeta">Edit</label>
-
- <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
- <span class="info width" >Width: $width</span>
- <span class="info height">Height: $height</span><br>
-
- <label class="tags">Tags:</label>
- $(echo "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
- ${description:+<span class="info description">$(echo -E "$description" |_wiki)</span>}
- </div>
- </div>
-
- <div class="tabcontainer">
- <input type="radio" class="tabhandle" name="viewmode" value="edit" id="editmeta">
- <form class="videoinfo tabcontent" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
- <label class="meta cancel" for="viewmeta">Cancel Edit</label>
-
- <input type="hidden" name="length" value="$length">
- <input type="hidden" name="width" value="$width">
- <input type="hidden" name="height" value="$height">
-
- <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
- <span class="info width" >Width: $width</span>
- <span class="info height">Height: $height</span>
-
- <span class="label tags">Tags:</span>
- <select class="edit tags" name="tag" size="16" multiple>
- $(echo "$taglist" |while read line; do
- echo "<option $(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && echo -n selected)>$line</option>"
- done)
- </select>
-
- <label class="moretags">Additional Tags (one per line):</label>
- <textarea class="edit moretags" name="tags" rows="4"></textarea>
-
- <label class="description">Description:</label>
- <textarea class="edit description" name="description" rows="4">$description</textarea>
-
- <input type="submit" value="Submit">
- <input type="submit" name="trash" value="Delete Video">
- <!-- input type="submit" name="cancel" value="Cancel" -->
- </form>
- </div>
+<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="videoview">
+ <h1>$(htmlsafe "$info")</h1>
+
+ <a href="$(urlsafe "$video")">Download</a>
+ <a href="javascript:stereoview(180, document.getElementById('mainvideo'));">View 180º Steroscopic</a>
+ <a href="javascript:stereoview(360, document.getElementById('mainvideo'));">View 360º Steroscopic</a>
+ <video id="mainvideo" autoplay controls>
+ <source src="$(urlsafe "$video")" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
+ </video>
+
+ <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>
- <ul id="thumblist">
- $([ -n "$info" ] && thumblist || filelist)
- </ul>
+<script type="text/javascript" src="?static=stereoview.js"></script>
+
+<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">
+
+ $(
+ 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
+ )
+
+ <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 footer" id="foot">
- <div class="pagination_nav">
- <label>Page:</label>
- <a href="?${page_prev}"><<</a>
- <a href="?${page_this}">$(($page + 1))</a>
- <a href="?${page_next}">>></a>
- </div>
+<div class="panel bottom" id="foot">
+ <a class="panel toggle" href="#tagger">Edit Tags</a>
</div>
EOF