Only show mobile buttons on mobile

merge-requests/30/head
Bob Mottram 2020-10-25 20:58:13 +00:00
parent 57bc04775f
commit a466d6764d
2 changed files with 81 additions and 31 deletions

View File

@ -1276,6 +1276,9 @@ aside .toggle-inside li {
cursor: pointer; cursor: pointer;
margin: 5px; margin: 5px;
} }
.buttonMobile {
display: none;
}
.button { .button {
border-radius: var(--button-corner-radius); border-radius: var(--button-corner-radius);
background-color: var(--button-background); background-color: var(--button-background);
@ -1879,6 +1882,24 @@ aside .toggle-inside li {
cursor: pointer; cursor: pointer;
margin: 15px; margin: 15px;
} }
.buttonMobile {
border-radius: var(--button-corner-radius);
background-color: var(--button-background);
color: var(--button-text);
text-align: center;
font-size: var(--font-size-button-mobile);
font-family: Arial, Helvetica, sans-serif;
padding: var(--button-height-padding-mobile);
width: 20%;
min-width: var(--button-width-chars);
transition: all 0.5s;
cursor: pointer;
margin: 15px;
border-top: var(--tab-border-width) solid var(--tab-border-color);
border-bottom: none;
border-left: var(--tab-border-width) solid var(--tab-border-color);
border-right: var(--tab-border-width) solid var(--tab-border-color);
}
.button { .button {
border-radius: var(--button-corner-radius); border-radius: var(--button-corner-radius);
background-color: var(--button-background); background-color: var(--button-background);

View File

@ -6142,7 +6142,7 @@ def getTimelineButtonHeader(defaultTimeline: str,
else: else:
tlStr += \ tlStr += \
' <a href="' + usersPath + '/newswiremobile' + \ ' <a href="' + usersPath + '/newswiremobile' + \
'"><button class="button">' + \ '"><button class="buttonMobile">' + \
'<span>' + translate['Newswire'] + \ '<span>' + translate['Newswire'] + \
'</span></button></a>\n' '</span></button></a>\n'
@ -6158,7 +6158,7 @@ def getTimelineButtonHeader(defaultTimeline: str,
else: else:
tlStr += \ tlStr += \
' <a href="' + usersPath + '/linksmobile' + \ ' <a href="' + usersPath + '/linksmobile' + \
'"><button class="button">' + \ '"><button class="buttonMobile">' + \
'<span>' + translate['Links'] + \ '<span>' + translate['Links'] + \
'</span></button></a>\n' '</span></button></a>\n'
@ -6404,47 +6404,76 @@ def htmlTimeline(defaultTimeline: str,
# what screen to go to when a new post is created # what screen to go to when a new post is created
if boxName == 'dm': if boxName == 'dm':
newPostButtonStr = \ if not iconsAsButtons:
' <a class="imageAnchor" href="' + usersPath + \ newPostButtonStr = \
'/newdm"><img loading="lazy" src="/' + \ ' <a class="imageAnchor" href="' + usersPath + \
iconsDir + '/newpost.png" title="' + \ '/newdm"><img loading="lazy" src="/' + \
translate['Create a new DM'] + \ iconsDir + '/newpost.png" title="' + \
'" alt="| ' + translate['Create a new DM'] + \ translate['Create a new DM'] + \
'" class="timelineicon"/></a>\n' '" alt="| ' + translate['Create a new DM'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr = \
'<a href="' + usersPath + '/newdm">' + \
'<button class="button"><span>+' + \
' </span></button></a>\n'
elif boxName == 'tlblogs' or boxName == 'tlnews': elif boxName == 'tlblogs' or boxName == 'tlnews':
newPostButtonStr = \ if not iconsAsButtons:
' <a class="imageAnchor" href="' + usersPath + \
'/newblog"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
elif boxName == 'tlevents':
newPostButtonStr = \
' <a class="imageAnchor" href="' + usersPath + \
'/newevent"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \
translate['Create a new event'] + '" alt="| ' + \
translate['Create a new event'] + \
'" class="timelineicon"/></a>\n'
else:
if not manuallyApproveFollowers:
newPostButtonStr = \ newPostButtonStr = \
' <a class="imageAnchor" href="' + usersPath + \ ' <a class="imageAnchor" href="' + usersPath + \
'/newpost"><img loading="lazy" src="/' + \ '/newblog"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \ iconsDir + '/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \ translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \ translate['Create a new post'] + \
'" class="timelineicon"/></a>\n' '" class="timelineicon"/></a>\n'
else: else:
newPostButtonStr = \
'<a href="' + usersPath + '/newblog">' + \
'<button class="button"><span>+' + \
' </span></button></a>\n'
elif boxName == 'tlevents':
if not iconsAsButtons:
newPostButtonStr = \ newPostButtonStr = \
' <a class="imageAnchor" href="' + usersPath + \ ' <a class="imageAnchor" href="' + usersPath + \
'/newfollowers"><img loading="lazy" src="/' + \ '/newevent"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \ iconsDir + '/newpost.png" title="' + \
translate['Create a new post'] + \ translate['Create a new event'] + '" alt="| ' + \
'" alt="| ' + translate['Create a new post'] + \ translate['Create a new event'] + \
'" class="timelineicon"/></a>\n' '" class="timelineicon"/></a>\n'
else:
newPostButtonStr = \
'<a href="' + usersPath + '/newevent">' + \
'<button class="button"><span>+' + \
' </span></button></a>\n'
else:
if not manuallyApproveFollowers:
if not iconsAsButtons:
newPostButtonStr = \
' <a class="imageAnchor" href="' + usersPath + \
'/newpost"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr = \
'<a href="' + usersPath + '/newpost">' + \
'<button class="button"><span>+' + \
' </span></button></a>\n'
else:
if not iconsAsButtons:
newPostButtonStr = \
' <a class="imageAnchor" href="' + usersPath + \
'/newfollowers"><img loading="lazy" src="/' + \
iconsDir + '/newpost.png" title="' + \
translate['Create a new post'] + \
'" alt="| ' + translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr = \
'<a href="' + usersPath + '/newfollowers">' + \
'<button class="button"><span>+' + \
' </span></button></a>\n'
# This creates a link to the profile page when viewed # This creates a link to the profile page when viewed
# in lynx, but should be invisible in a graphical web browser # in lynx, but should be invisible in a graphical web browser
tlStr += \ tlStr += \