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) {
loading_set_progress(20);
var hasAudio = !!((myAudioTag = document.createElement('audio')).canPlayType);
+ var hasSandbox = "sandbox" in document.createElement("iframe");
new Ajax.Request("backend.php", {
- parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio},
+ parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
+ hasSandbox: hasSandbox},
onComplete: function(transport) {
backend_sanity_check_callback(transport);
} });
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
if (keycode == 16) return; // ignore lone shift
if (keycode == 17) return; // ignore lone ctrl
- if (!shift_key) keychar = keychar.toLowerCase();
+ keychar = keychar.toLowerCase();
var hotkeys = getInitParam("hotkeys");
Element.hide(cmdline);
var hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
+
+ // ensure ^*char notation
+ if (shift_key) hotkey = "*" + hotkey;
if (ctrl_key) hotkey = "^" + hotkey;
+
hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
hotkey_prefix = false;
case "email_article":
if (typeof emailArticle != "undefined") {
emailArticle();
+ } else if (typeof mailtoArticle != "undefined") {
+ mailtoArticle();
} else {
alert(__("Please enable mail plugin first."));
}
return false;
case "help_dialog":
helpDialog("main");
+ return false;
+ case "toggle_combined_mode":
+ notify_progress("Loading, please wait...");
+
+ var value = isCdmMode() ? "false" : "true";
+ var query = "?op=rpc&method=setpref&key=COMBINED_DISPLAY_MODE&value=" + value;
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ window.location.reload();
+ } });
+
return false;
default:
console.log("unhandled action: " + hotkey_action + "; hotkey: " + hotkey);
if (runtime_info)
parse_runtime_info(runtime_info);
- hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
-
Element.hide(dijit.byId("net-alert").domNode);
} else {
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);
+ }
+}