]> git.wh0rd.org - tt-rss.git/commitdiff
various search-related improvements
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 9 Jan 2006 09:47:02 +0000 (10:47 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 9 Jan 2006 09:47:02 +0000 (10:47 +0100)
backend.php
feedlist.js
tt-rss.js

index 2dba06efda7742059935e9682352388b38f743b7..f32b8c214ea46e2739d3c21c7ae61074f3b8db9d 100644 (file)
                $feed_title = "";
 
                if ($search && $search_mode == "All feeds") {
-                       $feed_title = "Search results";
+                       $feed_title = "Global search results ($search)";
                } else if (sprintf("%d", $feed) == 0) {
-                       $feed_title = $feed;
+                       $feed_title = "Feed search results ($search, $feed)";
                } else if ($feed > 0) {
                        $result = db_query($link, "SELECT title,site_url,last_error FROM ttrss_feeds 
                                WHERE id = '$feed'");
 
                if ($id == "search") {
 
+                       $active_feed_id = db_escape_string($_GET["param"]);
+
                        print "<input id=\"searchbox\" class=\"extSearch\"                      
                        onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\"
                        onchange=\"javascript:search()\">
                        <select id=\"searchmodebox\">
-                               <option selected>All feeds</option>
-                               <option>This feed</option>
-                       </select>               
+                               <option selected>All feeds</option>";
+                               
+                       if ($active_feed_id) {                          
+                               print "<option>This feed</option>";
+                       } else {
+                               print "<option disabled>This feed</option>";
+                       }
+                       
+                       print "</select>                
                        <input type=\"submit\" 
                                class=\"button\" onclick=\"javascript:search()\" value=\"Search\">
                        <input class=\"button\"
index 0276fd0e98775ae1c22e25d7b311ede3760d83d3..8bb3a16b21c7a521207a9f9c17aae5451add0141 100644 (file)
@@ -95,6 +95,7 @@ function viewfeed(feed, skip, subop, doc) {
        
                if (search_query != "") {
                        query = query + "&search=" + param_escape(search_query);
+                       searchbox.value = "";
                }
                
                var headlines_frame = parent.frames["headlines-frame"];
index 36aec2bae76cd617a45070635365e2fe9c1454ce..5603c01cef3c6e7b7a3b6a65f699f15e6e559a06 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -266,7 +266,7 @@ function resetSearch() {
 }
 
 function search() {
-       closeDlg();
+       closeDlg();     
        viewCurrentFeed(0, "");
 }
 
@@ -411,7 +411,7 @@ function quickMenuGo() {
        }
 
        if (opid == "qmcSearch") {
-               displayDlg("search");
+               displayDlg("search", getActiveFeedId());
                return;
        }