diff options
author | onefang | 2020-03-17 12:42:57 +1000 |
---|---|---|
committer | onefang | 2020-03-17 12:42:57 +1000 |
commit | 49300630d3d3867b659c5d84cba91f34ac919f81 (patch) | |
tree | fcbef89225de1827676d58690c595ff11d8681aa | |
parent | Add a ToS block. (diff) | |
download | opensim-SC-49300630d3d3867b659c5d84cba91f34ac919f81.zip opensim-SC-49300630d3d3867b659c5d84cba91f34ac919f81.tar.gz opensim-SC-49300630d3d3867b659c5d84cba91f34ac919f81.tar.bz2 opensim-SC-49300630d3d3867b659c5d84cba91f34ac919f81.tar.xz |
Add an About me textarea.
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 31 |
1 files changed, 31 insertions, 0 deletions
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) | |||
2114 | " a:active {color: red;}\n" | 2114 | " a:active {color: red;}\n" |
2115 | " button:hover {color: blue;}\n" | 2115 | " button:hover {color: blue;}\n" |
2116 | " button:active {color: red;}\n" | 2116 | " button:active {color: red;}\n" |
2117 | " textarea {vertical-align: top;}\n" // What idiot thought aligning the label with the bottom of textareas was a good default? | ||
2117 | " </style>\n" | 2118 | " </style>\n" |
2118 | " </head>\n" | 2119 | " </head>\n" |
2119 | " <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'>\n" | 2120 | " <body bgcolor='black' text='white' link='aqua' vlink='fuchsia' alink='red'>\n" |
@@ -2226,6 +2227,30 @@ static void HTMLcheckBox(qgrow_t *reply, char *name, char *title, boolean checke | |||
2226 | reply->addstrf(reply, " <p><input type=\"checkbox\" name=\"%s\"><label for=\"%s\">%s</label></p>\n", name, name, title); | 2227 | reply->addstrf(reply, " <p><input type=\"checkbox\" name=\"%s\"><label for=\"%s\">%s</label></p>\n", name, name, title); |
2227 | } | 2228 | } |
2228 | 2229 | ||
2230 | 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) | ||
2231 | { | ||
2232 | reply->addstrf(reply, " <p><label for=\"%s\">%s</label> : <textarea name=\"%s\"", name, title, name); | ||
2233 | if (0 < rows) | ||
2234 | reply->addstrf(reply, " rows=\"%d\"", rows); | ||
2235 | if (0 < cols) | ||
2236 | reply->addstrf(reply, " cols=\"%d\"", cols); | ||
2237 | if (0 < min) | ||
2238 | reply->addstrf(reply, " minlength=\"%d\"", min); | ||
2239 | if (0 < max) | ||
2240 | reply->addstrf(reply, " maxlength=\"%d\"", max); | ||
2241 | if (required) | ||
2242 | reply->addstr(reply, " required"); | ||
2243 | if ("" != holder) | ||
2244 | reply->addstrf(reply, " placeholder=\"%s\"", holder); | ||
2245 | if ("" != comp) | ||
2246 | reply->addstrf(reply, " autocomplete=\"%s\"", comp); | ||
2247 | if ("" != spell) | ||
2248 | reply->addstrf(reply, " spellcheck=\"%s\"", spell); | ||
2249 | if ("" != wrap) | ||
2250 | reply->addstrf(reply, " wrap=\"%s\"", wrap); | ||
2251 | reply->addstr(reply, "></textarea></p>\n"); | ||
2252 | } | ||
2253 | |||
2229 | static void HTMLtext(qgrow_t *reply, char *type, char *title, char *name, char *val, int size, int max, boolean required) | 2254 | static void HTMLtext(qgrow_t *reply, char *type, char *title, char *name, char *val, int size, int max, boolean required) |
2230 | { | 2255 | { |
2231 | reply->addstrf(reply, " <p><label for=\"%s\">%s</label> : <input type=\"%s\" name=\"%s\"", name, title, type, name); | 2256 | reply->addstrf(reply, " <p><label for=\"%s\">%s</label> : <input type=\"%s\" name=\"%s\"", name, title, type, name); |
@@ -2836,6 +2861,7 @@ static void createUser(reqData *Rd) | |||
2836 | " ['DoB']='%s-%s',\n" | 2861 | " ['DoB']='%s-%s',\n" |
2837 | " ['agree']='%s',\n" | 2862 | " ['agree']='%s',\n" |
2838 | " ['adult']='%s',\n" | 2863 | " ['adult']='%s',\n" |
2864 | " ['aboutMe']='%s',\n" | ||
2839 | " ['vouched']='%s',\n" | 2865 | " ['vouched']='%s',\n" |
2840 | "}\n" | 2866 | "}\n" |
2841 | "return user\n", | 2867 | "return user\n", |
@@ -2853,6 +2879,7 @@ static void createUser(reqData *Rd) | |||
2853 | getStrH(Rd->body, "month"), | 2879 | getStrH(Rd->body, "month"), |
2854 | getStrH(Rd->body, "agree"), | 2880 | getStrH(Rd->body, "agree"), |
2855 | getStrH(Rd->body, "adult"), | 2881 | getStrH(Rd->body, "adult"), |
2882 | getStrH(Rd->body, "aboutMe"), | ||
2856 | "off" | 2883 | "off" |
2857 | ); | 2884 | ); |
2858 | 2885 | ||
@@ -4043,6 +4070,10 @@ void accountCreationPage(reqData *Rd, char *message) | |||
4043 | HTMLcheckBox(Rd->reply, "agree", "I accept the Terms of Service.", !strcmp("on", getStrH(Rd->stuff, "agree"))); | 4070 | HTMLcheckBox(Rd->reply, "agree", "I accept the Terms of Service.", !strcmp("on", getStrH(Rd->stuff, "agree"))); |
4044 | Rd->reply->addstrf(Rd->reply, "<h2>Terms of Service</h2><pre>%s</pre>\n", getStrH(Rd->configs, "ToS")); | 4071 | Rd->reply->addstrf(Rd->reply, "<h2>Terms of Service</h2><pre>%s</pre>\n", getStrH(Rd->configs, "ToS")); |
4045 | // 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. | 4072 | // 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. |
4073 | // 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 | ||
4074 | // TODO - check against the limit for in world profiles, coz this will become that. | ||
4075 | // TODO - validate aboutMe, it should not be empty, and should not be longer than 64 kilobytes. | ||
4076 | HTMLtextArea(Rd->reply, "aboutMe", "About me", 7, 50, 4, 16384, "Describe yourself here.", "off", "true", "soft", FALSE); | ||
4046 | Rd->reply->addstrf(Rd->reply, "<input type='submit' disabled style='display: none' aria-hidden='true' />\n"); // Stop Enter key on text fields triggering the first submit button. | 4077 | Rd->reply->addstrf(Rd->reply, "<input type='submit' disabled style='display: none' aria-hidden='true' />\n"); // Stop Enter key on text fields triggering the first submit button. |
4047 | HTMLbutton(Rd->reply, "confirm"); | 4078 | HTMLbutton(Rd->reply, "confirm"); |
4048 | HTMLbutton(Rd->reply, "cancel"); | 4079 | HTMLbutton(Rd->reply, "cancel"); |