]> git.wh0rd.org Git - tt-rss.git/commitdiff
add special link to cancel current search
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 30 Oct 2012 06:24:30 +0000 (10:24 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 30 Oct 2012 06:24:30 +0000 (10:24 +0400)
classes/feeds.php
js/viewfeed.js

index e6c9e0e3706a0138406e7e7e9e823ac8f783ffa2..8dad16584862034bda6dd2836e0707ec6867d4e2 100644 (file)
@@ -59,6 +59,7 @@ class Feeds extends Handler_Protected {
                // right part\r
 \r
                $reply .= "<span class='r'>";\r
+               $reply .= "<span id='feed_title'>";\r
 \r
                if ($feed_site_url) {\r
                        $target = "target=\"_blank\"";\r
@@ -73,6 +74,8 @@ class Feeds extends Handler_Protected {
                        $reply .= $feed_title;\r
                }\r
 \r
+               $reply .= "</span>";\r
+\r
                $reply .= "\r
                        <a href=\"#\"\r
                                title=\"".__("View as RSS feed")."\"\r
index c55b5ccd9ad8faa971473e3a07cc68fb12b7891e..86e0076c145ef423a62f95d679809ab06421f2c1 100644 (file)
@@ -98,6 +98,12 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                                initHeadlinesMenu();
 
+                               if (_search_query) {
+                                       $("feed_title").innerHTML += "<span id='cancel_search'>" +
+                                               " (<a href='#' onclick='cancelSearch()'>" + __("Cancel search") + "</a>)" +
+                                               "</span>";
+                               }
+
                        } else {
 
                                if (headlines_count > 0 && feed_id == getActiveFeedId() && is_cat == activeFeedIsCat()) {
@@ -2123,4 +2129,11 @@ function precache_headlines() {
        }
 }
 
-
+function cancelSearch() {
+       try {
+               _search_query = "";
+               viewCurrentFeed();
+       } catch (e) {
+               exception_error("cancelSearch", e);
+       }
+}