diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 17 |
1 files changed, 13 insertions, 4 deletions
| @@ -195,6 +195,7 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 195 | "rows=\"8\" wrap=\"virtual\" required=\"required\"></textarea>\n" | 195 | "rows=\"8\" wrap=\"virtual\" required=\"required\"></textarea>\n" |
| 196 | "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n" | 196 | "<input type=\"hidden\" name=\"in_reply_to\" value=\"\">\n" |
| 197 | "<input type=\"submit\" class=\"button\" value=\"%s\">\n" | 197 | "<input type=\"submit\" class=\"button\" value=\"%s\">\n" |
| 198 | "<input type=\"text\" name=\"attach_url\"> Image URL<p>" | ||
| 198 | "</form><p>\n" | 199 | "</form><p>\n" |
| 199 | "</div>\n" | 200 | "</div>\n" |
| 200 | 201 | ||
| @@ -204,12 +205,12 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 204 | "<form method=\"post\" action=\"%s/admin/action\">\n" | 205 | "<form method=\"post\" action=\"%s/admin/action\">\n" |
| 205 | "<input type=\"text\" name=\"actor\" required=\"required\">\n" | 206 | "<input type=\"text\" name=\"actor\" required=\"required\">\n" |
| 206 | "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n" | 207 | "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n" |
| 207 | "</form></p>\n" | 208 | "</form><p>\n" |
| 208 | 209 | ||
| 209 | "<form method=\"post\" action=\"%s/admin/action\">\n" | 210 | "<form method=\"post\" action=\"%s/admin/action\">\n" |
| 210 | "<input type=\"text\" name=\"id\" required=\"required\">\n" | 211 | "<input type=\"text\" name=\"id\" required=\"required\">\n" |
| 211 | "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n" | 212 | "<input type=\"submit\" name=\"action\" value=\"%s\"> %s\n" |
| 212 | "</form></p>\n" | 213 | "</form><p>\n" |
| 213 | 214 | ||
| 214 | "<details><summary>%s</summary>\n" | 215 | "<details><summary>%s</summary>\n" |
| 215 | 216 | ||
| @@ -222,7 +223,7 @@ d_char *html_top_controls(snac *snac, d_char *s) | |||
| 222 | "<input type=\"text\" name=\"avatar\" value=\"%s\"></p>\n" | 223 | "<input type=\"text\" name=\"avatar\" value=\"%s\"></p>\n" |
| 223 | 224 | ||
| 224 | "<p>%s:<br>\n" | 225 | "<p>%s:<br>\n" |
| 225 | "<textarea name=\"bio\" cols=60 rows=4>%s</textarea></p>\n" | 226 | "<textarea name=\"bio\" cols=\"40\" rows=\"4\">%s</textarea></p>\n" |
| 226 | 227 | ||
| 227 | "<p>%s:<br>\n" | 228 | "<p>%s:<br>\n" |
| 228 | "<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n" | 229 | "<input type=\"password\" name=\"passwd1\" value=\"\"></p>\n" |
| @@ -854,16 +855,24 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 854 | 855 | ||
| 855 | p_vars = xs_dict_get(req, "p_vars"); | 856 | p_vars = xs_dict_get(req, "p_vars"); |
| 856 | 857 | ||
| 858 | #if 0 | ||
| 859 | { | ||
| 860 | xs *j1 = xs_json_dumps_pp(p_vars, 4); | ||
| 861 | printf("%s\n", j1); | ||
| 862 | } | ||
| 863 | #endif | ||
| 864 | |||
| 857 | if (p_path && strcmp(p_path, "admin/note") == 0) { | 865 | if (p_path && strcmp(p_path, "admin/note") == 0) { |
| 858 | /* post note */ | 866 | /* post note */ |
| 859 | char *content = xs_dict_get(p_vars, "content"); | 867 | char *content = xs_dict_get(p_vars, "content"); |
| 860 | char *in_reply_to = xs_dict_get(p_vars, "in_reply_to"); | 868 | char *in_reply_to = xs_dict_get(p_vars, "in_reply_to"); |
| 869 | char *attach_url = xs_dict_get(p_vars, "attach_url"); | ||
| 861 | 870 | ||
| 862 | if (content != NULL) { | 871 | if (content != NULL) { |
| 863 | xs *msg = NULL; | 872 | xs *msg = NULL; |
| 864 | xs *c_msg = NULL; | 873 | xs *c_msg = NULL; |
| 865 | 874 | ||
| 866 | msg = msg_note(&snac, content, NULL, in_reply_to); | 875 | msg = msg_note(&snac, content, NULL, in_reply_to, attach_url); |
| 867 | 876 | ||
| 868 | c_msg = msg_create(&snac, msg); | 877 | c_msg = msg_create(&snac, msg); |
| 869 | 878 | ||