Make bidirectional support a preference

Fixes #270
This commit is contained in:
Zed 2020-11-08 00:41:12 +01:00
parent 13bdd6497b
commit 82fe5d8b78
3 changed files with 13 additions and 1 deletions

View file

@ -88,6 +88,9 @@ genPrefs:
stickyProfile(checkbox, true):
"Make profile sidebar stick to top"
bidiSupport(checkbox, false):
"Support bidirectional text (makes clicking on tweets harder)"
hideTweetStats(checkbox, false):
"Hide tweet stats (replies, retweets, likes)"

View file

@ -20,6 +20,11 @@
font-family: $font_3;
line-height: 1.4em;
pointer-events: all;
display: inline;
}
.tweet-bidi {
display: block !important;
}
.tweet-header {

View file

@ -299,7 +299,11 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
(tweet.reply.len > 1 or tweet.reply[0] != tweet.profile.username):
renderReply(tweet)
tdiv(class="tweet-content media-body", dir="auto"):
var tweetClass = "tweet-content media-body"
if prefs.bidiSupport:
tweetClass &= " tweet-bidi"
tdiv(class=tweetClass, dir="auto"):
verbatim replaceUrl(tweet.text, prefs) & renderLocation(tweet)
if tweet.attribution.isSome: