From 1cb360e5d3409f7f04e3e6836f784e1a0f7b3cb7 Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Mon, 28 Mar 2022 09:47:53 +0100
Subject: [PATCH] async image loading
---
blog.py | 19 +++++++------
webapp_calendar.py | 9 ++++--
webapp_column_left.py | 15 ++++++----
webapp_column_right.py | 27 ++++++++++--------
webapp_confirm.py | 11 +++++---
webapp_create_post.py | 37 +++++++++++++-----------
webapp_frontscreen.py | 2 +-
webapp_hashtagswarm.py | 3 +-
webapp_headerbuttons.py | 10 +++----
webapp_likers.py | 3 +-
webapp_login.py | 4 +--
webapp_media.py | 16 +++++++----
webapp_moderation.py | 2 +-
webapp_person_options.py | 3 +-
webapp_podcast.py | 12 ++++----
webapp_post.py | 61 ++++++++++++++++++++++------------------
webapp_profile.py | 26 +++++++++--------
webapp_search.py | 20 ++++++++-----
webapp_theme_designer.py | 2 +-
webapp_timeline.py | 36 +++++++++++++++---------
webapp_utils.py | 17 ++++++-----
21 files changed, 195 insertions(+), 140 deletions(-)
diff --git a/blog.py b/blog.py
index f4c78f41c..73601f043 100644
--- a/blog.py
+++ b/blog.py
@@ -497,14 +497,14 @@ def html_blog_post(session, authorized: bool,
blog_str += ''
blog_str += ''
# blog_str += ''
# blog_str += ''
@@ -557,7 +557,7 @@ def html_blog_page(authorized: bool, session,
navigate_str += '' + \
- '\n'
if len(timeline_json['orderedItems']) >= no_of_items:
@@ -565,7 +565,7 @@ def html_blog_page(authorized: bool, session,
navigate_str += '' + \
- '\n'
navigate_str += '
'
@@ -590,13 +590,13 @@ def html_blog_page(authorized: bool, session,
blog_str += ''
- blog_str += ''
# blog_str += ''
- # blog_str += ''
@@ -838,7 +838,7 @@ def html_edit_blog(media_instance: bool, translate: {},
translate['This is a scheduled post.'] + ''
date_and_location += \
- ''
date_and_location += \
''
@@ -874,13 +874,14 @@ def html_edit_blog(media_instance: bool, translate: {},
edit_blog_form += '
'
edit_blog_form += \
- '
' + \
scope_description + ''
edit_blog_form += '
'
edit_blog_form += ' '
diff --git a/webapp_calendar.py b/webapp_calendar.py
index d0901bad9..309f99263 100644
--- a/webapp_calendar.py
+++ b/webapp_calendar.py
@@ -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\n\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 += \
- ' \n'
calendar_str += ' '
calendar_str += \
- ' \n'
calendar_str += '\n'
diff --git a/webapp_column_left.py b/webapp_column_left.py
index 790be4c72..726c73fe0 100644
--- a/webapp_column_left.py
+++ b/webapp_column_left.py
@@ -140,7 +140,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
edit_image_class = 'leftColEditImage'
html_str += \
'\n \n \n' + \
' \n'
@@ -163,7 +163,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
' ' + \
- '\n'
@@ -172,7 +173,8 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
' ' + \
- '\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 = \
' \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 += \
'' + \
- '\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 += \
- '\n' + \
'\n'
diff --git a/webapp_column_right.py b/webapp_column_right.py
index b46473e25..cc680749e 100644
--- a/webapp_column_right.py
+++ b/webapp_column_right.py
@@ -104,7 +104,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \
'\n \n' + \
' \n' + \
' \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'] + '">' + \
'\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'] + '">' + \
'\n'
@@ -156,14 +156,14 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
rss_icon_str = \
' ' + \
'\n'
rss_icon_str += \
' ' + \
'\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'] + '">' + \
'\n'
@@ -261,7 +261,8 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
cached_favicon_filename.replace(base_dir, '')
favicon_link = \
- ''
moderated_item = item[5]
link_url = url
@@ -298,7 +299,8 @@ def _html_newswire(base_dir: str, newswire: {}, nickname: str, moderator: bool,
' ' + date_shown + ''
- html_str += '\n'
else:
@@ -390,8 +392,8 @@ def html_citations(base_dir: str, nickname: str, domain: str,
'\n'
- html_str += '\n'
html_str += \
@@ -504,7 +506,7 @@ def html_newswire_mobile(css_cache: {}, base_dir: str, nickname: str,
html_str += \
'' + \
- '\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 += \
- '\n'
diff --git a/webapp_confirm.py b/webapp_confirm.py
index d0bcedc6d..63dce3c4f 100644
--- a/webapp_confirm.py
+++ b/webapp_confirm.py
@@ -159,7 +159,7 @@ def html_confirm_remove_shared_item(css_cache: {}, translate: {},
shares_str += ' \n'
shares_str += '
\n'
if shared_item_image_url:
- shares_str += ' \n'
shares_str += \
' ' + translate['Remove'] + \
@@ -214,7 +214,8 @@ def html_confirm_follow(css_cache: {}, translate: {}, base_dir: str,
follow_str += '
\n'
follow_str += ' \n'
follow_str += \
- ' \n'
+ ' \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 += ' \n'
follow_str += ' \n'
follow_str += \
- ' \n'
+ ' \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 += ' \n'
block_str += ' \n'
block_str += \
- ' \n'
+ ' \n'
block_actor_nick = get_nickname_from_actor(block_actor)
if block_actor_nick:
block_str += \
diff --git a/webapp_create_post.py b/webapp_create_post.py
index c81ed2cbe..584be618b 100644
--- a/webapp_create_post.py
+++ b/webapp_create_post.py
@@ -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 += ' \n'
if no_drop_down:
@@ -102,7 +103,7 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'' + \
- '' + \
translate['Public'] + '
' + \
translate['Visible to anyone'] + '\n'
@@ -110,7 +111,8 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'' + \
- '' + \
translate['Article'] + '
' + \
translate['Create an article'] + '\n'
@@ -118,27 +120,28 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'' + \
- '' + \
translate['Blog'] + '
' + \
translate['Publicly visible post'] + '\n'
drop_down_content += \
'' + \
translate['Unlisted'] + '
' + \
translate['Not on public timeline'] + '\n'
drop_down_content += \
'' + \
- '' + \
translate['Followers'] + '
' + \
translate['Only to followers'] + '\n'
drop_down_content += \
'' + \
- '' + \
translate['DM'] + '
' + \
translate['Only to mentioned people'] + '\n'
@@ -146,14 +149,14 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'' + \
- '' + \
translate['Reminder'] + '
' + \
translate['Scheduled note to yourself'] + '\n'
drop_down_content += \
'' + \
- '' + \
translate['Report'] + '
' + \
translate['Send to moderators'] + '\n'
@@ -162,20 +165,21 @@ def _html_new_post_drop_down(scope_icon: str, scope_description: str,
drop_down_content += \
'' + \
- '' + \
translate['Shares'] + '
' + \
translate['Describe a shared item'] + '\n'
drop_down_content += \
'' + \
- '' + \
translate['Wanted'] + '
' + \
translate['Describe something wanted'] + '\n'
drop_down_content += \
'' + \
translate['Question'] + '
' + \
translate['Ask a question'] + '\n'
@@ -225,7 +229,7 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
date_and_time_str = '\n'
if not is_new_reminder:
date_and_time_str += \
- '\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 += '\n' + \
'\n'
@@ -765,8 +770,8 @@ def html_new_post(css_cache: {}, media_instance: bool, translate: {},
new_post_form += \
'
| \n'
diff --git a/webapp_frontscreen.py b/webapp_frontscreen.py
index 791dd1dc2..e6cc01145 100644
--- a/webapp_frontscreen.py
+++ b/webapp_frontscreen.py
@@ -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 = \
- '\n'
if login_button:
profile_header_str += '' + login_button + '\n'
diff --git a/webapp_hashtagswarm.py b/webapp_hashtagswarm.py
index 6ddab1486..4b12ecf4e 100644
--- a/webapp_hashtagswarm.py
+++ b/webapp_hashtagswarm.py
@@ -220,7 +220,8 @@ def html_search_hashtag_category(css_cache: {}, translate: {},
if os.path.isfile(search_banner_filename):
html_str += '\n'
- html_str += '\n'
html_str += \
diff --git a/webapp_headerbuttons.py b/webapp_headerbuttons.py
index 519de7438..63e6a4be1 100644
--- a/webapp_headerbuttons.py
+++ b/webapp_headerbuttons.py
@@ -220,7 +220,7 @@ def header_buttons_timeline(default_timeline: str,
# the search icon
tl_str += \
'\n'
@@ -265,7 +265,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
' \n'
@@ -287,7 +287,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
'' + \
- ''
@@ -305,7 +305,7 @@ def header_buttons_timeline(default_timeline: str,
tl_str += \
'' + \
- ''
diff --git a/webapp_likers.py b/webapp_likers.py
index 563b77d54..54d51507a 100644
--- a/webapp_likers.py
+++ b/webapp_likers.py
@@ -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 += '\n' + \
'\n'
diff --git a/webapp_login.py b/webapp_login.py
index cf00df87f..dd6fd4b24 100644
--- a/webapp_login.py
+++ b/webapp_login.py
@@ -166,7 +166,7 @@ def html_login(css_cache: {}, translate: {},
' \n' + \
'\n' + \
'' + \
- '\n'
login_form += html_footer()
diff --git a/webapp_media.py b/webapp_media.py
index 87cd44f25..35dc8b7f5 100644
--- a/webapp_media.py
+++ b/webapp_media.py
@@ -40,7 +40,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
if '<' in url:
url = url.split('<')[0]
content += \
- "\n