]> git.plutz.net Git - serve0/blob - templates/playctl.html.sh
styling for pagination links
[serve0] / templates / playctl.html.sh
1 # Copyright 2014 - 2017 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
20 <input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
21 <form class="panel" id="search" action="?" method="get" accept-charset="UTF-8">
22   <input type="text" name="s" value="$search" placeholder="Search">
23
24   <select class="order" size="1" name="o" id="o1">
25     <option class="label" selected disabled>Order by</option>
26     <option>Name</option>
27     <option>Date</option>
28     <option>Length</option>
29   </select>
30   <!-- input type="submit" name="submit" value="Find" -->
31
32   <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>
33 </form>
34
35 <input type=radio name=topmenu id=btn_playctl><label for=btn_playctl>Audio</label>
36 <form class="panel switchable top playctl" id="advctl" action="?action=playctl" method="post">
37   <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
38   <fieldset class="volume">
39     <button type="submit" name="amp" value="off">Amp Off</button>
40     <button type="submit" name="amp" value="on">Amp On</button>
41   </fieldset>
42   <fieldset class="pasink">
43     $(pa_sinks |while read no name; do
44       printf '<button type="submit" name="pasink" value="%s">%s</button>' "$no" "$name"
45     done)
46   </fieldset>
47   <a class="panel toggle" href="#foot">Hide</a>
48 </form>
49
50 <input type=radio name=topmenu id=btn_preferences><label for=btn_preferences>Preferences</label>
51   $(. $_EXEC/templates/preferences.html.sh)
52
53 <input type=radio name=topmenu id=btn_morelinks><label for=btn_morelinks>{+}</label>
54 <div class="panel switchable top" id="morelinks">
55   <a class="panel toggle" href="#">Hide</a>
56
57   <a class="panel listview" href="?p=list">Index view</a>
58   <a class="panel treeview" href="?p=browse">Browse Folders</a>
59 </div>
60
61
62 <div id="playctl">
63   <h1>$info</h1>
64
65   <form action="${actionuri}" method="post" class="playctl">
66     <input type="hidden" name="referrer" value="$(attribsafe "//${HTTP_HOST}${REQUEST_URI}")">
67     <fieldset class="playback">
68       <button type="submit" name="seek" value="-60">&lt;&lt;&lt;</button>
69       <button type="submit" name="seek" value="-10">&lt;&lt;</button>
70       <button type="submit" name="ctl" value="stop">&#x25a0;</button>
71       <button type="submit" name="ctl" value="pause">|| / &#x25b6;</button>
72       <button type="submit" name="seek" value="+10">&gt;&gt;</button>
73       <button type="submit" name="seek" value="+60">&gt;&gt;&gt;</button>
74     </fieldset>
75     <fieldset class="volume">
76       $(for n in $(seq 0 5 100); do
77         printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' \
78           "$( [ "$n" = "$volume" ] && printf selected
79               [ "$n" = "$((volume - 10))" ] && printf llselected
80               [ "$n" = "$((volume -  5))" ] && printf  lselected
81               [ "$n" = "$((volume +  5))" ] && printf  gselected
82               [ "$n" = "$((volume + 10))" ] && printf ggselected
83            )" "$n"
84       done)
85     </fieldset>
86   </form>
87
88   <span class="info length">$(printf "%d:%02d min" $(($length / 60)) $(($length % 60)) )</span>
89   <span class="info width" >Width: $width</span>
90   <span class="info height">Height: $height</span><br>
91   
92   $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span> :g')
93   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
94 </div>
95
96 <form class="panel switchable bottom" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
97   <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
98   <input type="hidden" name="length" value="$length">
99   <input type="hidden" name="width" value="$width">
100   <input type="hidden" name="height" value="$height">
101
102   $(
103   for cat in $(list_categories); do
104     printf '<fieldset class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
105     catt="${cat}:"
106     [ "$catt" = "none:" ] && catt=''
107     
108     printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
109       printf '<option %s value="%s">%s</option>' \
110              "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
111              "$line" "${line#*:}"
112     done
113     printf '</select></fieldset>'
114   done
115   )
116
117   <fieldset class="newtag additional">
118     <label class="additional">Additional Tags (one per line):</label>
119     <textarea name="tags" rows="4"></textarea>
120   </fieldset>
121   <fieldset class="newtag description">
122     <label class="description">Description:</label>
123     <textarea name="description" rows="4">$description</textarea>
124   </fieldset>
125   <input type="submit" value="Edit!">
126   <input type="submit" name="trash" value="Delete Video">
127
128   <a class="panel toggle" href="#foot">Hide</a>
129 </form>
130
131 <div class="panel footer" id="foot">
132   <a class="panel toggle" href="#tagger">Edit Tags</a>
133 </div>
134
135 <span class="progress">
136 EOF
137
138 cnt=0
139 progress \
140 | while read p t; do
141   printf '<span style="width: %d%%;">%d:%02d</span>\n' "${p}" "$(($t / 60))" "$(($t % 60))"
142 done
143
144 printf '</span>'
145
146 # vi:set filetype=html: