From b0ad0108f84dabe2b35b7a8d2395601e7312ecb1 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 27 Jun 2024 16:01:28 +0000 Subject: [PATCH] Added toggle for :visited links. --- src/mami.css/markup.css | 4 ++-- src/mami.js/main.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mami.css/markup.css b/src/mami.css/markup.css index ad34250..6a3596f 100644 --- a/src/mami.css/markup.css +++ b/src/mami.css/markup.css @@ -18,7 +18,7 @@ text-decoration: underline } -.markup__link--visited, -.markup__link:visited { +.chat:not(.mami-do-not-mark-links-as-visited) .markup__link--visited, +.chat:not(.mami-do-not-mark-links-as-visited) .markup__link:visited { color: #6B4F80; } diff --git a/src/mami.js/main.js b/src/mami.js/main.js index 1dc63d8..9bf2329 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -152,6 +152,7 @@ const MamiInit = async args => { settings.define('newLineOnEnter').default(false).create(); settings.define('showMarkupSelector').type(['always', 'focus', 'never']).default('focus').create(); settings.define('keepEmotePickerOpen').default(true).create(); + settings.define('doNotMarkLinksAsVisited').default(false).create(); const noNotifSupport = !('Notification' in window); settings.define('enableNotifications').default(false).immutable(noNotifSupport).critical().create(); @@ -304,7 +305,8 @@ const MamiInit = async args => { layout.getElement().classList.toggle('chat--compact', ev.detail.value); layout.getInterface().getMessageList().getElement().classList.toggle('chat--compact', ev.detail.value); }); - settings.watch('preventOverflow', ev => args.parent.classList.toggle('prevent-overflow', ev.detail.value)); + settings.watch('preventOverflow', ev => { args.parent.classList.toggle('prevent-overflow', ev.detail.value); }); + settings.watch('doNotMarkLinksAsVisited', ev => { layout.getInterface().getMessageList().getElement().classList.toggle('mami-do-not-mark-links-as-visited', ev.detail.value); }); settings.watch('minecraft', ev => { if(ev.detail.initial && ev.detail.value === 'no') @@ -450,6 +452,7 @@ const MamiInit = async args => { category.setting('autoScroll').title('Enable auto scroll').done(); category.setting('closeTabConfirm').title('Confirm tab close').done(); category.setting('autoCloseUserContext').title('Auto-close user menus').done(); + category.setting('doNotMarkLinksAsVisited').title("Don't mark links as visited").done(); }); sbSettings.category(category => { category.header('Text');