summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-08-04 15:20:23 +0400
committerAndrew Dolgov <[email protected]>2011-08-04 15:32:10 +0400
commit7131797307c2a6f7c57920dee6f21881d3373e98 (patch)
treee76c845cdae889fda321dfb3c0a5469728852b4a /viewfeed.js
parentc3fed9e63d60ec3aa1c4067efb848670c797112b (diff)
implement workaround for missing autoloaded headlines for adaptive & unread modes; reduce js debugging (refs #280)
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js31
1 files changed, 19 insertions, 12 deletions
diff --git a/viewfeed.js b/viewfeed.js
index ed3b897e6..df96f9d12 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -17,13 +17,13 @@ var cache_added = [];
var catchup_id_batch = [];
var catchup_timeout_id = false;
-function headlines_callback2(transport, feed_cur_page) {
+function headlines_callback2(transport, offset) {
try {
handle_rpc_json(transport);
loading_set_progress(25);
- console.log("headlines_callback2 [page=" + feed_cur_page + "]");
+ console.log("headlines_callback2 [offset=" + offset + "]");
var is_cat = false;
var feed_id = false;
@@ -48,7 +48,7 @@ function headlines_callback2(transport, feed_cur_page) {
update_btn.disabled = !(feed_id >= 0 && !is_cat);
try {
- if (feed_cur_page == 0) {
+ if (offset == 0) {
$("headlines-frame").scrollTop = 0;
}
} catch (e) { };
@@ -68,7 +68,7 @@ function headlines_callback2(transport, feed_cur_page) {
var articles = reply['articles'];
var runtime_info = reply['runtime-info'];
- if (feed_cur_page == 0) {
+ if (offset == 0) {
dijit.byId("headlines-frame").attr('content',
reply['headlines']['content']);
@@ -78,9 +78,9 @@ function headlines_callback2(transport, feed_cur_page) {
var hsp = $("headlines-spacer");
if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
- if (!_infscroll_disable)
+/* if (!_infscroll_disable)
hsp.innerHTML = "<img src='images/indicator_tiny.gif'> " +
- __("Loading, please wait...");
+ __("Loading, please wait..."); */
dijit.byId('headlines-frame').domNode.appendChild(hsp);
@@ -107,9 +107,11 @@ function headlines_callback2(transport, feed_cur_page) {
if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
- if (!_infscroll_disable)
+/* if (!_infscroll_disable)
hsp.innerHTML = "<img src='images/indicator_tiny.gif'> " +
- __("Loading, please wait...");
+ __("Loading, please wait..."); */
+
+ fixHeadlinesOrder(getLoadedArticleIds());
c.domNode.appendChild(hsp);
@@ -156,7 +158,7 @@ function headlines_callback2(transport, feed_cur_page) {
__('Could not update headlines (invalid object received)') + "</div>");
}
- _feed_cur_page = feed_cur_page;
+ //_feed_cur_page = feed_cur_page;
_infscroll_request_sent = 0;
notify("");
@@ -1274,7 +1276,7 @@ function preloadBatchedArticles() {
var id = articles[i]['id'];
if (!cache_check(id)) {
cache_inject(id, articles[i]['content']);
- console.log("preloaded article: " + id);
+ //console.log("preloaded article: " + id);
}
}
} });
@@ -1290,7 +1292,7 @@ function preloadArticleUnderPointer(id) {
if (post_under_pointer == id && !cache_check(id)) {
- console.log("trying to preload article " + id);
+ //console.log("trying to preload article " + id);
var neighbor_ids = getRelativePostIds(id, 1);
@@ -1348,7 +1350,12 @@ function headlines_scroll_handler(e) {
if (hsp && (e.scrollTop + e.offsetHeight > hsp.offsetTop) ||
e.scrollTop + e.offsetHeight > e.scrollHeight - 100) {
- viewNextFeedPage();
+ hsp.innerHTML = "<img src='images/indicator_tiny.gif'> " +
+ __("Loading, please wait...");
+
+ loadMoreHeadlines();
+
+ //viewNextFeedPage();
}
} else {
if (hsp) hsp.innerHTML = "";