diff --git a/assets/chat/js/const.js b/assets/chat/js/const.js index 559b19b2..7ebe885d 100644 --- a/assets/chat/js/const.js +++ b/assets/chat/js/const.js @@ -108,6 +108,7 @@ const settingsdefault = new Map( Object.entries({ schemaversion: 2, showtime: false, + showentireurl: false, hideflairicons: false, profilesettings: false, timestampformat: 'HH:mm', diff --git a/assets/chat/js/formatters/UrlFormatter.js b/assets/chat/js/formatters/UrlFormatter.js index 0dc2447d..7b182d44 100644 --- a/assets/chat/js/formatters/UrlFormatter.js +++ b/assets/chat/js/formatters/UrlFormatter.js @@ -80,11 +80,16 @@ export default class UrlFormatter { } catch (err) { // ignore } + const maxUrlLength = 90; let urlText = normalizedUrl; - if (urlText.length > maxUrlLength) { + if ( + !(chat.settings.get('showentireurl') ?? false) && + urlText.length > maxUrlLength + ) { urlText = `${urlText.slice(0, 40)}...${urlText.slice(-40)}`; } + const extra = self.encodeUrl(decodedUrl.substring(m[0].length)); const href = `${scheme ? '' : 'http://'}${normalizedUrl}`; diff --git a/assets/views/embed.html b/assets/views/embed.html index 87ddb616..2d95389b 100644 --- a/assets/views/embed.html +++ b/assets/views/embed.html @@ -104,6 +104,11 @@