From 178fb27b5b314321954787b3b52bbcd45e416175 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 5 Feb 2021 12:14:54 +0000 Subject: [PATCH] Turn off dropdown on new post screen under some single-purpose conditions --- daemon.py | 20 +++++++++++++++----- webapp_column_right.py | 4 ++-- webapp_create_post.py | 16 +++++++++++----- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/daemon.py b/daemon.py index 0c70a77fb..70c836065 100644 --- a/daemon.py +++ b/daemon.py @@ -2078,7 +2078,8 @@ class PubServer(BaseHTTPRequestHandler): domainFull, self.server.defaultTimeline, self.server.newswire, - self.server.themeName).encode('utf-8') + self.server.themeName, + True).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, callingDomain) @@ -2176,7 +2177,8 @@ class PubServer(BaseHTTPRequestHandler): domainFull, self.server.defaultTimeline, self.server.newswire, - self.server.themeName).encode('utf-8') + self.server.themeName, + True).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, callingDomain) @@ -9711,7 +9713,8 @@ class PubServer(BaseHTTPRequestHandler): inReplyToUrl: str, replyToList: [], shareDescription: str, replyPageNumber: int, domain: str, domainFull: str, - GETstartTime, GETtimings: {}, cookie) -> bool: + GETstartTime, GETtimings: {}, cookie, + noDropDown: bool) -> bool: """Shows the new post screen """ isNewPostEndpoint = False @@ -9740,7 +9743,8 @@ class PubServer(BaseHTTPRequestHandler): domainFull, self.server.defaultTimeline, self.server.newswire, - self.server.themeName).encode('utf-8') + self.server.themeName, + noDropDown).encode('utf-8') if not msg: print('Error replying to ' + inReplyToUrl) self._404() @@ -9983,6 +9987,12 @@ class PubServer(BaseHTTPRequestHandler): if self.path.startswith('/@'): self.path = self.path.replace('/@', '/users/') + # turn off dropdowns on new post screen + noDropDown = False + if self.path.endswith('?nodropdown'): + noDropDown = True + self.path = self.path.replace('?nodropdown', '') + # redirect music to #nowplaying list if self.path == '/music' or self.path == '/nowplaying': self.path = '/tags/nowplaying' @@ -11556,7 +11566,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.domain, self.server.domainFull, GETstartTime, GETtimings, - cookie): + cookie, noDropDown): return self._benchmarkGETtimings(GETstartTime, GETtimings, diff --git a/webapp_column_right.py b/webapp_column_right.py index b2a4e63b6..1b4276515 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -68,7 +68,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, titleStr = translate['Publish a news article'] publishButtonStr = \ ' ' + \ '\n' @@ -167,7 +167,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, titleStr = translate['Publish a news article'] htmlStr += \ ' ' + \ + '/users/' + nickname + '/newblog?nodropdown">' + \ '' + \
                 titleStr + '' + \ scopeDescription + '\n' - dropDownContent += '