]> git.wh0rd.org - tt-rss.git/commitdiff
tweak filter preview layout a bit; allow previewing matched articles in a popup
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 11 Sep 2015 10:05:08 +0000 (13:05 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Fri, 11 Sep 2015 10:05:08 +0000 (13:05 +0300)
classes/article.php
classes/pref/filters.php
js/functions.js

index bcd249873633a33089db437a170999c1f0783b8b..01f6b512660cc41b173b81522fc5e81f8dba1d6d 100644 (file)
@@ -41,12 +41,12 @@ class Article extends Handler_Protected {
                } else if ($mode == "zoom") {
                        array_push($articles, format_article($id, true, true));
                } else if ($mode == "raw") {
-                       if ($_REQUEST['html']) {
+                       if (isset($_REQUEST['html'])) {
                                header("Content-Type: text/html");
                                print '<link rel="stylesheet" type="text/css" href="css/tt-rss.css"/>';
                        }
 
-                       $article = format_article($id, false);
+                       $article = format_article($id, false, isset($_REQUEST["zoom"]));
                        print $article['content'];
                        return;
                }
index 6170f7a08366bb6410ebd5e65a192a54c115d5d8..427ce79a1571ee88b13ffee6a55851325c5d94e6 100755 (executable)
@@ -134,7 +134,7 @@ class Pref_Filters extends Handler_Protected {
 
                                if (count($rc) > 0) {
 
-                                       $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100, '...');
+                                       $line["content_preview"] = truncate_string(strip_tags($line["content"]), 200, '&hellip;');
 
                                        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
                                                $line = $p->hook_query_headlines($line, 100);
@@ -142,10 +142,12 @@ class Pref_Filters extends Handler_Protected {
 
                                        $content_preview = $line["content_preview"];
 
-                                       if ($line["feed_title"]) $feed_title = "(" . $line["feed_title"] . ")";
+                                       $tmp = "<tr style='margin-top : 5px'><td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\"
+                                               checked=\"1\" disabled=\"1\" type=\"checkbox\"></td>";
 
-                                       $tmp = "<tr><td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\"
-                                               checked=\"1\" disabled=\"1\" type=\"checkbox\"></td><td>";
+                                       $id = $line['id'];
+                                       $tmp .= "<td width='5%' align='center'><img style='cursor : pointer' title='".__("Preview article")."'
+                                               src='images/information.png' onclick='openArticlePopup($id)'></td><td>";
 
                                        foreach ($filter['rules'] as $rule) {
                                                $reg_exp = str_replace('/', '\/', $rule["reg_exp"]);
@@ -157,10 +159,9 @@ class Pref_Filters extends Handler_Protected {
                                                        "<span class=\"highlight\">$1</span>", $content_preview);
                                        }
 
-                                       $tmp .= "<strong>" . $line["title"] . "</strong>";
-                                       $tmp .= "<div class='small' style='float : right'>" . $feed_title . "</div>";
-                                       $tmp .= "<div class=\"insensitive\">" . $content_preview . "</div>";
-                                       $tmp .= " " . mb_substr($line["date_entered"], 0, 16);
+                                       $tmp .= "<strong>" . $line["title"] . "</strong><br/>";
+                                       $tmp .= $line['feed_title'] . ", " . mb_substr($line["date_entered"], 0, 16);
+                                       $tmp .= "<div class='insensitive'>" . $content_preview . "</div>";
                                        $tmp .= "</td></tr>";
 
                                        array_push($rv, $tmp);
index 2e9e544a9372fcba1fb58b0cfc1100e5639e9127..24e5858479b08f8d2cbbc89547f8210886575543 100755 (executable)
@@ -2053,3 +2053,10 @@ function getSelectionText() {
 
        return text.stripTags();
 }
+
+function openArticlePopup(id) {
+       window.open("backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id +
+               "&csrf_token=" + getInitParam("csrf_token"),
+               "ttrss_article_popup",
+               "height=900,width=900,resizable=yes,status=no,location=no,menubar=no,directories=no,scrollbars=yes,toolbar=no");
+}
\ No newline at end of file