Add avatar and profile name right text format for screen readers

This commit is contained in:
idotj 2021-05-24 18:17:26 +02:00
parent b10e37aff3
commit 18b79913e9

View File

@ -89,19 +89,19 @@ MastodonApi.prototype.getToots = function () {
// Boosted avatar // Boosted avatar
avatar = avatar =
'<a href="' + status_.reblog.account.url + '" class="mt-avatar mt-avatar-boosted" style="background-image:url(' + status_.reblog.account.avatar + ');" rel="noopener noreferrer" tabindex="-1" target="_blank">' '<a href="' + status_.reblog.account.url + '" class="mt-avatar mt-avatar-boosted" style="background-image:url(' + status_.reblog.account.avatar + ');" rel="noopener noreferrer" target="_blank">'
+ '<div class="mt-avatar mt-avatar-booster" style="background-image:url(' + status_.account.avatar + ');">' + '<div class="mt-avatar mt-avatar-booster" style="background-image:url(' + status_.account.avatar + ');">'
+ '</div>' + '</div>'
+ '<span class="visually-hidden">' + '<span class="visually-hidden">'
+ status_.account.username + status_.account.username + ' avatar'
+ '</span>' + '</span>'
+ '</a>'; + '</a>';
// User name and url // User name and url
user = user =
'<div class="mt-user">' '<div class="mt-user">'
+ '<a href="' + status_.reblog.account.url + '" rel="noopener noreferrer" tabindex="-1" target="_blank">' + '<a href="' + status_.reblog.account.url + '" rel="noopener noreferrer" target="_blank">'
+ status_.reblog.account.username + status_.reblog.account.username + '<span class="visually-hidden"> post</span>'
+ '</a>' + '</a>'
+ '</div>'; + '</div>';
@ -114,17 +114,17 @@ MastodonApi.prototype.getToots = function () {
// Avatar // Avatar
avatar = avatar =
'<a href="' + status_.account.url + '" class="mt-avatar" style="background-image:url(' + status_.account.avatar + ');" rel="noopener noreferrer" tabindex="-1" target="_blank">' '<a href="' + status_.account.url + '" class="mt-avatar" style="background-image:url(' + status_.account.avatar + ');" rel="noopener noreferrer" target="_blank">'
+ '<span class="visually-hidden">' + '<span class="visually-hidden">'
+ status_.account.username + status_.account.username + ' avatar'
+ '</span>' + '</span>'
+ '</a>'; + '</a>';
// User name and url // User name and url
user = user =
'<div class="mt-user">' '<div class="mt-user">'
+ '<a href="' + status_.account.url + '" rel="noopener noreferrer" tabindex="-1" target="_blank">' + '<a href="' + status_.account.url + '" rel="noopener noreferrer" target="_blank">'
+ status_.account.username + status_.account.username + '<span class="visually-hidden"> post</span>'
+ '</a>' + '</a>'
+ '</div>'; + '</div>';