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): stickyProfile(checkbox, true):
"Make profile sidebar stick to top" "Make profile sidebar stick to top"
bidiSupport(checkbox, false):
"Support bidirectional text (makes clicking on tweets harder)"
hideTweetStats(checkbox, false): hideTweetStats(checkbox, false):
"Hide tweet stats (replies, retweets, likes)" "Hide tweet stats (replies, retweets, likes)"

View File

@ -20,6 +20,11 @@
font-family: $font_3; font-family: $font_3;
line-height: 1.4em; line-height: 1.4em;
pointer-events: all; pointer-events: all;
display: inline;
}
.tweet-bidi {
display: block !important;
} }
.tweet-header { .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): (tweet.reply.len > 1 or tweet.reply[0] != tweet.profile.username):
renderReply(tweet) 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) verbatim replaceUrl(tweet.text, prefs) & renderLocation(tweet)
if tweet.attribution.isSome: if tweet.attribution.isSome: