diff options
| author | 2024-05-30 16:12:08 +0200 | |
|---|---|---|
| committer | 2024-05-30 16:12:08 +0200 | |
| commit | a5ec96a6da5437cad88487205d62a95f27614bd7 (patch) | |
| tree | 2df61457b69c26adafed87aca7f1951ca847b513 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-a5ec96a6da5437cad88487205d62a95f27614bd7.tar.gz snac2-a5ec96a6da5437cad88487205d62a95f27614bd7.tar.xz snac2-a5ec96a6da5437cad88487205d62a95f27614bd7.zip | |
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.
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | html.c | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c index 4247078..212dd2f 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -239,7 +239,7 @@ xs_list *get_attachments(const xs_dict *msg) | |||
| 239 | if (xs_is_null(name)) | 239 | if (xs_is_null(name)) |
| 240 | name = xs_dict_get(msg, "name"); | 240 | name = xs_dict_get(msg, "name"); |
| 241 | if (xs_is_null(name)) | 241 | if (xs_is_null(name)) |
| 242 | name = L("No description"); | 242 | name = ""; |
| 243 | 243 | ||
| 244 | xs *d = xs_dict_new(); | 244 | xs *d = xs_dict_new(); |
| 245 | d = xs_dict_append(d, "type", type); | 245 | d = xs_dict_append(d, "type", type); |
| @@ -1891,6 +1891,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1891 | xs_html_tag("a", | 1891 | xs_html_tag("a", |
| 1892 | xs_html_attr("href", href), | 1892 | xs_html_attr("href", href), |
| 1893 | xs_html_text(href)))); | 1893 | xs_html_text(href)))); |
| 1894 | |||
| 1895 | /* do not generate an Alt... */ | ||
| 1896 | name = NULL; | ||
| 1894 | } | 1897 | } |
| 1895 | else { | 1898 | else { |
| 1896 | xs_html_add(content_attachments, | 1899 | xs_html_add(content_attachments, |
| @@ -1900,6 +1903,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 1900 | xs_html_text(L("Attachment")), | 1903 | xs_html_text(L("Attachment")), |
| 1901 | xs_html_text(": "), | 1904 | xs_html_text(": "), |
| 1902 | xs_html_text(href)))); | 1905 | xs_html_text(href)))); |
| 1906 | |||
| 1907 | /* do not generate an Alt... */ | ||
| 1908 | name = NULL; | ||
| 1909 | } | ||
| 1910 | |||
| 1911 | if (name != NULL && *name) { | ||
| 1912 | xs_html_add(content_attachments, | ||
| 1913 | xs_html_tag("p", | ||
| 1914 | xs_html_tag("details", | ||
| 1915 | xs_html_tag("summary", | ||
| 1916 | xs_html_text(L("Alt..."))), | ||
| 1917 | xs_html_text(name)))); | ||
| 1903 | } | 1918 | } |
| 1904 | } | 1919 | } |
| 1905 | } | 1920 | } |