Key shortcuts for newswire

main
Bob Mottram 2021-04-23 20:06:34 +01:00
parent 5e4bd5dfcb
commit 78fb223bd4
4 changed files with 20 additions and 10 deletions

View File

@ -11778,6 +11778,9 @@ class PubServer(BaseHTTPRequestHandler):
rssIconAtTop = self.server.rssIconAtTop rssIconAtTop = self.server.rssIconAtTop
iconsAsButtons = self.server.iconsAsButtons iconsAsButtons = self.server.iconsAsButtons
defaultTimeline = self.server.defaultTimeline defaultTimeline = self.server.defaultTimeline
accessKeys = self.server.accessKeys
if self.server.keyShortcuts.get(nickname):
accessKeys = self.server.keyShortcuts[nickname]
msg = htmlNewswireMobile(self.server.cssCache, msg = htmlNewswireMobile(self.server.cssCache,
self.server.baseDir, self.server.baseDir,
nickname, nickname,
@ -11793,7 +11796,8 @@ class PubServer(BaseHTTPRequestHandler):
rssIconAtTop, rssIconAtTop,
iconsAsButtons, iconsAsButtons,
defaultTimeline, defaultTimeline,
self.server.themeName).encode('utf-8') self.server.themeName,
accessKeys).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
cookie, callingDomain) cookie, callingDomain)

View File

@ -51,7 +51,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
authorized: bool, authorized: bool,
showHeaderImage: bool, showHeaderImage: bool,
theme: str, theme: str,
defaultTimeline: str) -> str: defaultTimeline: str,
accessKeys: {}) -> str:
"""Returns html content for the right column """Returns html content for the right column
""" """
htmlStr = '' htmlStr = ''
@ -69,7 +70,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
publishButtonStr = \ publishButtonStr = \
' <a href="' + \ ' <a href="' + \
'/users/' + nickname + '/newblog?nodropdown" ' + \ '/users/' + nickname + '/newblog?nodropdown" ' + \
'title="' + titleStr + '">' + \ 'title="' + titleStr + '" ' + \
'accesskey="' + accessKeys['menuNewPost'] + '">' + \
'<button class="publishbtn">' + \ '<button class="publishbtn">' + \
translate['Publish'] + '</button></a>\n' translate['Publish'] + '</button></a>\n'
else: else:
@ -124,7 +126,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
# show the edit icon highlighted # show the edit icon highlighted
htmlStr += \ htmlStr += \
' <a href="' + \ ' <a href="' + \
'/users/' + nickname + '/editnewswire">' + \ '/users/' + nickname + '/editnewswire" ' + \
'accesskey="' + accessKeys['menuEdit'] + '">' + \
'<img class="' + editImageClass + \ '<img class="' + editImageClass + \
'" loading="lazy" alt="' + \ '" loading="lazy" alt="' + \
translate['Edit newswire'] + ' | " title="' + \ translate['Edit newswire'] + ' | " title="' + \
@ -134,7 +137,8 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
# show the edit icon # show the edit icon
htmlStr += \ htmlStr += \
' <a href="' + \ ' <a href="' + \
'/users/' + nickname + '/editnewswire">' + \ '/users/' + nickname + '/editnewswire" ' + \
'accesskey="' + accessKeys['menuEdit'] + '">' + \
'<img class="' + editImageClass + \ '<img class="' + editImageClass + \
'" loading="lazy" alt="' + \ '" loading="lazy" alt="' + \
translate['Edit newswire'] + ' | " title="' + \ translate['Edit newswire'] + ' | " title="' + \
@ -444,7 +448,8 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
rssIconAtTop: bool, rssIconAtTop: bool,
iconsAsButtons: bool, iconsAsButtons: bool,
defaultTimeline: str, defaultTimeline: str,
theme: str) -> str: theme: str,
accessKeys: {}) -> str:
"""Shows the mobile version of the newswire right column """Shows the mobile version of the newswire right column
""" """
htmlStr = '' htmlStr = ''
@ -473,7 +478,8 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
bannerFile, bannerFilename = \ bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain, theme) getBannerFile(baseDir, nickname, domain, theme)
htmlStr += \ htmlStr += \
'<a href="/users/' + nickname + '/' + defaultTimeline + '">' + \ '<a href="/users/' + nickname + '/' + defaultTimeline + '" ' + \
'accesskey="' + accessKeys['menuTimeline'] + '">' + \
'<img loading="lazy" class="timeline-banner" ' + \ '<img loading="lazy" class="timeline-banner" ' + \
'alt="' + translate['Timeline banner image'] + '" ' + \ 'alt="' + translate['Timeline banner image'] + '" ' + \
'src="/users/' + nickname + '/' + bannerFile + '" /></a>\n' 'src="/users/' + nickname + '/' + bannerFile + '" /></a>\n'
@ -493,7 +499,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
False, timelinePath, showPublishButton, False, timelinePath, showPublishButton,
showPublishAsIcon, rssIconAtTop, False, showPublishAsIcon, rssIconAtTop, False,
authorized, False, theme, authorized, False, theme,
defaultTimeline) defaultTimeline, accessKeys)
else: else:
if editor: if editor:
htmlStr += '<br><br><br>\n' htmlStr += '<br><br><br>\n'

View File

@ -174,7 +174,7 @@ def htmlFrontScreen(rssIconAtTop: bool,
False, False, newswire, False, False, False, newswire, False,
False, None, False, False, False, None, False, False,
False, True, authorized, True, theme, False, True, authorized, True, theme,
defaultTimeline) defaultTimeline, accessKeys)
profileFooterStr += ' </td>\n' profileFooterStr += ' </td>\n'
profileFooterStr += ' </tr>\n' profileFooterStr += ' </tr>\n'
profileFooterStr += ' </tbody>\n' profileFooterStr += ' </tbody>\n'

View File

@ -780,7 +780,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
showPublishAsIcon, showPublishAsIcon,
rssIconAtTop, publishButtonAtTop, rssIconAtTop, publishButtonAtTop,
authorized, True, theme, authorized, True, theme,
defaultTimeline) defaultTimeline, accessKeys)
tlStr += ' <td valign="top" class="col-right" ' + \ tlStr += ' <td valign="top" class="col-right" ' + \
'id="newswire" tabindex="-1">' + \ 'id="newswire" tabindex="-1">' + \
rightColumnStr + ' </td>\n' rightColumnStr + ' </td>\n'