mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-23 23:21:29 +00:00
rework search dialog
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
var _feed_cur_page = 0;
|
var _feed_cur_page = 0;
|
||||||
var _infscroll_disable = 0;
|
var _infscroll_disable = 0;
|
||||||
var _infscroll_request_sent = 0;
|
var _infscroll_request_sent = 0;
|
||||||
|
var _search_query = false;
|
||||||
|
|
||||||
var counter_timeout_id = false;
|
var counter_timeout_id = false;
|
||||||
|
|
||||||
@@ -100,12 +101,10 @@ function viewfeed(feed, subop, is_cat, offset) {
|
|||||||
var query = "?op=viewfeed&feed=" + feed + "&" +
|
var query = "?op=viewfeed&feed=" + feed + "&" +
|
||||||
toolbar_query + "&subop=" + param_escape(subop);
|
toolbar_query + "&subop=" + param_escape(subop);
|
||||||
|
|
||||||
if ($("search_form")) {
|
if (_search_query) {
|
||||||
var search_query = Form.serialize("search_form");
|
|
||||||
query = query + "&" + search_query;
|
|
||||||
$("search_form").query.value = "";
|
|
||||||
closeInfoBox(true);
|
|
||||||
force_nocache = true;
|
force_nocache = true;
|
||||||
|
query = query + "&" + _search_query;
|
||||||
|
_search_query = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log("IS_CAT_STORED: " + activeFeedIsCat() + ", IS_CAT: " + is_cat);
|
// console.log("IS_CAT_STORED: " + activeFeedIsCat() + ", IS_CAT: " + is_cat);
|
||||||
|
|||||||
@@ -376,13 +376,6 @@
|
|||||||
|
|
||||||
if ($id == "search") {
|
if ($id == "search") {
|
||||||
|
|
||||||
print "<title>".__('Search')."</title>";
|
|
||||||
print "<content><![CDATA[";
|
|
||||||
|
|
||||||
print "<form id='search_form' onsubmit='return false'>";
|
|
||||||
|
|
||||||
#$active_feed_id = db_escape_string($_REQUEST["param"]);
|
|
||||||
|
|
||||||
$params = explode(":", db_escape_string($_REQUEST["param"]), 2);
|
$params = explode(":", db_escape_string($_REQUEST["param"]), 2);
|
||||||
|
|
||||||
$active_feed_id = sprintf("%d", $params[0]);
|
$active_feed_id = sprintf("%d", $params[0]);
|
||||||
@@ -406,14 +399,15 @@
|
|||||||
|
|
||||||
print_select_hash("match_on", 3, $search_fields);
|
print_select_hash("match_on", 3, $search_fields);
|
||||||
} else {
|
} else {
|
||||||
print "<input onkeypress=\"return filterCR(event, search)\"
|
print "<input dojoType=\"dijit.form.ValidationTextBox\"
|
||||||
name=\"query\" size=\"50\" type=\"search\" value=''>";
|
style=\"font-size : 16px; width : 20em;\"
|
||||||
|
required=\"1\" name=\"query\" type=\"search\" value=''>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<br/>".__('Limit search to:')." ";
|
print "<br/>".__('Limit search to:')." ";
|
||||||
|
|
||||||
print "<select name=\"search_mode\">
|
print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\">
|
||||||
<option value=\"all_feeds\">".__('All feeds')."</option>";
|
<option value=\"all_feeds\">".__('All feeds')."</option>";
|
||||||
|
|
||||||
$feed_title = getFeedTitle($link, $active_feed_id);
|
$feed_title = getFeedTitle($link, $active_feed_id);
|
||||||
@@ -425,13 +419,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($active_feed_id && !$is_cat) {
|
if ($active_feed_id && !$is_cat) {
|
||||||
print "<option selected value=\"this_feed\">$feed_title</option>";
|
print "<option selected=\"1\" value=\"this_feed\">$feed_title</option>";
|
||||||
} else {
|
} else {
|
||||||
print "<option disabled>".__('This feed')."</option>";
|
print "<option disabled=\"1\" value=\"false\">".__('This feed')."</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_cat) {
|
if ($is_cat) {
|
||||||
$cat_preselected = "selected";
|
$cat_preselected = "selected=\"1\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
|
if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
|
||||||
@@ -444,17 +438,10 @@
|
|||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
print "<div class=\"dlgButtons\">
|
print "<div class=\"dlgButtons\">
|
||||||
<button onclick=\"javascript:search()\">".__('Search')."</button>
|
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
|
||||||
<button onclick=\"javascript:closeInfoBox(true)\">".__('Cancel')."</button>
|
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
print "]]></content>";
|
|
||||||
|
|
||||||
//return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id == "quickAddFilter") {
|
if ($id == "quickAddFilter") {
|
||||||
|
|||||||
32
tt-rss.js
32
tt-rss.js
@@ -231,8 +231,26 @@ function timeout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
closeInfoBox();
|
var query = "backend.php?op=dlg&id=search¶m=" +
|
||||||
viewCurrentFeed();
|
param_escape(getActiveFeedId() + ":" + activeFeedIsCat());
|
||||||
|
|
||||||
|
if (dijit.byId("searchDlg"))
|
||||||
|
dijit.byId("searchDlg").destroyRecursive();
|
||||||
|
|
||||||
|
dialog = new dijit.Dialog({
|
||||||
|
id: "searchDlg",
|
||||||
|
title: __("Search"),
|
||||||
|
style: "width: 600px",
|
||||||
|
execute: function() {
|
||||||
|
if (this.validate()) {
|
||||||
|
_search_query = dojo.objectToQuery(this.attr('value'));
|
||||||
|
this.hide();
|
||||||
|
viewCurrentFeed();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
href: query});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
@@ -365,10 +383,7 @@ function quickMenuGo(opid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opid == "qmcSearch") {
|
if (opid == "qmcSearch") {
|
||||||
displayDlg("search", getActiveFeedId() + ":" + activeFeedIsCat(),
|
search();
|
||||||
function() {
|
|
||||||
document.forms['search_form'].query.focus();
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -704,10 +719,7 @@ function hotkey_handler(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (keycode == 191 || keychar == '/') { // /
|
if (keycode == 191 || keychar == '/') { // /
|
||||||
displayDlg("search", getActiveFeedId() + ":" + activeFeedIsCat(),
|
search();
|
||||||
function() {
|
|
||||||
document.forms['search_form'].query.focus();
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user