mirror of https://gitlab.com/bashrc2/epicyon
Key shortcuts on new post screen
parent
4c06b02119
commit
e175bb207c
29
daemon.py
29
daemon.py
|
@ -2257,6 +2257,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
if debug:
|
if debug:
|
||||||
print('Sending DM to ' + optionsActor)
|
print('Sending DM to ' + optionsActor)
|
||||||
reportPath = path.replace('/personoptions', '') + '/newdm'
|
reportPath = path.replace('/personoptions', '') + '/newdm'
|
||||||
|
|
||||||
|
accessKeys = self.server.accessKeys
|
||||||
|
if '/users/' in path:
|
||||||
|
nickname = path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
if self.server.keyShortcuts.get(nickname):
|
||||||
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
msg = htmlNewPost(self.server.cssCache,
|
msg = htmlNewPost(self.server.cssCache,
|
||||||
False, self.server.translate,
|
False, self.server.translate,
|
||||||
baseDir,
|
baseDir,
|
||||||
|
@ -2270,7 +2279,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.defaultTimeline,
|
self.server.defaultTimeline,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
True).encode('utf-8')
|
True, 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)
|
||||||
|
@ -2357,6 +2366,15 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('Reporting ' + optionsActor)
|
print('Reporting ' + optionsActor)
|
||||||
reportPath = \
|
reportPath = \
|
||||||
path.replace('/personoptions', '') + '/newreport'
|
path.replace('/personoptions', '') + '/newreport'
|
||||||
|
|
||||||
|
accessKeys = self.server.accessKeys
|
||||||
|
if '/users/' in path:
|
||||||
|
nickname = path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
if self.server.keyShortcuts.get(nickname):
|
||||||
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
msg = htmlNewPost(self.server.cssCache,
|
msg = htmlNewPost(self.server.cssCache,
|
||||||
False, self.server.translate,
|
False, self.server.translate,
|
||||||
baseDir,
|
baseDir,
|
||||||
|
@ -2369,7 +2387,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.defaultTimeline,
|
self.server.defaultTimeline,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
True).encode('utf-8')
|
True, 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)
|
||||||
|
@ -10345,6 +10363,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
break
|
break
|
||||||
if isNewPostEndpoint:
|
if isNewPostEndpoint:
|
||||||
nickname = getNicknameFromActor(path)
|
nickname = getNicknameFromActor(path)
|
||||||
|
|
||||||
|
accessKeys = self.server.accessKeys
|
||||||
|
if self.server.keyShortcuts.get(nickname):
|
||||||
|
accessKeys = self.server.keyShortcuts[nickname]
|
||||||
|
|
||||||
msg = htmlNewPost(self.server.cssCache,
|
msg = htmlNewPost(self.server.cssCache,
|
||||||
mediaInstance,
|
mediaInstance,
|
||||||
translate,
|
translate,
|
||||||
|
@ -10359,7 +10382,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.defaultTimeline,
|
self.server.defaultTimeline,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
noDropDown).encode('utf-8')
|
noDropDown, accessKeys).encode('utf-8')
|
||||||
if not msg:
|
if not msg:
|
||||||
print('Error replying to ' + inReplyToUrl)
|
print('Error replying to ' + inReplyToUrl)
|
||||||
self._404()
|
self._404()
|
||||||
|
|
|
@ -177,7 +177,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
domainFull: str,
|
domainFull: str,
|
||||||
defaultTimeline: str, newswire: {},
|
defaultTimeline: str, newswire: {},
|
||||||
theme: str, noDropDown: bool) -> str:
|
theme: str, noDropDown: bool,
|
||||||
|
accessKeys: {}) -> str:
|
||||||
"""New post screen
|
"""New post screen
|
||||||
"""
|
"""
|
||||||
replyStr = ''
|
replyStr = ''
|
||||||
|
@ -579,7 +580,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
'<header>\n' + \
|
'<header>\n' + \
|
||||||
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
||||||
translate['Switch to timeline view'] + '" alt="' + \
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
translate['Switch to timeline view'] + '">\n'
|
translate['Switch to timeline view'] + '" ' + \
|
||||||
|
'accesskey="' + accessKeys['menuTimeline'] + '">\n'
|
||||||
newPostForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
newPostForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
'/users/' + nickname + '/' + bannerFile + '" alt="" /></a>\n' + \
|
'/users/' + nickname + '/' + bannerFile + '" alt="" /></a>\n' + \
|
||||||
'</header>\n'
|
'</header>\n'
|
||||||
|
@ -693,7 +695,8 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
|
|
||||||
newPostForm += \
|
newPostForm += \
|
||||||
' <td><input type="submit" name="submitPost" value="' + \
|
' <td><input type="submit" name="submitPost" value="' + \
|
||||||
translate['Submit'] + '"></td>\n'
|
translate['Submit'] + '" ' + \
|
||||||
|
'accesskey="' + accessKeys['submitButton'] + '"></td>\n'
|
||||||
|
|
||||||
newPostForm += ' </tr>\n'
|
newPostForm += ' </tr>\n'
|
||||||
newPostForm += '</table>\n'
|
newPostForm += '</table>\n'
|
||||||
|
|
Loading…
Reference in New Issue