document.onkeydown = hotkey_handler;
setTimeout("hotkey_prefix_timeout()", 5*1000);
- if (!getActiveFeedId())
- viewfeed(-3);
-
- console.log("T:" +
- getInitParam("cdm_auto_catchup") + " " + getFeedUnread(-3));
+ if (!getActiveFeedId()) {
+ viewfeed(-3);
+ } else {
+ viewfeed(getActiveFeedId(), '', activeFeedIsCat());
+ }
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
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;
}
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);
}
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) {
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);
+ }
+}
is_cat || feed_id <= 0);
try {
- if (offset == 0 && infscroll_req == false) {
+ if (infscroll_req == false) {
$("headlines-frame").scrollTop = 0;
}
} catch (e) { };
var articles = reply['articles'];
//var runtime_info = reply['runtime-info'];
- if (offset == 0 && infscroll_req == false) {
+ if (infscroll_req == false) {
loaded_article_ids = [];
dijit.byId("headlines-frame").attr('content',