mirror of https://gitlab.com/bashrc2/epicyon
Key shortcuts
parent
01ae322139
commit
5343c38ff2
|
@ -456,7 +456,11 @@ def htmlCalendar(personCache: {}, cssCache: {}, translate: {},
|
||||||
htmlHideFromScreenReader('←') + ' ' + translate['Previous month']
|
htmlHideFromScreenReader('←') + ' ' + translate['Previous month']
|
||||||
navLinks[prevMonthStr] = calActor + '/calendar?year=' + str(prevYear) + \
|
navLinks[prevMonthStr] = calActor + '/calendar?year=' + str(prevYear) + \
|
||||||
'?month=' + str(prevMonthNumber)
|
'?month=' + str(prevMonthNumber)
|
||||||
|
# TODO
|
||||||
|
navAccessKeys = {
|
||||||
|
}
|
||||||
screenReaderCal = \
|
screenReaderCal = \
|
||||||
htmlKeyboardNavigation(textModeBanner, navLinks, monthName)
|
htmlKeyboardNavigation(textModeBanner, navLinks, navAccessKeys,
|
||||||
|
monthName)
|
||||||
|
|
||||||
return headerStr + screenReaderCal + calendarStr + htmlFooter()
|
return headerStr + screenReaderCal + calendarStr + htmlFooter()
|
||||||
|
|
|
@ -84,7 +84,7 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
copyfile(baseDir + '/img/login.png', loginImageFilename)
|
copyfile(baseDir + '/img/login.png', loginImageFilename)
|
||||||
|
|
||||||
textModeLogo = getTextModeLogo(baseDir)
|
textModeLogo = getTextModeLogo(baseDir)
|
||||||
textModeLogoHtml = htmlKeyboardNavigation(textModeLogo, {})
|
textModeLogoHtml = htmlKeyboardNavigation(textModeLogo, {}, {})
|
||||||
|
|
||||||
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
||||||
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
||||||
|
|
|
@ -119,7 +119,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(baseDir, 'instanceTitle')
|
getConfigParam(baseDir, 'instanceTitle')
|
||||||
optionsStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle)
|
optionsStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle)
|
||||||
optionsStr += htmlKeyboardNavigation(textModeBanner, {})
|
optionsStr += htmlKeyboardNavigation(textModeBanner, {}, {})
|
||||||
optionsStr += '<br><br>\n'
|
optionsStr += '<br><br>\n'
|
||||||
optionsStr += '<div class="options">\n'
|
optionsStr += '<div class="options">\n'
|
||||||
optionsStr += ' <div class="optionsAvatar">\n'
|
optionsStr += ' <div class="optionsAvatar">\n'
|
||||||
|
|
|
@ -755,7 +755,19 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
menuShares: userPathStr + '/shares#timeline',
|
menuShares: userPathStr + '/shares#timeline',
|
||||||
menuLogout: '/logout'
|
menuLogout: '/logout'
|
||||||
}
|
}
|
||||||
profileStr = htmlKeyboardNavigation(textModeBanner, navLinks)
|
navAccessKeys = {
|
||||||
|
menuTimeline: 't',
|
||||||
|
menuEdit: 'e',
|
||||||
|
menuFollowing: 'f',
|
||||||
|
menuFollowers: 'g',
|
||||||
|
menuRoles: 'o',
|
||||||
|
menuSkills: 's',
|
||||||
|
menuShares: 'h',
|
||||||
|
menuLogout: 'x'
|
||||||
|
}
|
||||||
|
profileStr = htmlKeyboardNavigation(textModeBanner,
|
||||||
|
navLinks, navAccessKeys,
|
||||||
|
navAccessKeys)
|
||||||
|
|
||||||
profileStr += profileHeaderStr + donateSection
|
profileStr += profileHeaderStr + donateSection
|
||||||
profileStr += '<div class="container" id="buttonheader">\n'
|
profileStr += '<div class="container" id="buttonheader">\n'
|
||||||
|
@ -1471,7 +1483,12 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
menuProfile: userPathStr,
|
menuProfile: userPathStr,
|
||||||
menuTimeline: userTimalineStr
|
menuTimeline: userTimalineStr
|
||||||
}
|
}
|
||||||
editProfileForm += htmlKeyboardNavigation(textModeBanner, navLinks)
|
navAccessKeys = {
|
||||||
|
menuProfile: 'p',
|
||||||
|
menuTimeline: 't'
|
||||||
|
}
|
||||||
|
editProfileForm += htmlKeyboardNavigation(textModeBanner,
|
||||||
|
navLinks, navAccessKeys)
|
||||||
|
|
||||||
# top banner
|
# top banner
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
|
@ -342,7 +342,7 @@ def htmlSearch(cssCache: {}, translate: {},
|
||||||
searchBannerFile, searchBannerFilename = \
|
searchBannerFile, searchBannerFilename = \
|
||||||
getSearchBannerFile(baseDir, searchNickname, domain, theme)
|
getSearchBannerFile(baseDir, searchNickname, domain, theme)
|
||||||
|
|
||||||
textModeBannerStr = htmlKeyboardNavigation(textModeBanner, {})
|
textModeBannerStr = htmlKeyboardNavigation(textModeBanner, {}, {})
|
||||||
if textModeBannerStr is None:
|
if textModeBannerStr is None:
|
||||||
textModeBannerStr = ''
|
textModeBannerStr = ''
|
||||||
|
|
||||||
|
|
|
@ -479,10 +479,26 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
menuNewswire: usersPath + '/newswiremobile',
|
menuNewswire: usersPath + '/newswiremobile',
|
||||||
menuLinks: usersPath + '/linksmobile'
|
menuLinks: usersPath + '/linksmobile'
|
||||||
}
|
}
|
||||||
|
navAccessKeys = {
|
||||||
|
menuProfile: 'p',
|
||||||
|
menuInbox: 'i',
|
||||||
|
menuSearch: '/',
|
||||||
|
menuNewPost: 'n',
|
||||||
|
menuCalendar: 'c',
|
||||||
|
menuDM: 'm',
|
||||||
|
menuReplies: 'r',
|
||||||
|
menuOutbox: 'o',
|
||||||
|
menuBookmarks: 'k',
|
||||||
|
menuShares: 's',
|
||||||
|
menuBlogs: 'b',
|
||||||
|
menuNewswire: 'w',
|
||||||
|
menuLinks: 'l'
|
||||||
|
}
|
||||||
if moderator:
|
if moderator:
|
||||||
navLinks[menuModeration] = usersPath + '/moderation#modtimeline'
|
navLinks[menuModeration] = usersPath + '/moderation#modtimeline'
|
||||||
tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, None,
|
tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, navAccessKeys,
|
||||||
usersPath, translate, followApprovals)
|
None, usersPath, translate,
|
||||||
|
followApprovals)
|
||||||
|
|
||||||
# banner and row of buttons
|
# banner and row of buttons
|
||||||
tlStr += \
|
tlStr += \
|
||||||
|
|
|
@ -1114,7 +1114,7 @@ def htmlHideFromScreenReader(htmlStr: str) -> str:
|
||||||
return '<span aria-hidden="true">' + htmlStr + '</span>'
|
return '<span aria-hidden="true">' + htmlStr + '</span>'
|
||||||
|
|
||||||
|
|
||||||
def htmlKeyboardNavigation(banner: str, links: {},
|
def htmlKeyboardNavigation(banner: str, links: {}, accessKeys: {},
|
||||||
subHeading=None,
|
subHeading=None,
|
||||||
usersPath=None, translate=None,
|
usersPath=None, translate=None,
|
||||||
followApprovals=False) -> str:
|
followApprovals=False) -> str:
|
||||||
|
@ -1138,8 +1138,12 @@ def htmlKeyboardNavigation(banner: str, links: {},
|
||||||
|
|
||||||
# show the list of links
|
# show the list of links
|
||||||
for title, url in links.items():
|
for title, url in links.items():
|
||||||
|
accessKeyStr = ''
|
||||||
|
if accessKeys.get(title):
|
||||||
|
accessKeyStr = 'accesskey="' + accessKeys[title] + '"'
|
||||||
|
|
||||||
htmlStr += '<li><label class="transparent">' + \
|
htmlStr += '<li><label class="transparent">' + \
|
||||||
'<a href="' + str(url) + '">' + \
|
'<a href="' + str(url) + '" ' + accessKeyStr + '>' + \
|
||||||
str(title) + '</a></label></li>\n'
|
str(title) + '</a></label></li>\n'
|
||||||
htmlStr += '</ul></div>\n'
|
htmlStr += '</ul></div>\n'
|
||||||
return htmlStr
|
return htmlStr
|
||||||
|
|
Loading…
Reference in New Issue