X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=index.cgi;h=ef9c74778fab4626587dbb15727d35bec0420ec8;hb=84a902c72862437a0e5b9f9ce539a9c72b4ae11d;hp=170645f4c3d1d733f1b5173d710e1c5eedcd3ac5;hpb=ed7c5fd1f5d1232649fe3e206a8d88b89ee406dd;p=lobster diff --git a/index.cgi b/index.cgi index 170645f..ef9c747 100755 --- a/index.cgi +++ b/index.cgi @@ -18,12 +18,15 @@ ACTION="$(GET a)" message="$(COOKIE message)" [ "$message" ] && SET_COOKIE 0 message='' +checked(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'checked="checked"' 2>/dev/null; } +selected(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'selected="selected"' 2>/dev/null; } + yield_page() { local class="$1" style="$2" printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' { printf ' [html [head - [title Confetti] + [title Lobster] [meta name="viewport" content="width=device-width"] [link rel="stylesheet" type="text/css" href="/style.css"] ' @@ -40,8 +43,8 @@ yield_page() { | "${_EXEC}/cgilite/html-sh.sed" } -if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/main.cgi" ]; then - . "${_EXEC}/${_PATH}/main.cgi" +if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then + . "${_EXEC}/${_PATH}/index.cgi" elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then . "${_EXEC}/${_PATH}" elif [ ! -x "${_EXEC}/${_PATH}" -a -r "${_EXEC}/${_PATH}" ]; then