]> git.plutz.net Git - serve0/blob - view.sh
Merge commit 'b931bbd0c30907b9cc956d3707b26b449bf41f76'
[serve0] / view.sh
1 #!/bin/sh
2
3 . "$_EXEC/indexmeta.sh"
4 . "$_EXEC/widgets.sh"
5
6 read length width height tags comment short <<-EOF
7         $(meta_info "$_DATA/$ITEM")
8         EOF
9
10 printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
11
12 { printf '
13 [!DOCTYPE HTML]
14 [html [head [title \n'
15   HTML "${ITEM##*/}"
16   printf ']
17   [meta name="viewport" content="width=device-width"]
18   [link rel=stylesheet href="/style.css" ]
19 ] [body #view
20   [script type="text/javascript" src="/stereoview.js"\n]
21   [div #navigation
22     [a #t_bookmarks href="#bookmarks" &#x2605;]'
23     w_search
24     printf '
25     [a #t_avsearch href="#advsearch" Advanced]
26     [a #t_prefs href="#prefs" &#x2699;]
27   ]'
28   w_bookmarks
29   w_advsearch
30   w_prefs
31   printf '
32   [video #mainvideo controls="controls" preload="auto" [source src="?a=download" type="video/mp4"]]
33   [a "?a=download" Download]
34   [a "javascript:stereoview(180, document.getElementById(&#34;mainvideo&#34;));" View 180° Stereoscopic]
35   [a "javascript:stereoview(360, document.getElementById(&#34;mainvideo&#34;));" View 360° Stereoscopic]
36   [h1\n %s]
37   [span .time %i:%02imin] [span .dim %ix%i] %s
38   ' "$(HTML "${ITEM##*/}" |sed -r "$w_ascii"' s;[^0-9a-zA-Z&#];&[wbr];g')" \
39     "$((length / 60))" "$((length % 60))" "$width" "$height" \
40     "$(printf '%s\n' "${tags#tags=}" |sed -r "$UNSTRING"'
41        s;^;,;; s;,+;,;g; s;,$;;; :X s;,-?([^,]+)(,|$); [span .tag\n \1]\2;; tX;'
42     )"
43   printf '
44   [div #editing
45     [form method=POST action="/?a=multitag"
46     [hidden "select" "%s"]' "$(HTML "${ITEM}")"
47       [ -d "$_DATA/${ITEM%/*}/.index/" ] && w_tagging
48     printf '
49     ]
50   ]
51 ] ]
52 '; } | "$_EXEC/cgilite/html-sh.sed"