damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit d63c15c8e8374da889762050ee22ab3d8499c167
parent 66a688d9506b7c6df40dc0c53d6175116f80078a
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 12 Nov 2022 10:14:13 -0800

web: max height on inline media content

Diffstat:
Mweb/damus.js | 6+++++-
Mweb/index.html | 4++--
Mweb/styles.css | 2++
3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/web/damus.js b/web/damus.js @@ -1312,7 +1312,11 @@ function linkify(text, show_media) { return text.replace(URL_REGEX, function(url) { const parsed = new URL(url) if (show_media && is_img_url(parsed.pathname)) - return `<img class="inline-img" src="${url}"/>`; + return ` + <a target="_blank" href="${url}"> + <img class="inline-img" src="${url}"/> + </a> + `; else if (show_media && is_video_url(parsed.pathname)) return ` <video controls class="inline-img" /> diff --git a/web/index.html b/web/index.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Damus</title> - <link rel="stylesheet" href="styles.css?v=109"> + <link rel="stylesheet" href="styles.css?v=110"> <link rel="stylesheet" href="damus.css?v=211"> <link rel="stylesheet" href="fontawesome.css?v=2"> </head> @@ -66,7 +66,7 @@ <script src="noble-secp256k1.js?v=1"></script> <script src="bech32.js?v=1"></script> <script src="nostr.js?v=6"></script> - <script src="damus.js?v=66"></script> + <script src="damus.js?v=67"></script> <script> // I have to delay loading to wait for nos2x const relay = setTimeout(damus_web_init, 100) diff --git a/web/styles.css b/web/styles.css @@ -183,6 +183,8 @@ button.nav { .inline-img { width: 100%; + max-height: 300px; + object-fit: contain; } .action-bar {