From 49300630d3d3867b659c5d84cba91f34ac919f81 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 17 Mar 2020 12:42:57 +1000 Subject: Add an About me textarea. --- src/sledjchisl/sledjchisl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index a895c51..9808245 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -2114,6 +2114,7 @@ static void HTMLheader(qgrow_t *reply, char *title) " a:active {color: red;}\n" " button:hover {color: blue;}\n" " button:active {color: red;}\n" + " textarea {vertical-align: top;}\n" // What idiot thought aligning the label with the bottom of textareas was a good default? " \n" " \n" " \n" @@ -2226,6 +2227,30 @@ static void HTMLcheckBox(qgrow_t *reply, char *name, char *title, boolean checke reply->addstrf(reply, "

\n", name, name, title); } +static void HTMLtextArea(qgrow_t *reply, char *name, char *title, int rows, int cols, int min, int max, char *holder, char *comp, char *spell, char *wrap, boolean required) +{ + reply->addstrf(reply, "

:

\n"); +} + static void HTMLtext(qgrow_t *reply, char *type, char *title, char *name, char *val, int size, int max, boolean required) { reply->addstrf(reply, "

: body, "month"), getStrH(Rd->body, "agree"), getStrH(Rd->body, "adult"), + getStrH(Rd->body, "aboutMe"), "off" ); @@ -4043,6 +4070,10 @@ void accountCreationPage(reqData *Rd, char *message) HTMLcheckBox(Rd->reply, "agree", "I accept the Terms of Service.", !strcmp("on", getStrH(Rd->stuff, "agree"))); Rd->reply->addstrf(Rd->reply, "

Terms of Service

%s
\n", getStrH(Rd->configs, "ToS")); // For maxlength - the MySQL database field is type text, which has a max length of 64 Kilobytes byets, but characters might take up 1 - 4 bytes, and maxlength is in characters. + // For rows and cols, seems a bit broken, I ask for 5/42, I get 6,36. In world it seems to be 7,46 +// TODO - check against the limit for in world profiles, coz this will become that. +// TODO - validate aboutMe, it should not be empty, and should not be longer than 64 kilobytes. + HTMLtextArea(Rd->reply, "aboutMe", "About me", 7, 50, 4, 16384, "Describe yourself here.", "off", "true", "soft", FALSE); Rd->reply->addstrf(Rd->reply, "\n"); // Stop Enter key on text fields triggering the first submit button. HTMLbutton(Rd->reply, "confirm"); HTMLbutton(Rd->reply, "cancel"); -- cgit v1.1