var _last_headlines_update = 0;
var current_first_id = 0;
+var _catchup_request_sent = false;
+
var has_storage = 'sessionStorage' in window && window['sessionStorage'] !== null;
function headlines_callback2(transport, offset, background, infscroll_req) {
window.clearTimeout(catchup_timeout_id);
if (!_infscroll_request_sent) {
- catchup_timeout_id = window.setTimeout('catchupBatchedArticles()',
- 500);
+ if (catchup_id_batch.length < 10) {
+ catchup_timeout_id = window.setTimeout('catchupBatchedArticles()',
+ 500);
+ } else {
+ catchupBatchedArticles();
+ }
}
+
+ catchupBatchedArticles();
}
if (_infscroll_disable) {
function catchupBatchedArticles() {
try {
- if (catchup_id_batch.length > 0 && !_infscroll_request_sent) {
+ if (catchup_id_batch.length > 0 && !_infscroll_request_sent && !_catchup_request_sent) {
// make a copy of the array
var batch = catchup_id_batch.slice();
console.log(query);
+ _catchup_request_sent = true;
+
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
handle_rpc_json(transport);
+ _catchup_request_sent = false;
+
reply = JSON.parse(transport.responseText);
var batch = reply.ids;
- _infscroll_tmp_disable = 1;
-
batch.each(function(id) {
console.log(id);
var elem = $("RROW-" + id);
catchup_id_batch.remove(id);
});
- _infscroll_tmp_disable = 0;
-
updateFloatingTitle(true);
} });
function cdmExpandArticle(id, noexpand) {
try {
+ if (getInitParam("cdm_expanded")) return;
+
console.log("cdmExpandArticle " + id);
if (!$("RROW-" + id)) return false;
if (!noexpand)
toggleUnread(id, 0, true);
+
toggleSelected(id);
$("RROW-" + id).addClassName("active");
}
}
+// we don't really hide rows anymore
function getVisibleArticleIds() {
- var ids = [];
+ return getLoadedArticleIds();
+
+ /*var ids = [];
try {
exception_error("getVisibleArticleIds", e);
}
- return ids;
+ return ids; */
}
function cdmClicked(event, id) {