From c923fda8c9b0ddc141ab1c22b35cb984c2e30f48 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sun, 5 Mar 2023 20:03:35 +0000 Subject: Also use friendly names for special feed+cat IDs in the frontend. --- js/Feeds.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/Feeds.js') diff --git a/js/Feeds.js b/js/Feeds.js index 42641dc74..d84255310 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -3,6 +3,19 @@ /* global __, App, Headlines, xhr, dojo, dijit, fox, PluginHost, Notify, fox */ const Feeds = { + FEED_ARCHIVED: 0, + FEED_STARRED: -1, + FEED_PUBLISHED: -2, + FEED_FRESH: -3, + FEED_ALL: -4, + FEED_NOTHING: -5, + FEED_RECENTLY_READ: -6, + FEED_ERROR: -7, + CATEGORY_UNCATEGORIZED: 0, + CATEGORY_SPECIAL: -1, + CATEGORY_LABELS: -2, + CATEGORY_ALL_EXCEPT_VIRTUAL: -3, + CATEGORY_ALL: -4, _default_feed_id: -3, counters_last_request: 0, _active_feed_id: undefined, -- cgit v1.2.3-54-g00ecf From b14a8a76ebdf41adc7b8e0e95db1decb1a3d95f6 Mon Sep 17 00:00:00 2001 From: wn_ Date: Tue, 7 Mar 2023 15:45:07 +0000 Subject: Change 'FEED_NOTHING' to 'FEED_DASHBOARD'. --- classes/feeds.php | 6 +++--- js/Feeds.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'js/Feeds.js') diff --git a/classes/feeds.php b/classes/feeds.php index a7bfbe9d6..002a9eae7 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -23,7 +23,7 @@ class Feeds extends Handler_Protected { * TODO: Remove this and 'Feeds::_generate_dashboard_feed()'? It only seems to be used if 'Feeds::view()' (also potentially removable) * gets passed the ID. */ - const FEED_NOTHING = -5; + const FEED_DASHBOARD = -5; /** special feed for recently read articles */ const FEED_RECENTLY_READ = -6; @@ -522,7 +522,7 @@ class Feeds extends Handler_Protected { if (is_numeric($feed)) $feed = (int) $feed; - if ($feed == Feeds::FEED_NOTHING) { + if ($feed == Feeds::FEED_DASHBOARD) { print json_encode($this->_generate_dashboard_feed()); return; } @@ -607,7 +607,7 @@ class Feeds extends Handler_Protected { private function _generate_dashboard_feed(): array { $reply = array(); - $reply['headlines']['id'] = Feeds::FEED_NOTHING; + $reply['headlines']['id'] = Feeds::FEED_DASHBOARD; $reply['headlines']['is_cat'] = false; $reply['headlines']['toolbar'] = ''; diff --git a/js/Feeds.js b/js/Feeds.js index d84255310..7a5678084 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -8,7 +8,7 @@ const Feeds = { FEED_PUBLISHED: -2, FEED_FRESH: -3, FEED_ALL: -4, - FEED_NOTHING: -5, + FEED_DASHBOARD: -5, FEED_RECENTLY_READ: -6, FEED_ERROR: -7, CATEGORY_UNCATEGORIZED: 0, -- cgit v1.2.3-54-g00ecf