diff options
| author | grunfink <grunfink@comam.es> | 2026-09-01 16:19:37 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2026-09-01 16:19:37 +0200 |
| commit | 7a62d550de0fe0f76fe5c2c789fe331ea4fe5046 (patch) | |
| tree | 9af08d42ed1c1fd3c946b37e85d5245c65cef51a | |
| parent | 32953e4d2d23e0ded2a8cbd96d1b73f6d91b8953 (diff) | |
Added web UI for setting the 'text_browser_uas' user config field.
| -rw-r--r-- | html.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1624,6 +1624,7 @@ xs_html *html_top_controls(snac *user, int tb_friendly) const char *webhook = xs_dict_get_def(user->config, "notify_webhook", ""); const char *post_langs = xs_dict_get_def(user->config, "post_langs", ""); const char *excluded_langs = xs_dict_get_def(user->config, "excluded_langs", ""); + const char *text_browser_uas = xs_dict_get_def(user->config, "text_browser_uas", ""); xs *metadata = NULL; const xs_dict *md = xs_dict_get(user->config, "metadata"); @@ -1871,6 +1872,16 @@ xs_html *html_top_controls(snac *user, int tb_friendly) xs_html_attr("placeholder", L("en fr es de_AT")))), xs_html_tag("p", + xs_html_text(L("Show a simpler web UI for browsers with these user agents (one per line):")), + xs_html_sctag("br", NULL), + xs_html_tag("textarea", + xs_html_attr("name", "text_browser_uas"), + xs_html_attr("cols", "40"), + xs_html_attr("rows", "4"), + xs_html_attr("placeholder", "Links\nLynx\nNetSurf"), + xs_html_text(text_browser_uas))), + + xs_html_tag("p", xs_html_text(L("New password:")), xs_html_sctag("br", NULL), xs_html_sctag("input", @@ -4698,7 +4709,7 @@ int text_browser_friendly(const snac *user, const char *user_agent) xs *v2 = xs_strip_i(xs_dup(v)); - /* a * means "all browsers", then yes */ + /* an asterisk alone means "all browsers", so yes */ if (strcmp(v2, "*") == 0) return 1; @@ -6119,6 +6130,8 @@ int html_post_handler(const xs_dict *req, const char *q_path, if ((v = xs_dict_get(p_vars, "metadata")) != NULL) snac.config = xs_dict_set(snac.config, "metadata", v); + snac.config = xs_dict_set(snac.config, "text_browser_uas", xs_dict_get_def(p_vars, "text_browser_uas", "")); + /* uploads */ const char *uploads[] = { "avatar", "header", NULL }; int n; |