forked from lda/telodendria
Apply #54
This commit is contained in:
parent
f4838f8211
commit
d899a836b6
4 changed files with 27 additions and 9 deletions
1
src/Db.c
1
src/Db.c
|
@ -832,6 +832,7 @@ DbList(Db * db, size_t nArgs,...)
|
|||
while ((file = readdir(files)))
|
||||
{
|
||||
size_t namlen = strlen(file->d_name);
|
||||
|
||||
if (namlen > 5)
|
||||
{
|
||||
int nameOffset = namlen - 5;
|
||||
|
|
|
@ -46,9 +46,8 @@ HtmlBegin(FILE * stream, char *title)
|
|||
"<title>%s | Telodendria</title>"
|
||||
,title
|
||||
);
|
||||
|
||||
HtmlBeginStyle(stream);
|
||||
fprintf(stream,
|
||||
"<style>"
|
||||
":root {"
|
||||
" color-scheme: dark;"
|
||||
" --accent: #7b8333;"
|
||||
|
@ -95,8 +94,8 @@ HtmlBegin(FILE * stream, char *title)
|
|||
" margin-left: auto;"
|
||||
" margin-right: auto;"
|
||||
"}"
|
||||
"</style>"
|
||||
);
|
||||
HtmlEndStyle(stream);
|
||||
|
||||
fprintf(stream,
|
||||
"</head>"
|
||||
|
|
|
@ -38,22 +38,26 @@ StaticLogin(FILE * stream)
|
|||
"<input type=\"password\" id=\"password\">"
|
||||
"<br>"
|
||||
"<input type=\"submit\" value=\"Log In\">"
|
||||
"</form>"
|
||||
"<style>"
|
||||
"</form>");
|
||||
|
||||
HtmlBeginStyle(stream);
|
||||
fprintf(stream,
|
||||
"#error-msg {"
|
||||
" display: none;"
|
||||
" color: red;"
|
||||
" text-align: center;"
|
||||
" font-weight: bold;"
|
||||
" font-size: larger;"
|
||||
"}"
|
||||
"</style>"
|
||||
"}");
|
||||
HtmlEndStyle(stream);
|
||||
|
||||
fprintf(stream,
|
||||
"<p id=\"error-msg\"></p>"
|
||||
"</div>"
|
||||
);
|
||||
|
||||
HtmlBeginJs(stream);
|
||||
fprintf(stream,
|
||||
"<script>"
|
||||
"function findGetParameter(parameterName) {"
|
||||
" var result = null;"
|
||||
" var tmp = [];"
|
||||
|
@ -136,8 +140,8 @@ StaticLogin(FILE * stream)
|
|||
" sendRequest(request);"
|
||||
" });"
|
||||
"});"
|
||||
"</script>"
|
||||
);
|
||||
HtmlEndJs(stream);
|
||||
|
||||
HtmlEnd(stream);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,20 @@
|
|||
|
||||
#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
|
||||
HtmlBegin(FILE *, char *);
|
||||
|
||||
|
|
Loading…
Reference in a new issue