-function cdmCollapseArticle(event, id, unmark) {
- if (unmark == undefined) unmark = true;
-
- var row = $("RROW-" + id);
- var elem = $("CICD-" + id);
-
- if (elem && row) {
- var collapse = row.select("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("data-article-id", 0);
- }
-}
-
-function cdmExpandArticle(id, noexpand) {
- console.log("cdmExpandArticle " + id);
-
- var row = $("RROW-" + id);
-
- if (!row) return false;
-
- var oldrow = $("RROW-" + getActiveArticleId());
-
- var elem = $("CICD-" + getActiveArticleId());
-
- if (id == getActiveArticleId() && Element.visible(elem))
- return true;
-
- selectArticles("none");
-
- var old_offset = row.offsetTop;
-
- if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) {
- var collapse = oldrow.select("span[class='collapseBtn']")[0];
-
- Element.hide(elem);
- Element.show("CEXC-" + getActiveArticleId());
- Element.hide(collapse);
- }
-
- if (oldrow) oldrow.removeClassName("active");
-
- setActiveArticleId(id);
-
- elem = $("CICD-" + id);
-
- var collapse = row.select("span[class='collapseBtn']")[0];
-
- var cencw = $("CENCW-" + id);
-
- if (!Element.visible(elem) && !noexpand) {
- if (cencw) {
- cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
- cencw.setAttribute('id', '');
- Element.show(cencw);
- }
-
- Element.show(elem);
- Element.hide("CEXC-" + id);
- Element.show(collapse);
- }
-
- var new_offset = row.offsetTop;
-
- if (old_offset > new_offset)
- $("headlines-frame").scrollTop -= (old_offset - new_offset);
-
- if (!noexpand) {
- if (catchup_id_batch.indexOf(id) == -1)
- catchup_id_batch.push(id);
-
- catchupCurrentBatchIfNeeded();
- }
-
- toggleSelected(id);
- row.addClassName("active");
-
- PluginHost.run(PluginHost.HOOK_ARTICLE_EXPANDED, id);
-
- return false;
-}
-