From a9e8827ff8886ac2315911a38fd5da4dcf448c0f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 25 May 2022 12:45:54 +0100 Subject: [PATCH] Tab index for posts --- webapp_post.py | 84 ++++++++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index e70c87796..45609f3e7 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -384,7 +384,8 @@ def _get_avatar_image_html(showAvatarOptions: bool, avatar_link = '' if '/users/news/' not in avatar_url: avatar_link = \ - ' ' + ' ' 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, ' \n' + avatar_url + message_id_str + '" tabindex="10">\n' avatar_link += \ ' \n' + '" title="' + reply_to_this_post_str + '" tabindex="10">\n' elif is_unlisted_reply: reply_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">' + \ '' + edit_blog_post_str + \
                     ' |\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">' + \ '' + edit_blog_post_str + \
                     ' |\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">' + \ '' + edit_event_str + \
                 ' |\n' @@ -658,7 +659,8 @@ def _get_announce_icon_html(is_announced: bool, # show the number of announces next to icon announce_str += '\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 += '\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 += \ ' ' + \ '\n' + '?tl=' + box_name + '" title="' + bookmark_title + \ + '" tabindex="10">\n' bookmark_str += \ ' ' + \ '\n' + '?tl=' + box_name + '" title="' + reaction_title + \ + '" tabindex="10">\n' reaction_str += \ ' ' + \ '\n' + '" title="' + mute_this_post_str + '" tabindex="10">\n' mute_str += \ ' ' + \ '' + \
@@ -883,7 +889,8 @@ def _get_mute_icon_html(is_muted: bool,
             '        <a class=\n' + timeline_post_bookmark + '" title="' + undo_mute_str + \ + '" tabindex="10">\n' mute_str += \ ' ' + \ '\n' + '" title="' + delete_this_post_str + '" tabindex="10">\n' delete_str += \ ' ' + \ '' + \
@@ -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['name'] + '
  • \n' if citations_str: @@ -1030,7 +1037,7 @@ def _announce_unattributed_html(translate: {}, '/repeat_inactive.png" ' + \ 'class="announceOrReply"/>\n' + \ ' @unattributed\n' + '" class="announceOrReply" tabindex="10">@unattributed\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' + \ ' ' + \ + 'class="announceOrReply" tabindex="10">' + \ '\n' @@ -1154,7 +1161,8 @@ def _get_post_title_announce_html(base_dir: str, ' ' \ + ';' + announce_avatar_url + message_id_str + \ + '" tabindex="10">' \ '\n' + \ ' @unknown\n' + '" class="announceOrReply" tabindex="10">@unknown\n' def _mitm_warning_html(translate: {}) -> str: @@ -1222,7 +1230,7 @@ def _reply_with_unknown_path_html(translate: {}, 'class="announceOrReply"/>\n' + \ ' ' + \ + '" class="announceOrReply" tabindex="10">' + \ post_domain + '\n' @@ -1240,7 +1248,7 @@ def _get_reply_html(translate: {}, 'icons/reply.png" ' + \ 'class="announceOrReply"/>\n' + \ ' ' + \ + '" class="announceOrReply" tabindex="10">' + \ '' + \ reply_display_name + '\n' @@ -1357,7 +1365,7 @@ def _get_post_title_reply_html(base_dir: str, ' \n' + \ + message_id_str + '" tabindex="10">\n' + \ ' \n' else: footer_str += ' \n' + '" class="' + time_class + '" tabindex="10">' + \ + '\n' footer_str += ' \n' footer_str += ' \n' return footer_str @@ -1762,7 +1770,7 @@ def individual_post_as_html(signing_priv_key_pem: str, ' ' + \ + '" tabindex="10">' + \ '' + \ '\n' else: @@ -1780,7 +1788,8 @@ def individual_post_as_html(signing_priv_key_pem: str, ' @\n' + '" tabindex="10">' + \ + '@\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 = '' + published_str + '\n' + '" class="' + time_class + '" tabindex="10">' + \ + published_str + '\n' else: footer_str = '' + published_str + '\n' + '" class="' + time_class + '" tabindex="10">' + \ + published_str + '\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 += \ - '

    ' + by_text + ' @' + \ + '

    ' + by_text + ' @' + \ by_str_handle + '' + 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 = '' emoji_picks_str += \ - ' ' + emoji_label + '\n' + ' ' + \ + emoji_label + '\n' emoji_picks_str += '\n' css_filename = base_dir + '/epicyon-profile.css' @@ -2573,7 +2585,7 @@ def html_emoji_reaction_picker(css_cache: {}, '\n' + translate['Switch to timeline view'] + '" tabindex="10">\n' header_str += '\n' + \