mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 22:35:57 +00:00
modify filterCR to call user-specified callback on CR (e.g. for search toolbar)
This commit is contained in:
@@ -2511,7 +2511,7 @@
|
|||||||
print "<table width='100%'><tr><td>Search:</td><td>";
|
print "<table width='100%'><tr><td>Search:</td><td>";
|
||||||
|
|
||||||
print "<input name=\"query\" class=\"iedit\"
|
print "<input name=\"query\" class=\"iedit\"
|
||||||
onkeypress=\"return filterCR(event)\"
|
onkeypress=\"return filterCR(event, search)\"
|
||||||
onkeyup=\"toggleSubmitNotEmpty(this, 'search_submit_btn')\"
|
onkeyup=\"toggleSubmitNotEmpty(this, 'search_submit_btn')\"
|
||||||
value=\"\">
|
value=\"\">
|
||||||
</td></tr>";
|
</td></tr>";
|
||||||
@@ -2647,7 +2647,7 @@
|
|||||||
print "<table width='100%'>";
|
print "<table width='100%'>";
|
||||||
|
|
||||||
print "<tr><td>Match:</td>
|
print "<tr><td>Match:</td>
|
||||||
<td><input onkeypress=\"return filterCR(event)\"
|
<td><input onkeypress=\"return filterCR(event, qaddFilter)\"
|
||||||
onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
|
onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
|
||||||
name=\"reg_exp\" class=\"iedit\">";
|
name=\"reg_exp\" class=\"iedit\">";
|
||||||
print "</td><td>";
|
print "</td><td>";
|
||||||
|
|||||||
26
functions.js
26
functions.js
@@ -1189,10 +1189,12 @@ function infobox_submit_callback() {
|
|||||||
if (xmlhttp.readyState == 4) {
|
if (xmlhttp.readyState == 4) {
|
||||||
closeInfoBox();
|
closeInfoBox();
|
||||||
|
|
||||||
// called from prefs, reload tab
|
try {
|
||||||
if (active_tab) {
|
// called from prefs, reload tab
|
||||||
selectTab(active_tab, false);
|
if (active_tab) {
|
||||||
}
|
selectTab(active_tab, false);
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
notify(xmlhttp.responseText);
|
notify(xmlhttp.responseText);
|
||||||
|
|
||||||
@@ -1266,7 +1268,7 @@ function qafAdd() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterCR(e)
|
function filterCR(e, f)
|
||||||
{
|
{
|
||||||
var key;
|
var key;
|
||||||
|
|
||||||
@@ -1275,10 +1277,16 @@ function filterCR(e)
|
|||||||
else
|
else
|
||||||
key = e.which; //firefox
|
key = e.which; //firefox
|
||||||
|
|
||||||
if(key == 13)
|
if (key == 13) {
|
||||||
return false;
|
if (typeof f != 'undefined') {
|
||||||
else
|
f();
|
||||||
return true;
|
return false;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMainContext() {
|
function getMainContext() {
|
||||||
|
|||||||
@@ -569,3 +569,5 @@ function userSwitch() {
|
|||||||
var user = chooser[chooser.selectedIndex].value;
|
var user = chooser[chooser.selectedIndex].value;
|
||||||
window.location = "tt-rss.php?swu=" + user;
|
window.location = "tt-rss.php?swu=" + user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ window.onload = init;
|
|||||||
|
|
||||||
<?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
|
<?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
|
||||||
<input name="query"
|
<input name="query"
|
||||||
onKeyPress="return filterCR(event)"
|
onKeyPress="return filterCR(event, viewCurrentFeed)"
|
||||||
onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
|
onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
|
||||||
<input class="button" type="submit"
|
<input class="button" type="submit"
|
||||||
onclick="return viewCurrentFeed(0)" value="Search">
|
onclick="return viewCurrentFeed(0)" value="Search">
|
||||||
|
|||||||
Reference in New Issue
Block a user