if (xmlhttp_rpc.readyState == 4) {
try {
debug("catchup_callback");
- if (_catchup_callback_func) {
- setTimeout(_catchup_callback_func, 100);
- }
notify("");
all_counters_callback();
+ if (_catchup_callback_func) {
+ setTimeout(_catchup_callback_func, 10);
+ }
} catch (e) {
exception_error("catchup_callback", e);
}
debug("headlines_callback");
var f = document.getElementById("headlines-frame");
try {
- f.scrollTop = 0;
+ if (feed_cur_page == 0) {
+ debug("resetting headlines scrollTop");
+ f.scrollTop = 0;
+ }
} catch (e) { };
if (xmlhttp.responseXML) {
var headlines = xmlhttp.responseXML.getElementsByTagName("headlines")[0];
var counters = xmlhttp.responseXML.getElementsByTagName("counters")[0];
var articles = xmlhttp.responseXML.getElementsByTagName("article");
+ var runtime_info = xmlhttp.responseXML.getElementsByTagName("runtime-info");
- if (headlines) {
- f.innerHTML = headlines.firstChild.nodeValue;
+ if (feed_cur_page == 0) {
+ if (headlines) {
+ f.innerHTML = headlines.firstChild.nodeValue;
+ } else {
+ debug("headlines_callback: returned no data");
+ f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML data)') + "</div>";
+
+ }
} else {
- debug("headlines_callback: returned no data");
- f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML data)') + "</div>";
+ if (headlines) {
+ debug("adding some more headlines...");
+
+ var c = document.getElementById("headlinesList");
+
+ if (!c) {
+ c = document.getElementById("headlinesInnerContainer");
+ }
+
+ c.innerHTML = c.innerHTML + headlines.firstChild.nodeValue;
+ } else {
+ debug("headlines_callback: returned no data");
+ notify_error("Error while trying to load more headlines");
+ }
}
} else {
debug("counters container not found in reply");
}
+
+ if (runtime_info) {
+ debug("parsing runtime info: " + runtime_info[0]);
+ parse_runtime_info(runtime_info[0]);
+ } else {
+ debug("counters container not found in reply");
+ }
+
} else {
debug("headlines_callback: returned no XML object");
f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML object)') + "</div>";
try {
document.getElementById("headlinesInnerContainer").scrollTop = _tag_cdm_scroll;
_tag_cdm_scroll = false;
+ debug("resetting headlinesInner scrollTop");
+
} catch (e) { }
}
var cached_article = cache_find(id);
debug("cache check result: " + (cached_article != false));
-
-/* if (!skip_history) {
- history_push("ARTICLE:" + id + ":" + feed_id);
- } */
enableHotkeys();
if (!xmlhttp_ready(xmlhttp) && last_article_view < date.getTime() / 1000 - 15) {
debug("<b>xmlhttp seems to be stuck at view, aborting</b>");
xmlhttp.abort();
+ if (is_safari()) {
+ debug("trying alternative reset method for Safari");
+ xmlhttp = Ajax.getTransport();
+ }
}
if (xmlhttp_ready(xmlhttp)) {
function catchupPage() {
+ var fn = getFeedName(getActiveFeedId(), active_feed_is_cat);
+
+ var str = "Mark all visible articles in " + fn + " as read?";
+
+ if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
+ return;
+ }
+
if (document.getElementById("headlinesList")) {
selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true);
selectionToggleUnread(false, false, 'viewCurrentFeed()', true);
var query = Form.serialize("tag_edit_form");
- xmlhttp_rpc.open("GET", "backend.php?op=rpc&subop=setArticleTags&" + query, true);
+ query = "backend.php?op=rpc&subop=setArticleTags&" + query;
+
+ debug(query);
+
+ xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=tag_saved_callback;
xmlhttp_rpc.send(null);
exception_error("cache_invalidate", e);
}
}
+
+function getActiveArticleId() {
+ return active_post_id;
+}
+
+function cdmMouseIn(elem) {
+ try {
+ if (elem.id && elem.id.match("RROW-")) {
+ var id = elem.id.replace("RROW-", "");
+ active_post_id = id;
+ }
+ } catch (e) {
+ exception_error("cdmMouseIn", e);
+ }
+
+}
+
+function cdmMouseOut(elem) {
+ active_post_id = false;
+}
+
+function headlines_scroll_handler() {
+ try {
+
+ var e = document.getElementById("headlinesInnerContainer");
+
+ if (e.scrollTop + e.offsetHeight == e.scrollHeight) {
+ debug("more cowbell!");
+
+ viewNextFeedPage();
+ }
+
+ } catch (e) {
+ exception_error("headlines_scroll_handler", e);
+ }
+}