From: Andrew Dolgov Date: Mon, 25 Mar 2013 12:08:20 +0000 (+0400) Subject: add a simple appearing preview for unexpanded cdm and normal mode X-Git-Tag: 1.7.6~304 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d2f3467bb6c0c42ef0e0d20ac975988efacb22e2;p=tt-rss.git add a simple appearing preview for unexpanded cdm and normal mode --- diff --git a/cdm.css b/cdm.css index 6bed55de..60d46019 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 3657a056..89ebd4a0 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 ea139935..eb241591 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 f2b035d4..5c5f706d 100644 --- a/index.php +++ b/index.php @@ -123,6 +123,8 @@
+ +