diff options
| author | 2023-11-08 20:23:54 +0100 | |
|---|---|---|
| committer | 2023-11-08 20:23:54 +0100 | |
| commit | 348028a29043b7d1d0f80544c44f0454b2c375c3 (patch) | |
| tree | 8f01badaa6983341f27e8afb05e2e9d42992b9b0 /p | |
| parent | 7d26dcc8475e4c7c3f68358405e9074ed61e018c (diff) | |
New feature important feeds (#5782)
* 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>
Diffstat (limited to 'p')
| -rw-r--r-- | p/api/greader.php | 2 | ||||
| -rw-r--r-- | p/scripts/main.js | 9 | ||||
| -rw-r--r-- | p/themes/base-theme/frss.css | 5 | ||||
| -rw-r--r-- | p/themes/base-theme/frss.rtl.css | 5 | ||||
| -rw-r--r-- | p/themes/icons/important.svg | 16 |
5 files changed, 36 insertions, 1 deletions
diff --git a/p/api/greader.php b/p/api/greader.php index a014a4db1..a93bad52e 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -963,7 +963,7 @@ final class GReaderAPI { } } } elseif ($streamId === 'user/-/state/com.google/reading-list') { - $entryDAO->markReadEntries($olderThanId, false, -1); + $entryDAO->markReadEntries($olderThanId, false); } else { self::badRequest(); } 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'); diff --git a/p/themes/base-theme/frss.css b/p/themes/base-theme/frss.css index 49188f888..219a78dce 100644 --- a/p/themes/base-theme/frss.css +++ b/p/themes/base-theme/frss.css @@ -1978,6 +1978,11 @@ html.slider-active { color: var(--frss-font-color-light); } +.feed[data-priority="20"] .item-title, +.flux[data-priority="20"] .website > a { + text-decoration: underline double; +} + .aside .category .title:not([data-unread="0"])::after, .aside .feed .item-title:not([data-unread="0"])::after { margin: calc(0.125rem + var(--frss-padding-top-bottom)) 0 0 0; diff --git a/p/themes/base-theme/frss.rtl.css b/p/themes/base-theme/frss.rtl.css index 1452b1f7c..3bb38e88b 100644 --- a/p/themes/base-theme/frss.rtl.css +++ b/p/themes/base-theme/frss.rtl.css @@ -1978,6 +1978,11 @@ html.slider-active { color: var(--frss-font-color-light); } +.feed[data-priority="20"] .item-title, +.flux[data-priority="20"] .website > a { + text-decoration: underline double; +} + .aside .category .title:not([data-unread="0"])::after, .aside .feed .item-title:not([data-unread="0"])::after { margin: calc(0.125rem + var(--frss-padding-top-bottom)) 0 0 0; diff --git a/p/themes/icons/important.svg b/p/themes/icons/important.svg new file mode 100644 index 000000000..6c354bef1 --- /dev/null +++ b/p/themes/icons/important.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="72mm" + height="72mm" + viewBox="0 0 71.999999 72" + version="1.1" + id="svg5" + xml:space="preserve" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"><defs + id="defs2" /><g + id="layer1" + transform="translate(-122.44279,-77.410739)"><path + style="fill:#666666;fill-opacity:1;stroke-width:0.264583" + d="m 155.36278,125.51274 -23.40677,-0.267 c 0.37363,-6.79753 6.08526,-15.40892 10.29516,-18.966 l 0.18842,-14.416001 c -2.08469,-2.992382 -3.17159,-9.454502 -2.90518,-13.134 h 37.73107 c 0.55646,4.844593 -2.38864,11.922429 -3.21412,13.134 l 0.66741,14.416001 c 6.09605,4.12103 10.68435,11.5874 10.1717,18.966 l -23.13629,0.267 c 0,0 0.53578,23.15291 -2.689,23.21131 -3.22478,0.0584 -3.7024,-23.21131 -3.7024,-23.21131 z m 20.94348,-7.48921 c -0.87839,-5.10027 -7.7188,-8.00726 -9.06022,-9.36379 l -0.46497,-18.060001 c 0.93662,-1.542882 2.08799,-2.833625 2.83719,-5.066 H 147.4665 c 0.2891,2.515209 2.13895,3.39548 2.77999,5.066 l -0.11232,18.060001 c -1.28385,1.35457 -8.57876,5.82732 -9.32679,9.83151 10.08085,0.18667 26.33338,-0.71732 35.49866,-0.46768 z" + id="path248" /></g></svg> |
