From ba0978c86db54fe397cd4c68fc90b9e1008af4b4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Jan 2007 10:12:33 +0100 Subject: implement CDM auto-catchup for articles --- backend.php | 6 ++--- viewfeed.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/backend.php b/backend.php index 71bbcea40..223842f34 100644 --- a/backend.php +++ b/backend.php @@ -534,9 +534,9 @@ print "
"; - print "
$updated_fmt, - Toggle unread + print "
$updated_fmt $id +
"; print " ctr.offsetHeight && + e.offsetTop + e.offsetHeight >= ctr.scrollTop && + e.offsetTop + e.offsetHeight <= ctr.scrollTop + ctr.offsetHeight) { + + ids.push(e.id.replace("RROW-", "")); + + } + + } + + e = e.nextSibling; + } + + debug("cdmWatchdog, ids= " + ids.toString()); + + if (ids.length > 0 && xmlhttp_ready(xmlhttp_rpc)) { + + for (var i = 0; i < ids.length; i++) { + var e = document.getElementById("RROW-" + ids[i]); + if (e) { + e.className = e.className.replace("Unread", ""); + } + } + + var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + + param_escape(ids.toString()) + "&cmode=0"; + +/* xmlhttp_rpc.open("GET", query, true); + xmlhttp_rpc.onreadystatechange=all_counters_callback; + xmlhttp_rpc.send(null); */ + + } + + _cdm_wd_timeout = window.setTimeout("cdmWatchdog()", 5000); + + } catch (e) { + exception_error(e, "cdmWatchdog"); + } + +} -- cgit v1.2.3