]> git.wh0rd.org Git - tt-rss.git/commitdiff
automatically add active article title in create filter dialog
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Jun 2012 06:19:29 +0000 (10:19 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Jun 2012 06:19:29 +0000 (10:19 +0400)
include/functions.php
js/functions.js

index e914ac365f444ae61cc109b365f63339ac156641..96b502d58554076c8043d98cc2a0e31e59eb0725 100644 (file)
                        $rv['content'] .= "<div id=\"PTITLE-$id\" style=\"display : none\">" .
                                truncate_string(strip_tags($line['title']), 15) . "</div>";
 
+                       $rv['content'] .= "<div id=\"PTITLE-FULL-$id\" style=\"display : none\">" .
+                               strip_tags($line['title']) . "</div>";
+
                        $rv['content'] .= "<div class=\"postReply\" id=\"POST-$id\">";
 
                        $rv['content'] .= "<div onclick=\"return postClicked(event, $id)\"
index 0b0b475c6710bb4d8d4ae16f5f0343e92cf5404f..b2d79dc567a012eed2a01a4a6006936ab90d0f7e 100644 (file)
@@ -1058,6 +1058,17 @@ function quickAddFilter() {
                        href: query});
 
                dialog.show();
+
+               var lh = dojo.connect(dialog, "onLoad",
+                               function() {
+                                       dojo.disconnect(lh);
+                                       var title = $("PTITLE-FULL-" + active_post_id);
+
+                                       if (title) {
+                                               $("filterDlg_regExp").value = title.innerHTML;
+                                       }
+                       });
+
        } catch (e) {
                exception_error("quickAddFilter", e);
        }