various search-related improvements

This commit is contained in:
Andrew Dolgov 2006-01-09 10:47:02 +01:00
parent 8e84993bf9
commit 49b7cbd351
3 changed files with 16 additions and 7 deletions

View file

@ -1198,9 +1198,9 @@
$feed_title = ""; $feed_title = "";
if ($search && $search_mode == "All feeds") { if ($search && $search_mode == "All feeds") {
$feed_title = "Search results"; $feed_title = "Global search results ($search)";
} else if (sprintf("%d", $feed) == 0) { } else if (sprintf("%d", $feed) == 0) {
$feed_title = $feed; $feed_title = "Feed search results ($search, $feed)";
} else if ($feed > 0) { } else if ($feed > 0) {
$result = db_query($link, "SELECT title,site_url,last_error FROM ttrss_feeds $result = db_query($link, "SELECT title,site_url,last_error FROM ttrss_feeds
WHERE id = '$feed'"); WHERE id = '$feed'");
@ -3047,13 +3047,21 @@
if ($id == "search") { if ($id == "search") {
$active_feed_id = db_escape_string($_GET["param"]);
print "<input id=\"searchbox\" class=\"extSearch\" print "<input id=\"searchbox\" class=\"extSearch\"
onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\" onblur=\"javascript:enableHotkeys()\" onfocus=\"javascript:disableHotkeys()\"
onchange=\"javascript:search()\"> onchange=\"javascript:search()\">
<select id=\"searchmodebox\"> <select id=\"searchmodebox\">
<option selected>All feeds</option> <option selected>All feeds</option>";
<option>This feed</option>
</select> if ($active_feed_id) {
print "<option>This feed</option>";
} else {
print "<option disabled>This feed</option>";
}
print "</select>
<input type=\"submit\" <input type=\"submit\"
class=\"button\" onclick=\"javascript:search()\" value=\"Search\"> class=\"button\" onclick=\"javascript:search()\" value=\"Search\">
<input class=\"button\" <input class=\"button\"

View file

@ -95,6 +95,7 @@ function viewfeed(feed, skip, subop, doc) {
if (search_query != "") { if (search_query != "") {
query = query + "&search=" + param_escape(search_query); query = query + "&search=" + param_escape(search_query);
searchbox.value = "";
} }
var headlines_frame = parent.frames["headlines-frame"]; var headlines_frame = parent.frames["headlines-frame"];

View file

@ -266,7 +266,7 @@ function resetSearch() {
} }
function search() { function search() {
closeDlg(); closeDlg();
viewCurrentFeed(0, ""); viewCurrentFeed(0, "");
} }
@ -411,7 +411,7 @@ function quickMenuGo() {
} }
if (opid == "qmcSearch") { if (opid == "qmcSearch") {
displayDlg("search"); displayDlg("search", getActiveFeedId());
return; return;
} }