-function catchupRelativeToArticle(below, id) {
-
- try {
-
- if (!id) id = getActiveArticleId();
-
- if (!id) {
- alert(__("No article is selected."));
- return;
- }
-
- var visible_ids = getVisibleArticleIds();
-
- var ids_to_mark = new Array();
-
- if (!below) {
- for (var i = 0; i < visible_ids.length; i++) {
- if (visible_ids[i] != id) {
- var e = $("RROW-" + visible_ids[i]);
-
- if (e && e.hasClassName("Unread")) {
- ids_to_mark.push(visible_ids[i]);
- }
- } else {
- break;
- }
- }
- } else {
- for (var i = visible_ids.length-1; i >= 0; i--) {
- if (visible_ids[i] != id) {
- var e = $("RROW-" + visible_ids[i]);
-
- if (e && e.hasClassName("Unread")) {
- ids_to_mark.push(visible_ids[i]);
- }
- } else {
- break;
- }
- }
- }
-
- if (ids_to_mark.length == 0) {
- alert(__("No articles found to mark"));
- } else {
- var msg = ngettext("Mark %d article as read?", "Mark %d articles as read?", ids_to_mark.length).replace("%d", ids_to_mark.length);
-
- if (getInitParam("confirm_feed_catchup") != 1 || confirm(msg)) {
-
- for (var i = 0; i < ids_to_mark.length; i++) {
- var e = $("RROW-" + ids_to_mark[i]);
- e.removeClassName("Unread");
- }
-
- var query = "?op=rpc&method=catchupSelected" +
- "&cmode=0" + "&ids=" + param_escape(ids_to_mark.toString());
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- handle_rpc_json(transport);
- } });
-
- }
- }
-
- } catch (e) {
- exception_error("catchupRelativeToArticle", e);
- }
-}
-
-function cdmCollapseArticle(event, id, unmark) {
- try {
- if (unmark == undefined) unmark = true;
-
- var row = $("RROW-" + id);
- var elem = $("CICD-" + id);
-
- if (elem && row) {
- var collapse = $$("div#RROW-" + id +
- " span[class='collapseBtn']")[0];
-
- Element.hide(elem);
- Element.show("CEXC-" + id);
- Element.hide(collapse);
-
- if (unmark) {
- row.removeClassName("active");
-
- markHeadline(id, false);
-
- if (id == getActiveArticleId()) {
- setActiveArticleId(0);
- }
-
- updateSelectedPrompt();
- }
-
- if (event) Event.stop(event);
-
- PluginHost.run(PluginHost.HOOK_ARTICLE_COLLAPSED, id);
-
- if (row.offsetTop < $("headlines-frame").scrollTop)
- scrollToRowId(row.id);
-
- $("floatingTitle").style.visibility = "hidden";
- $("floatingTitle").setAttribute("rowid", false);
- }
-
- } catch (e) {
- exception_error("cdmCollapseArticle", e);
- }
-}
-
-function cdmExpandArticle(id, noexpand) {
- try {
- console.log("cdmExpandArticle " + id);
-
- if (!$("RROW-" + id)) return false;
-
- var oldrow = $("RROW-" + getActiveArticleId());
-
- var elem = $("CICD-" + getActiveArticleId());
-
- if (id == getActiveArticleId() && Element.visible(elem))
- return true;