From b5a23447f8c4173677ed3576e1d0ce491d2cba1e Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Wed, 25 May 2022 10:14:49 +0100
Subject: [PATCH] Set tab indexes for the left column
This is so that when hitting tab a few times it goes to the main timeline posts and not the left column
---
webapp_column_left.py | 44 ++++++++++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/webapp_column_left.py b/webapp_column_left.py
index a13f048a6..08c3e4d87 100644
--- a/webapp_column_left.py
+++ b/webapp_column_left.py
@@ -162,7 +162,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
# show the edit icon
html_str += \
' ' + \
+ 'accesskey="' + access_keys['menuEdit'] + '" tabindex="4000">' + \
'
' + \
+ 'accesskey="' + access_keys['menuThemeDesigner'] + '" ' + \
+ 'tabindex="4001">' + \
'![' + \
@@ -190,8 +191,10 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
rss_title = translate['RSS feed for your blog']
else:
rss_title = translate['RSS feed for this site']
+ rss_icon_tab = 'tabindex= ' + \
translate['Theme Designer'] + ' |]()
' + \
+ '
\n'
@@ -240,6 +243,7 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
new_tab_str = ' target="_blank" rel="nofollow noopener noreferrer"'
if links_list:
html_str += '
\n'
+ tab_ctr += 1
links_file_contains_entries = True
elif line_str.startswith('=> '):
# gemini style link
@@ -308,12 +315,15 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
'?showwarning=' not in link_str:
html_str += \
' ' + \
+ '"' + new_tab_str + \
+ ' tabindex="' + str(tab_ctr) + '">' + \
line_str.strip() + '
\n'
else:
html_str += \
' ' + line_str.strip() + '
\n'
+ '" tabindex="' + str(tab_ctr) + '">' + \
+ line_str.strip() + '\n'
+ tab_ctr += 1
links_file_contains_entries = True
else:
if line_str.startswith('#') or line_str.startswith('*'):
@@ -334,20 +344,32 @@ def get_left_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += separator_str
html_str += \
'' + translate['Shares Catalog'] + '
'
+ '/catalog.csv" ' + \
+ 'tabindex="' + str(tab_ctr) + '">' + \
+ translate['Shares Catalog'] + ''
+ tab_ctr += 1
html_str += \
'' + \
+ access_keys['menuKeys'] + '" ' + \
+ 'tabindex="' + str(tab_ctr) + '">' + \
translate['Key Shortcuts'] + '
'
+ tab_ctr += 1
html_str += \
- '' + \
+ '' + \
translate['About this Instance'] + '
'
+ tab_ctr += 1
html_str += \
- '' + \
+ '' + \
translate['Terms of Service'] + '
'
+ tab_ctr += 1
if links_file_contains_entries and not rss_icon_at_top:
+ rss_icon_str = \
+ rss_icon_str.replace(rss_icon_tab,
+ 'tabindex="' + str(tab_ctr) + '"')
html_str += '
' + rss_icon_str + '
'
return html_str