global search, update TODO
This commit is contained in:
parent
9cab3250d6
commit
52b51244c1
4 changed files with 28 additions and 3 deletions
2
TODO
2
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
|
||||
|
|
10
backend.php
10
backend.php
|
@ -472,6 +472,8 @@
|
|||
|
||||
$search = $_GET["search"];
|
||||
|
||||
$search_mode = $_GET["smode"];
|
||||
|
||||
if ($search) {
|
||||
$search_query_part = "(upper(title) LIKE upper('%$search%')
|
||||
OR content LIKE '%$search%') AND";
|
||||
|
@ -514,7 +516,12 @@
|
|||
|
||||
$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,";
|
||||
|
@ -538,6 +545,7 @@
|
|||
$query_strategy_part = "id > 0"; // dumb
|
||||
}
|
||||
|
||||
|
||||
$order_by = "updated DESC";
|
||||
|
||||
// if ($feed < -10) {
|
||||
|
|
14
tt-rss.js
14
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);
|
||||
|
|
|
@ -79,6 +79,11 @@
|
|||
<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"
|
||||
|
|
Loading…
Reference in a new issue