summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-05-15 08:37:10 +0100
committerAndrew Dolgov <[email protected]>2007-05-15 08:37:10 +0100
commit961f4c7323a840d256f95f0c026178ddf9fa13c0 (patch)
treea90a772351f39c95ca1d856a969777749afdd987 /viewfeed.js
parent53761dda370de2d37dfd2cb1446b1c634b26abf2 (diff)
prefetch topmost articles on headlines load
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/viewfeed.js b/viewfeed.js
index f60783514..49849c199 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -44,9 +44,18 @@ function headlines_callback() {
if (xmlhttp.responseXML) {
var headlines = xmlhttp.responseXML.getElementsByTagName("headlines")[0];
var counters = xmlhttp.responseXML.getElementsByTagName("counters")[0];
+ var articles = xmlhttp.responseXML.getElementsByTagName("article");
f.innerHTML = headlines.firstChild.nodeValue;
+ if (articles) {
+ for (var i = 0; i < articles.length; i++) {
+ var a_id = articles[i].getAttribute("id");
+ debug("found id: " + a_id);
+ cache_inject(a_id, articles[i].firstChild.nodeValue);
+ }
+ }
+
if (counters) {
debug("parsing piggybacked counters: " + counters);
parse_counters(counters, false);