diff --git a/classes/feeds.php b/classes/feeds.php
index 9608290c..089c3e71 100644
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -307,7 +307,11 @@ class Feeds extends Handler_Protected {
$expand_cdm = get_pref('CDM_EXPANDED');
+ $reply['content'] = array();
+
while ($line = $this->dbh->fetch_assoc($result)) {
+ $headline_row = '';
+
$line["content_preview"] = "— " . truncate_string(strip_tags($line["content"]), 250);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
@@ -448,76 +452,79 @@ class Feeds extends Handler_Protected {
$vf_catchup_link = "".__('mark feed as read')."";
- $reply['content'] .= "
".
+ $feed_title_row = "
";
+
+ array_push($reply['content'], array('id' => 0, 'kind' => 'feed_title', 'html' => $feed_title_row));
}
}
@@ -563,20 +572,20 @@ class Feeds extends Handler_Protected {
$expanded_class = $expand_cdm ? "expanded" : "expandable";
- $reply['content'] .= "
";
- $reply['content'] .= "";
+ $headline_row .= "
";
}
+ array_push($reply['content'], array("id" => (int)$line['id'], 'html' => $headline_row));
+
++$lnum;
}
diff --git a/css/cdm.css b/css/cdm.css
index 0af07076..ed9bedea 100644
--- a/css/cdm.css
+++ b/css/cdm.css
@@ -213,17 +213,14 @@ div.cdmContent div.postEnclosures {
}
div.cdmFeedTitle {
- border-color : #a0a0a0;
+ border-color : #4684ff;
border-width : 0px 0px 1px 0px;
border-style : solid;
padding : 5px 3px 5px 5px;
- background : url("../images/toolbar.png") bottom left;
- background-repeat : repeat-x;
}
div.cdmFeedTitle a.title {
color : #555;
- font-style : italic;
font-weight : bold;
}
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 1a45e8bb..be30183b 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -86,8 +86,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
if (infscroll_req == false) {
loaded_article_ids = [];
- dijit.byId("headlines-frame").attr('content',
- reply['headlines']['content']);
+ /*dijit.byId("headlines-frame").attr('content',
+ reply['headlines']['content']);*/
//dijit.byId("headlines-toolbar").attr('content',
// reply['headlines']['toolbar']);
@@ -96,12 +96,28 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
reply['headlines']['toolbar'],
{parseContent: true});
- $$("#headlines-frame > div[id*=RROW]").each(function(row) {
+ /*$$("#headlines-frame > div[id*=RROW]").each(function(row) {
if (loaded_article_ids.indexOf(row.id) != -1) {
row.parentNode.removeChild(row);
} else {
loaded_article_ids.push(row.id);
}
+ });*/
+
+
+ dijit.byId("headlines-frame").attr("content", "");
+
+ reply['headlines']['content'].each(function(row) {
+ if (loaded_article_ids.indexOf(row.id) == -1) {
+ loaded_article_ids.push(row.id);
+ }
+
+ var tmp = new Element("div");
+ tmp.innerHTML = row.html;
+
+ dojo.parser.parse(tmp.firstChild);
+ dijit.byId("headlines-frame").domNode.appendChild(tmp.firstChild);
+
});
var hsp = $("headlines-spacer");
@@ -127,16 +143,16 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
var c = dijit.byId("headlines-frame");
var ids = getSelectedArticleIds2();
- var new_elems = [];
+ //var new_elems = [];
- $("headlines-tmp").innerHTML = reply['headlines']['content'];
+ //$("headlines-tmp").innerHTML = reply['headlines']['content'];
var hsp = $("headlines-spacer");
if (hsp)
c.domNode.removeChild(hsp);
- $$("#headlines-tmp > div").each(function(row) {
+ /*$$("#headlines-tmp > div").each(function(row) {
if (row.className == 'cdmFeedTitle') {
row.style.display = 'none';
c.domNode.appendChild(row);
@@ -149,18 +165,31 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
} else {
row.parentNode.removeChild(row);
}
+ });*/
+
+ reply['headlines']['content'].each(function(row) {
+ if (loaded_article_ids.indexOf(row.id) == -1 || row.kind == 'feed_title') {
+ loaded_article_ids.push(row.id);
+
+ var tmp = new Element("div");
+ tmp.innerHTML = row.html;
+
+ dojo.parser.parse(tmp.firstChild);
+ dijit.byId("headlines-frame").domNode.appendChild(tmp.firstChild);
+
+ }
});
+
if (!hsp) hsp = new Element("DIV", {"id": "headlines-spacer"});
// if (getInitParam("cdm_auto_catchup") == 1) {
c.domNode.appendChild(hsp);
// }
- console.log("added " + new_elems.size() + " headlines");
+ console.log("added " + reply['headlines']['content'].size() + " headlines");
- if (new_elems.size() == 0)
- _infscroll_disable = true;
+ if (reply['headlines']['content'].size() == 0) _infscroll_disable = true;
console.log("restore selected ids: " + ids);
@@ -170,12 +199,12 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
initHeadlinesMenu();
- new_elems.each(function(child) {
+ /*new_elems.each(function(child) {
dojo.parser.parse(child);
if (!Element.visible(child))
new Effect.Appear(child, { duration : 0.5 });
- });
+ });*/
if (_infscroll_disable) {
hsp.innerHTML = "
" +