mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
e58511d0e4
19
content.py
19
content.py
|
@ -616,8 +616,8 @@ def add_web_links(content: str) -> str:
|
|||
# the word contains a prefix
|
||||
if wrd.endswith('.') or wrd.endswith(';'):
|
||||
wrd = wrd[:-1]
|
||||
markup = '<a href="' + wrd + \
|
||||
'" rel="nofollow noopener noreferrer" target="_blank">'
|
||||
markup = '<a href="' + wrd + '" tabindex="10" ' + \
|
||||
'rel="nofollow noopener noreferrer" target="_blank">'
|
||||
for prefix in prefixes:
|
||||
if wrd.startswith(prefix):
|
||||
markup += '<span class="invisible">' + prefix + '</span>'
|
||||
|
@ -678,7 +678,7 @@ def _add_hash_tags(word_str: str, http_prefix: str, domain: str,
|
|||
'type': 'Hashtag'
|
||||
}
|
||||
replace_hashtags[word_str] = "<a href=\"" + hashtag_url + \
|
||||
"\" class=\"mention hashtag\" rel=\"tag\">#<span>" + \
|
||||
"\" class=\"mention hashtag\" rel=\"tag\" tabindex=\"10\">#<span>" + \
|
||||
hashtag + "</span></a>"
|
||||
return True
|
||||
|
||||
|
@ -768,7 +768,7 @@ def _add_mention(word_str: str, http_prefix: str, following: str,
|
|||
replace_mentions[word_str] = \
|
||||
"<span class=\"h-card\"><a href=\"" + http_prefix + \
|
||||
"://" + replace_domain + "/@" + possible_nickname + \
|
||||
"\" class=\"u-url mention\">@<span>" + \
|
||||
"\" tabindex=\"10\" class=\"u-url mention\">@<span>" + \
|
||||
possible_nickname + "</span></a></span>"
|
||||
return True
|
||||
# try replacing petnames with mentions
|
||||
|
@ -795,7 +795,8 @@ def _add_mention(word_str: str, http_prefix: str, following: str,
|
|||
replace_mentions[word_str] = \
|
||||
"<span class=\"h-card\"><a href=\"" + http_prefix + \
|
||||
"://" + replace_domain + "/@" + replace_nickname + \
|
||||
"\" class=\"u-url mention\">@<span>" + \
|
||||
"\" tabindex=\"10\" " + \
|
||||
"class=\"u-url mention\">@<span>" + \
|
||||
replace_nickname + "</span></a></span>"
|
||||
return True
|
||||
follow_ctr += 1
|
||||
|
@ -827,8 +828,8 @@ def _add_mention(word_str: str, http_prefix: str, following: str,
|
|||
replace_mentions[word_str] = \
|
||||
"<span class=\"h-card\"><a href=\"" + http_prefix + \
|
||||
"://" + possible_domain + "/@" + possible_nickname + \
|
||||
"\" class=\"u-url mention\">@<span>" + possible_nickname + \
|
||||
"</span></a></span>"
|
||||
"\" tabindex=\"10\" class=\"u-url mention\">@<span>" + \
|
||||
possible_nickname + "</span></a></span>"
|
||||
return True
|
||||
# @nick@domain
|
||||
if not (possible_domain == 'localhost' or '.' in possible_domain):
|
||||
|
@ -845,8 +846,8 @@ def _add_mention(word_str: str, http_prefix: str, following: str,
|
|||
replace_mentions[word_str] = \
|
||||
"<span class=\"h-card\"><a href=\"" + http_prefix + \
|
||||
"://" + possible_domain + "/@" + possible_nickname + \
|
||||
"\" class=\"u-url mention\">@<span>" + possible_nickname + \
|
||||
"</span></a></span>"
|
||||
"\" tabindex=\"10\" class=\"u-url mention\">@<span>" + \
|
||||
possible_nickname + "</span></a></span>"
|
||||
return True
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
|
@ -877,7 +877,7 @@ def _dav_store_event(base_dir: str, nickname: str, domain: str,
|
|||
next_str = post_id + "/replies?only_other_accounts=true&page=true"
|
||||
content = \
|
||||
'<p><span class=\"h-card\"><a href=\"' + actor2 + \
|
||||
'\" class=\"u-url mention\">@<span>' + nickname + \
|
||||
'\" class=\"u-url mention\" tabindex="10">@<span>' + nickname + \
|
||||
'</span></a></span>' + remove_html(description) + '</p>'
|
||||
event_json = {
|
||||
"@context": post_context,
|
||||
|
|
28
tests.py
28
tests.py
|
@ -3583,10 +3583,15 @@ def _test_web_links():
|
|||
example_text = \
|
||||
'This post has a web links https://somesite.net\n\nAnd some other text'
|
||||
linked_text = add_web_links(example_text)
|
||||
assert \
|
||||
'<a href="https://somesite.net" rel="nofollow noopener noreferrer"' + \
|
||||
expected_text = \
|
||||
'<a href="https://somesite.net" tabindex="10" ' + \
|
||||
'rel="nofollow noopener noreferrer"' + \
|
||||
' target="_blank"><span class="invisible">https://' + \
|
||||
'</span><span class="ellipsis">somesite.net</span></a' in linked_text
|
||||
'</span><span class="ellipsis">somesite.net</span></a'
|
||||
if expected_text not in linked_text:
|
||||
print(expected_text + '\n')
|
||||
print(linked_text)
|
||||
assert expected_text in linked_text
|
||||
|
||||
example_text = \
|
||||
'This post has a very long web link\n\nhttp://' + \
|
||||
|
@ -4613,11 +4618,15 @@ def _test_reply_to_public_post(base_dir: str) -> None:
|
|||
low_bandwidth, content_license_url,
|
||||
languages_understood)
|
||||
# print(str(reply))
|
||||
assert reply['object']['content'] == \
|
||||
expected_str = \
|
||||
'<p><span class=\"h-card\">' + \
|
||||
'<a href=\"https://rat.site/@ninjarodent\" ' + \
|
||||
'<a href=\"https://rat.site/@ninjarodent\" tabindex="10" ' + \
|
||||
'class=\"u-url mention\">@<span>ninjarodent</span>' + \
|
||||
'</a></span> This is a test.</p>'
|
||||
if reply['object']['content'] != expected_str:
|
||||
print(expected_str + '\n')
|
||||
print(reply['object']['content'])
|
||||
assert reply['object']['content'] == expected_str
|
||||
reply['object']['contentMap'][system_language] = reply['object']['content']
|
||||
assert reply['object']['tag'][0]['type'] == 'Mention'
|
||||
assert reply['object']['tag'][0]['name'] == '@ninjarodent@rat.site'
|
||||
|
@ -5541,17 +5550,22 @@ def _test_links_within_post(base_dir: str) -> None:
|
|||
low_bandwidth, content_license_url,
|
||||
languages_understood)
|
||||
|
||||
assert post_json_object['object']['content'] == \
|
||||
expected_str = \
|
||||
'<p>This is a test post with links.<br><br>' + \
|
||||
'<a href="ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/v4/" ' + \
|
||||
'tabindex="10" ' + \
|
||||
'rel="nofollow noopener noreferrer" target="_blank">' + \
|
||||
'<span class="invisible">ftp://</span>' + \
|
||||
'<span class="ellipsis">' + \
|
||||
'ftp.ncdc.noaa.gov/pub/data/ghcn/v4/</span>' + \
|
||||
'</a><br><br><a href="https://libreserver.org" ' + \
|
||||
'</a><br><br><a href="https://libreserver.org" tabindex="10" ' + \
|
||||
'rel="nofollow noopener noreferrer" target="_blank">' + \
|
||||
'<span class="invisible">https://</span>' + \
|
||||
'<span class="ellipsis">libreserver.org</span></a></p>'
|
||||
if post_json_object['object']['content'] != expected_str:
|
||||
print(expected_str + '\n')
|
||||
print(post_json_object['object']['content'])
|
||||
assert post_json_object['object']['content'] == expected_str
|
||||
assert post_json_object['object']['content'] == \
|
||||
post_json_object['object']['contentMap'][system_language]
|
||||
|
||||
|
|
|
@ -162,7 +162,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
# show the edit icon
|
||||
html_str += \
|
||||
' <a href="/users/' + nickname + '/editlinks" ' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + '">' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + '" tabindex="5" ' + \
|
||||
'class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Edit Links'] + ' | " title="' + \
|
||||
|
@ -172,7 +173,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
# show the theme designer icon
|
||||
html_str += \
|
||||
' <a href="/users/' + nickname + '/themedesigner" ' + \
|
||||
'accesskey="' + access_keys['menuThemeDesigner'] + '">' + \
|
||||
'accesskey="' + access_keys['menuThemeDesigner'] + \
|
||||
'" tabindex="5" class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Theme Designer'] + ' | " title="' + \
|
||||
|
@ -191,7 +193,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
else:
|
||||
rss_title = translate['RSS feed for this site']
|
||||
rss_icon_str = \
|
||||
' <a href="' + rss_url + '"><img class="' + edit_image_class + \
|
||||
' <a href="' + rss_url + '" tabindex="5" class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
rss_title + '" title="' + rss_title + \
|
||||
'" src="/icons/logorss.png" /></a>\n'
|
||||
|
|
|
@ -78,13 +78,14 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
'/users/' + nickname + '/newblog?nodropdown" ' + \
|
||||
'title="' + title_str + '" ' + \
|
||||
'accesskey="' + access_keys['menuNewPost'] + '">' + \
|
||||
'<button class="publishbtn">' + \
|
||||
'<button class="publishbtn" tabindex="4">' + \
|
||||
translate['Publish'] + '</button></a>\n'
|
||||
else:
|
||||
# if not logged in then replace the publish button with
|
||||
# a login button
|
||||
publish_button_str = \
|
||||
' <a href="/login"><button class="publishbtn">' + \
|
||||
' <a href="/login">' + \
|
||||
'<button class="publishbtn" tabindex="4">' + \
|
||||
translate['Login'] + '</button></a>\n'
|
||||
|
||||
# show publish button at the top if needed
|
||||
|
@ -134,7 +135,8 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
html_str += \
|
||||
' <a href="' + \
|
||||
'/users/' + nickname + '/editnewswire" ' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + '">' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + \
|
||||
'" tabindex="4" class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Edit newswire'] + ' | " title="' + \
|
||||
|
@ -145,7 +147,8 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
html_str += \
|
||||
' <a href="' + \
|
||||
'/users/' + nickname + '/editnewswire" ' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + '">' + \
|
||||
'accesskey="' + access_keys['menuEdit'] + \
|
||||
'" tabindex="4" class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Edit newswire'] + ' | " title="' + \
|
||||
|
@ -154,14 +157,15 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
|
||||
# show the RSS icons
|
||||
rss_icon_str = \
|
||||
' <a href="/categories.xml">' + \
|
||||
' <a href="/categories.xml" tabindex="4" ' + \
|
||||
'class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Hashtag Categories RSS Feed'] + ' | " title="' + \
|
||||
translate['Hashtag Categories RSS Feed'] + '" src="/' + \
|
||||
'icons/categoriesrss.png" /></a>\n'
|
||||
rss_icon_str += \
|
||||
' <a href="/newswire.xml">' + \
|
||||
' <a href="/newswire.xml" tabindex="4" class="imageAnchor">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
translate['Newswire RSS Feed'] + ' | " title="' + \
|
||||
|
@ -179,7 +183,8 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
|
|||
html_str += \
|
||||
' <a href="' + \
|
||||
'/users/' + nickname + '/newblog?nodropdown" ' + \
|
||||
'accesskey="' + access_keys['menuNewPost'] + '">' + \
|
||||
'accesskey="' + access_keys['menuNewPost'] + \
|
||||
'" class="imageAnchor" tabindex="4">' + \
|
||||
'<img class="' + edit_image_class + \
|
||||
'" loading="lazy" decoding="async" alt="' + \
|
||||
title_str + '" title="' + \
|
||||
|
@ -298,7 +303,8 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
|
|||
html_str += \
|
||||
' ' + date_shown + '<a href="/users/' + nickname + \
|
||||
'/newswireunvote=' + date_str_link + '" ' + \
|
||||
'title="' + translate['Remove Vote'] + '">'
|
||||
'title="' + translate['Remove Vote'] + \
|
||||
'" class="imageAnchor">'
|
||||
html_str += '<img loading="lazy" decoding="async" ' + \
|
||||
'class="voteicon" src="/' + \
|
||||
'alt="' + translate['Remove Vote'] + '" ' + \
|
||||
|
@ -327,7 +333,7 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
|
|||
html_str += ' ' + date_shown
|
||||
html_str += '<a href="/users/' + nickname + \
|
||||
'/newswirevote=' + date_str_link + '" ' + \
|
||||
'title="' + translate['Vote'] + '">'
|
||||
'title="' + translate['Vote'] + '" class="imageAnchor">'
|
||||
html_str += '<img class="voteicon" ' + \
|
||||
'alt="' + translate['Vote'] + '" ' + \
|
||||
'src="/icons/vote.png" /></a>'
|
||||
|
@ -393,7 +399,7 @@ def html_citations(base_dir: str, nickname: str, domain: str,
|
|||
html_str += \
|
||||
'<a href="/users/' + nickname + '/newblog" title="' + \
|
||||
translate['Go Back'] + '" alt="' + \
|
||||
translate['Go Back'] + '">\n'
|
||||
translate['Go Back'] + '" class="imageAnchor">\n'
|
||||
html_str += '<img loading="lazy" decoding="async" ' + \
|
||||
'class="timeline-banner" alt="" src="' + \
|
||||
'/users/' + nickname + '/' + banner_file + '" /></a>\n'
|
||||
|
@ -507,7 +513,8 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
|
|||
get_banner_file(base_dir, nickname, domain, theme)
|
||||
html_str += \
|
||||
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
|
||||
'accesskey="' + access_keys['menuTimeline'] + '">' + \
|
||||
'accesskey="' + access_keys['menuTimeline'] + '" ' + \
|
||||
'class="imageAnchor">' + \
|
||||
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
|
||||
'alt="' + translate['Timeline banner image'] + '" ' + \
|
||||
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n'
|
||||
|
|
|
@ -158,7 +158,7 @@ def html_front_screen(signing_priv_key_pem: str,
|
|||
' </colgroup>\n' + \
|
||||
' <tbody>\n' + \
|
||||
' <tr>\n' + \
|
||||
' <td valign="top" class="col-left">\n'
|
||||
' <td valign="top" class="col-left" tabindex="-1">\n'
|
||||
profile_header_str += \
|
||||
get_left_column_content(base_dir, 'news', domain_full,
|
||||
http_prefix, translate,
|
||||
|
@ -168,7 +168,7 @@ def html_front_screen(signing_priv_key_pem: str,
|
|||
shared_items_federated_domains)
|
||||
profile_header_str += \
|
||||
' </td>\n' + \
|
||||
' <td valign="top" class="col-center">\n'
|
||||
' <td valign="top" class="col-center" tabindex="-1">\n'
|
||||
|
||||
profile_str = profile_header_str
|
||||
|
||||
|
@ -199,7 +199,8 @@ def html_front_screen(signing_priv_key_pem: str,
|
|||
|
||||
# Footer which is only used for system accounts
|
||||
profile_footer_str = ' </td>\n'
|
||||
profile_footer_str += ' <td valign="top" class="col-right">\n'
|
||||
profile_footer_str += \
|
||||
' <td valign="top" class="col-right" tabindex="-1">\n'
|
||||
profile_footer_str += \
|
||||
get_right_column_content(base_dir, 'news', domain_full,
|
||||
http_prefix, translate,
|
||||
|
|
|
@ -52,11 +52,11 @@ def header_buttons_timeline(default_timeline: str,
|
|||
buttons for inbox, outbox, search, calendar, etc
|
||||
"""
|
||||
# start of the button header with inbox, outbox, etc
|
||||
tl_str = '<div class="containerHeader"><nav>\n'
|
||||
tl_str = '<div id="containerHeader" class="containerHeader"><nav>\n'
|
||||
# first button
|
||||
if default_timeline == 'tlmedia':
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/tlmedia" tabindex="-1" ' + \
|
||||
'<a href="' + users_path + '/tlmedia" tabindex="2" ' + \
|
||||
'accesskey="' + access_keys['menuMedia'] + '"'
|
||||
if box_name == 'tlmedia':
|
||||
tl_str += ' aria-current="location"'
|
||||
|
@ -67,17 +67,17 @@ def header_buttons_timeline(default_timeline: str,
|
|||
elif default_timeline == 'tlblogs':
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/tlblogs" tabindex="-1"'
|
||||
'/tlblogs" tabindex="2"'
|
||||
if box_name == 'tlblogs':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + \
|
||||
blogs_button + '"><span>' + translate['Blogs'] + \
|
||||
'</span></button></a>'
|
||||
blogs_button + '" accesskey="' + access_keys['menuBlogs'] + \
|
||||
'"><span>' + translate['Blogs'] + '</span></button></a>'
|
||||
elif default_timeline == 'tlfeatures':
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/tlfeatures" tabindex="-1"'
|
||||
'/tlfeatures" tabindex="2"'
|
||||
if box_name == 'tlfeatures':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
|
@ -87,12 +87,13 @@ def header_buttons_timeline(default_timeline: str,
|
|||
else:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/inbox" tabindex="-1"><button class="' + \
|
||||
'/inbox" tabindex="2"><button class="' + \
|
||||
inbox_button + '"'
|
||||
if box_name == 'inbox':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><span>' + translate['Inbox'] + '</span></button></a>'
|
||||
' accesskey="' + access_keys['menuInbox'] + '">' + \
|
||||
'<span>' + translate['Inbox'] + '</span></button></a>'
|
||||
|
||||
# if this is a news instance and we are viewing the news timeline
|
||||
features_header = False
|
||||
|
@ -101,23 +102,25 @@ def header_buttons_timeline(default_timeline: str,
|
|||
|
||||
if not features_header:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/dm" tabindex="-1"'
|
||||
'<a href="' + users_path + '/dm" tabindex="2"'
|
||||
if box_name == 'dm':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + dm_button + \
|
||||
'"><span>' + html_highlight_label(translate['DM'], new_dm) + \
|
||||
'" accesskey="' + access_keys['menuDM'] + '">' + \
|
||||
'<span>' + html_highlight_label(translate['DM'], new_dm) + \
|
||||
'</span></button></a>'
|
||||
|
||||
replies_index_filename = \
|
||||
acct_dir(base_dir, nickname, domain) + '/tlreplies.index'
|
||||
if os.path.isfile(replies_index_filename):
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/tlreplies" tabindex="-1"'
|
||||
'<a href="' + users_path + '/tlreplies" tabindex="2"'
|
||||
if box_name == 'tlreplies':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + replies_button + '"><span>' + \
|
||||
'><button class="' + replies_button + '" ' + \
|
||||
'accesskey="' + access_keys['menuReplies'] + '"><span>' + \
|
||||
html_highlight_label(translate['Replies'], new_reply) + \
|
||||
'</span></button></a>'
|
||||
|
||||
|
@ -125,7 +128,7 @@ def header_buttons_timeline(default_timeline: str,
|
|||
if default_timeline != 'tlmedia':
|
||||
if not minimal and not features_header:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/tlmedia" tabindex="-1" ' + \
|
||||
'<a href="' + users_path + '/tlmedia" tabindex="2" ' + \
|
||||
'accesskey="' + access_keys['menuMedia'] + '"'
|
||||
if box_name == 'tlmedia':
|
||||
tl_str += ' aria-current="location"'
|
||||
|
@ -137,7 +140,7 @@ def header_buttons_timeline(default_timeline: str,
|
|||
if not minimal:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/inbox" tabindex="-1"'
|
||||
'/inbox" tabindex="2"'
|
||||
if box_name == 'inbox':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
|
@ -155,18 +158,18 @@ def header_buttons_timeline(default_timeline: str,
|
|||
title_str = translate['Article']
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/tlblogs" tabindex="-1"'
|
||||
'/tlblogs" tabindex="2"'
|
||||
if box_name == 'tlblogs':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + \
|
||||
blogs_button + '"><span>' + title_str + \
|
||||
'><button class="' + blogs_button + '" accesskey="' + \
|
||||
access_keys['menuBlogs'] + '"><span>' + title_str + \
|
||||
'</span></button></a>'
|
||||
else:
|
||||
if not minimal:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/inbox" tabindex="-1"'
|
||||
'/inbox" tabindex="2"'
|
||||
if box_name == 'inbox':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
|
@ -180,12 +183,13 @@ def header_buttons_timeline(default_timeline: str,
|
|||
if not features_header:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/inbox" tabindex="-1"'
|
||||
'/inbox" tabindex="2"'
|
||||
if box_name == 'inbox':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + \
|
||||
inbox_button + '"><span>' + translate['Inbox'] + \
|
||||
inbox_button + '" accesskey="' + \
|
||||
access_keys['menuInbox'] + '"><span>' + translate['Inbox'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
# show todays events buttons on the first inbox page
|
||||
|
@ -200,14 +204,14 @@ def header_buttons_timeline(default_timeline: str,
|
|||
happening_str += \
|
||||
'<a href="' + users_path + '/calendar?year=' + \
|
||||
str(now.year) + '?month=' + str(now.month) + \
|
||||
'?day=' + str(now.day) + '" tabindex="-1">' + \
|
||||
'?day=' + str(now.day) + '" tabindex="2">' + \
|
||||
'<button class="buttonevent">' + \
|
||||
translate['Happening Today'] + '</button></a>'
|
||||
else:
|
||||
happening_str += \
|
||||
'<a href="' + users_path + '/calendar?year=' + \
|
||||
str(now.year) + '?month=' + str(now.month) + \
|
||||
'?day=' + str(now.day) + '" tabindex="-1">' + \
|
||||
'?day=' + str(now.day) + '" tabindex="2">' + \
|
||||
'<button class="button">' + \
|
||||
translate['Happening Today'] + '</button></a>'
|
||||
|
||||
|
@ -217,27 +221,27 @@ def header_buttons_timeline(default_timeline: str,
|
|||
happening_str += \
|
||||
'<a href="' + users_path + '/calendar?year=' + \
|
||||
str(tomorrow.year) + '?month=' + str(tomorrow.month) + \
|
||||
'?day=' + str(tomorrow.day) + '" tabindex="-1">' + \
|
||||
'?day=' + str(tomorrow.day) + '" tabindex="2">' + \
|
||||
'<button class="buttonevent">' + \
|
||||
translate['Happening Tomorrow'] + '</button></a>'
|
||||
else:
|
||||
happening_str += \
|
||||
'<a href="' + users_path + '/calendar?year=' + \
|
||||
str(tomorrow.year) + '?month=' + str(tomorrow.month) + \
|
||||
'?day=' + str(tomorrow.day) + '" tabindex="-1">' + \
|
||||
'?day=' + str(tomorrow.day) + '" tabindex="2">' + \
|
||||
'<button class="button">' + \
|
||||
translate['Happening Tomorrow'] + '</button></a>'
|
||||
elif day_events_check(base_dir, nickname, domain, twodays):
|
||||
if not icons_as_buttons:
|
||||
happening_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/calendar" tabindex="-1">' + \
|
||||
'/calendar" tabindex="2">' + \
|
||||
'<button class="buttonevent">' + \
|
||||
translate['Happening This Week'] + '</button></a>'
|
||||
else:
|
||||
happening_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/calendar" tabindex="-1">' + \
|
||||
'/calendar" tabindex="2">' + \
|
||||
'<button class="button">' + \
|
||||
translate['Happening This Week'] + '</button></a>'
|
||||
|
||||
|
@ -249,8 +253,9 @@ def header_buttons_timeline(default_timeline: str,
|
|||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
'><button class="' + \
|
||||
sent_button + '" tabindex="-1"><span>' + translate['Sent'] + \
|
||||
'</span></button></a>'
|
||||
sent_button + '" tabindex="2" accesskey="' + \
|
||||
access_keys['menuOutbox'] + '">' + \
|
||||
'<span>' + translate['Sent'] + '</span></button></a>'
|
||||
|
||||
# add other buttons
|
||||
tl_str += \
|
||||
|
@ -263,7 +268,9 @@ def header_buttons_timeline(default_timeline: str,
|
|||
# the search icon
|
||||
tl_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/search"><img loading="lazy" decoding="async" src="/' + \
|
||||
'/search" accesskey="' + access_keys['menuSearch'] + \
|
||||
'" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/search.png" title="' + \
|
||||
translate['Search and follow'] + '" alt="| ' + \
|
||||
translate['Search and follow'] + \
|
||||
|
@ -272,7 +279,9 @@ def header_buttons_timeline(default_timeline: str,
|
|||
# the search button
|
||||
tl_str += \
|
||||
'<a href="' + users_path + \
|
||||
'/search" tabindex="-1"><button class="button">' + \
|
||||
'/search" tabindex="3">' + \
|
||||
'<button class="button" ' + \
|
||||
'accesskey="' + access_keys['menuSearch'] + '>' + \
|
||||
'<span>' + translate['Search'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
|
@ -291,14 +300,17 @@ def header_buttons_timeline(default_timeline: str,
|
|||
tl_str += \
|
||||
' <a class="imageAnchor" href="' + \
|
||||
users_path + calendar_path + \
|
||||
'"><img loading="lazy" decoding="async" src="/icons/' + \
|
||||
'" accesskey="' + access_keys['menuCalendar'] + \
|
||||
'" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/icons/' + \
|
||||
calendar_image + '" title="' + translate['Calendar'] + \
|
||||
'" alt="| ' + calendar_alt_text + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + calendar_path + \
|
||||
'" tabindex="-1"><button class="button">' + \
|
||||
'" tabindex="3"><button class="button" accesskey="' + \
|
||||
access_keys['menuCalendar'] + '">' + \
|
||||
'<span>' + translate['Calendar'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
|
@ -307,21 +319,21 @@ def header_buttons_timeline(default_timeline: str,
|
|||
if not icons_as_buttons:
|
||||
tl_str += \
|
||||
' <a class="imageAnchor" href="' + \
|
||||
users_path + '/minimal' + \
|
||||
'"><img loading="lazy" decoding="async" src="/icons' + \
|
||||
users_path + '/minimal" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/icons' + \
|
||||
'/showhide.png" title="' + translate['Show/Hide Buttons'] + \
|
||||
'" alt="| ' + translate['Show/Hide Buttons'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/minimal' + \
|
||||
'" tabindex="-1"><button class="button">' + \
|
||||
'" tabindex="3"><button class="button">' + \
|
||||
'<span>' + translate['Show/Hide Buttons'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
if features_header:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/inbox" tabindex="-1"'
|
||||
'<a href="' + users_path + '/inbox" tabindex="2"'
|
||||
if box_name == 'inbox':
|
||||
tl_str += ' aria-current="location"'
|
||||
tl_str += \
|
||||
|
@ -342,7 +354,7 @@ def header_buttons_timeline(default_timeline: str,
|
|||
tl_str += \
|
||||
'<a href="' + \
|
||||
users_path + '/newswiremobile' + \
|
||||
'" tabindex="-1"><button class="buttonMobile">' + \
|
||||
'" tabindex="2"><button class="buttonMobile">' + \
|
||||
'<span>' + translate['Newswire'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
|
@ -360,13 +372,13 @@ def header_buttons_timeline(default_timeline: str,
|
|||
tl_str += \
|
||||
'<a href="' + \
|
||||
users_path + '/linksmobile' + \
|
||||
'" tabindex="-1"><button class="buttonMobile">' + \
|
||||
'" tabindex="2"><button class="buttonMobile">' + \
|
||||
'<span>' + translate['Links'] + \
|
||||
'</span></button></a>'
|
||||
|
||||
if features_header:
|
||||
tl_str += \
|
||||
'<a href="' + users_path + '/editprofile" tabindex="-1">' + \
|
||||
'<a href="' + users_path + '/editprofile" tabindex="2">' + \
|
||||
'<button class="buttonDesktop">' + \
|
||||
'<span>' + translate['Settings'] + '</span></button></a>'
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"" + \
|
||||
"fullscreen\" allowfullscreen></iframe>\n" + \
|
||||
"fullscreen\" allowfullscreen " + \
|
||||
"tabindex=\"10\"></iframe>\n" + \
|
||||
"</span>\n</center>\n"
|
||||
return content
|
||||
|
||||
|
@ -70,7 +71,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n" + \
|
||||
"allowfullscreen tabindex=\"10\"></iframe>\n" + \
|
||||
"</span></center>\n"
|
||||
return content
|
||||
|
||||
|
@ -93,7 +94,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
video_site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n" + \
|
||||
"allowfullscreen tabindex=\"10\"></iframe>\n" + \
|
||||
"</span></center>\n"
|
||||
return content
|
||||
|
||||
|
@ -138,7 +139,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
video_site + url + "\" width=\"" + \
|
||||
str(width) + "\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n" + \
|
||||
"allowfullscreen tabindex=\"10\"></iframe>\n" + \
|
||||
"</span>\n</center>\n"
|
||||
return content
|
||||
|
||||
|
@ -161,7 +162,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
video_site + url + "\" width=\"" + \
|
||||
str(width) + "\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||
"allowfullscreen></iframe>\n" + \
|
||||
"allowfullscreen tabindex=\"10\"></iframe>\n" + \
|
||||
"</span>\n</center>\n"
|
||||
return content
|
||||
|
||||
|
@ -230,7 +231,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
site + url + "\" width=\"" + str(width) + \
|
||||
"\" height=\"" + str(height) + \
|
||||
"\" frameborder=\"0\" allow=\"" + \
|
||||
"fullscreen\" allowfullscreen></iframe>\n" + \
|
||||
"fullscreen\" allowfullscreen tabindex=\"10\">' + \
|
||||
'</iframe>\n" + \
|
||||
"</span>\n</center>\n"
|
||||
return content
|
||||
return content
|
||||
|
@ -278,7 +280,7 @@ def _add_embedded_audio(translate: {}, content: str) -> str:
|
|||
'<center>\n<span itemprop="audio">' + \
|
||||
'<audio controls>\n' + \
|
||||
'<source src="' + wrd + '" type="audio/' + \
|
||||
extension.replace('.', '') + '">' + \
|
||||
extension.replace('.', '') + '" tabindex="10">' + \
|
||||
translate['Your browser does not support the audio element.'] + \
|
||||
'</audio>\n</span>\n</center>\n'
|
||||
return content
|
||||
|
@ -323,7 +325,7 @@ def _add_embedded_video(translate: {}, content: str) -> str:
|
|||
' <video id="video" controls ' + \
|
||||
'preload="metadata">\n' + \
|
||||
'<source src="' + wrd + '" type="video/' + \
|
||||
extension.replace('.', '') + '">\n' + \
|
||||
extension.replace('.', '') + '" tabindex="10">\n' + \
|
||||
translate['Your browser does not support the video element.'] + \
|
||||
'</video>\n</figure>\n</span>\n</center>\n'
|
||||
return content
|
||||
|
|
|
@ -384,7 +384,8 @@ def _get_avatar_image_html(showAvatarOptions: bool,
|
|||
avatar_link = ''
|
||||
if '/users/news/' not in avatar_url:
|
||||
avatar_link = \
|
||||
' <a class="imageAnchor" href="' + post_actor + '">'
|
||||
' <a class="imageAnchor" href="' + \
|
||||
post_actor + '" tabindex="10">'
|
||||
show_profile_str = 'Show profile'
|
||||
if translate.get(show_profile_str):
|
||||
show_profile_str = translate[show_profile_str]
|
||||
|
@ -405,7 +406,7 @@ def _get_avatar_image_html(showAvatarOptions: bool,
|
|||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + '?options=' + post_actor + \
|
||||
';' + str(page_number) + ';' + \
|
||||
avatar_url + message_id_str + '">\n'
|
||||
avatar_url + message_id_str + '" tabindex="10">\n'
|
||||
avatar_link += \
|
||||
' <img loading="lazy" decoding="async" title="' + \
|
||||
show_options_for_this_person_str + '" ' + \
|
||||
|
@ -484,14 +485,14 @@ def _get_reply_icon_html(base_dir: str, nickname: str, domain: str,
|
|||
nickname + '?replyto=' + reply_to_link + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
conversation_str + \
|
||||
'" title="' + reply_to_this_post_str + '">\n'
|
||||
'" title="' + reply_to_this_post_str + '" tabindex="10">\n'
|
||||
elif is_unlisted_reply:
|
||||
reply_str += \
|
||||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + '?replyunlisted=' + reply_to_link + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
conversation_str + \
|
||||
'" title="' + reply_to_this_post_str + '">\n'
|
||||
'" title="' + reply_to_this_post_str + '" tabindex="10">\n'
|
||||
else:
|
||||
if is_dm(post_json_object):
|
||||
reply_type = 'replydm'
|
||||
|
@ -503,7 +504,7 @@ def _get_reply_icon_html(base_dir: str, nickname: str, domain: str,
|
|||
'?' + reply_type + '=' + reply_to_link + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
conversation_str + \
|
||||
'" title="' + reply_to_this_post_str + '">\n'
|
||||
'" title="' + reply_to_this_post_str + '" tabindex="10">\n'
|
||||
else:
|
||||
reply_str += \
|
||||
' ' + \
|
||||
|
@ -511,7 +512,7 @@ def _get_reply_icon_html(base_dir: str, nickname: str, domain: str,
|
|||
'?replyfollowers=' + reply_to_link + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
conversation_str + \
|
||||
'" title="' + reply_to_this_post_str + '">\n'
|
||||
'" title="' + reply_to_this_post_str + '" tabindex="10">\n'
|
||||
|
||||
reply_str += \
|
||||
' ' + \
|
||||
|
@ -553,7 +554,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
|
|||
'/tlblogs?editblogpost=' + \
|
||||
post_id.split('/statuses/')[1] + \
|
||||
';actor=' + actor_nickname + \
|
||||
'" title="' + edit_blog_post_str + '">' + \
|
||||
'" title="' + edit_blog_post_str + '" tabindex="10">' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
edit_blog_post_str + '" alt="' + edit_blog_post_str + \
|
||||
' |" src="/icons/edit.png"/></a>\n'
|
||||
|
@ -564,7 +565,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
|
|||
nickname + '/editnewspost=' + \
|
||||
post_id.split('/statuses/')[1] + \
|
||||
'?actor=' + actor_nickname + \
|
||||
'" title="' + edit_blog_post_str + '">' + \
|
||||
'" title="' + edit_blog_post_str + '" tabindex="10">' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
edit_blog_post_str + '" alt="' + edit_blog_post_str + \
|
||||
' |" src="/icons/edit.png"/></a>\n'
|
||||
|
@ -578,7 +579,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
|
|||
'/tlblogs?editeventpost=' + \
|
||||
post_id.split('/statuses/')[1] + \
|
||||
'?actor=' + actor_nickname + \
|
||||
'" title="' + edit_event_str + '">' + \
|
||||
'" title="' + edit_event_str + '" tabindex="10">' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
edit_event_str + '" alt="' + edit_event_str + \
|
||||
' |" src="/icons/edit.png"/></a>\n'
|
||||
|
@ -658,7 +659,8 @@ def _get_announce_icon_html(is_announced: bool,
|
|||
# show the number of announces next to icon
|
||||
announce_str += '<label class="likesCount">'
|
||||
announce_str += '<a href="' + announcers_screen_link + '" ' + \
|
||||
'title="' + translate['Show who repeated this post'] + '">'
|
||||
'title="' + translate['Show who repeated this post'] + \
|
||||
'" tabindex="10">'
|
||||
announce_str += \
|
||||
announce_count_str.replace('(', '').replace(')', '').strip()
|
||||
announce_str += '</a></label>\n'
|
||||
|
@ -670,7 +672,7 @@ def _get_announce_icon_html(is_announced: bool,
|
|||
nickname + announce_link_str + unannounce_link_str + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
'?bm=' + timeline_post_bookmark + \
|
||||
'?tl=' + box_name + '" title="' + announce_title + '">\n'
|
||||
'?tl=' + box_name + '" title="' + announce_title + '" tabindex="10">\n'
|
||||
|
||||
announce_str += \
|
||||
' ' + \
|
||||
|
@ -736,7 +738,8 @@ def _get_like_icon_html(nickname: str, domain_full: str,
|
|||
# show the number of likes next to icon
|
||||
like_str += '<label class="likesCount">'
|
||||
like_str += '<a href="' + likers_screen_link + '" ' + \
|
||||
'title="' + translate['Show who liked this post'] + '">'
|
||||
'title="' + translate['Show who liked this post'] + \
|
||||
'" tabindex="10">'
|
||||
like_str += like_count_str.replace('(', '').replace(')', '').strip()
|
||||
like_str += '</a></label>\n'
|
||||
|
||||
|
@ -746,7 +749,8 @@ def _get_like_icon_html(nickname: str, domain_full: str,
|
|||
page_number_param + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
'?bm=' + timeline_post_bookmark + \
|
||||
'?tl=' + box_name + '" title="' + like_title + like_count_str + '">\n'
|
||||
'?tl=' + box_name + '" title="' + like_title + like_count_str + \
|
||||
'" tabindex="10">\n'
|
||||
like_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
|
@ -794,7 +798,8 @@ def _get_bookmark_icon_html(nickname: str, domain_full: str,
|
|||
page_number_param + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
'?bm=' + timeline_post_bookmark + \
|
||||
'?tl=' + box_name + '" title="' + bookmark_title + '">\n'
|
||||
'?tl=' + box_name + '" title="' + bookmark_title + \
|
||||
'" tabindex="10">\n'
|
||||
bookmark_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
|
@ -833,7 +838,8 @@ def _get_reaction_icon_html(nickname: str, domain_full: str,
|
|||
'?selreact=' + reaction_post_id + page_number_param + \
|
||||
'?actor=' + post_json_object['actor'] + \
|
||||
'?bm=' + timeline_post_reaction + \
|
||||
'?tl=' + box_name + '" title="' + reaction_title + '">\n'
|
||||
'?tl=' + box_name + '" title="' + reaction_title + \
|
||||
'" tabindex="10">\n'
|
||||
reaction_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" title="' + \
|
||||
|
@ -868,7 +874,7 @@ def _get_mute_icon_html(is_muted: bool,
|
|||
' <a class="imageAnchor" href="/users/' + nickname + \
|
||||
'?mute=' + message_id + page_number_param + '?tl=' + box_name + \
|
||||
'?bm=' + timeline_post_bookmark + \
|
||||
'" title="' + mute_this_post_str + '">\n'
|
||||
'" title="' + mute_this_post_str + '" tabindex="10">\n'
|
||||
mute_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" alt="' + \
|
||||
|
@ -883,7 +889,8 @@ def _get_mute_icon_html(is_muted: bool,
|
|||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + '?unmute=' + message_id + \
|
||||
page_number_param + '?tl=' + box_name + '?bm=' + \
|
||||
timeline_post_bookmark + '" title="' + undo_mute_str + '">\n'
|
||||
timeline_post_bookmark + '" title="' + undo_mute_str + \
|
||||
'" tabindex="10">\n'
|
||||
mute_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" ' + \
|
||||
|
@ -915,7 +922,7 @@ def _get_delete_icon_html(nickname: str, domain_full: str,
|
|||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + \
|
||||
'?delete=' + message_id + page_number_param + \
|
||||
'" title="' + delete_this_post_str + '">\n'
|
||||
'" title="' + delete_this_post_str + '" tabindex="10">\n'
|
||||
delete_str += \
|
||||
' ' + \
|
||||
'<img loading="lazy" decoding="async" alt="' + \
|
||||
|
@ -990,7 +997,7 @@ def _get_blog_citations_html(box_name: str,
|
|||
if not tag_json.get('url'):
|
||||
continue
|
||||
citations_str += \
|
||||
'<li><a href="' + tag_json['url'] + '">' + \
|
||||
'<li><a href="' + tag_json['url'] + '" tabindex="10">' + \
|
||||
'<cite>' + tag_json['name'] + '</cite></a></li>\n'
|
||||
|
||||
if citations_str:
|
||||
|
@ -1030,7 +1037,7 @@ def _announce_unattributed_html(translate: {},
|
|||
'/repeat_inactive.png" ' + \
|
||||
'class="announceOrReply"/>\n' + \
|
||||
' <a href="' + post_id + \
|
||||
'" class="announceOrReply">@unattributed</a>\n'
|
||||
'" class="announceOrReply" tabindex="10">@unattributed</a>\n'
|
||||
|
||||
|
||||
def _announce_with_display_name_html(translate: {},
|
||||
|
@ -1048,7 +1055,7 @@ def _announce_with_display_name_html(translate: {},
|
|||
'icons/repeat_inactive.png" ' + \
|
||||
'class="announceOrReply"/>\n' + \
|
||||
' <a href="' + post_id + '" ' + \
|
||||
'class="announceOrReply">' + \
|
||||
'class="announceOrReply" tabindex="10">' + \
|
||||
'<span itemprop="author">' + \
|
||||
announce_display_name + '</span></a>\n'
|
||||
|
||||
|
@ -1154,7 +1161,8 @@ def _get_post_title_announce_html(base_dir: str,
|
|||
' <a class="imageAnchor" ' + \
|
||||
'href="/users/' + nickname + '?options=' + \
|
||||
announce_actor + ';' + str(page_number) + \
|
||||
';' + announce_avatar_url + message_id_str + '">' \
|
||||
';' + announce_avatar_url + message_id_str + \
|
||||
'" tabindex="10">' \
|
||||
'<img loading="lazy" decoding="async" src="' + \
|
||||
announce_avatar_url + '" ' + \
|
||||
'title="' + show_options_for_this_person_str + \
|
||||
|
@ -1193,7 +1201,7 @@ def _reply_to_unknown_html(translate: {},
|
|||
'/reply.png" class="announceOrReply"/>\n' + \
|
||||
' <a href="' + \
|
||||
post_json_object['object']['inReplyTo'] + \
|
||||
'" class="announceOrReply">@unknown</a>\n'
|
||||
'" class="announceOrReply" tabindex="10">@unknown</a>\n'
|
||||
|
||||
|
||||
def _mitm_warning_html(translate: {}) -> str:
|
||||
|
@ -1222,7 +1230,7 @@ def _reply_with_unknown_path_html(translate: {},
|
|||
'class="announceOrReply"/>\n' + \
|
||||
' <a href="' + \
|
||||
post_json_object['object']['inReplyTo'] + \
|
||||
'" class="announceOrReply">' + \
|
||||
'" class="announceOrReply" tabindex="10">' + \
|
||||
post_domain + '</a>\n'
|
||||
|
||||
|
||||
|
@ -1240,7 +1248,7 @@ def _get_reply_html(translate: {},
|
|||
'icons/reply.png" ' + \
|
||||
'class="announceOrReply"/>\n' + \
|
||||
' <a href="' + in_reply_to + \
|
||||
'" class="announceOrReply">' + \
|
||||
'" class="announceOrReply" tabindex="10">' + \
|
||||
'<span itemprop="audience">' + \
|
||||
reply_display_name + '</span></a>\n'
|
||||
|
||||
|
@ -1357,7 +1365,7 @@ def _get_post_title_reply_html(base_dir: str,
|
|||
' <a class="imageAnchor" ' + \
|
||||
'href="/users/' + nickname + '?options=' + reply_actor + \
|
||||
';' + str(page_number) + ';' + reply_avatar_url + \
|
||||
message_id_str + '">\n' + \
|
||||
message_id_str + '" tabindex="10">\n' + \
|
||||
' <img loading="lazy" decoding="async" ' + \
|
||||
'src="' + reply_avatar_url + '" ' + \
|
||||
'title="' + show_profile_str + \
|
||||
|
@ -1456,13 +1464,13 @@ def _get_footer_with_icons(show_icons: bool,
|
|||
footer_str += delete_str + mute_str + edit_str
|
||||
if not is_news_post(post_json_object):
|
||||
footer_str += ' <a href="' + published_link + '" class="' + \
|
||||
time_class + '"><span itemprop="datePublished">' + \
|
||||
time_class + '" tabindex="10"><span itemprop="datePublished">' + \
|
||||
published_str + '</span></a>\n'
|
||||
else:
|
||||
footer_str += ' <a href="' + \
|
||||
published_link.replace('/news/', '/news/statuses/') + \
|
||||
'" class="' + time_class + '"><span itemprop="datePublished">' + \
|
||||
published_str + '</span></a>\n'
|
||||
'" class="' + time_class + '" tabindex="10">' + \
|
||||
'<span itemprop="datePublished">' + published_str + '</span></a>\n'
|
||||
footer_str += ' </div>\n'
|
||||
footer_str += ' </nav>\n'
|
||||
return footer_str
|
||||
|
@ -1762,7 +1770,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + '?options=' + post_actor + \
|
||||
';' + str(page_number) + ';' + avatar_url + message_id_str + \
|
||||
'">' + \
|
||||
'" tabindex="10">' + \
|
||||
'<span itemprop="author">' + display_name + '</span>' + \
|
||||
'</a>\n'
|
||||
else:
|
||||
|
@ -1780,7 +1788,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
' <a class="imageAnchor" href="/users/' + \
|
||||
nickname + '?options=' + post_actor + \
|
||||
';' + str(page_number) + ';' + avatar_url + message_id_str + \
|
||||
'">@<span itemprop="author">' + actor_handle + '</span></a>\n'
|
||||
'" tabindex="10">' + \
|
||||
'@<span itemprop="author">' + actor_handle + '</span></a>\n'
|
||||
|
||||
# benchmark 9
|
||||
_log_post_timing(enable_timing_log, post_start_time, '9')
|
||||
|
@ -1980,11 +1989,13 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
|
||||
if not is_news_post(post_json_object):
|
||||
footer_str = '<a href="' + published_link + \
|
||||
'" class="' + time_class + '">' + published_str + '</a>\n'
|
||||
'" class="' + time_class + '" tabindex="10">' + \
|
||||
published_str + '</a>\n'
|
||||
else:
|
||||
footer_str = '<a href="' + \
|
||||
published_link.replace('/news/', '/news/statuses/') + \
|
||||
'" class="' + time_class + '">' + published_str + '</a>\n'
|
||||
'" class="' + time_class + '" tabindex="10">' + \
|
||||
published_str + '</a>\n'
|
||||
|
||||
# change the background color for DMs in inbox timeline
|
||||
if post_is_dm:
|
||||
|
@ -2297,7 +2308,7 @@ def html_individual_post(css_cache: {},
|
|||
if translate.get(by_text):
|
||||
by_text = translate[by_text]
|
||||
post_str += \
|
||||
'<p>' + by_text + ' <a href="' + by_str + '">@' + \
|
||||
'<p>' + by_text + ' <a href="' + by_str + '" tabindex="10">@' + \
|
||||
by_str_handle + '</a>' + by_text_extra + '\n'
|
||||
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
@ -2551,7 +2562,8 @@ def html_emoji_reaction_picker(css_cache: {},
|
|||
'?emojreact=' + emoji_content_encoded
|
||||
emoji_label = '<label class="rlab">' + emoji_content + '</label>'
|
||||
emoji_picks_str += \
|
||||
' <a href="' + emoji_url + '">' + emoji_label + '</a>\n'
|
||||
' <a href="' + emoji_url + '" tabindex="10">' + \
|
||||
emoji_label + '</a>\n'
|
||||
emoji_picks_str += '</div>\n'
|
||||
|
||||
css_filename = base_dir + '/epicyon-profile.css'
|
||||
|
@ -2573,7 +2585,7 @@ def html_emoji_reaction_picker(css_cache: {},
|
|||
'<a href="/users/' + nickname + '/' + box_name + \
|
||||
'?page=' + str(page_number) + '" title="' + \
|
||||
translate['Switch to timeline view'] + '" alt="' + \
|
||||
translate['Switch to timeline view'] + '">\n'
|
||||
translate['Switch to timeline view'] + '" tabindex="10">\n'
|
||||
header_str += '<img loading="lazy" decoding="async" ' + \
|
||||
'class="timeline-banner" alt="" ' + \
|
||||
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
|
||||
|
|
|
@ -422,7 +422,8 @@ def _get_profile_header(base_dir: str, http_prefix: str,
|
|||
'\n\n <figure class="profileHeader">\n' + \
|
||||
' <a href="/users/' + \
|
||||
nickname + '/' + default_timeline + '" title="' + \
|
||||
translate['Switch to timeline view'] + '">\n' + \
|
||||
translate['Switch to timeline view'] + '" tabindex="1" ' + \
|
||||
'accesskey="' + access_keys['menuTimeline'] + '">\n' + \
|
||||
' <img class="profileBackground" ' + \
|
||||
'alt="" ' + \
|
||||
'src="/users/' + nickname + '/image_' + theme + '.png" /></a>\n' + \
|
||||
|
@ -470,7 +471,8 @@ def _get_profile_header(base_dir: str, http_prefix: str,
|
|||
ctr += 1
|
||||
alt_domain, _ = get_domain_from_actor(alt_actor)
|
||||
other_accounts_html += \
|
||||
'<a href="' + alt_actor + '">' + alt_domain + '</a>'
|
||||
'<a href="' + alt_actor + \
|
||||
'" tabindex="1">' + alt_domain + '</a>'
|
||||
elif isinstance(also_known_as, str):
|
||||
if also_known_as != actor:
|
||||
ctr += 1
|
||||
|
@ -483,7 +485,7 @@ def _get_profile_header(base_dir: str, http_prefix: str,
|
|||
html_str += \
|
||||
' <a href="/users/' + nickname + \
|
||||
'/qrcode.png" alt="' + translate['QR Code'] + '" title="' + \
|
||||
translate['QR Code'] + '">' + \
|
||||
translate['QR Code'] + '" tabindex="1">' + \
|
||||
'<img class="qrcode" alt="' + translate['QR Code'] + \
|
||||
'" src="/icons/qrcode.png" /></a></p>\n' + \
|
||||
' <p>' + profile_description_short + '</p>\n' + login_button
|
||||
|
@ -493,7 +495,8 @@ def _get_profile_header(base_dir: str, http_prefix: str,
|
|||
# show vcard download link
|
||||
html_str += \
|
||||
' <a href="/users/' + nickname + '.vcf" ' + \
|
||||
'download="contact_' + nickname + '@' + domain_full + '.vcf">' + \
|
||||
'download="contact_' + nickname + '@' + domain_full + \
|
||||
'.vcf" tabindex="1" class="imageAnchor">' + \
|
||||
'<img class="vcard" src="/icons/vcard.png" ' + \
|
||||
'title="vCard" alt="vCard" /></a>\n'
|
||||
|
||||
|
@ -526,7 +529,7 @@ def _get_profile_header_after_search(base_dir: str,
|
|||
' <a href="/users/' + \
|
||||
nickname + '/' + default_timeline + '" title="' + \
|
||||
translate['Switch to timeline view'] + '" ' + \
|
||||
'accesskey="' + access_keys['menuTimeline'] + '">\n' + \
|
||||
'accesskey="' + access_keys['menuTimeline'] + '" tabindex="1">\n' + \
|
||||
' <img class="profileBackground" ' + \
|
||||
'alt="" ' + \
|
||||
'src="' + image_url + '" /></a>\n' + \
|
||||
|
@ -571,7 +574,8 @@ def _get_profile_header_after_search(base_dir: str,
|
|||
ctr += 1
|
||||
alt_domain, _ = get_domain_from_actor(alt_actor)
|
||||
other_accounts_html += \
|
||||
'<a href="' + alt_actor + '">' + alt_domain + '</a>'
|
||||
'<a href="' + alt_actor + \
|
||||
'" tabindex="1">' + alt_domain + '</a>'
|
||||
elif isinstance(also_known_as, str):
|
||||
if also_known_as != actor:
|
||||
ctr += 1
|
||||
|
@ -703,25 +707,26 @@ def html_profile(signing_priv_key_pem: str,
|
|||
donate_section += ' <center>\n'
|
||||
if donate_url and not is_system_account(nickname):
|
||||
donate_section += \
|
||||
' <p><a href="' + donate_url + \
|
||||
'"><button class="donateButton">' + translate['Donate'] + \
|
||||
' <p><a href="' + donate_url + '" tabindex="1">' + \
|
||||
'<button class="donateButton">' + translate['Donate'] + \
|
||||
'</button></a></p>\n'
|
||||
if website_url:
|
||||
donate_section += \
|
||||
'<p>' + translate['Website'] + ': <a href="' + \
|
||||
website_url + '">' + website_url + '</a></p>\n'
|
||||
website_url + '" tabindex="1">' + website_url + '</a></p>\n'
|
||||
if email_address:
|
||||
donate_section += \
|
||||
'<p>' + translate['Email'] + ': <a href="mailto:' + \
|
||||
email_address + '">' + email_address + '</a></p>\n'
|
||||
email_address + '" tabindex="1">' + \
|
||||
email_address + '</a></p>\n'
|
||||
if blog_address:
|
||||
donate_section += \
|
||||
'<p>Blog: <a href="' + \
|
||||
blog_address + '">' + blog_address + '</a></p>\n'
|
||||
blog_address + '" tabindex="1">' + blog_address + '</a></p>\n'
|
||||
if xmpp_address:
|
||||
donate_section += \
|
||||
'<p>' + translate['XMPP'] + ': <a href="xmpp:' + \
|
||||
xmpp_address + '">' + xmpp_address + '</a></p>\n'
|
||||
xmpp_address + '" tabindex="1">' + xmpp_address + '</a></p>\n'
|
||||
if matrix_address:
|
||||
donate_section += \
|
||||
'<p>' + translate['Matrix'] + ': ' + matrix_address + '</p>\n'
|
||||
|
@ -763,13 +768,14 @@ def html_profile(signing_priv_key_pem: str,
|
|||
|
||||
if authorized:
|
||||
edit_profile_str = \
|
||||
'<a class="imageAnchor" href="' + users_path + '/editprofile">' + \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/editprofile" tabindex="1">' + \
|
||||
'<img loading="lazy" decoding="async" src="/icons' + \
|
||||
'/edit.png" title="' + translate['Edit'] + \
|
||||
'" alt="| ' + translate['Edit'] + '" class="timelineicon"/></a>\n'
|
||||
|
||||
logout_str = \
|
||||
'<a class="imageAnchor" href="/logout">' + \
|
||||
'<a class="imageAnchor" href="/logout" tabindex="1">' + \
|
||||
'<img loading="lazy" decoding="async" src="/icons' + \
|
||||
'/logout.png" title="' + translate['Logout'] + \
|
||||
'" alt="| ' + translate['Logout'] + \
|
||||
|
@ -815,7 +821,8 @@ def html_profile(signing_priv_key_pem: str,
|
|||
follow_approvals_section += \
|
||||
'<div class="container">'
|
||||
follow_approvals_section += \
|
||||
'<a href="' + follower_actor + '">'
|
||||
'<a href="' + follower_actor + \
|
||||
'" tabindex="2">'
|
||||
follow_approvals_section += \
|
||||
'<span class="followRequestHandle">' + \
|
||||
follower_handle + \
|
||||
|
@ -824,13 +831,15 @@ def html_profile(signing_priv_key_pem: str,
|
|||
# show Approve and Deny buttons
|
||||
follow_approvals_section += \
|
||||
'<a href="' + base_path + \
|
||||
'/followapprove=' + follower_handle + '">'
|
||||
'/followapprove=' + follower_handle + \
|
||||
'" tabindex="2">'
|
||||
follow_approvals_section += \
|
||||
'<button class="followApprove">' + \
|
||||
translate['Approve'] + '</button></a><br><br>'
|
||||
follow_approvals_section += \
|
||||
'<a href="' + base_path + \
|
||||
'/followdeny=' + follower_handle + '">'
|
||||
'/followdeny=' + follower_handle + \
|
||||
'" tabindex="3">'
|
||||
follow_approvals_section += \
|
||||
'<button class="followDeny">' + \
|
||||
translate['Deny'] + '</button></a>'
|
||||
|
@ -952,34 +961,41 @@ def html_profile(signing_priv_key_pem: str,
|
|||
profile_str += '<div class="container" id="buttonheader">\n'
|
||||
profile_str += ' <center>'
|
||||
profile_str += \
|
||||
' <a href="' + users_path + '#buttonheader"><button class="' + \
|
||||
' <a href="' + users_path + '#buttonheader" tabindex="2">' + \
|
||||
'<button class="' + \
|
||||
posts_button + '"><span>' + translate['Posts'] + \
|
||||
' </span></button></a>'
|
||||
if not is_group:
|
||||
profile_str += \
|
||||
' <a href="' + users_path + '/following#buttonheader">' + \
|
||||
' <a href="' + users_path + \
|
||||
'/following#buttonheader" tabindex="2">' + \
|
||||
'<button class="' + following_button + '"><span>' + \
|
||||
translate['Following'] + ' </span></button></a>'
|
||||
profile_str += \
|
||||
' <a href="' + users_path + '/followers#buttonheader">' + \
|
||||
' <a href="' + users_path + \
|
||||
'/followers#buttonheader" tabindex="2">' + \
|
||||
'<button class="' + followers_button + \
|
||||
'"><span>' + followers_str + ' </span></button></a>'
|
||||
if not is_group:
|
||||
profile_str += \
|
||||
' <a href="' + users_path + '/roles#buttonheader">' + \
|
||||
' <a href="' + users_path + \
|
||||
'/roles#buttonheader" tabindex="2">' + \
|
||||
'<button class="' + roles_button + '"><span>' + \
|
||||
translate['Roles'] + \
|
||||
' </span></button></a>'
|
||||
profile_str += \
|
||||
' <a href="' + users_path + '/skills#buttonheader">' + \
|
||||
' <a href="' + users_path + \
|
||||
'/skills#buttonheader" tabindex="2">' + \
|
||||
'<button class="' + skills_button + '"><span>' + \
|
||||
translate['Skills'] + ' </span></button></a>'
|
||||
# profile_str += \
|
||||
# ' <a href="' + users_path + '/shares#buttonheader">' + \
|
||||
# ' <a href="' + users_path + \
|
||||
# '/shares#buttonheader" tabindex="2">' + \
|
||||
# '<button class="' + shares_button + '"><span>' + \
|
||||
# translate['Shares'] + ' </span></button></a>'
|
||||
# profile_str += \
|
||||
# ' <a href="' + users_path + '/wanted#buttonheader">' + \
|
||||
# ' <a href="' + users_path + \
|
||||
# '/wanted#buttonheader" tabindex="2">' + \
|
||||
# '<button class="' + wanted_button + '"><span>' + \
|
||||
# translate['Wanted'] + ' </span></button></a>'
|
||||
profile_str += logout_str + edit_profile_str
|
||||
|
@ -996,7 +1012,7 @@ def html_profile(signing_priv_key_pem: str,
|
|||
css_filename = base_dir + '/epicyon.css'
|
||||
|
||||
license_str = \
|
||||
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
|
||||
'<a href="https://gitlab.com/bashrc2/epicyon" tabindex="2">' + \
|
||||
'<img loading="lazy" decoding="async" class="license" alt="' + \
|
||||
translate['Get the source code'] + '" title="' + \
|
||||
translate['Get the source code'] + '" src="/icons/agpl.png" /></a>'
|
||||
|
|
|
@ -107,7 +107,7 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newdm?nodropdown"><img loading="lazy" ' + \
|
||||
'/newdm?nodropdown" tabindex="3"><img loading="lazy" ' + \
|
||||
'decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new DM'] + \
|
||||
|
@ -115,28 +115,30 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newdm?nodropdown">' + \
|
||||
'<a href="' + users_path + \
|
||||
'/newdm?nodropdown" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + ' </span></button></a>'
|
||||
elif box_name in ('tlblogs', 'tlnews', 'tlfeatures'):
|
||||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newblog"><img loading="lazy" decoding="async" src="/' + \
|
||||
'/newblog" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new post'] + '" alt="| ' + \
|
||||
translate['Create a new post'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newblog">' + \
|
||||
'<a href="' + users_path + '/newblog" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + '</span></button></a>'
|
||||
elif box_name == 'tlshares':
|
||||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newshare?nodropdown">' + \
|
||||
'/newshare?nodropdown" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new shared item'] + '" alt="| ' + \
|
||||
|
@ -144,14 +146,15 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newshare?nodropdown">' + \
|
||||
'<a href="' + users_path + \
|
||||
'/newshare?nodropdown" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + '</span></button></a>'
|
||||
elif box_name == 'tlwanted':
|
||||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newwanted?nodropdown">' + \
|
||||
'/newwanted?nodropdown" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new wanted item'] + '" alt="| ' + \
|
||||
|
@ -159,7 +162,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newwanted?nodropdown">' + \
|
||||
'<a href="' + users_path + \
|
||||
'/newwanted?nodropdown" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + '</span></button></a>'
|
||||
else:
|
||||
|
@ -167,7 +171,7 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newpost">' + \
|
||||
'/newpost" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new post'] + '" alt="| ' + \
|
||||
|
@ -175,14 +179,14 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newpost">' + \
|
||||
'<a href="' + users_path + '/newpost" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + '</span></button></a>'
|
||||
else:
|
||||
if not icons_as_buttons:
|
||||
new_post_button_str += \
|
||||
'<a class="imageAnchor" href="' + users_path + \
|
||||
'/newfollowers">' + \
|
||||
'/newfollowers" tabindex="3">' + \
|
||||
'<img loading="lazy" decoding="async" src="/' + \
|
||||
'icons/newpost.png" title="' + \
|
||||
translate['Create a new post'] + \
|
||||
|
@ -190,7 +194,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
|
|||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
new_post_button_str += \
|
||||
'<a href="' + users_path + '/newfollowers">' + \
|
||||
'<a href="' + users_path + \
|
||||
'/newfollowers" tabindex="3">' + \
|
||||
'<button class="button"><span>' + \
|
||||
translate['Post'] + '</span></button></a>'
|
||||
return new_post_button_str
|
||||
|
@ -432,7 +437,7 @@ def _page_number_buttons(users_path: str, box_name: str,
|
|||
'<a href="' + users_path + '/' + box_name + '?page=' + \
|
||||
str(page) + '" class="pageslist" ' + \
|
||||
'aria-label="Current Page, Page ' + str(page) + \
|
||||
'"' + aria_page_str + '>' + page_str + '</a>'
|
||||
'"' + aria_page_str + ' tabindex="11">' + page_str + '</a>'
|
||||
return '<center>\n' + \
|
||||
' <nav role="navigation" aria-label="Pagination Navigation">\n' + \
|
||||
' ' + num_str + '\n' + \
|
||||
|
@ -673,7 +678,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
|
|||
moderation_button_str += ' aria-current="location"'
|
||||
moderation_button_str += \
|
||||
'><button class="' + \
|
||||
moderation_button + '"><span>' + \
|
||||
moderation_button + '" tabindex="2"><span>' + \
|
||||
html_highlight_label(translate['Mod'], new_report) + \
|
||||
' </span></button></a>'
|
||||
|
||||
|
@ -688,13 +693,13 @@ def html_timeline(css_cache: {}, default_timeline: str,
|
|||
if box_name == 'tlshares':
|
||||
shares_button_str += ' aria-current="location"'
|
||||
shares_button_str += \
|
||||
'><button class="' + shares_button + '"><span>' + \
|
||||
'><button class="' + shares_button + '" tabindex="2"><span>' + \
|
||||
html_highlight_label(translate['Shares'], new_share) + \
|
||||
'</span></button></a>'
|
||||
|
||||
wanted_button_str = \
|
||||
'<a href="' + users_path + '/tlwanted"><button class="' + \
|
||||
wanted_button + '"'
|
||||
wanted_button + '" tabindex="2"'
|
||||
if box_name == 'tlwanted':
|
||||
wanted_button_str += ' aria-current="location"'
|
||||
wanted_button_str += \
|
||||
|
@ -708,8 +713,8 @@ def html_timeline(css_cache: {}, default_timeline: str,
|
|||
bookmarks_button_str += ' aria-current="location"'
|
||||
bookmarks_button_str += \
|
||||
'><button class="' + \
|
||||
bookmarks_button + '"><span>' + translate['Bookmarks'] + \
|
||||
'</span></button></a>'
|
||||
bookmarks_button + '" tabindex="2">' + \
|
||||
'<span>' + translate['Bookmarks'] + '</span></button></a>'
|
||||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
|
@ -747,7 +752,9 @@ def html_timeline(css_cache: {}, default_timeline: str,
|
|||
'<header>\n' + \
|
||||
'<a href="/users/' + nickname + '" title="' + \
|
||||
translate['Switch to profile view'] + '" alt="' + \
|
||||
translate['Switch to profile view'] + '">\n'
|
||||
translate['Switch to profile view'] + '" ' + \
|
||||
'aria-flowto="containerHeader" tabindex="1" accesskey="' + \
|
||||
access_keys['menuProfile'] + '">\n'
|
||||
tl_str += '<img loading="lazy" decoding="async" ' + \
|
||||
'class="timeline-banner" alt="" ' + \
|
||||
'src="' + users_path + '/' + banner_file + '" /></a>\n' + \
|
||||
|
@ -799,7 +806,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
|
|||
' </td>\n'
|
||||
|
||||
# center column containing posts
|
||||
tl_str += ' <td valign="top" class="col-center">\n'
|
||||
tl_str += ' <td valign="top" class="col-center" tabindex="-1">\n'
|
||||
|
||||
if not full_width_tl_button_header:
|
||||
tl_str += \
|
||||
|
|
|
@ -1165,7 +1165,7 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
|
|||
gallery_str += ' </div>\n'
|
||||
gallery_str += '</div>\n'
|
||||
|
||||
attachment_str += '<a href="' + image_url + '">'
|
||||
attachment_str += '<a href="' + image_url + '" tabindex="10">'
|
||||
attachment_str += \
|
||||
'<img loading="lazy" decoding="async" ' + \
|
||||
'src="' + image_url + \
|
||||
|
@ -1180,7 +1180,9 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
|
|||
if box_name == 'tlmedia':
|
||||
gallery_str += '<div class="gallery">\n'
|
||||
if not is_muted:
|
||||
gallery_str += ' <a href="' + attach['url'] + '">\n'
|
||||
gallery_str += \
|
||||
' <a href="' + attach['url'] + \
|
||||
'" tabindex="10">\n'
|
||||
gallery_str += \
|
||||
' <figure id="videoContainer" ' + \
|
||||
'data-fullscreen="false">\n' + \
|
||||
|
@ -1204,7 +1206,7 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
|
|||
if image_description and not is_muted:
|
||||
gallery_str += \
|
||||
' <a href="' + video_post_url + \
|
||||
'" class="gallerytext"><div ' + \
|
||||
'" class="gallerytext" tabindex="10"><div ' + \
|
||||
'class="gallerytext">' + \
|
||||
image_description + '</div></a>\n'
|
||||
else:
|
||||
|
@ -1248,7 +1250,9 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
|
|||
if box_name == 'tlmedia':
|
||||
gallery_str += '<div class="gallery">\n'
|
||||
if not is_muted:
|
||||
gallery_str += ' <a href="' + attach['url'] + '">\n'
|
||||
gallery_str += \
|
||||
' <a href="' + attach['url'] + \
|
||||
'" tabindex="10">\n'
|
||||
gallery_str += ' <audio controls>\n'
|
||||
gallery_str += \
|
||||
' <source src="' + attach['url'] + \
|
||||
|
@ -1383,7 +1387,8 @@ def html_keyboard_navigation(banner: str, links: {}, access_keys: {},
|
|||
# show new follower approvals
|
||||
if users_path and translate and follow_approvals:
|
||||
html_str += '<strong><label class="transparent">' + \
|
||||
'<a href="' + users_path + '/followers#timeline">' + \
|
||||
'<a href="' + users_path + '/followers#timeline" ' + \
|
||||
'tabindex="-1">' + \
|
||||
translate['Approve follow requests'] + '</a>' + \
|
||||
'</label></strong><br><br>\n'
|
||||
|
||||
|
@ -1394,7 +1399,8 @@ def html_keyboard_navigation(banner: str, links: {}, access_keys: {},
|
|||
access_key_str = 'accesskey="' + access_keys[title] + '"'
|
||||
|
||||
html_str += '<li><label class="transparent">' + \
|
||||
'<a href="' + str(url) + '" ' + access_key_str + '>' + \
|
||||
'<a href="' + str(url) + '" ' + access_key_str + \
|
||||
' tabindex="-1">' + \
|
||||
str(title) + '</a></label></li>\n'
|
||||
html_str += '</ul></div>\n'
|
||||
return html_str
|
||||
|
|
Loading…
Reference in New Issue