From b61478a18df30bf9c2ed23ff86917c08e358717f Mon Sep 17 00:00:00 2001 From: iiPython Date: Sun, 24 Nov 2024 20:55:26 -0600 Subject: [PATCH] image improvements --- nightwatch/web/css/main.css | 2 +- nightwatch/web/js/nightwatch.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nightwatch/web/css/main.css b/nightwatch/web/css/main.css index 0b6c74c..7cd98b2 100644 --- a/nightwatch/web/css/main.css +++ b/nightwatch/web/css/main.css @@ -104,7 +104,7 @@ input:hover { padding-bottom: 5px; } .message-content > img { - max-width: 300px; + max-width: 640px; } .timestamp { margin-left: auto; diff --git a/nightwatch/web/js/nightwatch.js b/nightwatch/web/js/nightwatch.js index 18edd11..9cdf563 100644 --- a/nightwatch/web/js/nightwatch.js +++ b/nightwatch/web/js/nightwatch.js @@ -86,7 +86,8 @@ const NOTIFICATION_SFX = new Audio("/audio/notification.mp3"); // Construct text/attachment let attachment = message.message, classlist = "message-content"; if (attachment.toLowerCase().match(/^https:\/\/[\w\d./-]+.(?:avifs?|a?png|jpe?g|jfif|webp|ico|gif|svg)(?:\?.+)?$/)) { - attachment = ``; + const url = `http${connection.protocol}://${address}/api/fwd/${btoa(attachment.slice(8))}`; + attachment = ``; classlist += " has-image"; } else {