summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions.js59
-rw-r--r--functions.php18
-rw-r--r--tt-rss.css6
-rw-r--r--tt-rss.js1
-rw-r--r--viewfeed.js36
5 files changed, 93 insertions, 27 deletions
diff --git a/functions.js b/functions.js
index 9ef91c59a..088b986ee 100644
--- a/functions.js
+++ b/functions.js
@@ -353,6 +353,19 @@ function hotkey_handler(e) {
}
}
+ if (keycode == 73 && shift_key) { // shift + i
+ if (document.getElementById("subtoolbar_search")) {
+ if (Element.visible("subtoolbar_search")) {
+ Element.hide("subtoolbar_search");
+ Element.show("subtoolbar_ftitle");
+ setTimeout("Element.focus('subtoolbar_search_box')", 100);
+ } else {
+ Element.show("subtoolbar_search");
+ Element.hide("subtoolbar_ftitle");
+ }
+ }
+ }
+
if (typeof localHotkeyHandler != 'undefined') {
try {
return localHotkeyHandler(e);
@@ -1056,38 +1069,40 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
}
for (i = 0; i < content.rows.length; i++) {
- if (!classcheck || content.rows[i].className.match(classcheck)) {
+ if (Element.visible(content.rows[i])) {
+ if (!classcheck || content.rows[i].className.match(classcheck)) {
+
+ if (content.rows[i].id.match(prefix)) {
+ selectTableRow(content.rows[i], do_select);
+
+ var row_id = content.rows[i].id.replace(prefix, "");
+ var check = document.getElementById(check_prefix + row_id);
+
+ if (check) {
+ check.checked = do_select;
+ }
+ } else if (reset_others) {
+ selectTableRow(content.rows[i], false);
+
+ var row_id = content.rows[i].id.replace(prefix, "");
+ var check = document.getElementById(check_prefix + row_id);
+
+ if (check) {
+ check.checked = false;
+ }
- if (content.rows[i].id.match(prefix)) {
- selectTableRow(content.rows[i], do_select);
-
- var row_id = content.rows[i].id.replace(prefix, "");
- var check = document.getElementById(check_prefix + row_id);
-
- if (check) {
- check.checked = do_select;
}
} else if (reset_others) {
selectTableRow(content.rows[i], false);
-
+
var row_id = content.rows[i].id.replace(prefix, "");
var check = document.getElementById(check_prefix + row_id);
-
+
if (check) {
check.checked = false;
}
-
- }
- } else if (reset_others) {
- selectTableRow(content.rows[i], false);
-
- var row_id = content.rows[i].id.replace(prefix, "");
- var check = document.getElementById(check_prefix + row_id);
-
- if (check) {
- check.checked = false;
+
}
-
}
}
}
diff --git a/functions.php b/functions.php
index 449bb4e51..719316461 100644
--- a/functions.php
+++ b/functions.php
@@ -3964,7 +3964,15 @@
print "<td class=\"headlineTitle$rtl_cpart\">";
- print "<span class=\"headlineInnerTitle\">";
+ print "<span id=\"subtoolbar_search\"
+ style=\"display : none\">Search: <input
+ id=\"subtoolbar_search_box\"
+ onblur=\"javascript:enableHotkeys();\"
+ onfocus=\"javascript:disableHotkeys();\"
+ onchange=\"subtoolbarSearch()\"
+ onkeyup=\"subtoolbarSearch()\" type=\"search\"></span>";
+
+ print "<span id=\"subtoolbar_ftitle\">";
if ($feed_site_url) {
if (!$bottom) {
@@ -3984,8 +3992,6 @@
print " [$user_page_offset] ";
}
- print "</span>";
-
if (!$bottom && !$disable_feed) {
print "
<a target=\"_new\"
@@ -3996,7 +4002,9 @@
} else if ($feed_small_icon) {
print "<img class=\"noborder\" alt=\"\" src=\"images/$feed_small_icon\">";
}
-
+
+ print "</span>";
+
print "</td>";
print "</tr></table>";
@@ -4981,7 +4989,7 @@
print "<td class='hlContent$hlc_suffix' valign='middle'>";
- print "<a href=\"javascript:view($id,$feed_id);\">" .
+ print "<a id=\"RTITLE-$id\" href=\"javascript:view($id,$feed_id);\">" .
$line["title"];
if (get_pref($link, 'SHOW_CONTENT_PREVIEW')) {
diff --git a/tt-rss.css b/tt-rss.css
index e33b291a4..e772b83b5 100644
--- a/tt-rss.css
+++ b/tt-rss.css
@@ -743,6 +743,12 @@ table.headlinesSubToolbar {
background-color : white;
}
+input#subtoolbar_search_box {
+ height : 10px;
+ font-size : 7pt;
+ vertical-align : middle;
+}
+
table.headlinesSubToolbar td.headlineActions {
font-size : 9pt;
font-family : "Lucida Grande", Tahoma, Arial, sans-serif;
diff --git a/tt-rss.js b/tt-rss.js
index 25efe8f65..11ce57b73 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -891,3 +891,4 @@ function rescoreCurrentFeed() {
}
}
+
diff --git a/viewfeed.js b/viewfeed.js
index 79dbe0037..4a192a35e 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -152,6 +152,8 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
markHeadline(ids[i]);
}
+ subtoolbarSearch();
+
} else {
debug("no new headlines received");
}
@@ -1677,4 +1679,38 @@ function cdmExpandArticle(a_id) {
}
+function subtoolbarSearch() {
+
+ try {
+
+ var q = document.getElementById("subtoolbar_search_box");
+
+ if (!q) return;
+
+ q = q.value.toUpperCase();
+
+ var ids = false;
+
+ if (document.getElementById("headlinesList")) {
+ ids = getVisibleHeadlineIds();
+ } else {
+ ids = cdmGetVisibleArticles();
+ }
+ for (var i = 0; i < ids.length; i++) {
+ var title = document.getElementById("RTITLE-" + ids[i]);
+
+ if (title) {
+ if (!title.innerHTML.toUpperCase().match(q)) {
+ Element.hide(document.getElementById("RROW-" + ids[i]));
+ } else {
+ Element.show(document.getElementById("RROW-" + ids[i]));
+ }
+ }
+ }
+
+ } catch (e) {
+ exception_error("subtoolbarSearch", e);
+ }
+
+}