diff --git a/daemon.py b/daemon.py index 967f55b9f..b400099c3 100644 --- a/daemon.py +++ b/daemon.py @@ -7852,7 +7852,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) if GETstartTime: self._benchmarkGETtimings(GETstartTime, GETtimings, 'show status done', @@ -7981,7 +7982,8 @@ class PubServer(BaseHTTPRequestHandler): authorized, self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8103,7 +8105,8 @@ class PubServer(BaseHTTPRequestHandler): authorized, self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8226,7 +8229,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8349,7 +8353,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8481,7 +8486,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8609,7 +8615,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8698,7 +8705,8 @@ class PubServer(BaseHTTPRequestHandler): authorized, self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8804,7 +8812,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -8930,7 +8939,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -9048,7 +9058,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -9156,7 +9167,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.themeName, self.server.peertubeInstances, self.server.allowLocalNetworkAccess, - self.server.textModeBanner) + self.server.textModeBanner, + self.server.accessKeys) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -14477,6 +14489,9 @@ def runDaemon(brochMode: bool, # ASCII/ANSI text banner used in shell browsers, such as Lynx httpd.textModeBanner = getTextModeBanner(baseDir) + # key shortcuts SHIFT + ALT + [key] + httpd.accessKeys = {} + httpd.unitTest = unitTest httpd.allowLocalNetworkAccess = allowLocalNetworkAccess if unitTest: diff --git a/webapp_moderation.py b/webapp_moderation.py index a8e90fdb9..07d64bbdd 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -44,7 +44,8 @@ def htmlModeration(cssCache: {}, defaultTimeline: str, authorized: bool, moderationActionStr: str, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the moderation feed as html This is what you see when selecting the "mod" timeline """ @@ -60,7 +61,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, moderationActionStr, theme, peertubeInstances, allowLocalNetworkAccess, - textModeBanner) + textModeBanner, accessKeys) def htmlAccountInfo(cssCache: {}, translate: {}, diff --git a/webapp_timeline.py b/webapp_timeline.py index a8687fd9c..84a1cd059 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -116,7 +116,8 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the timeline as html """ enableTimingLog = False @@ -478,25 +479,26 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, menuNewswire: usersPath + '/newswiremobile', menuLinks: usersPath + '/linksmobile' } - navAccessKeys = { - menuProfile: 'p', - menuInbox: 'i', - menuSearch: '/', - menuNewPost: 'n', - menuCalendar: 'c', - menuDM: 'd', - menuReplies: 'r', - menuOutbox: 's', - menuBookmarks: 'k', - menuShares: 'h', - menuBlogs: 'b', - menuNewswire: 'w', - menuLinks: 'l', - menuModeration: 'm' - } + if not accessKeys: + accessKeys = { + menuProfile: 'p', + menuInbox: 'i', + menuSearch: '/', + menuNewPost: 'n', + menuCalendar: 'c', + menuDM: 'd', + menuReplies: 'r', + menuOutbox: 's', + menuBookmarks: 'k', + menuShares: 'h', + menuBlogs: 'b', + menuNewswire: 'w', + menuLinks: 'l', + menuModeration: 'm' + } if moderator: navLinks[menuModeration] = usersPath + '/moderation#modtimeline' - tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, navAccessKeys, + tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, accessKeys, None, usersPath, translate, followApprovals) @@ -910,7 +912,8 @@ def htmlShares(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the shares timeline as html """ manuallyApproveFollowers = \ @@ -931,7 +934,8 @@ def htmlShares(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInbox(cssCache: {}, defaultTimeline: str, @@ -953,7 +957,8 @@ def htmlInbox(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the inbox as html """ manuallyApproveFollowers = \ @@ -974,7 +979,8 @@ def htmlInbox(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlBookmarks(cssCache: {}, defaultTimeline: str, @@ -996,7 +1002,8 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the bookmarks as html """ manuallyApproveFollowers = \ @@ -1017,7 +1024,8 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlEvents(cssCache: {}, defaultTimeline: str, @@ -1039,7 +1047,8 @@ def htmlEvents(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the events as html """ manuallyApproveFollowers = \ @@ -1060,7 +1069,8 @@ def htmlEvents(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxDMs(cssCache: {}, defaultTimeline: str, @@ -1082,7 +1092,8 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the DM timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1098,7 +1109,8 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxReplies(cssCache: {}, defaultTimeline: str, @@ -1120,7 +1132,8 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the replies timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1137,7 +1150,8 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxMedia(cssCache: {}, defaultTimeline: str, @@ -1159,7 +1173,8 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the media timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1176,7 +1191,8 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxBlogs(cssCache: {}, defaultTimeline: str, @@ -1198,7 +1214,8 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the blogs timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1215,7 +1232,8 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxFeatures(cssCache: {}, defaultTimeline: str, @@ -1238,7 +1256,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the features timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1255,7 +1274,8 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlInboxNews(cssCache: {}, defaultTimeline: str, @@ -1277,7 +1297,8 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the news timeline as html """ return htmlTimeline(cssCache, defaultTimeline, @@ -1294,7 +1315,8 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys) def htmlOutbox(cssCache: {}, defaultTimeline: str, @@ -1316,7 +1338,8 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str, authorized: bool, theme: str, peertubeInstances: [], allowLocalNetworkAccess: bool, - textModeBanner: str) -> str: + textModeBanner: str, + accessKeys: {}) -> str: """Show the Outbox as html """ manuallyApproveFollowers = \ @@ -1334,4 +1357,5 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str, showPublishAsIcon, fullWidthTimelineButtonHeader, iconsAsButtons, rssIconAtTop, publishButtonAtTop, authorized, None, theme, peertubeInstances, - allowLocalNetworkAccess, textModeBanner) + allowLocalNetworkAccess, textModeBanner, + accessKeys)