]> git.plutz.net Git - serve0/blob - templates/playctl.html.sh
simplified styling
[serve0] / templates / playctl.html.sh
1 # Copyright 2014 - 2016 Paul Hänsch
2 #
3 # This file is part of Serve0
4
5 # Serve0 is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # Serve0 is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
17
18 cat <<EOF
19 <form class="panel top" id="search" style="display: block;" action="?" method="get" accept-charset="UTF-8">
20   <input type="text" name="s" value="$search" placeholder="Search">
21
22   <label for="o1" class="order">Order by:</label>
23   <select class="order" size="1" name="o" id="o1">
24     <option>Name</option>
25     <option>Date</option>
26     <option>Length</option>
27   </select>
28   <input type="submit" name="submit" value="Find">
29
30   <a class="panel clearsearch" href="?">Clear All</a>
31   <a class="panel" href="${info:+?p=list&amp;${page_this}}${directory:+?p=tree&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</a>
32 </form>
33
34 <div id="playctl">
35   <h1>$info</h1>
36   <a href="$video">Download</a>
37
38   <form action="?action=playctl" method="post" class="playctl">
39     <fieldset class="playback">
40       <button type="submit" name="seek" value="-60">&lt;&lt;&lt;</button>
41       <button type="submit" name="seek" value="-10">&lt;&lt;</button>
42       <button type="submit" name="ctl" value="stop">&#x25a0;</button>
43       <button type="submit" name="ctl" value="pause">|| / &#x25b6;</button>
44       <button type="submit" name="seek" value="+10">&gt;&gt;</button>
45       <button type="submit" name="seek" value="+60">&gt;&gt;&gt;</button>
46     </fieldset>
47     <fieldset class="volume">
48       $(for n in $(seq 0 5 100); do
49         printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' "$([ "$volume" = "$n" ] && printf selected)" "$n"
50       done)
51     </fieldset>
52   </form>
53
54   <span class="info length">$(printf "%d:%02d min" $(($length / 60)) $(($length % 60)) )</span>
55   <span class="info width" >Width: $width</span>
56   <span class="info height">Height: $height</span><br>
57   
58   $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span> :g')
59   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
60 </div>
61
62 <form class="panel switchable bottom playctl" id="advctl" action="?action=playctl" method="post">
63   <fieldset class="volume">
64     <button type="submit" name="amp" value="off">Amp Off</button>
65     <button type="submit" name="amp" value="on">Amp On</button>
66   </fieldset>
67   <fieldset class="pasink">
68     $(pa_sinks |while read no name; do
69       printf '<button type="submit" name="pasink" value="%s">%s</button>' "$no" "$name"
70     done)
71   </fieldset>
72   <a class="panel toggle" href="#foot">Hide</a>
73 </form>
74
75 <form class="panel switchable bottom" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
76   <input type="hidden" name="length" value="$length">
77   <input type="hidden" name="width" value="$width">
78   <input type="hidden" name="height" value="$height">
79
80   $(
81   for cat in $(list_categories); do
82     printf '<fieldset class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
83     catt="${cat}:"
84     [ "$catt" = "none:" ] && catt=''
85     
86     printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
87       printf '<option %s value="%s">%s</option>' \
88              "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
89              "$line" "${line#*:}"
90     done
91     printf '</select></fieldset>'
92   done
93   )
94
95   <fieldset class="newtag additional">
96     <label class="additional">Additional Tags (one per line):</label>
97     <textarea name="tags" rows="4"></textarea>
98   </fieldset>
99   <fieldset class="newtag description">
100     <label class="description">Description:</label>
101     <textarea name="description" rows="4">$description</textarea>
102   </fieldset>
103   <input type="submit" value="Edit!">
104   <input type="submit" name="trash" value="Delete Video">
105
106   <a class="panel toggle" href="#foot">Hide</a>
107 </form>
108
109 <div class="panel footer" id="foot">
110   <a class="panel toggle" href="#tagger">Edit Tags</a>
111   <a class="panel toggle" href="#advctl">More</a>
112 </div>
113
114 <span class="progress">
115 EOF
116
117 cnt=0
118 progress \
119 | while read p t; do
120   printf '<span style="width: %d%%;">%d:%02d</span>\n' "${p}" "$(($t / 60))" "$(($t % 60))"
121 done
122
123 printf '</span>'
124
125 # vi:set filetype=html: