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;
var _rpc_seq = 0;
+var _active_feed_id = 0;
+var _active_feed_is_cat = false;
function next_seq() {
_rpc_seq += 1;
function getActiveFeedId() {
try {
- //console.log("gAFID: " + _active_feed_id);
return _active_feed_id;
} catch (e) {
exception_error("getActiveFeedId", e);
function setActiveFeedId(id, is_cat) {
try {
- _active_feed_id = id;
+ hash_set('f', id);
+ hash_set('c', is_cat ? 1 : 0);
- if (is_cat != undefined) {
- _active_feed_is_cat = is_cat;
- }
+ _active_feed_id = id;
+ _active_feed_is_cat = is_cat;
selectFeed(id, is_cat);
} catch (e) {
feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
+ var hash_feed_id = hash_get('f');
+ var hash_feed_is_cat = hash_get('c') == "1";
+
+ if (hash_feed_id != undefined) {
+ setActiveFeedId(hash_feed_id, hash_feed_is_cat);
+ }
+
loading_set_progress(30);
// can't use cache_clear() here because viewfeed might not have initialized yet
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 ;
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);
+ }
+}