3 _EXEC="${_EXEC:-${0%/*}/}"
7 . "$_EXEC"/cgilite/cgilite.sh
8 . "$_EXEC"/cgilite/session.sh
9 . "$_EXEC"/cgilite/file.sh
10 . "$_EXEC"/cgilite/storage.sh
11 #. "$_EXEC"/session_lock.sh
14 PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
16 #git init "$_DATA" >/dev/null &
17 bookmarks="$(COOKIE bookmarks |grep -xE '[0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?( [0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?)*')"
20 title="${1:-Webpoll}" page="$2"
21 printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
22 "Content-Security-Policy: script-src 'none'" \
26 [meta name="viewport" content="width=device-width"]
27 [link rel="stylesheet" type="text/css" href="%s/common.css"]
28 [link rel="stylesheet" type="text/css" href="%s/widgets.css"]
29 [link rel="stylesheet" type="text/css" href="%s/webpoll.css"]
32 ' "$_BASE" "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
35 } |"$_EXEC/cgilite/html-sh.sed" -u
40 local file="$_DATA/$id"
41 if [ -f "$file" ]; then
42 DBM "$file" get title || printf 'Unnamed Page'
48 page_home() { . "$_EXEC"/home.sh; }
49 page_newdate() { . "$_EXEC"/newdate.sh; }
50 page_poll() { . "$_EXEC"/poll.sh; }
53 /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
54 /common.css) FILE "$_EXEC/cgilite/common.css";;
55 /widgets.css|/webpoll.css) FILE "${_EXEC}/${PATH_INFO}";;
57 /[0-9a-zA-Z:=]???????????????/[0-9a-zA-Z:=]???????????????) page_newdate;;
59 /[0-9a-zA-Z:=]???????????????) page_poll;;