From 9689f884ab6960f5f3dde341e3e678550c792692 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Feb 2021 12:34:50 +0300 Subject: [PATCH] add Prefs::DEBUG_HEADLINE_IDS --- classes/pref/prefs.php | 6 +++++- classes/prefs.php | 2 ++ classes/rpc.php | 2 +- js/Headlines.js | 12 ++++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 45216d20e..74178d3c6 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -65,7 +65,10 @@ class Pref_Prefs extends Handler_Protected { Prefs::SSL_CERT_SERIAL, 'BLOCK_SEPARATOR', Prefs::HEADLINES_NO_DISTINCT, - ] + ], + __('Debugging') => [ + Prefs::DEBUG_HEADLINE_IDS, + ], ]; $this->pref_help_bottom = [ @@ -101,6 +104,7 @@ class Pref_Prefs extends Handler_Protected { Prefs::USER_LANGUAGE => array(__("Language")), Prefs::USER_CSS_THEME => array(__("Theme")), Prefs::HEADLINES_NO_DISTINCT => array(__("Don't enforce DISTINCT headlines"), __("May produce duplicate entries")), + Prefs::DEBUG_HEADLINE_IDS => array(__("Show article and feed IDs"), __("In headlines buffer")), ]; // hidden in the main prefs UI (use to hide things that have description set above) diff --git a/classes/prefs.php b/classes/prefs.php index 6da1029dc..8eba40ad5 100644 --- a/classes/prefs.php +++ b/classes/prefs.php @@ -57,6 +57,7 @@ class Prefs { const DEFAULT_SEARCH_LANGUAGE = "DEFAULT_SEARCH_LANGUAGE"; const _PREFS_MIGRATED = "_PREFS_MIGRATED"; const HEADLINES_NO_DISTINCT = "HEADLINES_NO_DISTINCT"; + const DEBUG_HEADLINE_IDS = "DEBUG_HEADLINE_IDS"; private const _DEFAULTS = [ Prefs::PURGE_OLD_DAYS => [ 60, Config::T_INT ], @@ -114,6 +115,7 @@ class Prefs { Prefs::DEFAULT_SEARCH_LANGUAGE => [ "" , Config::T_STRING ], Prefs::_PREFS_MIGRATED => [ false, Config::T_BOOL ], Prefs::HEADLINES_NO_DISTINCT => [ false, Config::T_BOOL ], + Prefs::DEBUG_HEADLINE_IDS => [ false, Config::T_BOOL ], ]; const _PROFILE_BLACKLIST = [ diff --git a/classes/rpc.php b/classes/rpc.php index 56b28910a..aaaf4f8d5 100755 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -415,7 +415,7 @@ class RPC extends Handler_Protected { Prefs::ENABLE_FEED_CATS, Prefs::FEEDS_SORT_BY_UNREAD, Prefs::CONFIRM_FEED_CATCHUP, Prefs::CDM_AUTO_CATCHUP, Prefs::FRESH_ARTICLE_MAX_AGE, Prefs::HIDE_READ_SHOWS_SPECIAL, - Prefs::COMBINED_DISPLAY_MODE] as $param) { + Prefs::COMBINED_DISPLAY_MODE, Prefs::DEBUG_HEADLINE_IDS] as $param) { $params[strtolower($param)] = (int) get_pref($param); } diff --git a/js/Headlines.js b/js/Headlines.js index 6dbe24918..fd9bc6661 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -440,10 +440,12 @@ const Headlines = { if (headlines.vfeed_group_enabled && hl.feed_title && this.vgroup_last_feed != hl.feed_id) { const vgrhdr = `
-
${Feeds.renderIcon(hl.feed_id, hl.has_icon)}
- ${hl.feed_title} - done_all -
` +
${Feeds.renderIcon(hl.feed_id, hl.has_icon)}
+ ${hl.feed_title} + + done_all + + ` const tmp = document.createElement("div"); tmp.innerHTML = vgrhdr; @@ -476,6 +478,7 @@ const Headlines = { + ${App.getInitParam("debug_headline_ids") ? `A: ${hl.id} F: ${hl.feed_id}` : ""} ${hl.title} ${hl.author} @@ -542,6 +545,7 @@ const Headlines = { rss_feed
+ ${App.getInitParam("debug_headline_ids") ? `A: ${hl.id} F: ${hl.feed_id}` : ""} ${hl.title} ${hl.content_preview} ${hl.author}