]> git.wh0rd.org Git - tt-rss.git/commitdiff
global search, update TODO
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 16 Oct 2005 16:16:34 +0000 (17:16 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 16 Oct 2005 16:16:34 +0000 (17:16 +0100)
TODO
backend.php
tt-rss.js
tt-rss.php

diff --git a/TODO b/TODO
index 82b7dea9ebf1f04be55ee49a087edb5f58a22bcd..98aacd64d354c417558bde41f24bc404cc384deb 100644 (file)
--- a/TODO
+++ b/TODO
@@ -8,4 +8,4 @@ information, see if tags or feeds are required and return only them)
 - per-feed update interval
 - download linked images and store them somewhere in case the links get broken
 - mark item as unread (maybe add combobox in view frame to mark as read/unread/starred)
-
+- "mark as read" is broken for vfeeds/searches
index 7ade2fb678a8b54afe473181ab9a667e9854c2c3..6fe21b92369a152106e7010c76adf6d566213257 100644 (file)
 
                $search = $_GET["search"];
 
+               $search_mode = $_GET["smode"];
+
                if ($search) {
                        $search_query_part = "(upper(title) LIKE upper('%$search%') 
                                OR content LIKE '%$search%') AND";
 
                $vfeed_query_part = "";
 
-               if (sprintf("%d", $feed) == 0) {
+               // override query strategy and enable feed display when searching globally
+               if ($search_mode == "All feeds") {
+                       $query_strategy_part = "id > 0";
+                       $vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
+                               id = feed_id) as feed_title,";
+               } else if (sprintf("%d", $feed) == 0) {
                        $query_strategy_part = "ttrss_entries.id > 0";
                        $vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
                                id = feed_id) as feed_title,";
                        $query_strategy_part = "id > 0"; // dumb
                }
 
+
                $order_by = "updated DESC";
 
 //             if ($feed < -10) {
index 919b0bd458a87c52f8f91bf948738465f9660e42..26218889e40b2cdaa95e4050c52f58201906e7d0 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -9,6 +9,7 @@ var total_unread = 0;
 var first_run = true;
 
 var search_query = "";
+var search_mode = "";
 
 var display_tags = false;
 
@@ -203,6 +204,16 @@ function viewfeed(feed, skip, subop) {
                search_query = "";
        } 
 
+       var searchmodebox = document.getElementById("searchmodebox");
+
+       if (searchmodebox) {
+               search_mode = searchmodebox.value;
+       } else {
+               search_mode = "";
+       }
+
+       setCookie("ttrss_vf_smode", search_mode);
+
        var viewbox = document.getElementById("viewbox");
 
        var view_mode;
@@ -246,7 +257,8 @@ function viewfeed(feed, skip, subop) {
 
        var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) +
                "&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) +
-               "&view=" + param_escape(view_mode) + "&limit=" + limit;
+               "&view=" + param_escape(view_mode) + "&limit=" + limit + 
+               "&smode=" + param_escape(search_mode);
 
        if (search_query != "") {
                query = query + "&search=" + param_escape(search_query);
index 0bf146c1e0ca57d1907b8971de05303da23f74aa..d5271b84f2108637835c590ff15f39b848d75e19 100644 (file)
                        <input id="searchbox"
                        onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
                        onchange="javascript:search()">
+               <select id="searchmodebox">
+                       <option>This feed</option>
+                       <option>All feeds</option>
+               </select>
+               
                <input type="submit" 
                        class="button" onclick="javascript:search()" value="Search">
                <!-- <input type="submit"