]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
Revert "headlines buffer: remove dijit-based RCHK elements"
[tt-rss.git] / js / tt-rss.js
index 530cb293139d4c02ffaed5fdac7df24db5e9a693..9814718f09aeef03857beb0de98322ea9032fceb 100644 (file)
@@ -1,6 +1,4 @@
 var global_unread = -1;
-var _active_feed_id = undefined;
-var _active_feed_is_cat = false;
 var hotkey_prefix = false;
 var hotkey_prefix_pressed = false;
 var _widescreen_mode = false;
@@ -16,13 +14,12 @@ function get_seq() {
 }
 
 function activeFeedIsCat() {
-       return _active_feed_is_cat;
+       return hash_get('c') == "1";
 }
 
 function getActiveFeedId() {
        try {
-               //console.log("gAFID: " + _active_feed_id);
-               return _active_feed_id;
+               return hash_get('f');
        } catch (e) {
                exception_error("getActiveFeedId", e);
        }
@@ -30,11 +27,8 @@ function getActiveFeedId() {
 
 function setActiveFeedId(id, is_cat) {
        try {
-               _active_feed_id = id;
-
-               if (is_cat != undefined) {
-                       _active_feed_is_cat = is_cat;
-               }
+               hash_set('f', id);
+               hash_set('c', is_cat ? 1 : 0);
 
                selectFeed(id, is_cat);
        } catch (e) {
@@ -604,6 +598,12 @@ function hotkey_handler(e) {
                case "prev_article":
                        moveToPost('prev');
                        return false;
+               case "next_article_noscroll":
+                       moveToPost('next', true);
+                       return false;
+               case "prev_article_noscroll":
+                       moveToPost('prev', true);
+                       return false;
                case "search_dialog":
                        search();
                        return ;
@@ -942,3 +942,21 @@ function update_random_feed() {
                exception_error("update_random_feed", e);
        }
 }
+
+function hash_get(key) {
+       try {
+               kv = window.location.hash.substring(1).toQueryParams();
+               return kv[key];
+       } catch (e) {
+               exception_error("hash_set", e);
+       }
+}
+function hash_set(key, value) {
+       try {
+               kv = window.location.hash.substring(1).toQueryParams();
+               kv[key] = value;
+               window.location.hash = $H(kv).toQueryString();
+       } catch (e) {
+               exception_error("hash_set", e);
+       }
+}