forked from indymedia/epicyon
Remove full screen image
parent
9f20864ad1
commit
b0fea9c7f7
18
daemon.py
18
daemon.py
|
@ -81,7 +81,6 @@ from roles import setRole
|
||||||
from roles import clearModeratorStatus
|
from roles import clearModeratorStatus
|
||||||
from skills import outboxSkills
|
from skills import outboxSkills
|
||||||
from availability import outboxAvailability
|
from availability import outboxAvailability
|
||||||
from webinterface import htmlFullScreenImage
|
|
||||||
from webinterface import htmlDeletePost
|
from webinterface import htmlDeletePost
|
||||||
from webinterface import htmlAbout
|
from webinterface import htmlAbout
|
||||||
from webinterface import htmlRemoveSharedItem
|
from webinterface import htmlRemoveSharedItem
|
||||||
|
@ -754,7 +753,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'/emoji/' not in self.path and \
|
'/emoji/' not in self.path and \
|
||||||
'/tags/' not in self.path and \
|
'/tags/' not in self.path and \
|
||||||
'/avatars/' not in self.path and \
|
'/avatars/' not in self.path and \
|
||||||
'/fullscreen?' not in self.path and \
|
|
||||||
'/icons/' not in self.path:
|
'/icons/' not in self.path:
|
||||||
divertToLoginScreen=True
|
divertToLoginScreen=True
|
||||||
if self.path.startswith('/users/'):
|
if self.path.startswith('/users/'):
|
||||||
|
@ -972,22 +970,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._404()
|
self._404()
|
||||||
return
|
return
|
||||||
|
|
||||||
# full screen images shown from the media timeline
|
|
||||||
if htmlGET and authorized and '/fullscreen?' in self.path:
|
|
||||||
imageFilename=self.path.split('?img=')[1].replace('%20',' ').replace('%40','@').replace('%3A',':').replace('%23','#')
|
|
||||||
if '?' in imageFilename:
|
|
||||||
imageFilename=imageFilename.split('?')[0]
|
|
||||||
imageDescription=None
|
|
||||||
if '?desc=' in self.path:
|
|
||||||
imageDescription=self.path.split('?desc=')[1].replace('%20',' ').replace('%40','@').replace('%3A',':').replace('%23','#')
|
|
||||||
if '?' in imageDescription:
|
|
||||||
imageDescription=imageDescription.split('?')[0]
|
|
||||||
msg=htmlFullScreenImage(imageFilename,imageDescription).encode('utf-8')
|
|
||||||
self._set_headers('text/html',len(msg),cookie)
|
|
||||||
self._write(msg)
|
|
||||||
self.server.GETbusy=False
|
|
||||||
return
|
|
||||||
|
|
||||||
# cached avatar images
|
# cached avatar images
|
||||||
# Note that this comes before the busy flag to avoid conflicts
|
# Note that this comes before the busy flag to avoid conflicts
|
||||||
if self.path.startswith('/avatars/'):
|
if self.path.startswith('/avatars/'):
|
||||||
|
|
|
@ -51,44 +51,6 @@ from skills import getSkills
|
||||||
from cache import getPersonFromCache
|
from cache import getPersonFromCache
|
||||||
from cache import storePersonInCache
|
from cache import storePersonInCache
|
||||||
|
|
||||||
def htmlFullScreenImage(imageFilename: str,description: str) -> str:
|
|
||||||
"""On the media timeline show a full screen image when selecting it
|
|
||||||
"""
|
|
||||||
htmlStr='<!DOCTYPE html>\n'
|
|
||||||
htmlStr+='<html>\n'
|
|
||||||
htmlStr+='<head>\n'
|
|
||||||
htmlStr+='<meta name="viewport" content="width=device-width, initial-scale=1">\n'
|
|
||||||
htmlStr+='<style>\n'
|
|
||||||
htmlStr+='body, html {\n'
|
|
||||||
htmlStr+=' height: 100%;\n'
|
|
||||||
htmlStr+=' margin: 0;\n'
|
|
||||||
htmlStr+='}\n'
|
|
||||||
htmlStr+='\n'
|
|
||||||
htmlStr+='.bg {\n'
|
|
||||||
htmlStr+=' background-image: url("'+imageFilename+'");\n'
|
|
||||||
htmlStr+='\n'
|
|
||||||
if description:
|
|
||||||
htmlStr+=' height: 90%;\n'
|
|
||||||
else:
|
|
||||||
htmlStr+=' height: 100%;\n'
|
|
||||||
htmlStr+=''
|
|
||||||
htmlStr+=' background-position: center;\n'
|
|
||||||
htmlStr+=' background-repeat: no-repeat;\n'
|
|
||||||
htmlStr+=' background-size: cover;\n'
|
|
||||||
htmlStr+='}\n'
|
|
||||||
htmlStr+='</style>\n'
|
|
||||||
htmlStr+='</head>\n'
|
|
||||||
htmlStr+='<body>\n'
|
|
||||||
htmlStr+='\n'
|
|
||||||
htmlStr+='<div class="bg"></div>\n'
|
|
||||||
htmlStr+='\n'
|
|
||||||
if description:
|
|
||||||
htmlStr+='<p>'+description+'</p>\n'
|
|
||||||
htmlStr+='\n'
|
|
||||||
htmlStr+='</body>\n'
|
|
||||||
htmlStr+='</html>'
|
|
||||||
return htmlStr
|
|
||||||
|
|
||||||
def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avatarUrl: str,personCache: {},force=False) -> str:
|
def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avatarUrl: str,personCache: {},force=False) -> str:
|
||||||
"""Updates the cached avatar for the given actor
|
"""Updates the cached avatar for the given actor
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue