From 2c8d8825ceaa83613dd4fc6d61cc8cd9018a35de Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Wed, 14 Aug 2024 12:37:38 +0100
Subject: [PATCH] Don't use unsupported download attribute with preferred
filename
---
maps.py | 8 +++-----
webapp_calendar.py | 8 ++++++--
webapp_profile.py | 9 ++++++---
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/maps.py b/maps.py
index 634c14a9f..c57b7c443 100644
--- a/maps.py
+++ b/maps.py
@@ -831,16 +831,14 @@ def html_hashtag_maps(base_dir: str, tag_name: str,
period_str2 = period_str.replace('Last ', '').lower()
endpoint_str = \
'/tagmaps/' + tag_name + '-' + period_str2.replace(' ', '_')
- download_filename = \
- (tag_name + '-' +
- period_str.lower()).replace(' ', '_') + '.' + map_format
if html_str:
html_str += ' '
description = period_str
if translate.get(period_str):
description = translate[period_str]
- html_str += '' + \
+ # NOTE: don't use download="preferredfilename" which is
+ # unsupported by some browsers
+ html_str += '' + \
description + ''
if html_str:
html_str = '📌 ' + html_str
diff --git a/webapp_calendar.py b/webapp_calendar.py
index 69fb8be1d..b54e9c4b1 100644
--- a/webapp_calendar.py
+++ b/webapp_calendar.py
@@ -336,9 +336,11 @@ def _html_calendar_day(person_cache: {}, translate: {},
calendar_str += '\n\n'
# icalendar download link
+ # NOTE: don't use download="preferredfilename" which is
+ # unsupported by some browsers
calendar_str += \
' ' + \
+ 'download class="imageAnchor" tabindex="3">' + \
'
\n'
@@ -657,9 +659,11 @@ def html_calendar(person_cache: {}, translate: {},
translate['Add to the calendar'] + '
\n' + \
show_reminders_link + '
\n\n'
+ # NOTE: don't use download="preferredfilename" which is
+ # unsupported by some browsers
calendar_icon_str = \
' ' + \
+ 'download class="imageAnchor" tabindex="3">' + \
'
\n'
diff --git a/webapp_profile.py b/webapp_profile.py
index 2b45f2d7b..7dc1d4bc5 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -783,10 +783,11 @@ def _get_profile_header(base_dir: str, http_prefix: str, nickname: str,
translate)
# show vcard download link
+ # NOTE: don't use download="preferredfilename" which is
+ # unsupported by some browsers
html_str += \
' ' + \
+ 'type="text/vcard" tabindex="1" class="imageAnchor">' + \
'
\n'
@@ -2842,9 +2843,11 @@ def _html_edit_profile_import_export(nickname: str, domain: str,
''
+ # NOTE: don't use download="preferredfilename" which is
+ # unsupported by some browsers
edit_profile_form += \
' ' + \
+ 'download>' + \
'
\n'
followers_str = translate['Followers']
if premium: