]> git.plutz.net Git - webpoll/blobdiff - index.cgi
added polling page
[webpoll] / index.cgi
index 9037c330099f6bc876743d39888543912bf3058c..0694c6e4d9b5f8c9c9ea8fa3c744149d8a2ece86 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -11,6 +11,13 @@ _BASE="${_BASE%/}"
 #. "$_EXEC"/session_lock.sh
 . "$_EXEC"/widgets.sh
 
+export MD_HTML="false"
+if [ "$(which awk)" ]; then
+  markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; }
+else
+  markdown() { busybox awk -f "$_EXEC/cgilite/markdown.awk"; }
+fi
+
 PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
 
 #git init "$_DATA" >/dev/null &
@@ -28,7 +35,7 @@ yield_page(){
       [link rel="stylesheet" type="text/css" href="%s/webpoll.css"]
       [title %s]
     ] [body class="%s"
-  ' "$_BASE" "$_BASE" "$_BASE" "$title" "$page"
+  ' "$_BASE" "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
   cat
   printf '] ]'
   } |"$_EXEC/cgilite/html-sh.sed" -u
@@ -77,6 +84,7 @@ page_home() {
   fi
 }
 page_newdate() { . "$_EXEC"/newdate.sh; }
+page_poll() { . "$_EXEC/poll.sh"; }
 
 case ${PATH_INFO} in
   /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';;
@@ -85,7 +93,7 @@ case ${PATH_INFO} in
   /) page_home;;
   /*/newdate) page_newdate;;
   /*/newoptions);;
-  *);;
+  /[0-9a-zA-Z:=]???????????????) page_poll;;
 esac
 
 exit 0