mirror of https://gitlab.com/bashrc2/epicyon
Preload images on timeline
parent
0e9b7a60dd
commit
86f5e759b1
12
blog.py
12
blog.py
|
@ -552,8 +552,10 @@ def html_blog_page(authorized: bool, session,
|
|||
css_filename = base_dir + '/epicyon.css'
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
blog_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
_html_blog_remove_cw_button(blog_str, translate)
|
||||
|
||||
blogs_index = acct_dir(base_dir, nickname, domain) + '/tlblogs.index'
|
||||
|
@ -756,8 +758,10 @@ def html_blog_view(authorized: bool,
|
|||
css_filename = base_dir + '/epicyon.css'
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
blog_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
if _no_of_blog_accounts(base_dir) <= 1:
|
||||
nickname = _single_blog_account_nickname(base_dir)
|
||||
|
@ -868,8 +872,10 @@ def html_edit_blog(media_instance: bool, translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
edit_blog_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
edit_blog_form += \
|
||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||
|
|
|
@ -81,8 +81,10 @@ def html_watch_points_graph(base_dir: str, fitness: {}, fitness_id: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
html_str += \
|
||||
'<table class="graph">\n' + \
|
||||
'<caption>Watchpoints for ' + fitness_id + '</caption>\n' + \
|
||||
|
|
|
@ -66,8 +66,10 @@ def html_access_keys(base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
access_keys_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
access_keys_form += \
|
||||
'<header>\n' + \
|
||||
|
|
|
@ -70,8 +70,10 @@ def html_calendar_delete_confirm(translate: {}, base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
delete_post_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
delete_post_str += \
|
||||
'<center>\n<h1>' + post_time + ' ' + str(year) + '/' + \
|
||||
str(month_number) + \
|
||||
|
@ -138,8 +140,10 @@ def _html_calendar_day(person_cache: {}, translate: {},
|
|||
cal_actor = '/users/' + actor.split('/users/')[1]
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
calendar_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
calendar_link = cal_actor + \
|
||||
'/calendar?year=' + str(year) + '?month=' + str(month_number)
|
||||
|
@ -491,8 +495,10 @@ def html_calendar(person_cache: {}, translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
header_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show banner
|
||||
banner_file, _ = \
|
||||
|
|
|
@ -397,8 +397,10 @@ def html_links_mobile(base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
banner_file, _ = \
|
||||
get_banner_file(base_dir, nickname, domain, theme)
|
||||
html_str += \
|
||||
|
@ -468,8 +470,10 @@ def html_edit_links(translate: {}, base_dir: str, path: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
edit_links_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# top banner
|
||||
edit_links_form += \
|
||||
|
|
|
@ -406,8 +406,10 @@ def html_citations(base_dir: str, nickname: str, domain: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# top banner
|
||||
banner_file, _ = \
|
||||
|
@ -525,8 +527,10 @@ def html_newswire_mobile(base_dir: str, nickname: str,
|
|||
metadata = None
|
||||
if text_mode_browser(ua_str):
|
||||
metadata = '<meta http-equiv="refresh" content="1800" >\n'
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, metadata)
|
||||
html_header_with_external_style(css_filename, instance_title, metadata,
|
||||
preload_images)
|
||||
|
||||
banner_file, _ = \
|
||||
get_banner_file(base_dir, nickname, domain, theme)
|
||||
|
@ -599,8 +603,10 @@ def html_edit_newswire(translate: {}, base_dir: str, path: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
edit_newswire_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# top banner
|
||||
edit_newswire_form += \
|
||||
|
@ -755,8 +761,10 @@ def html_edit_news_post(translate: {}, base_dir: str, path: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
edit_news_post_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
edit_news_post_form += \
|
||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||
'accept-charset="UTF-8" action="' + path + '/newseditdata">\n'
|
||||
|
|
|
@ -73,8 +73,10 @@ def html_confirm_delete(server,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
delete_post_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
timezone = get_account_timezone(base_dir, nickname, domain)
|
||||
mitm = False
|
||||
if os.path.isfile(post_filename.replace('.json', '') + '.mitm'):
|
||||
|
@ -168,8 +170,10 @@ def html_confirm_remove_shared_item(translate: {},
|
|||
css_filename = base_dir + '/follow.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
shares_str = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
shares_str += '<div class="follow">\n'
|
||||
shares_str += ' <div class="followAvatar">\n'
|
||||
shares_str += ' <center>\n'
|
||||
|
@ -224,8 +228,10 @@ def html_confirm_follow(translate: {}, base_dir: str,
|
|||
css_filename = base_dir + '/follow.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
follow_str = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
follow_str += '<div class="follow">\n'
|
||||
follow_str += ' <div class="followAvatar">\n'
|
||||
follow_str += ' <center>\n'
|
||||
|
@ -283,8 +289,10 @@ def html_confirm_unfollow(translate: {}, base_dir: str,
|
|||
css_filename = base_dir + '/follow.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
follow_str = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
follow_str += '<div class="follow">\n'
|
||||
follow_str += ' <div class="followAvatar">\n'
|
||||
follow_str += ' <center>\n'
|
||||
|
@ -330,8 +338,10 @@ def html_confirm_unblock(translate: {}, base_dir: str,
|
|||
css_filename = base_dir + '/follow.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
block_str = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
block_str += '<div class="block">\n'
|
||||
block_str += ' <div class="blockAvatar">\n'
|
||||
block_str += ' <center>\n'
|
||||
|
@ -377,8 +387,10 @@ def html_confirm_block(translate: {}, base_dir: str,
|
|||
css_filename = base_dir + '/follow.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
block_str = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
block_str += '<div class="block">\n'
|
||||
block_str += ' <div class="blockAvatar">\n'
|
||||
block_str += ' <center>\n'
|
||||
|
|
|
@ -73,8 +73,10 @@ def html_conversation_view(authorized: bool, post_id: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
conv_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# banner and row of buttons
|
||||
users_path = '/users/' + nickname
|
||||
|
|
|
@ -1085,8 +1085,10 @@ def html_new_post(edit_post_params: {},
|
|||
date_and_location += end_edit_section()
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
new_post_form = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
|
||||
new_post_form += \
|
||||
'<header>\n' + \
|
||||
|
|
|
@ -230,7 +230,9 @@ def html_front_screen(signing_priv_key_pem: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
profile_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None) + \
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images) + \
|
||||
profile_str + profile_footer_str + html_footer()
|
||||
return profile_str
|
||||
|
|
|
@ -254,8 +254,10 @@ def html_search_hashtag_category(translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show a banner above the search box
|
||||
search_banner_file, search_banner_filename = \
|
||||
|
|
|
@ -53,8 +53,10 @@ def html_likers_of_post(base_dir: str, nickname: str,
|
|||
css_filename = base_dir + '/epicyon.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# get the post which was liked
|
||||
filename = locate_post(base_dir, nickname, domain, post_url)
|
||||
|
|
|
@ -119,8 +119,10 @@ def html_account_info(translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
info_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
search_nickname = get_nickname_from_actor(search_handle)
|
||||
if not search_nickname:
|
||||
|
@ -337,8 +339,10 @@ def html_moderation_info(translate: {}, base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
info_form = html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show banner
|
||||
banner_file, _ = \
|
||||
|
|
|
@ -252,8 +252,10 @@ def html_person_options(default_timeline: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
options_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show banner
|
||||
banner_file, _ = \
|
||||
|
|
|
@ -323,8 +323,10 @@ def html_podcast_episode(translate: {},
|
|||
dir_str + '/podcast-background.jpg')
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
podcast_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
podcast_properties = newswire_item[8]
|
||||
image_url = ''
|
||||
|
|
|
@ -3289,8 +3289,10 @@ def html_individual_post(recent_posts_cache: {}, max_recent_posts: int,
|
|||
get_config_param(base_dir, 'instanceTitle')
|
||||
metadata_str = _html_post_metadata_open_graph(domain, original_post_json,
|
||||
system_language)
|
||||
preload_images = []
|
||||
header_str = html_header_with_external_style(css_filename,
|
||||
instance_title, metadata_str)
|
||||
instance_title, metadata_str,
|
||||
preload_images)
|
||||
|
||||
return header_str + post_str + html_footer()
|
||||
|
||||
|
@ -3353,8 +3355,10 @@ def html_post_replies(recent_posts_cache: {}, max_recent_posts: int,
|
|||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
metadata = ''
|
||||
preload_images = []
|
||||
header_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, metadata)
|
||||
html_header_with_external_style(css_filename, instance_title, metadata,
|
||||
preload_images)
|
||||
return header_str + replies_str + html_footer()
|
||||
|
||||
|
||||
|
@ -3443,8 +3447,10 @@ def html_emoji_reaction_picker(recent_posts_cache: {}, max_recent_posts: int,
|
|||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
metadata = ''
|
||||
preload_images = []
|
||||
header_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, metadata)
|
||||
html_header_with_external_style(css_filename, instance_title, metadata,
|
||||
preload_images)
|
||||
|
||||
# banner
|
||||
header_str += \
|
||||
|
|
|
@ -622,8 +622,10 @@ def html_profile_after_search(authorized: bool,
|
|||
break
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
return html_header_with_external_style(css_filename,
|
||||
instance_title, None) + \
|
||||
instance_title, None,
|
||||
preload_images) + \
|
||||
profile_str + text_mode_separator + html_footer()
|
||||
|
||||
|
||||
|
@ -3426,8 +3428,10 @@ def html_edit_profile(server, translate: {},
|
|||
system_monitor_str = _html_system_monitor(nickname, translate)
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
edit_profile_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# keyboard navigation
|
||||
user_path_str = '/users/' + nickname
|
||||
|
|
|
@ -79,8 +79,10 @@ def html_search_emoji(translate: {}, base_dir: str, search_str: str,
|
|||
# create header
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
emoji_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show top banner
|
||||
if nickname and domain and theme:
|
||||
|
@ -279,8 +281,10 @@ def html_search_shared_items(translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
shared_items_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
if shares_file_type == 'shares':
|
||||
title_str = translate['Shared Items Search']
|
||||
else:
|
||||
|
@ -405,8 +409,10 @@ def html_search_emoji_text_entry(translate: {},
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
emoji_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
emoji_str += '<div class="follow">\n'
|
||||
emoji_str += ' <div class="followAvatar">\n'
|
||||
emoji_str += ' <center>\n'
|
||||
|
@ -451,8 +457,10 @@ def html_search(translate: {}, base_dir: str, path: str, domain: str,
|
|||
css_filename = base_dir + '/search.css'
|
||||
|
||||
instance_title = get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
follow_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# set a search banner
|
||||
search_banner_filename = \
|
||||
|
@ -637,8 +645,10 @@ def html_skills_search(actor: str, translate: {}, base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
skill_search_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# show top banner
|
||||
if nickname and domain and theme_name:
|
||||
|
@ -741,8 +751,10 @@ def html_history_search(translate: {}, base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
history_search_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# add the page title
|
||||
domain_full = get_full_domain(domain, port)
|
||||
|
@ -915,8 +927,10 @@ def html_hashtag_search(nickname: str, domain: str, port: int,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
hashtag_search_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
if nickname:
|
||||
# banner at top
|
||||
|
@ -1152,8 +1166,10 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
hashtag_search_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# add the page title
|
||||
hashtag_search_form += '<center>\n' + \
|
||||
|
|
|
@ -23,8 +23,10 @@ def html_suspended(base_dir: str) -> str:
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
suspended_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
suspended_form += \
|
||||
'<div><center>\n' + \
|
||||
' <p class="screentitle">Account Suspended</p>\n' + \
|
||||
|
|
|
@ -193,8 +193,10 @@ def html_theme_designer(base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
theme_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
banner_file, _ = \
|
||||
get_banner_file(base_dir, nickname, domain, theme_name)
|
||||
theme_form += \
|
||||
|
|
|
@ -618,10 +618,6 @@ def html_timeline(default_timeline: str,
|
|||
if os.path.isfile(base_dir + '/epicyon.css'):
|
||||
css_filename = base_dir + '/epicyon.css'
|
||||
|
||||
# filename of the banner shown at the top
|
||||
banner_file, _ = \
|
||||
get_banner_file(base_dir, nickname, domain, theme)
|
||||
|
||||
_log_timeline_timing(enable_timing_log, timeline_start_time, box_name, '1')
|
||||
|
||||
# is the user a moderator?
|
||||
|
@ -774,10 +770,43 @@ def html_timeline(default_timeline: str,
|
|||
bookmarks_button + '" tabindex="2">' + \
|
||||
'<span>' + translate['Bookmarks'] + '</span></button></a>'
|
||||
|
||||
# filename of the banner shown at the top
|
||||
banner_file, _ = \
|
||||
get_banner_file(base_dir, nickname, domain, theme)
|
||||
banner_path = users_path + '/' + banner_file
|
||||
|
||||
# these images are pre-loaded to prevent the web page from
|
||||
# jumping around when rendering
|
||||
preload_images = [
|
||||
banner_path,
|
||||
'/icons/showhide.png',
|
||||
'/icons/repeat_hide.png',
|
||||
'/icons/repeat_show.png',
|
||||
'/icons/calendar.png',
|
||||
'/icons/search.png',
|
||||
'/icons/newpost.png',
|
||||
'/icons/mute.png',
|
||||
'/icons/unmute.png',
|
||||
'/icons/reaction.png',
|
||||
'/icons/bookmark_inactive.png',
|
||||
'/icons/bookmark.png',
|
||||
'/icons/like.png',
|
||||
'/icons/like_inactive.png',
|
||||
'/icons/repeat_inactive.png',
|
||||
'/icons/repeat.png',
|
||||
'/icons/reply.png',
|
||||
'/icons/theme.png',
|
||||
'/icons/logorss.png',
|
||||
'/icons/edit.png',
|
||||
'/icons/publish.png',
|
||||
'/icons/categoriesrss.png'
|
||||
]
|
||||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
tl_str = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
_log_timeline_timing(enable_timing_log, timeline_start_time, box_name, '4')
|
||||
|
||||
|
@ -816,7 +845,7 @@ def html_timeline(default_timeline: str,
|
|||
access_keys['menuProfile'] + '">\n'
|
||||
tl_str += '<img loading="lazy" decoding="async" ' + \
|
||||
'class="timeline-banner" alt="" ' + \
|
||||
'src="' + users_path + '/' + banner_file + '" /></a>\n' + \
|
||||
'src="' + banner_path + '" /></a>\n' + \
|
||||
'</header>\n'
|
||||
|
||||
is_text_browser = text_mode_browser(ua_str)
|
||||
|
|
|
@ -48,8 +48,10 @@ def html_terms_of_service(base_dir: str,
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
tos_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
tos_form += '<div class="container">' + tos_text + '</div>\n'
|
||||
if admin_nickname:
|
||||
admin_actor = local_actor_url(http_prefix, admin_nickname, domain_full)
|
||||
|
|
|
@ -112,9 +112,11 @@ def html_following_list(base_dir: str, following_filename: str) -> str:
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
following_list_html = \
|
||||
html_header_with_external_style(css_filename,
|
||||
instance_title, None)
|
||||
instance_title, None,
|
||||
preload_images)
|
||||
for following_address in following_list:
|
||||
if following_address:
|
||||
following_list_html += \
|
||||
|
@ -192,8 +194,10 @@ def html_hashtag_blocked(base_dir: str, translate: {}) -> str:
|
|||
|
||||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
preload_images = []
|
||||
blocked_hashtag_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
blocked_hashtag_form += '<div><center>\n'
|
||||
blocked_hashtag_form += \
|
||||
' <p class="screentitle">' + \
|
||||
|
@ -714,12 +718,19 @@ def get_right_image_file(base_dir: str,
|
|||
|
||||
|
||||
def html_header_with_external_style(css_filename: str, instance_title: str,
|
||||
metadata: str, lang='en') -> str:
|
||||
metadata: str, preload_images: [],
|
||||
lang='en') -> str:
|
||||
if metadata is None:
|
||||
metadata = ''
|
||||
css_file = '/' + css_filename.split('/')[-1]
|
||||
pwa_theme_color, pwa_theme_background_color = \
|
||||
get_pwa_theme_colors(css_filename)
|
||||
preload_images_str = ''
|
||||
if preload_images:
|
||||
for image_path in preload_images:
|
||||
preload_images_str += \
|
||||
' <link rel="preload" as="image" href="' + \
|
||||
image_path + '">\n'
|
||||
html_str = \
|
||||
'<!DOCTYPE html>\n' + \
|
||||
'<!--\n' + \
|
||||
|
@ -738,7 +749,7 @@ def html_header_with_external_style(css_filename: str, instance_title: str,
|
|||
'name="msapplication-config">\n' + \
|
||||
' <meta content="yes" name="apple-mobile-web-app-capable">\n' + \
|
||||
' <link href="/apple-touch-icon.png" rel="apple-touch-icon" ' + \
|
||||
'sizes="180x180">\n' + \
|
||||
'sizes="180x180">\n' + preload_images_str + \
|
||||
' <meta name="theme-color" content="' + pwa_theme_color + '">\n' + \
|
||||
metadata + \
|
||||
' <meta name="apple-mobile-web-app-status-bar-style" ' + \
|
||||
|
@ -757,9 +768,11 @@ def html_header_with_person_markup(css_filename: str, instance_title: str,
|
|||
https://schema.org/Person
|
||||
"""
|
||||
if not actor_json:
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename,
|
||||
instance_title, None, lang)
|
||||
instance_title, None,
|
||||
preload_images, lang)
|
||||
return html_str
|
||||
|
||||
city_markup = ''
|
||||
|
@ -939,9 +952,11 @@ def html_header_with_person_markup(css_filename: str, instance_title: str,
|
|||
" <meta content=\"" + value + \
|
||||
"\" property=\"og:" + og_tag + "\" />\n"
|
||||
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title,
|
||||
og_metadata + profile_markup, lang)
|
||||
og_metadata + profile_markup,
|
||||
preload_images, lang)
|
||||
return html_str
|
||||
|
||||
|
||||
|
@ -996,10 +1011,11 @@ def html_header_with_website_markup(css_filename: str, instance_title: str,
|
|||
'" property="og:locale" />\n' + \
|
||||
' <meta content="summary_large_image" property="twitter:card" />\n'
|
||||
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title,
|
||||
og_metadata + website_markup,
|
||||
system_language)
|
||||
preload_images, system_language)
|
||||
return html_str
|
||||
|
||||
|
||||
|
@ -1054,10 +1070,11 @@ def html_header_with_blog_markup(css_filename: str, instance_title: str,
|
|||
' <meta property="article:modified_time" content="' + \
|
||||
modified + '" />\n'
|
||||
|
||||
preload_images = []
|
||||
html_str = \
|
||||
html_header_with_external_style(css_filename, instance_title,
|
||||
og_metadata + blog_markup,
|
||||
system_language)
|
||||
preload_images, system_language)
|
||||
return html_str
|
||||
|
||||
|
||||
|
@ -2101,8 +2118,10 @@ def html_show_share(base_dir: str, domain: str, nickname: str,
|
|||
instance_title = \
|
||||
get_config_param(base_dir, 'instanceTitle')
|
||||
|
||||
preload_images = []
|
||||
return html_header_with_external_style(css_filename,
|
||||
instance_title, None) + \
|
||||
instance_title, None,
|
||||
preload_images) + \
|
||||
share_str + html_footer()
|
||||
|
||||
|
||||
|
|
|
@ -96,8 +96,10 @@ def html_welcome_screen(base_dir: str, nickname: str,
|
|||
if os.path.isfile(base_dir + '/welcome.css'):
|
||||
css_filename = base_dir + '/welcome.css'
|
||||
|
||||
preload_images = []
|
||||
welcome_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
welcome_form += \
|
||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||
'accept-charset="UTF-8" ' + \
|
||||
|
|
|
@ -65,8 +65,10 @@ def html_welcome_final(base_dir: str, nickname: str,
|
|||
if os.path.isfile(base_dir + '/welcome.css'):
|
||||
css_filename = base_dir + '/welcome.css'
|
||||
|
||||
preload_images = []
|
||||
final_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
final_form += \
|
||||
'<div class="container">' + final_text + '</div>\n' + \
|
||||
|
|
|
@ -74,8 +74,10 @@ def html_welcome_profile(base_dir: str, nickname: str, domain: str,
|
|||
if os.path.isfile(base_dir + '/welcome.css'):
|
||||
css_filename = base_dir + '/welcome.css'
|
||||
|
||||
preload_images = []
|
||||
profile_form = \
|
||||
html_header_with_external_style(css_filename, instance_title, None)
|
||||
html_header_with_external_style(css_filename, instance_title, None,
|
||||
preload_images)
|
||||
|
||||
# get the url of the avatar
|
||||
ext = 'png'
|
||||
|
|
Loading…
Reference in New Issue