This commit is contained in:
Jordan Bancino 2023-03-02 22:06:33 +00:00
parent f4838f8211
commit d899a836b6
4 changed files with 27 additions and 9 deletions

View file

@ -832,6 +832,7 @@ DbList(Db * db, size_t nArgs,...)
while ((file = readdir(files))) while ((file = readdir(files)))
{ {
size_t namlen = strlen(file->d_name); size_t namlen = strlen(file->d_name);
if (namlen > 5) if (namlen > 5)
{ {
int nameOffset = namlen - 5; int nameOffset = namlen - 5;

View file

@ -46,9 +46,8 @@ HtmlBegin(FILE * stream, char *title)
"<title>%s | Telodendria</title>" "<title>%s | Telodendria</title>"
,title ,title
); );
HtmlBeginStyle(stream);
fprintf(stream, fprintf(stream,
"<style>"
":root {" ":root {"
" color-scheme: dark;" " color-scheme: dark;"
" --accent: #7b8333;" " --accent: #7b8333;"
@ -95,8 +94,8 @@ HtmlBegin(FILE * stream, char *title)
" margin-left: auto;" " margin-left: auto;"
" margin-right: auto;" " margin-right: auto;"
"}" "}"
"</style>"
); );
HtmlEndStyle(stream);
fprintf(stream, fprintf(stream,
"</head>" "</head>"

View file

@ -38,22 +38,26 @@ StaticLogin(FILE * stream)
"<input type=\"password\" id=\"password\">" "<input type=\"password\" id=\"password\">"
"<br>" "<br>"
"<input type=\"submit\" value=\"Log In\">" "<input type=\"submit\" value=\"Log In\">"
"</form>" "</form>");
"<style>"
HtmlBeginStyle(stream);
fprintf(stream,
"#error-msg {" "#error-msg {"
" display: none;" " display: none;"
" color: red;" " color: red;"
" text-align: center;" " text-align: center;"
" font-weight: bold;" " font-weight: bold;"
" font-size: larger;" " font-size: larger;"
"}" "}");
"</style>" HtmlEndStyle(stream);
fprintf(stream,
"<p id=\"error-msg\"></p>" "<p id=\"error-msg\"></p>"
"</div>" "</div>"
); );
HtmlBeginJs(stream);
fprintf(stream, fprintf(stream,
"<script>"
"function findGetParameter(parameterName) {" "function findGetParameter(parameterName) {"
" var result = null;" " var result = null;"
" var tmp = [];" " var tmp = [];"
@ -136,8 +140,8 @@ StaticLogin(FILE * stream)
" sendRequest(request);" " sendRequest(request);"
" });" " });"
"});" "});"
"</script>"
); );
HtmlEndJs(stream);
HtmlEnd(stream); HtmlEnd(stream);
} }

View file

@ -26,6 +26,20 @@
#include <stdio.h> #include <stdio.h>
#define HtmlBeginJs(stream) fprintf(stream, \
"<script>" \
"// @license magnet:?xt=" \
"urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt " \
"Expat\n")
#define HtmlEndJs(stream) fprintf(stream, \
"// @license-end\n" \
"</script>")
#define HtmlBeginStyle(stream) fprintf(stream, "<style>")
#define HtmlEndStyle(stream) fprintf(stream, "</style>")
extern void extern void
HtmlBegin(FILE *, char *); HtmlBegin(FILE *, char *);