async image loading

merge-requests/23/head
Bob Mottram 2022-03-28 09:47:53 +01:00
parent 9ae9bd3e94
commit 1cb360e5d3
21 changed files with 195 additions and 140 deletions

19
blog.py
View File

@ -497,14 +497,14 @@ def html_blog_post(session, authorized: bool,
blog_str += '<a href="' + http_prefix + '://' + \
domain_full + '/blog/' + nickname + '/rss.xml">'
blog_str += '<img style="width:3%;min-width:50px" ' + \
'loading="lazy" alt="RSS 2.0" ' + \
'loading="lazy" decoding="async" alt="RSS 2.0" ' + \
'title="RSS 2.0" src="/' + \
'icons/logorss.png" /></a>'
# blog_str += '<a href="' + http_prefix + '://' + \
# domain_full + '/blog/' + nickname + '/rss.txt">'
# blog_str += '<img style="width:3%;min-width:50px" ' + \
# 'loading="lazy" alt="RSS 3.0" ' + \
# 'loading="lazy" decoding="async" alt="RSS 3.0" ' + \
# 'title="RSS 3.0" src="/' + \
# 'icons/rss3.png" /></a>'
@ -557,7 +557,7 @@ def html_blog_page(authorized: bool, session,
navigate_str += '<a href="' + http_prefix + '://' + \
domain_full + '/blog/' + \
nickname + '?page=' + str(page_number-1) + '">' + \
'<img loading="lazy" alt="<" title="<" ' + \
'<img loading="lazy" decoding="async" alt="<" title="<" ' + \
'src="/icons' + \
'/prev.png" class="buttonprev"/></a>\n'
if len(timeline_json['orderedItems']) >= no_of_items:
@ -565,7 +565,7 @@ def html_blog_page(authorized: bool, session,
navigate_str += '<a href="' + http_prefix + '://' + \
domain_full + '/blog/' + nickname + \
'?page=' + str(page_number + 1) + '">' + \
'<img loading="lazy" alt=">" title=">" ' + \
'<img loading="lazy" decoding="async" alt=">" title=">" ' + \
'src="/icons' + \
'/prev.png" class="buttonnext"/></a>\n'
navigate_str += '</p>'
@ -590,13 +590,13 @@ def html_blog_page(authorized: bool, session,
blog_str += '<a href="' + http_prefix + '://' + \
domain_full + '/blog/' + nickname + '/rss.xml">'
blog_str += '<img loading="lazy" alt="RSS 2.0" ' + \
blog_str += '<img loading="lazy" decoding="async" alt="RSS 2.0" ' + \
'title="RSS 2.0" src="/' + \
'icons/logorss.png" /></a>'
# blog_str += '<a href="' + http_prefix + '://' + \
# domain_full + '/blog/' + nickname + '/rss.txt">'
# blog_str += '<img loading="lazy" alt="RSS 3.0" ' + \
# blog_str += '<img loading="lazy" decoding="async" alt="RSS 3.0" ' + \
# 'title="RSS 3.0" src="/' + \
# 'icons/rss3.png" /></a>'
@ -838,7 +838,7 @@ def html_edit_blog(media_instance: bool, translate: {},
translate['This is a scheduled post.'] + '</label></p>'
date_and_location += \
'<p><img loading="lazy" alt="" title="" ' + \
'<p><img loading="lazy" decoding="async" alt="" title="" ' + \
'class="emojicalendar" src="/icons/calendar.png"/>'
date_and_location += \
'<label class="labels">' + translate['Date'] + ': </label>'
@ -874,13 +874,14 @@ def html_edit_blog(media_instance: bool, translate: {},
edit_blog_form += ' <div class="dropbtn">'
edit_blog_form += \
' <img loading="lazy" alt="" title="" src="/icons' + \
' <img loading="lazy" decoding="async" ' + \
'alt="" title="" src="/icons' + \
'/' + scope_icon + '"/><b class="scope-desc">' + \
scope_description + '</b>'
edit_blog_form += ' </div>'
edit_blog_form += ' <a href="' + path_base + \
'/searchemoji"><img loading="lazy" ' + \
'/searchemoji"><img loading="lazy" decoding="async" ' + \
'class="emojisearch" src="/emoji/1F601.png" title="' + \
translate['Search for emoji'] + '" alt="' + \
translate['Search for emoji'] + '"/></a>'

View File

@ -199,7 +199,8 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
'?month=' + str(month_number) + \
'?day=' + str(day_number) + \
'?time=' + event_time + \
'">\n<img class="calendardayicon" loading="lazy" alt="' + \
'">\n<img class="calendardayicon" loading="lazy" ' + \
'decoding="async" alt="' + \
translate['Delete this event'] + ' |" title="' + \
translate['Delete this event'] + '" src="/' + \
'icons/delete.png" /></a></td>\n'
@ -395,7 +396,8 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
'?month=' + str(prev_month_number) + '" ' + \
'accesskey="' + access_keys['Page up'] + '">'
calendar_str += \
' <img loading="lazy" alt="' + translate['Previous month'] + \
' <img loading="lazy" decoding="async" ' + \
'alt="' + translate['Previous month'] + \
'" title="' + translate['Previous month'] + '" src="/icons' + \
'/prev.png" class="buttonprev"/></a>\n'
calendar_str += ' <a href="' + cal_actor + '/inbox" title="'
@ -407,7 +409,8 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
'?month=' + str(next_month_number) + '" ' + \
'accesskey="' + access_keys['Page down'] + '">'
calendar_str += \
' <img loading="lazy" alt="' + translate['Next month'] + \
' <img loading="lazy" decoding="async" ' + \
'alt="' + translate['Next month'] + \
'" title="' + translate['Next month'] + '" src="/icons' + \
'/prev.png" class="buttonnext"/></a>\n'
calendar_str += '</caption>\n'

View File

@ -140,7 +140,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
edit_image_class = 'leftColEditImage'
html_str += \
'\n <center>\n <img class="leftColImg" ' + \
'alt="" loading="lazy" src="/users/' + \
'alt="" loading="lazy" decoding="async" src="/users/' + \
nickname + '/' + left_image_file + '" />\n' + \
' </center>\n'
@ -163,7 +163,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
' <a href="/users/' + nickname + '/editlinks" ' + \
'accesskey="' + access_keys['menuEdit'] + '">' + \
'<img class="' + edit_image_class + '" loading="lazy" alt="' + \
'<img class="' + edit_image_class + \
'" loading="lazy" decoding="async" alt="' + \
translate['Edit Links'] + ' | " title="' + \
translate['Edit Links'] + '" src="/icons/edit.png" /></a>\n'
@ -172,7 +173,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
' <a href="/users/' + nickname + '/themedesigner" ' + \
'accesskey="' + access_keys['menuThemeDesigner'] + '">' + \
'<img class="' + edit_image_class + '" loading="lazy" alt="' + \
'<img class="' + edit_image_class + \
'" loading="lazy" decoding="async" alt="' + \
translate['Theme Designer'] + ' | " title="' + \
translate['Theme Designer'] + '" src="/icons/theme.png" /></a>\n'
@ -190,7 +192,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
rss_title = translate['RSS feed for this site']
rss_icon_str = \
' <a href="' + rss_url + '"><img class="' + edit_image_class + \
'" loading="lazy" alt="' + rss_title + '" title="' + rss_title + \
'" loading="lazy" decoding="async" alt="' + \
rss_title + '" title="' + rss_title + \
'" src="/icons/logorss.png" /></a>\n'
if rss_icon_at_top:
html_str += rss_icon_str
@ -387,7 +390,7 @@ def html_links_mobile(css_cache: {}, base_dir: str,
html_str += \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
'alt="' + translate['Switch to timeline view'] + '" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n'
@ -457,7 +460,7 @@ def html_edit_links(css_cache: {}, translate: {}, base_dir: str, path: str,
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'
edit_links_form += \
'<img loading="lazy" class="timeline-banner" ' + \
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
'alt = "" src="' + \
'/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header>\n'

View File

@ -104,7 +104,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
'\n <center>\n' + \
' <img class="rightColImg" ' + \
'alt="" loading="lazy" src="/users/' + \
'alt="" loading="lazy" decoding="async" src="/users/' + \
nickname + '/' + right_image_file + '" />\n' + \
' </center>\n'
@ -136,7 +136,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
'/users/' + nickname + '/editnewswire" ' + \
'accesskey="' + access_keys['menuEdit'] + '">' + \
'<img class="' + edit_image_class + \
'" loading="lazy" alt="' + \
'" loading="lazy" decoding="async" alt="' + \
translate['Edit newswire'] + ' | " title="' + \
translate['Edit newswire'] + '" src="/' + \
'icons/edit_notify.png" /></a>\n'
@ -147,7 +147,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
'/users/' + nickname + '/editnewswire" ' + \
'accesskey="' + access_keys['menuEdit'] + '">' + \
'<img class="' + edit_image_class + \
'" loading="lazy" alt="' + \
'" loading="lazy" decoding="async" alt="' + \
translate['Edit newswire'] + ' | " title="' + \
translate['Edit newswire'] + '" src="/' + \
'icons/edit.png" /></a>\n'
@ -156,14 +156,14 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
rss_icon_str = \
' <a href="/categories.xml">' + \
'<img class="' + edit_image_class + \
'" loading="lazy" alt="' + \
'" 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">' + \
'<img class="' + edit_image_class + \
'" loading="lazy" alt="' + \
'" loading="lazy" decoding="async" alt="' + \
translate['Newswire RSS Feed'] + ' | " title="' + \
translate['Newswire RSS Feed'] + '" src="/' + \
'icons/logorss.png" /></a>\n'
@ -181,7 +181,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
'/users/' + nickname + '/newblog?nodropdown" ' + \
'accesskey="' + access_keys['menuNewPost'] + '">' + \
'<img class="' + edit_image_class + \
'" loading="lazy" alt="' + \
'" loading="lazy" decoding="async" alt="' + \
title_str + '" title="' + \
title_str + '" src="/' + \
'icons/publish.png" /></a>\n'
@ -261,7 +261,8 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
cached_favicon_filename.replace(base_dir, '')
favicon_link = \
'<img loading="lazy" src="' + favicon_url + '" ' + \
'<img loading="lazy" decoding="async" ' + \
'src="' + favicon_url + '" ' + \
'alt="" ' + _get_broken_fav_substitute() + '/>'
moderated_item = item[5]
link_url = url
@ -298,7 +299,8 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
' ' + date_shown + '<a href="/users/' + nickname + \
'/newswireunvote=' + date_str_link + '" ' + \
'title="' + translate['Remove Vote'] + '">'
html_str += '<img loading="lazy" class="voteicon" src="/' + \
html_str += '<img loading="lazy" decoding="async" ' + \
'class="voteicon" src="/' + \
'alt="' + translate['Remove Vote'] + '" ' + \
'icons/vote.png" /></a></p>\n'
else:
@ -390,8 +392,8 @@ def html_citations(base_dir: str, nickname: str, domain: str,
'<a href="/users/' + nickname + '/newblog" title="' + \
translate['Go Back'] + '" alt="' + \
translate['Go Back'] + '">\n'
html_str += '<img loading="lazy" class="timeline-banner" ' + \
'alt="" src="' + \
html_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" src="' + \
'/users/' + nickname + '/' + banner_file + '" /></a>\n'
html_str += \
@ -504,7 +506,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
html_str += \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
'alt="' + translate['Timeline banner image'] + '" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n'
@ -576,7 +578,8 @@ def html_edit_newswire(css_cache: {}, translate: {}, base_dir: str, path: str,
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'
edit_newswire_form += \
'<img loading="lazy" class="timeline-banner" src="' + \
'<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
'/users/' + nickname + '/' + banner_file + '" ' + \
'alt="" /></a>\n</header>'

View File

@ -159,7 +159,7 @@ def html_confirm_remove_shared_item(css_cache: {}, translate: {},
shares_str += ' <div class="followAvatar">\n'
shares_str += ' <center>\n'
if shared_item_image_url:
shares_str += ' <img loading="lazy" src="' + \
shares_str += ' <img loading="lazy" decoding="async" src="' + \
shared_item_image_url + '"/>\n'
shares_str += \
' <p class="followText">' + translate['Remove'] + \
@ -214,7 +214,8 @@ def html_confirm_follow(css_cache: {}, translate: {}, base_dir: str,
follow_str += ' <center>\n'
follow_str += ' <a href="' + follow_actor + '">\n'
follow_str += \
' <img loading="lazy" src="' + follow_profile_url + '"/></a>\n'
' <img loading="lazy" decoding="async" ' + \
'src="' + follow_profile_url + '"/></a>\n'
follow_actor_nick = get_nickname_from_actor(follow_actor)
if follow_actor_nick:
follow_str += \
@ -263,7 +264,8 @@ def html_confirm_unfollow(css_cache: {}, translate: {}, base_dir: str,
follow_str += ' <center>\n'
follow_str += ' <a href="' + follow_actor + '">\n'
follow_str += \
' <img loading="lazy" src="' + follow_profile_url + '"/></a>\n'
' <img loading="lazy" decoding="async" src="' + \
follow_profile_url + '"/></a>\n'
follow_actor_nick = get_nickname_from_actor(follow_actor)
if follow_actor_nick:
follow_str += \
@ -309,7 +311,8 @@ def html_confirm_unblock(css_cache: {}, translate: {}, base_dir: str,
block_str += ' <center>\n'
block_str += ' <a href="' + block_actor + '">\n'
block_str += \
' <img loading="lazy" src="' + block_profile_url + '"/></a>\n'
' <img loading="lazy" decoding="async" src="' + \
block_profile_url + '"/></a>\n'
block_actor_nick = get_nickname_from_actor(block_actor)
if block_actor_nick:
block_str += \

View File

@ -90,7 +90,8 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
'id="my-newPostDropdown" value="" name="my-checkbox">\n'
drop_down_content += ' <label for="my-newPostDropdown"\n'
drop_down_content += ' data-toggle="newPostDropdown">\n'
drop_down_content += ' <img loading="lazy" alt="" title="" src="/' + \
drop_down_content += ' <img loading="lazy" decoding="async" ' + \
'alt="" title="" src="/' + \
'icons/' + scope_icon + '"/><b>' + scope_description + '</b></label>\n'
if no_drop_down:
@ -102,7 +103,7 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'<li><a href="' + path_base + dropdown_new_post_suffix + \
'" accesskey="' + access_keys['Public'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_public.png"/><b>' + \
translate['Public'] + '</b><br>' + \
translate['Visible to anyone'] + '</a></li>\n'
@ -110,7 +111,8 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'<li><a href="' + path_base + dropdown_new_blog_suffix + \
'" accesskey="' + access_keys['menuBlogs'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" ' + \
'alt="" title="" src="/' + \
'icons/scope_blog.png"/><b>' + \
translate['Article'] + '</b><br>' + \
translate['Create an article'] + '</a></li>\n'
@ -118,27 +120,28 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'<li><a href="' + path_base + dropdown_new_blog_suffix + \
'" accesskey="' + access_keys['menuBlogs'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" ' + \
'alt="" title="" src="/' + \
'icons/scope_blog.png"/><b>' + \
translate['Blog'] + '</b><br>' + \
translate['Publicly visible post'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + dropdown_unlisted_suffix + \
'"><img loading="lazy" alt="" title="" src="/' + \
'"><img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_unlisted.png"/><b>' + \
translate['Unlisted'] + '</b><br>' + \
translate['Not on public timeline'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + dropdown_followers_suffix + \
'" accesskey="' + access_keys['menuFollowers'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_followers.png"/><b>' + \
translate['Followers'] + '</b><br>' + \
translate['Only to followers'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + dropdown_dm_suffix + \
'" accesskey="' + access_keys['menuDM'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_dm.png"/><b>' + \
translate['DM'] + '</b><br>' + \
translate['Only to mentioned people'] + '</a></li>\n'
@ -146,14 +149,14 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'<li><a href="' + path_base + dropdown_reminder_suffix + \
'" accesskey="' + access_keys['Reminder'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_reminder.png"/><b>' + \
translate['Reminder'] + '</b><br>' + \
translate['Scheduled note to yourself'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + dropdown_report_suffix + \
'" accesskey="' + access_keys['reportButton'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_report.png"/><b>' + \
translate['Report'] + '</b><br>' + \
translate['Send to moderators'] + '</a></li>\n'
@ -162,20 +165,21 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'<li><a href="' + path_base + \
'/newshare" accesskey="' + access_keys['menuShares'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_share.png"/><b>' + \
translate['Shares'] + '</b><br>' + \
translate['Describe a shared item'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + \
'/newwanted" accesskey="' + access_keys['menuWanted'] + '">' + \
'<img loading="lazy" alt="" title="" src="/' + \
'<img loading="lazy" decoding="async" alt="" title="" src="/' + \
'icons/scope_wanted.png"/><b>' + \
translate['Wanted'] + '</b><br>' + \
translate['Describe something wanted'] + '</a></li>\n'
drop_down_content += \
'<li><a href="' + path_base + \
'/newquestion"><img loading="lazy" alt="" title="" src="/' + \
'/newquestion"><img loading="lazy" decoding="async" ' + \
'alt="" title="" src="/' + \
'icons/scope_question.png"/><b>' + \
translate['Question'] + '</b><br>' + \
translate['Ask a question'] + '</a></li>\n'
@ -225,7 +229,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
date_and_time_str = '<p>\n'
if not is_new_reminder:
date_and_time_str += \
'<img loading="lazy" alt="" title="" ' + \
'<img loading="lazy" decoding="async" alt="" title="" ' + \
'class="emojicalendar" src="/' + \
'icons/calendar.png"/>\n'
# select a date and time for this post
@ -652,7 +656,8 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'
new_post_form += '<img loading="lazy" class="timeline-banner" src="' + \
new_post_form += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
'/users/' + nickname + '/' + banner_file + '" alt="" /></a>\n' + \
'</header>\n'
@ -765,8 +770,8 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
new_post_form += \
' <td><a href="' + path_base + \
'/searchemoji"><img loading="lazy" class="emojisearch" ' + \
'src="/emoji/1F601.png" title="' + \
'/searchemoji"><img loading="lazy" decoding="async" ' + \
'class="emojisearch" src="/emoji/1F601.png" title="' + \
translate['Search for emoji'] + '" alt="' + \
translate['Search for emoji'] + '"/></a></td>\n'

View File

@ -144,7 +144,7 @@ def html_front_screen(signing_priv_key_pem: str,
banner_file, _ = \
get_banner_file(base_dir, nickname, domain, theme)
profile_header_str = \
'<img loading="lazy" class="timeline-banner" ' + \
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
'src="/users/' + nickname + '/' + banner_file + '" />\n'
if login_button:
profile_header_str += '<center>' + login_button + '</center>\n'

View File

@ -220,7 +220,8 @@ def html_search_hashtag_category(css_cache: {}, translate: {},
if os.path.isfile(search_banner_filename):
html_str += '<a href="' + actor + '/search">\n'
html_str += '<img loading="lazy" class="timeline-banner" src="' + \
html_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
actor + '/' + search_banner_file + '" alt="" /></a>\n'
html_str += \

View File

@ -220,7 +220,7 @@ def header_buttons_timeline(default_timeline: str,
# the search icon
tl_str += \
'<a class="imageAnchor" href="' + users_path + \
'/search"><img loading="lazy" src="/' + \
'/search"><img loading="lazy" decoding="async" src="/' + \
'icons/search.png" title="' + \
translate['Search and follow'] + '" alt="| ' + \
translate['Search and follow'] + \
@ -248,7 +248,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
' <a class="imageAnchor" href="' + \
users_path + calendar_path + \
'"><img loading="lazy" src="/icons/' + \
'"><img loading="lazy" decoding="async" src="/icons/' + \
calendar_image + '" title="' + translate['Calendar'] + \
'" alt="| ' + calendar_alt_text + \
'" class="timelineicon"/></a>\n'
@ -265,7 +265,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
' <a class="imageAnchor" href="' + \
users_path + '/minimal' + \
'"><img loading="lazy" src="/icons' + \
'"><img loading="lazy" decoding="async" src="/icons' + \
'/showhide.png" title="' + translate['Show/Hide Buttons'] + \
'" alt="| ' + translate['Show/Hide Buttons'] + \
'" class="timelineicon"/></a>\n'
@ -287,7 +287,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
'<a class="imageAnchorMobile" href="' + \
users_path + '/newswiremobile">' + \
'<img loading="lazy" src="/icons' + \
'<img loading="lazy" decoding="async" src="/icons' + \
'/newswire.png" title="' + translate['News'] + \
'" alt="| ' + translate['News'] + \
'" class="timelineicon"/></a>'
@ -305,7 +305,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
'<a class="imageAnchorMobile" href="' + \
users_path + '/linksmobile">' + \
'<img loading="lazy" src="/icons' + \
'<img loading="lazy" decoding="async" src="/icons' + \
'/links.png" title="' + translate['Edit Links'] + \
'" alt="| ' + translate['Edit Links'] + \
'" class="timelineicon"/></a>'

View File

@ -73,7 +73,8 @@ def html_likers_of_post(base_dir: str, nickname: str,
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">\n'
html_str += '<img loading="lazy" class="timeline-banner" src="' + \
html_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
'/users/' + nickname + '/' + banner_file + '" alt="" /></a>\n' + \
'</header>\n'

View File

@ -166,7 +166,7 @@ def html_login(css_cache: {}, translate: {},
'<form method="POST" action="/login">\n' + \
' <div class="imgcontainer">\n' + \
text_mode_logo_html + '\n' + \
' <img loading="lazy" src="' + login_image + \
' <img loading="lazy" decoding="async" src="' + login_image + \
'" alt="' + instance_title + '" class="loginimage">\n' + \
login_text + tos_str + '\n' + \
' </div>\n' + \
@ -188,7 +188,7 @@ def html_login(css_cache: {}, translate: {},
' </div>\n' + \
'</form>\n' + \
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
'<img loading="lazy" class="license" title="' + \
'<img loading="lazy" decoding="async" class="license" title="' + \
translate['Get the source code'] + '" alt="' + \
translate['Get the source code'] + '" src="/icons/agpl.png" /></a>\n'
login_form += html_footer()

View File

@ -40,7 +40,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
if '<' in url:
url = url.split('<')[0]
content += \
"<center>\n<iframe loading=\"lazy\" " + \
"<center>\n<iframe loading=\"lazy\" decoding=\"async\" " + \
"src=\"https://player.vimeo.com/video/" + \
url + "\" width=\"" + str(width) + \
"\" height=\"" + str(height) + \
@ -62,7 +62,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
if '?utm_' in url:
url = url.split('?utm_')[0]
content += \
"<center>\n<iframe loading=\"lazy\" src=\"" + \
"<center>\n<iframe loading=\"lazy\" " + \
"decoding=\"async\" src=\"" + \
video_site + url + "\" width=\"" + str(width) + \
"\" height=\"" + str(height) + \
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
@ -82,7 +83,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = url.split('?utm_')[0]
video_site = 'https://www.youtube.com/'
content += \
"<center>\n<iframe loading=\"lazy\" src=\"" + \
"<center>\n<iframe loading=\"lazy\" " + \
"decoding=\"async\" src=\"" + \
video_site + url + "\" width=\"" + str(width) + \
"\" height=\"" + str(height) + \
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
@ -113,7 +115,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
if '?utm_' in url:
url = url.split('?utm_')[0]
content += \
"<center>\n<iframe loading=\"lazy\" src=\"" + \
"<center>\n<iframe loading=\"lazy\" " + \
"decoding=\"async\" src=\"" + \
video_site + url + "\" width=\"" + \
str(width) + "\" height=\"" + str(height) + \
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
@ -133,7 +136,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = url + '/oembed'
url += video_site_settings
content += \
"<center>\n<iframe loading=\"lazy\" src=\"" + \
"<center>\n<iframe loading=\"lazy\" " + \
"decoding=\"async\" src=\"" + \
video_site + url + "\" width=\"" + \
str(width) + "\" height=\"" + str(height) + \
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
@ -195,7 +199,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url = url.replace('/watch/', '/embed/')
content += \
"<center>\n<iframe loading=\"lazy\" " + \
"<center>\n<iframe loading=\"lazy\" decoding=\"async\" " + \
"sandbox=\"allow-same-origin " + \
"allow-scripts\" src=\"https://" + \
site + url + "\" width=\"" + str(width) + \

View File

@ -357,7 +357,7 @@ def html_moderation_info(css_cache: {}, translate: {},
'/users/' + nickname + '?options=' + actor + ';1;' + \
'/members/' + acct_nickname + ext
info_form += '<td>\n<a href="' + acct_url + '">'
info_form += '<img loading="lazy" style="width:90%" '
info_form += '<img loading="lazy" decoding="async" style="width:90%" '
info_form += 'src="' + avatar_url + '" />'
info_form += '<br><center>'
if is_moderator(base_dir, acct_nickname):

View File

@ -142,7 +142,8 @@ def html_person_options(default_timeline: str,
options_str += ' <div class="optionsAvatar">\n'
options_str += ' <center>\n'
options_str += ' <a href="' + options_actor + '">\n'
options_str += ' <img loading="lazy" src="' + options_profile_url + \
options_str += ' <img loading="lazy" decoding="async" ' + \
'src="' + options_profile_url + \
'" alt="" ' + get_broken_link_substitute() + '/></a>\n'
handle_nick = get_nickname_from_actor(options_actor)
if not handle_nick:

View File

@ -95,8 +95,8 @@ def _html_podcast_performers(podcast_properties: {}) -> str:
podcast_str += ' <figure>\n'
podcast_str += ' <a href="' + performer_url + '">\n'
podcast_str += \
' <img loading="lazy" src="' + performer_img + \
'" alt="" />\n'
' <img loading="lazy" decoding="async" ' + \
'src="' + performer_img + '" alt="" />\n'
podcast_str += \
' <figcaption>' + performer_title + '</figcaption>\n'
podcast_str += ' </a>\n'
@ -194,10 +194,12 @@ def html_podcast_episode(css_cache: {}, translate: {},
podcast_str += ' <center>\n'
podcast_str += ' <a href="' + link_url + '">\n'
if image_src == 'srcset':
podcast_str += ' <img loading="lazy" srcset="' + image_url + \
podcast_str += ' <img loading="lazy" decoding="async" ' + \
'srcset="' + image_url + \
'" alt="" ' + get_broken_link_substitute() + '/></a>\n'
else:
podcast_str += ' <img loading="lazy" src="' + image_url + \
podcast_str += ' <img loading="lazy" decoding="async" ' + \
'src="' + image_url + \
'" alt="" ' + get_broken_link_substitute() + '/></a>\n'
podcast_str += ' </center>\n'
podcast_str += ' </div>\n'
@ -235,7 +237,7 @@ def html_podcast_episode(css_cache: {}, translate: {},
if '?utm_' in url:
url = url.split('?utm_')[0]
podcast_str += \
" <iframe loading=\"lazy\" src=\"" + \
" <iframe loading=\"lazy\" decoding=\"async\" src=\"" + \
url + "\" width=\"400\" height=\"300\" " + \
"frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
"allowfullscreen>\n </iframe>\n"

View File

@ -356,7 +356,8 @@ def _get_avatar_image_html(showAvatarOptions: bool,
if translate.get(show_profile_str):
show_profile_str = translate[show_profile_str]
avatar_link += \
'<img loading="lazy" src="' + avatar_url + '" title="' + \
'<img loading="lazy" decoding="async" ' + \
'src="' + avatar_url + '" title="' + \
show_profile_str + '" alt=" "' + avatar_position + \
get_broken_link_substitute() + '/></a>\n'
@ -373,7 +374,7 @@ def _get_avatar_image_html(showAvatarOptions: bool,
';' + str(page_number) + ';' + \
avatar_url + message_id_str + '">\n'
avatar_link += \
' <img loading="lazy" title="' + \
' <img loading="lazy" decoding="async" title="' + \
show_options_for_this_person_str + '" ' + \
'alt="👤 ' + \
show_options_for_this_person_str + '" ' + \
@ -382,7 +383,7 @@ def _get_avatar_image_html(showAvatarOptions: bool,
else:
# don't link to the person options for the news account
avatar_link += \
' <img loading="lazy" title="' + \
' <img loading="lazy" decoding="async" title="' + \
show_options_for_this_person_str + '" ' + \
'alt="👤 ' + \
show_options_for_this_person_str + '" ' + \
@ -481,7 +482,7 @@ def _get_reply_icon_html(base_dir: str, nickname: str, domain: str,
reply_str += \
' ' + \
'<img loading="lazy" title="' + \
'<img loading="lazy" decoding="async" title="' + \
reply_to_this_post_str + '" alt="' + reply_to_this_post_str + \
' |" src="/icons/reply.png"/></a>\n'
return reply_str
@ -520,7 +521,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
post_id.split('/statuses/')[1] + \
';actor=' + actor_nickname + \
'" title="' + edit_blog_post_str + '">' + \
'<img loading="lazy" title="' + \
'<img loading="lazy" decoding="async" title="' + \
edit_blog_post_str + '" alt="' + edit_blog_post_str + \
' |" src="/icons/edit.png"/></a>\n'
else:
@ -531,7 +532,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
post_id.split('/statuses/')[1] + \
'?actor=' + actor_nickname + \
'" title="' + edit_blog_post_str + '">' + \
'<img loading="lazy" title="' + \
'<img loading="lazy" decoding="async" title="' + \
edit_blog_post_str + '" alt="' + edit_blog_post_str + \
' |" src="/icons/edit.png"/></a>\n'
elif isEvent:
@ -545,7 +546,7 @@ def _get_edit_icon_html(base_dir: str, nickname: str, domain_full: str,
post_id.split('/statuses/')[1] + \
'?actor=' + actor_nickname + \
'" title="' + edit_event_str + '">' + \
'<img loading="lazy" title="' + \
'<img loading="lazy" decoding="async" title="' + \
edit_event_str + '" alt="' + edit_event_str + \
' |" src="/icons/edit.png"/></a>\n'
return edit_str
@ -640,7 +641,7 @@ def _get_announce_icon_html(is_announced: bool,
announce_str += \
' ' + \
'<img loading="lazy" title="' + announce_title + \
'<img loading="lazy" decoding="async" title="' + announce_title + \
'" alt="' + announce_emoji + announce_title + \
' |" src="/icons/' + announce_icon + '"/></a>\n'
return announce_str
@ -715,7 +716,8 @@ def _get_like_icon_html(nickname: str, domain_full: str,
'?tl=' + box_name + '" title="' + like_title + like_count_str + '">\n'
like_str += \
' ' + \
'<img loading="lazy" title="' + like_title + like_count_str + \
'<img loading="lazy" decoding="async" title="' + \
like_title + like_count_str + \
'" alt="' + like_emoji + like_title + \
' |" src="/icons/' + like_icon + '"/></a>\n'
return like_str
@ -762,7 +764,8 @@ def _get_bookmark_icon_html(nickname: str, domain_full: str,
'?tl=' + box_name + '" title="' + bookmark_title + '">\n'
bookmark_str += \
' ' + \
'<img loading="lazy" title="' + bookmark_title + '" alt="' + \
'<img loading="lazy" decoding="async" title="' + \
bookmark_title + '" alt="' + \
bookmark_emoji + bookmark_title + ' |" src="/icons' + \
'/' + bookmark_icon + '"/></a>\n'
return bookmark_str
@ -800,7 +803,8 @@ def _get_reaction_icon_html(nickname: str, domain_full: str,
'?tl=' + box_name + '" title="' + reaction_title + '">\n'
reaction_str += \
' ' + \
'<img loading="lazy" title="' + reaction_title + '" alt="' + \
'<img loading="lazy" decoding="async" title="' + \
reaction_title + '" alt="' + \
reaction_title + ' |" src="/icons' + \
'/' + reaction_icon + '"/></a>\n'
return reaction_str
@ -834,7 +838,7 @@ def _get_mute_icon_html(is_muted: bool,
'" title="' + mute_this_post_str + '">\n'
mute_str += \
' ' + \
'<img loading="lazy" alt="' + \
'<img loading="lazy" decoding="async" alt="' + \
mute_this_post_str + \
' |" title="' + mute_this_post_str + \
'" src="/icons/mute.png"/></a>\n'
@ -849,7 +853,8 @@ def _get_mute_icon_html(is_muted: bool,
timeline_post_bookmark + '" title="' + undo_mute_str + '">\n'
mute_str += \
' ' + \
'<img loading="lazy" alt="🔇 ' + undo_mute_str + \
'<img loading="lazy" decoding="async" ' + \
'alt="🔇 ' + undo_mute_str + \
' |" title="' + undo_mute_str + \
'" src="/icons/unmute.png"/></a>\n'
return mute_str
@ -880,7 +885,7 @@ def _get_delete_icon_html(nickname: str, domain_full: str,
'" title="' + delete_this_post_str + '">\n'
delete_str += \
' ' + \
'<img loading="lazy" alt="' + \
'<img loading="lazy" decoding="async" alt="' + \
delete_this_post_str + \
' |" title="' + delete_this_post_str + \
'" src="/icons/delete.png"/></a>\n'
@ -970,7 +975,7 @@ def _boost_own_post_html(translate: {}) -> str:
announces_str = 'announces'
if translate.get(announces_str):
announces_str = translate[announces_str]
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
announces_str + \
'" alt="' + announces_str + \
'" src="/icons' + \
@ -986,7 +991,7 @@ def _announce_unattributed_html(translate: {},
if translate.get(announces_str):
announces_str = translate[announces_str]
post_id = remove_id_ending(post_json_object['object']['id'])
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
announces_str + '" alt="' + \
announces_str + '" src="/icons' + \
'/repeat_inactive.png" ' + \
@ -1004,7 +1009,7 @@ def _announce_with_display_name_html(translate: {},
if translate.get(announces_str):
announces_str = translate[announces_str]
post_id = remove_id_ending(post_json_object['object']['id'])
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
announces_str + '" alt="' + \
announces_str + '" src="/' + \
'icons/repeat_inactive.png" ' + \
@ -1111,7 +1116,8 @@ def _get_post_title_announce_html(base_dir: str,
'href="/users/' + nickname + '?options=' + \
announce_actor + ';' + str(page_number) + \
';' + announce_avatar_url + message_id_str + '">' \
'<img loading="lazy" src="' + announce_avatar_url + '" ' + \
'<img loading="lazy" decoding="async" src="' + \
announce_avatar_url + '" ' + \
'title="' + show_options_for_this_person_str + \
'" alt=" "' + avatar_position + \
get_broken_link_substitute() + '/></a>\n </div>\n'
@ -1126,7 +1132,7 @@ def _reply_to_yourself_html(translate: {}) -> str:
replying_to_themselves_str = 'replying to themselves'
if translate.get(replying_to_themselves_str):
replying_to_themselves_str = translate[replying_to_themselves_str]
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
replying_to_themselves_str + \
'" alt="' + replying_to_themselves_str + \
'" src="/icons' + \
@ -1140,7 +1146,7 @@ def _reply_to_unknown_html(translate: {},
replying_to_str = 'replying to'
if translate.get(replying_to_str):
replying_to_str = translate[replying_to_str]
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
replying_to_str + '" alt="' + \
replying_to_str + '" src="/icons' + \
'/reply.png" class="announceOrReply"/>\n' + \
@ -1153,7 +1159,7 @@ def _mitm_warning_html(translate: {}) -> str:
"""Returns the html title for a reply to an unknown handle
"""
mitm_warning_str = translate['mitm']
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
mitm_warning_str + '" alt="' + \
mitm_warning_str + '" src="/icons' + \
'/mitm.png" class="announceOrReply"/>\n'
@ -1168,7 +1174,7 @@ def _reply_with_unknown_path_html(translate: {},
replying_to_str = 'replying to'
if translate.get(replying_to_str):
replying_to_str = translate[replying_to_str]
return ' <img loading="lazy" title="' + \
return ' <img loading="lazy" decoding="async" title="' + \
replying_to_str + \
'" alt="' + replying_to_str + \
'" src="/icons/reply.png" ' + \
@ -1187,7 +1193,7 @@ def _get_reply_html(translate: {},
if translate.get(replying_to_str):
replying_to_str = translate[replying_to_str]
return ' ' + \
'<img loading="lazy" title="' + \
'<img loading="lazy" decoding="async" title="' + \
replying_to_str + '" alt="' + \
replying_to_str + '" src="/' + \
'icons/reply.png" ' + \
@ -1305,7 +1311,8 @@ def _get_post_title_reply_html(base_dir: str,
'href="/users/' + nickname + '?options=' + reply_actor + \
';' + str(page_number) + ';' + reply_avatar_url + \
message_id_str + '">\n' + \
' <img loading="lazy" src="' + reply_avatar_url + '" ' + \
' <img loading="lazy" decoding="async" ' + \
'src="' + reply_avatar_url + '" ' + \
'title="' + show_profile_str + \
'" alt=" "' + avatar_position + get_broken_link_substitute() + \
'/></a>\n </div>\n'
@ -1712,7 +1719,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
# Show a DM icon for DMs in the inbox timeline
if post_is_dm:
title_str = \
title_str + ' <img loading="lazy" src="/' + \
title_str + ' <img loading="lazy" decoding="async" src="/' + \
'icons/dm.png" class="DMicon"/>\n'
# check if replying is permitted
@ -2434,8 +2441,8 @@ def html_emoji_reaction_picker(css_cache: {},
'?page=' + str(page_number) + '" title="' + \
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '">\n'
header_str += '<img loading="lazy" class="timeline-banner" ' + \
'alt="" ' + \
header_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header>\n'

View File

@ -411,8 +411,8 @@ def _get_profile_header(base_dir: str, http_prefix: str,
' <a href="/users/' + \
nickname + '/' + default_timeline + '" title="' + \
translate['Switch to timeline view'] + '">\n' + \
' <img loading="lazy" src="' + avatar_url + '" ' + \
'alt="" class="title"></a>\n'
' <img loading="lazy" decoding="async" ' + \
'src="' + avatar_url + '" alt="" class="title"></a>\n'
occupation_str = ''
if occupation_name:
@ -517,8 +517,8 @@ def _get_profile_header_after_search(base_dir: str,
' <a href="/users/' + \
nickname + '/' + default_timeline + '" title="' + \
translate['Switch to timeline view'] + '">\n' + \
' <img loading="lazy" src="' + avatar_url + '" ' + \
'alt="" class="title"></a>\n'
' <img loading="lazy" decoding="async" src="' + \
avatar_url + '" ' + 'alt="" class="title"></a>\n'
if not display_name:
display_name = search_nickname
html_str += \
@ -750,13 +750,13 @@ def html_profile(signing_priv_key_pem: str,
if authorized:
edit_profile_str = \
'<a class="imageAnchor" href="' + users_path + '/editprofile">' + \
'<img loading="lazy" src="/icons' + \
'<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">' + \
'<img loading="lazy" src="/icons' + \
'<img loading="lazy" decoding="async" src="/icons' + \
'/logout.png" title="' + translate['Logout'] + \
'" alt="| ' + translate['Logout'] + \
'" class="timelineicon"/></a>\n'
@ -984,7 +984,7 @@ def html_profile(signing_priv_key_pem: str,
license_str = \
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
'<img loading="lazy" class="license" alt="' + \
'<img loading="lazy" decoding="async" class="license" alt="' + \
translate['Get the source code'] + '" title="' + \
translate['Get the source code'] + '" src="/icons/agpl.png" /></a>'
@ -1161,7 +1161,8 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
' <center>\n' + \
' <a href="' + actor + '/' + feedName + \
'?page=' + str(page_number - 1) + '#buttonheader' + \
'"><img loading="lazy" class="pageicon" src="/' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \
'icons/pageup.png" title="' + \
translate['Page up'] + '" alt="' + \
translate['Page up'] + '"></a>\n' + \
@ -1191,7 +1192,8 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str,
' <center>\n' + \
' <a href="' + actor + '/' + feedName + \
'?page=' + str(page_number + 1) + '#buttonheader' + \
'"><img loading="lazy" class="pageicon" src="/' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \
'icons/pagedown.png" title="' + \
translate['Page down'] + '" alt="' + \
translate['Page down'] + '"></a>\n' + \
@ -2137,7 +2139,8 @@ def _html_edit_profile_top_banner(base_dir: str,
"""
edit_profile_form = \
'<a href="/users/' + nickname + '/' + default_timeline + '">' + \
'<img loading="lazy" class="timeline-banner" src="' + \
'<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
'/users/' + nickname + '/' + banner_file + '" alt="" /></a>\n'
edit_profile_form += \
@ -2513,7 +2516,8 @@ def _individual_follow_as_html(signing_priv_key_pem: str,
result_str += \
'<a href="/users/' + actor_nickname + '?options=' + \
followUrl + ';1;' + avatar_url + '">\n'
result_str += '<p><img loading="lazy" src="' + avatar_url + '" alt=" ">'
result_str += '<p><img loading="lazy" decoding="async" ' + \
'src="' + avatar_url + '" alt=" ">'
result_str += title_str + '</a>' + buttons_str + '</p>\n'
result_str += '</div>\n'
return result_str

View File

@ -98,7 +98,8 @@ def html_search_emoji(css_cache: {}, translate: {},
heading_shown = False
emoji_form += '<center>'
msg_str1 = translate['Copy the text then paste it into your post']
msg_str2 = ':<img loading="lazy" class="searchEmoji" src="/emoji/'
msg_str2 = ':<img loading="lazy" decoding="async" ' + \
'class="searchEmoji" src="/emoji/'
for emoji_name, filename in results.items():
if not os.path.isfile(base_dir + '/emoji/' + filename):
if not os.path.isfile(base_dir + '/emojicustom/' + filename):
@ -161,7 +162,8 @@ def _html_search_result_share_page(actor: str, domain_full: str,
' <center>\n' + ' <a href="' + actor + \
'" type="submit" name="submitSearch">\n'
shared_items_form += \
' <img loading="lazy" ' + 'class="pageicon" src="/icons' + \
' <img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/icons' + \
'/' + image_url + '" title="' + title_str + \
'" alt="' + title_str + '"/></a>\n'
shared_items_form += ' </center>\n'
@ -410,7 +412,8 @@ def html_search(css_cache: {}, translate: {},
translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'accesskey="' + timeline_key + '">\n'
follow_str += '<img loading="lazy" class="timeline-banner" src="' + \
follow_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" src="' + \
users_path + '/' + search_banner_file + '" alt="" /></a>\n' + \
'</header>\n'
@ -579,7 +582,7 @@ def html_skills_search(actor: str,
'<div class="search-result""><a href="' + \
actor + '/skills">'
skill_search_form += \
'<img loading="lazy" src="' + avatar_url + \
'<img loading="lazy" decoding="async" src="' + avatar_url + \
'" alt="" /><span class="search-result-text">' + actor_name + \
'</span></a></div>'
ctr += 1
@ -790,7 +793,8 @@ def html_hashtag_search(css_cache: {},
hashtag_search_form += '<a href="/tags/rss2/' + hashtag + '">'
hashtag_search_form += \
'<img style="width:3%;min-width:50px" ' + \
'loading="lazy" alt="RSS 2.0" title="RSS 2.0" src="/' + \
'loading="lazy" decoding="async" ' + \
'alt="RSS 2.0" title="RSS 2.0" src="/' + \
'icons/logorss.png" /></a></center>\n'
# edit the category for this hashtag
@ -820,7 +824,8 @@ def html_hashtag_search(css_cache: {},
' <a href="/users/' + nickname + \
'/tags/' + hashtag + '?page=' + \
str(page_number - 1) + \
'"><img loading="lazy" class="pageicon" src="/' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \
'icons/pageup.png" title="' + \
translate['Page up'] + \
'" alt="' + translate['Page up'] + \
@ -899,7 +904,8 @@ def html_hashtag_search(css_cache: {},
' <center>\n' + \
' <a href="/users/' + nickname + '/tags/' + hashtag + \
'?page=' + str(page_number + 1) + \
'"><img loading="lazy" class="pageicon" src="/icons' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/icons' + \
'/pagedown.png" title="' + translate['Page down'] + \
'" alt="' + translate['Page down'] + '"></a>' + \
' </center>'

View File

@ -199,7 +199,7 @@ def html_theme_designer(css_cache: {}, base_dir: str,
theme_form += \
'<a href="/users/' + nickname + '/' + default_timeline + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \
'<img loading="lazy" decoding="async" class="timeline-banner" ' + \
'title="' + translate['Switch to timeline view'] + '" ' + \
'alt="' + translate['Switch to timeline view'] + '" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n'

View File

@ -107,7 +107,8 @@ 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" src="/' + \
'/newdm?nodropdown"><img loading="lazy" ' + \
'decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new DM'] + \
'" alt="| ' + translate['Create a new DM'] + \
@ -121,7 +122,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 + \
'/newblog"><img loading="lazy" src="/' + \
'/newblog"><img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
@ -135,7 +136,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
if not icons_as_buttons:
new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \
'/newshare?nodropdown"><img loading="lazy" src="/' + \
'/newshare?nodropdown">' + \
'<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new shared item'] + '" alt="| ' + \
translate['Create a new shared item'] + \
@ -149,7 +151,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
if not icons_as_buttons:
new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \
'/newwanted?nodropdown"><img loading="lazy" src="/' + \
'/newwanted?nodropdown">' + \
'<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new wanted item'] + '" alt="| ' + \
translate['Create a new wanted item'] + \
@ -164,7 +167,8 @@ 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"><img loading="lazy" src="/' + \
'/newpost">' + \
'<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
@ -178,7 +182,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
if not icons_as_buttons:
new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \
'/newfollowers"><img loading="lazy" src="/' + \
'/newfollowers">' + \
'<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + \
'" alt="| ' + translate['Create a new post'] + \
@ -638,7 +643,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
'<a href="' + users_path + \
'/followers#buttonheader" ' + \
'accesskey="' + access_keys['followButton'] + '">' + \
'<img loading="lazy" ' + \
'<img loading="lazy" decoding="async" ' + \
'class="timelineicon" alt="' + \
translate['Approve follow requests'] + \
'" title="' + translate['Approve follow requests'] + \
@ -717,8 +722,8 @@ def html_timeline(css_cache: {}, default_timeline: str,
'<a href="/users/' + nickname + '" title="' + \
translate['Switch to profile view'] + '" alt="' + \
translate['Switch to profile view'] + '">\n'
tl_str += '<img loading="lazy" class="timeline-banner" ' + \
'alt="" ' + \
tl_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="' + users_path + '/' + banner_file + '" /></a>\n' + \
'</header>\n'
@ -850,7 +855,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
' <a href="' + users_path + '/' + box_name + \
'?page=' + str(page_number - 1) + \
'" accesskey="' + access_keys['Page up'] + '">' + \
'<img loading="lazy" class="pageicon" src="/' + \
'<img loading="lazy" decoding="async" class="pageicon" src="/' + \
'icons/pageup.png" title="' + \
translate['Page up'] + '" alt="' + \
translate['Page up'] + '"></a>\n' + \
@ -962,7 +967,7 @@ def html_timeline(css_cache: {}, default_timeline: str,
' <a href="' + users_path + '/' + box_name + '?page=' + \
str(page_number + 1) + \
'" accesskey="' + access_keys['Page down'] + '">' + \
'<img loading="lazy" class="pageicon" src="/' + \
'<img loading="lazy" decoding="async" class="pageicon" src="/' + \
'icons/pagedown.png" title="' + \
translate['Page down'] + '" alt="' + \
translate['Page down'] + '"></a>\n' + \
@ -999,7 +1004,8 @@ def html_individual_share(domain: str, share_id: str,
if shared_item.get('imageUrl'):
profile_str += '<a href="' + shared_item['imageUrl'] + '">\n'
profile_str += \
'<img loading="lazy" src="' + shared_item['imageUrl'] + \
'<img loading="lazy" decoding="async" ' + \
'src="' + shared_item['imageUrl'] + \
'" alt="' + translate['Item image'] + '">\n</a>\n'
profile_str += '<p>' + shared_item['summary'] + '</p>\n<p>'
if shared_item.get('itemQty'):
@ -1089,7 +1095,8 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
str(page_number - 1) + \
'"><img loading="lazy" class="pageicon" src="/' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \
'icons/pageup.png" title="' + translate['Page up'] + \
'" alt="' + translate['Page up'] + '"></a>\n' + \
' </center>\n'
@ -1129,7 +1136,8 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
str(page_number + 1) + \
'"><img loading="lazy" class="pageicon" src="/' + \
'"><img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \
'icons/pagedown.png" title="' + translate['Page down'] + \
'" alt="' + translate['Page down'] + '"></a>\n' + \
' </center>\n'

View File

@ -136,13 +136,13 @@ def header_buttons_front_screen(translate: {},
header_str += \
' <a href="' + \
'/users/news/newswiremobile">' + \
'<img loading="lazy" src="/icons' + \
'<img loading="lazy" decoding="async" src="/icons' + \
'/newswire.png" title="' + translate['Newswire'] + \
'" alt="| ' + translate['Newswire'] + '"/></a>\n'
header_str += \
' <a href="' + \
'/users/news/linksmobile">' + \
'<img loading="lazy" src="/icons' + \
'<img loading="lazy" decoding="async" src="/icons' + \
'/links.png" title="' + translate['Links'] + \
'" alt="| ' + translate['Links'] + '"/></a>\n'
else:
@ -1117,7 +1117,8 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
if not is_muted:
gallery_str += ' <a href="' + image_url + '">\n'
gallery_str += \
' <img loading="lazy" src="' + \
' <img loading="lazy" ' + \
'decoding="async" src="' + \
image_url + '" alt="" title="">\n'
gallery_str += ' </a>\n'
if post_json_object['object'].get('url'):
@ -1145,7 +1146,8 @@ def get_post_attachments_as_html(post_json_object: {}, box_name: str,
attachment_str += '<a href="' + image_url + '">'
attachment_str += \
'<img loading="lazy" src="' + image_url + \
'<img loading="lazy" decoding="async" ' + \
'src="' + image_url + \
'" alt="' + image_description + '" title="' + \
image_description + '" class="attachment"></a>\n'
attachment_ctr += 1
@ -1492,7 +1494,8 @@ def html_search_result_share(base_dir: str, shared_item: {}, translate: {},
shared_items_form += \
'<a href="' + shared_item['imageUrl'] + '">\n'
shared_items_form += \
'<img loading="lazy" src="' + shared_item['imageUrl'] + \
'<img loading="lazy" decoding="async" ' + \
'src="' + shared_item['imageUrl'] + \
'" alt="Item image"></a>\n'
shared_items_form += '<p>' + shared_item['summary'] + '</p>\n<p>'
if shared_item.get('itemQty'):
@ -1630,8 +1633,8 @@ def html_show_share(base_dir: str, domain: str, nickname: str,
'<header>\n' + \
'<a href="/users/' + nickname + '/' + \
default_timeline + '" title="" alt="">\n'
share_str += '<img loading="lazy" class="timeline-banner" ' + \
'alt="" ' + \
share_str += '<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header><br>\n'
share_str += \