From: Andrew Dolgov Date: Sun, 1 Oct 2006 06:33:32 +0000 (+0100) Subject: modify filterCR to call user-specified callback on CR (e.g. for search toolbar) X-Git-Tag: 1.2.4~40 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6e6504bc029415d347712da5a0ca4ed39e394cf3;p=tt-rss.git modify filterCR to call user-specified callback on CR (e.g. for search toolbar) --- diff --git a/backend.php b/backend.php index e9bca734..c63b981c 100644 --- a/backend.php +++ b/backend.php @@ -2511,7 +2511,7 @@ print ""; @@ -2647,7 +2647,7 @@ print "
Search:"; print "
"; print " -
Match:"; print ""; diff --git a/functions.js b/functions.js index 896d5488..64042c31 100644 --- a/functions.js +++ b/functions.js @@ -1189,10 +1189,12 @@ function infobox_submit_callback() { if (xmlhttp.readyState == 4) { closeInfoBox(); - // called from prefs, reload tab - if (active_tab) { - selectTab(active_tab, false); - } + try { + // called from prefs, reload tab + if (active_tab) { + selectTab(active_tab, false); + } + } catch (e) { } notify(xmlhttp.responseText); @@ -1266,7 +1268,7 @@ function qafAdd() { return false; } -function filterCR(e) +function filterCR(e, f) { var key; @@ -1275,10 +1277,16 @@ function filterCR(e) else key = e.which; //firefox - if(key == 13) - return false; - else - return true; + if (key == 13) { + if (typeof f != 'undefined') { + f(); + return false; + } else { + return false; + } + } else { + return true; + } } function getMainContext() { diff --git a/tt-rss.js b/tt-rss.js index 2bd5068d..0e3ddb79 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -569,3 +569,5 @@ function userSwitch() { var user = chooser[chooser.selectedIndex].value; window.location = "tt-rss.php?swu=" + user; } + + diff --git a/tt-rss.php b/tt-rss.php index e1331e03..35d14715 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -154,7 +154,7 @@ window.onload = init;