mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
make a preference for image sizes in posts, fix #119
This commit is contained in:
@@ -24,6 +24,19 @@ html
|
||||
p subreddit:
|
||||
a(href="/r/" + subreddit + "")
|
||||
p /r/#{subreddit}
|
||||
if user_preferences.post_media_max_height
|
||||
if(post_media_max_heights.hasOwnProperty(user_preferences.post_media_max_height))
|
||||
style.
|
||||
#post .image img, #post .video video {
|
||||
max-height: #{post_media_max_heights[user_preferences.post_media_max_height]}px;
|
||||
max-width: 100%;
|
||||
}
|
||||
else if(!isNaN(user_preferences.post_media_max_height))
|
||||
style.
|
||||
#post .image img, #post .video video {
|
||||
max-height: #{user_preferences.post_media_max_height}px;
|
||||
max-width: 100%;
|
||||
}
|
||||
.info
|
||||
.score
|
||||
div.arrow
|
||||
|
||||
@@ -51,6 +51,20 @@ html
|
||||
input(type="checkbox", name="nsfw_enabled", id="nsfw_enabled")
|
||||
else
|
||||
input(type="checkbox", name="nsfw_enabled", id="nsfw_enabled", checked="checked")
|
||||
.setting
|
||||
label(for="post_media_max_height") Media size in posts:
|
||||
select(id="post_media_max_height", name="post_media_max_height")
|
||||
-
|
||||
let max_heights_html = ''
|
||||
let user_key = user_preferences.post_media_max_height
|
||||
if(!user_key || user_key == '')
|
||||
user_key = 'medium'
|
||||
|
||||
for(let key in instance_config.post_media_max_heights) {
|
||||
if(instance_config.post_media_max_heights.hasOwnProperty(key))
|
||||
max_heights_html += `<option value="${key}" ${(user_key == key ? "selected" : "")}>${key}</option>`
|
||||
}
|
||||
!= max_heights_html
|
||||
legend Subscribed subreddits
|
||||
.setting
|
||||
details
|
||||
|
||||
Reference in New Issue
Block a user