"feed_catchup" => __("Mark as read"),
"feed_reverse" => __("Reverse headlines"),
"feed_debug_update" => __("Debug feed update"),
+ "feed_debug_viewfeed" => __("Debug viewfeed()"),
"catchup_all" => __("Mark all feeds as read"),
"cat_toggle_collapse" => __("Un/collapse current category"),
"toggle_combined_mode" => __("Toggle combined mode"),
"f q" => "feed_catchup",
"f x" => "feed_reverse",
"f *d" => "feed_debug_update",
+ "f *g" => "feed_debug_viewfeed",
"f *c" => "toggle_combined_mode",
"f c" => "toggle_cdm_expanded",
"*q" => "catchup_all",
var counters_last_request = 0;
function viewCategory(cat) {
- viewfeed(cat, '', true);
+ viewfeed({feed: cat, is_cat: true});
return false;
}
console.log("offset: " + offset);
- viewfeed(getActiveFeedId(), '', activeFeedIsCat(), offset, false, true);
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat(), offset: offset, infscroll_req: true});
} catch (e) {
exception_error("viewNextFeedPage", e);
}
}
-
-function viewfeed(feed, method, is_cat, offset, background, infscroll_req, can_wait) {
+function viewfeed(params) {
try {
+ var feed = params.feed;
+ var is_cat = params.is_cat;
+ var offset = params.offset;
+ var background = params.background;
+ var infscroll_req = params.infscroll_req;
+ var can_wait = params.can_wait;
+ var viewfeed_debug = params.viewfeed_debug;
+
if (is_cat == undefined)
is_cat = false;
else
is_cat = !!is_cat;
- if (method == undefined) method = '';
if (offset == undefined) offset = 0;
if (background == undefined) background = false;
if (infscroll_req == undefined) infscroll_req = false;
_infscroll_disable = 0;
}
- if (infscroll_req && !method) {
+ if (infscroll_req) {
var timestamp = get_timestamp();
if (_infscroll_request_sent && _infscroll_request_sent + 30 > timestamp) {
var query = "?op=feeds&method=view&feed=" + param_escape(feed) + "&" +
toolbar_query;
- if (method) {
- query = query + "&m=" + param_escape(method);
- }
-
if (offset > 0) {
if (current_first_id) {
query = query + "&fid=" + param_escape(current_first_id);
query = query + "&vgrlf=" + param_escape(vgroup_last_feed);
}
} else {
- if (!method && !is_cat && feed == getActiveFeedId()) {
+ if (!is_cat && feed == getActiveFeedId()) {
query = query + "&m=ForceUpdate";
}
}
setActiveFeedId(feed, is_cat);
+ if (viewfeed_debug) {
+ window.open("backend.php" + query + "&debug=1&csrf_token=" + getInitParam("csrf_token"));
+ }
+
timeout_ms = can_wait ? 250 : 0;
_viewfeed_timeout = setTimeout(function() {
setTimeout("hotkey_prefix_timeout()", 5*1000);
if (!getActiveFeedId()) {
- viewfeed(-3);
+ viewfeed({feed: -3});
} else {
- viewfeed(getActiveFeedId(), '', activeFeedIsCat());
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat()});
}
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
var nuf = getNextUnreadFeed(feed, is_cat);
if (nuf) {
- viewfeed(nuf, '', is_cat);
+ viewfeed({feed: nuf, is_cat: is_cat});
}
} else {
if (feed == getActiveFeedId() && is_cat == activeFeedIsCat()) {
var id = String(item.id);
var is_cat = id.match("^CAT:");
var feed = id.substr(id.indexOf(":")+1);
- viewfeed(feed, '', is_cat);
+ viewfeed({feed: feed, is_cat: is_cat});
return false;
},
openOnClick: false,
}
}
-function viewCurrentFeed(method) {
+function viewCurrentFeed() {
console.log("viewCurrentFeed");
if (getActiveFeedId() != undefined) {
- viewfeed(getActiveFeedId(), method, activeFeedIsCat());
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat()});
}
return false; // block unneeded form submits
}
var rv = dijit.byId("feedTree").getNextFeed(
getActiveFeedId(), activeFeedIsCat());
- if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
+ if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
};
hotkey_actions["prev_feed"] = function() {
var rv = dijit.byId("feedTree").getPreviousFeed(
getActiveFeedId(), activeFeedIsCat());
- if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
+ if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
};
hotkey_actions["next_article"] = function() {
moveToPost('next');
};
hotkey_actions["feed_refresh"] = function() {
if (getActiveFeedId() != undefined) {
- viewfeed(getActiveFeedId(), '', activeFeedIsCat());
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat()});
return;
}
};
alert("You can't debug this kind of feed.");
}
};
+
+ hotkey_actions["feed_debug_viewfeed"] = function() {
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat(), viewfeed_debug: true});
+ };
+
hotkey_actions["feed_edit"] = function() {
if (activeFeedIsCat())
alert(__("You can't edit this kind of feed."));
}
};
hotkey_actions["goto_all"] = function() {
- viewfeed(-4);
+ viewfeed({feed: -4});
};
hotkey_actions["goto_fresh"] = function() {
- viewfeed(-3);
+ viewfeed({feed: -3});
};
hotkey_actions["goto_marked"] = function() {
- viewfeed(-1);
+ viewfeed({feed: -1});
};
hotkey_actions["goto_published"] = function() {
- viewfeed(-2);
+ viewfeed({feed: -2});
};
hotkey_actions["goto_tagcloud"] = function() {
displayDlg(__("Tag cloud"), "printTagCloud");
try {
var is_cat = activeFeedIsCat();
var nuf = getNextUnreadFeed(getActiveFeedId(), is_cat);
- if (nuf) viewfeed(nuf, '', is_cat);
+ if (nuf) viewfeed({feed: nuf, is_cat: is_cat});
} catch (e) {
exception_error("openNextUnreadFeed", e);
}