diff --git a/cdm.css b/cdm.css index 6bed55de1..60d460198 100644 --- a/cdm.css +++ b/cdm.css @@ -174,3 +174,23 @@ div.cdm.expanded div.cdmHeader a.title, div.cdm.active div.cdmHeader a.title { font-size : 13px; } +div#small_article_preview { + width : 300px; + max-height : 350px; + overflow : hidden; + border : 1px solid #c0c0c0; + background : white; + position : absolute; + box-shadow : 2px 2px 4px #c0c0c0; + z-index : 2; +} + +div#small_article_preview div.content { + padding : 5px; + font-size : 12px; + color : gray; +} + +div#small_article_preview div.content img { + max-width : 290px; +} diff --git a/classes/feeds.php b/classes/feeds.php index 3657a0564..89ebd4a0a 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -413,7 +413,7 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn($id)' + $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; $reply['content'] .= "
"; @@ -512,7 +512,7 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn($id)' + $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; $expanded_class = $expand_cdm ? "expanded" : ""; @@ -537,7 +537,6 @@ class Feeds extends Handler_Protected { onclick=\"return cdmClicked(event, $id);\" class=\"titleWrap$hlc_suffix\"> ". $line["title"] . diff --git a/classes/rpc.php b/classes/rpc.php index ea139935e..eb241591b 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -843,5 +843,32 @@ class RPC extends Handler_Protected { } } + function cdmArticlePreview() { + $id = db_escape_string($this->link, $_REQUEST['id']); + + $result = db_query($this->link, "SELECT link, + ttrss_entries.title, content, feed_url + FROM + ttrss_entries, ttrss_user_entries + LEFT JOIN ttrss_feeds ON (ttrss_user_entries.feed_id = ttrss_feeds.id) + WHERE ref_id = '$id' AND ref_id = ttrss_entries.id AND + ttrss_user_entries.owner_uid = ". $_SESSION["uid"]); + + if (db_num_rows($result) != 0) { + $link = db_fetch_result($result, 0, "link"); + $title = db_fetch_result($result, 0, "title"); + $feed_url = db_fetch_result($result, 0, "feed_url"); + + $content = sanitize($this->link, + db_fetch_result($result, 0, "content"), false, false, $feed_url); + + print "
".$content.""; + + } else { + print "Article not found."; + } + + } + } ?> diff --git a/index.php b/index.php index f2b035d47..5c5f706d1 100644 --- a/index.php +++ b/index.php @@ -123,6 +123,8 @@
+ +