mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
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.
This commit is contained in:
parent
a2ee9d802a
commit
a5ec96a6da
2 changed files with 16 additions and 1 deletions
|
@ -239,7 +239,7 @@ xs_list *get_attachments(const xs_dict *msg)
|
||||||
if (xs_is_null(name))
|
if (xs_is_null(name))
|
||||||
name = xs_dict_get(msg, "name");
|
name = xs_dict_get(msg, "name");
|
||||||
if (xs_is_null(name))
|
if (xs_is_null(name))
|
||||||
name = L("No description");
|
name = "";
|
||||||
|
|
||||||
xs *d = xs_dict_new();
|
xs *d = xs_dict_new();
|
||||||
d = xs_dict_append(d, "type", type);
|
d = xs_dict_append(d, "type", type);
|
||||||
|
|
15
html.c
15
html.c
|
@ -1891,6 +1891,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
xs_html_tag("a",
|
xs_html_tag("a",
|
||||||
xs_html_attr("href", href),
|
xs_html_attr("href", href),
|
||||||
xs_html_text(href))));
|
xs_html_text(href))));
|
||||||
|
|
||||||
|
/* do not generate an Alt... */
|
||||||
|
name = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xs_html_add(content_attachments,
|
xs_html_add(content_attachments,
|
||||||
|
@ -1900,6 +1903,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
xs_html_text(L("Attachment")),
|
xs_html_text(L("Attachment")),
|
||||||
xs_html_text(": "),
|
xs_html_text(": "),
|
||||||
xs_html_text(href))));
|
xs_html_text(href))));
|
||||||
|
|
||||||
|
/* do not generate an Alt... */
|
||||||
|
name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name != NULL && *name) {
|
||||||
|
xs_html_add(content_attachments,
|
||||||
|
xs_html_tag("p",
|
||||||
|
xs_html_tag("details",
|
||||||
|
xs_html_tag("summary",
|
||||||
|
xs_html_text(L("Alt..."))),
|
||||||
|
xs_html_text(name))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue