From dbfc952271bef1332dc49b528379295781e918b8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 12 Jan 2010 11:48:31 +0300 Subject: [PATCH] make f a hotkey persistent; obsolete option HIDE_READ_FEEDS --- functions.js | 3 +-- modules/pref-prefs.php | 2 +- tt-rss.js | 15 +++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/functions.js b/functions.js index 5228995c..8335f7e6 100644 --- a/functions.js +++ b/functions.js @@ -1505,8 +1505,7 @@ function getInitParam(key) { return init_params[key]; } -function storeInitParam(key, value) { - debug("storeInitParam is OBSOLETE: " + key + " => " + value + ""); +function setInitParam(key, value) { init_params[key] = value; } diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index dd58fe7b..3bb86e9e 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -14,7 +14,7 @@ $subop = $_REQUEST["subop"]; $prefs_blacklist = array("HIDE_FEEDLIST", "SYNC_COUNTERS", "ENABLE_LABELS", - "ENABLE_SEARCH_TOOLBAR"); + "ENABLE_SEARCH_TOOLBAR", "HIDE_READ_FEEDS"); if (FORCE_ARTICLE_PURGE != 0) { array_push($prefs_blacklist, "PURGE_OLD_DAYS"); diff --git a/tt-rss.js b/tt-rss.js index 88a41afe..04671c04 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -726,15 +726,18 @@ function updateFeedTitle(t) { function toggleDispRead() { try { - var hide_read_feeds = (getInitParam("hide_read_feeds") == "1"); + var hide = !(getInitParam("hide_read_feeds") == "1"); - hide_read_feeds = !hide_read_feeds; + hideOrShowFeeds(hide); - debug("toggle_disp_read => " + hide_read_feeds); + var query = "?op=rpc&subop=setpref&key=HIDE_READ_FEEDS&value=" + + param_escape(hide); - hideOrShowFeeds(hide_read_feeds); - - storeInitParam("hide_read_feeds", hide_read_feeds, true); + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + setInitParam("hide_read_feeds", hide); + } }); } catch (e) { exception_error("toggleDispRead", e); -- 2.39.5