]> git.wh0rd.org Git - tt-rss.git/commitdiff
make f a hotkey persistent; obsolete option HIDE_READ_FEEDS
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 12 Jan 2010 08:48:31 +0000 (11:48 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 12 Jan 2010 08:48:31 +0000 (11:48 +0300)
functions.js
modules/pref-prefs.php
tt-rss.js

index 5228995cd6b26194cbbad1a21fa7b64bb47ccf75..8335f7e6eefbe13eef77f2625b9274e4c5f58fce 100644 (file)
@@ -1505,8 +1505,7 @@ function getInitParam(key) {
        return init_params[key];
 }
 
-function storeInitParam(key, value) {
-       debug("<b>storeInitParam is OBSOLETE: " + key + " => " + value + "</b>");
+function setInitParam(key, value) {
        init_params[key] = value;
 }
 
index dd58fe7b5858ebe81854ee70e6fbf396cb23b8a1..3bb86e9e1a212f17e474fc919db1571ec575fc72 100644 (file)
@@ -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");
index 88a41afef83e5b9ef27e5f26413b0f28329ababe..04671c04893b1e343e28201401fc8f5a31370e08 100644 (file)
--- 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);