Add scope icons
16
daemon.py
|
@ -464,6 +464,22 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
self._404()
|
||||
return
|
||||
# icon images
|
||||
# Note that this comes before the busy flag to avoid conflicts
|
||||
if '/icons/' in self.path:
|
||||
if self.path.endswith('.png'):
|
||||
mediaStr=self.path.split('/icons/')[1]
|
||||
mediaFilename= \
|
||||
self.server.baseDir+'/img/icons/'+mediaStr
|
||||
if os.path.isfile(mediaFilename):
|
||||
if mediaFilename.endswith('.png'):
|
||||
self._set_headers('image/png')
|
||||
with open(mediaFilename, 'rb') as avFile:
|
||||
mediaBinary = avFile.read()
|
||||
self.wfile.write(mediaBinary)
|
||||
return
|
||||
self._404()
|
||||
return
|
||||
# show avatar or background image
|
||||
# Note that this comes before the busy flag to avoid conflicts
|
||||
if '/users/' in self.path:
|
||||
|
|
|
@ -241,16 +241,17 @@ input[type=text], select, textarea {
|
|||
}
|
||||
|
||||
input[type=submit] {
|
||||
background-color: #4CAF50;
|
||||
background-color: #555;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
input[type=submit]:hover {
|
||||
background-color: #45a049;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
.vertical-center {
|
||||
|
@ -261,3 +262,46 @@ input[type=submit]:hover {
|
|||
min-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.dropbtn {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* The container <div> - needed to position the dropdown content */
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Dropdown Content (Hidden by Default) */
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #f1f1f1;
|
||||
min-width: 260px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Links inside the dropdown */
|
||||
.dropdown-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Change color of dropdown links on hover */
|
||||
.dropdown-content a:hover {background-color: #ddd;}
|
||||
|
||||
/* Show the dropdown menu on hover */
|
||||
.dropdown:hover .dropdown-content {display: block;}
|
||||
|
||||
/* Change the background color of the dropdown button when the dropdown content is shown */
|
||||
.dropdown:hover .dropbtn {background-color: #3e8e41;}
|
||||
|
|
After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 811 B |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 794 B |
|
@ -92,8 +92,20 @@ def htmlNewPost(baseDir: str,path: str) -> str:
|
|||
'' \
|
||||
' <textarea id="message" name="message" placeholder="Write something..." style="height:200px"></textarea>' \
|
||||
'' \
|
||||
' <input type="submit" value="Cencel">' \
|
||||
' <div class="container">' \
|
||||
' <input type="submit" value="Cancel">' \
|
||||
' <input type="submit" value="Submit">' \
|
||||
' <div class="dropdown">' \
|
||||
' <button class="dropbtn">Scope</button>' \
|
||||
' <div class="dropdown-content">' \
|
||||
' <a href="#"><img="/icons/scope_public.png"/><b>Public</b><br>Visible to anyone</a>' \
|
||||
' <a href="#"><img="/icons/scope_unlisted.png"/><b>Unlisted</b><br>Not shown on public timeline</a>' \
|
||||
' <a href="#"><img="/icons/scope_followers.png"/><b>Followers Only</b><br>Only sent to followers</a>' \
|
||||
' <a href="#"><img="/icons/scope_dm.png"/><b>Direct Message</b><br>Sent only to mentioned people</a>' \
|
||||
' <a href="#"><img="/icons/scope_offer.png"/><b>Offer</b><br>Describe a shared item</a>' \
|
||||
' </div>' \
|
||||
' </div>' \
|
||||
' </div>' \
|
||||
' </div>' \
|
||||
'</form>'
|
||||
newPostForm+=htmlFooter()
|
||||
|
@ -399,8 +411,7 @@ def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
|
|||
'<div class="timeline-banner">' \
|
||||
'</div>' \
|
||||
'<div class="container">\n' \
|
||||
' <center>'+ \
|
||||
newPostStr+ \
|
||||
' <center>'+newPostStr+ \
|
||||
' <a href="'+actor+'/inbox"><button class="'+localButton+'"><span>Local </span></button></a>' \
|
||||
' <a href="'+actor+'/outbox"><button class="'+personalButton+'"><span>Personal </span></button></a>' \
|
||||
' <a href="'+actor+'/federated"><button class="'+federatedButton+'"><span>Federated </span></button></a>' \
|
||||
|
|