if (infscroll_req == false) {
$("headlines-frame").scrollTop = 0;
- Element.hide("floatingTitle");
+ $("floatingTitle").style.visibility = "hidden";
$("floatingTitle").setAttribute("rowid", 0);
$("floatingTitle").innerHTML = "";
}
initHeadlinesMenu();
+ if (_infscroll_disable)
+ hsp.innerHTML = "<a href='#' onclick='openNextUnreadFeed()'>" +
+ __("Click to open next unread feed.") + "</a>";
+
if (_search_query) {
$("feed_title").innerHTML += "<span id='cancel_search'>" +
" (<a href='#' onclick='cancelSearch()'>" + __("Cancel search") + "</a>)" +
if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
- if (getInitParam("cdm_auto_catchup") == 1) {
+// if (getInitParam("cdm_auto_catchup") == 1) {
c.domNode.appendChild(hsp);
- }
+// }
console.log("added " + new_elems.size() + " headlines");
} else {
console.log("no new headlines received");
+ var top_id_changed = reply['headlines']['top_id_changed'];
+ console.log("top id changed:" + top_id_changed);
+
var hsp = $("headlines-spacer");
- if (hsp) hsp.innerHTML = "";
+ if (hsp) {
+ if (top_id_changed) {
+ hsp.innerHTML = "<a href='#' onclick='viewCurrentFeed()'>" +
+ __("New articles found, reload feed to continue.") + "</a>";
+ } else {
+ hsp.innerHTML = "<a href='#' onclick='openNextUnreadFeed()'>" +
+ __("Click to open next unread feed.") + "</a>";
+ }
+
+ }
+
}
}
((e.scrollTop + e.offsetHeight) / e.scrollHeight >= 0.7))) {
if (hsp)
- hsp.innerHTML = "<img src='images/indicator_tiny.gif'> " +
- __("Loading, please wait...");
+ hsp.innerHTML = "<span class='loading'><img src='images/indicator_tiny.gif'> " +
+ __("Loading, please wait...") + "</span>";
loadMoreHeadlines();
return;
}
- } else {
- if (hsp) hsp.innerHTML = "";
+ /*} else {
+ if (hsp) {
+ if (_infscroll_disable)
+ hsp.innerHTML = "<a href='#' onclick='openNextUnreadFeed()'>" +
+ __("Click to open next unread feed.") + "</a>";
+ else
+ hsp.innerHTML = "";
+ }*/
}
if (isCdmMode()) {
var child = $$("#headlines-frame div[id*=RROW]").last();
if (child && $("headlines-frame").scrollTop >
- (child.offsetTop + child.offsetHeight/2)) {
+ (child.offsetTop + child.offsetHeight - 50)) {
console.log("we seem to be at an end");
if (getInitParam("on_catchup_show_next_feed") == "1") {
- var is_cat = activeFeedIsCat();
- var nuf = getNextUnreadFeed(getActiveFeedId(), is_cat);
-
- if (nuf) viewfeed(nuf, '', is_cat);
+ openNextUnreadFeed();
}
}
}
}
}
+function openNextUnreadFeed() {
+ try {
+ var is_cat = activeFeedIsCat();
+ var nuf = getNextUnreadFeed(getActiveFeedId(), is_cat);
+ if (nuf) viewfeed(nuf, '', is_cat);
+ } catch (e) {
+ exception_error("openNextUnreadFeed", e);
+ }
+}
+
function catchupBatchedArticles() {
try {
if (catchup_id_batch.length > 0 && !_infscroll_request_sent) {
if (row.offsetTop < $("headlines-frame").scrollTop)
scrollToRowId(row.id);
- Element.hide("floatingTitle");
+ $("floatingTitle").style.visibility = "hidden";
$("floatingTitle").setAttribute("rowid", false);
}
}
}
+function updateScore(id) {
+ try {
+ var pic = $$("#RROW-" + id + " .hlScorePic")[0];
+
+ if (pic) {
+
+ var query = "op=article&method=getScore&id=" + param_escape(id);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ console.log(transport.responseText);
+
+ var reply = JSON.parse(transport.responseText);
+
+ if (reply) {
+ pic.src = pic.src.replace(/score_.*?\.png/, reply["score_pic"]);
+ pic.setAttribute("score", reply["score"]);
+ pic.setAttribute("title", reply["score"]);
+ }
+ } });
+ }
+
+ } catch (e) {
+ exception_error("updateScore", e);
+ }
+}
+
function changeScore(id, pic) {
try {
var score = pic.getAttribute("score");
if (reply) {
pic.src = pic.src.replace(/score_.*?\.png/, reply["score_pic"]);
pic.setAttribute("score", new_score);
+ pic.setAttribute("title", new_score);
}
} });
}
var row = $(id);
if (row)
- $("headlines-frame").scrollTop = row.offsetTop;
+ $("headlines-frame").scrollTop = row.offsetTop - 4;
} catch (e) {
exception_error("scrollToRowId", e);
PluginHost.run(PluginHost.HOOK_FLOATING_TITLE, child);
}
- if (child.offsetTop < hf.scrollTop - header.offsetHeight &&
- child.offsetTop + child.offsetHeight - hf.scrollTop > header.offsetHeight)
- Element.show("floatingTitle");
+ $("floatingTitle").style.marginRight = hf.offsetWidth - child.offsetWidth + "px";
+ if (header.offsetTop + header.offsetHeight < hf.scrollTop + $("floatingTitle").offsetHeight - 5 &&
+ child.offsetTop + child.offsetHeight >= hf.scrollTop + $("floatingTitle").offsetHeight - 5)
+ $("floatingTitle").style.visibility = "visible";
else
- Element.hide("floatingTitle");
+ $("floatingTitle").style.visibility = "hidden";
return;
exception_error("updateFloatingTitle", e);
}
}
+
+function cdmFooterClick(event) {
+ event.stopPropagation();
+}
\ No newline at end of file