From 348028a29043b7d1d0f80544c44f0454b2c375c3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 8 Nov 2023 20:23:54 +0100 Subject: New feature important feeds (#5782) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New feature important feeds * Fix PHPStan * Initial style for important feeds + keep unread * Change UI order * Count important unread * Never mark as read important feeds during scroll * Fix i18n conf.iew.normal regression * Fix reader view * More fix reader view * Create important.svg * Fix title * Fix counter * Account for important during mark-all-as-read * Fix underline colour * 📌 * Changelog --------- Co-authored-by: math-gh <> Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com> --- p/scripts/main.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 4ddafb2bd..b3876f628 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -135,6 +135,15 @@ function incUnreadsFeed(article, feed_id, nb) { } } + // Update unread: important + if (feed_priority >= 20) { + elem = document.querySelector('#aside_feed .important .title'); + if (elem) { + feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; + elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + } + } + // Update unread: favourites if (article && article.closest('div').classList.contains('favorite')) { elem = document.querySelector('#aside_feed .favorites .title'); -- cgit v1.2.3