commit a5ec96a
default
·
2024-05-30 14:12:08 +0000 UTC
parent a2ee9d8
Added an "Alt..." details just below attachments with them. The alt text is still also generated as 'alt' and 'name' attributes, but this is more usable from phones and tablets.
2 files changed,
+16,
-1
M
html.c
+1,
-1
1@@ -239,7 +239,7 @@ xs_list *get_attachments(const xs_dict *msg)
2 if (xs_is_null(name))
3 name = xs_dict_get(msg, "name");
4 if (xs_is_null(name))
5- name = L("No description");
6+ name = "";
7
8 xs *d = xs_dict_new();
9 d = xs_dict_append(d, "type", type);
M
html.c
+15,
-0
1@@ -1891,6 +1891,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2 xs_html_tag("a",
3 xs_html_attr("href", href),
4 xs_html_text(href))));
5+
6+ /* do not generate an Alt... */
7+ name = NULL;
8 }
9 else {
10 xs_html_add(content_attachments,
11@@ -1900,6 +1903,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
12 xs_html_text(L("Attachment")),
13 xs_html_text(": "),
14 xs_html_text(href))));
15+
16+ /* do not generate an Alt... */
17+ name = NULL;
18+ }
19+
20+ if (name != NULL && *name) {
21+ xs_html_add(content_attachments,
22+ xs_html_tag("p",
23+ xs_html_tag("details",
24+ xs_html_tag("summary",
25+ xs_html_text(L("Alt..."))),
26+ xs_html_text(name))));
27 }
28 }
29 }