]> git.wh0rd.org Git - tt-rss.git/commitdiff
add a %d articles selected element
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 15 Apr 2013 09:16:14 +0000 (13:16 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 15 Apr 2013 09:16:14 +0000 (13:16 +0400)
classes/feeds.php
js/functions.js
js/viewfeed.js
tt-rss.css

index 2f8dcb5ecc706ce59f02afce3dd77ca6c86afaf5..c7b7a83e6acefe67d7e08221ec8fa2a0f792fe93 100644 (file)
@@ -49,6 +49,7 @@ class Feeds extends Handler_Protected {
                // right part
 
                $reply .= "<span class='r'>";
+               $reply .= "<span id='selected_prompt'></span>";
                $reply .= "<span id='feed_title'>";
 
                if ($feed_site_url) {
index 07eed2ad9aee08139446aa751a757d4d080c3d9c..9336433ca3b5a2ff96710283053a9c5cab0cee4b 100644 (file)
@@ -368,6 +368,9 @@ function toggleSelectRow2(sender, row, is_cdm) {
                row.addClassName('Selected');
        else
                row.removeClassName('Selected');
+
+       if (typeof updateSelectedPrompt != undefined)
+               updateSelectedPrompt();
 }
 
 
@@ -379,6 +382,9 @@ function toggleSelectRow(sender, row) {
                row.addClassName('Selected');
        else
                row.removeClassName('Selected');
+
+       if (typeof updateSelectedPrompt != undefined)
+               updateSelectedPrompt();
 }
 
 function checkboxToggleElement(elem, id) {
index da5ded64facd9b52a5784fdb183cb4115bdb0d66..519ab3449336cbbe5fc5313a3e96ee11d73cb105 100644 (file)
@@ -639,11 +639,33 @@ function toggleSelected(id, force_on) {
                                if (cb) cb.attr("checked", true);
                        }
                }
+
+               updateSelectedPrompt();
        } catch (e) {
                exception_error("toggleSelected", e);
        }
 }
 
+function updateSelectedPrompt() {
+       try {
+               var count = getSelectedArticleIds2().size();
+               var elem = $("selected_prompt");
+
+               if (elem) {
+                       elem.innerHTML = ngettext("%d article selected",
+                                       "%d articles selected", count).replace("%d", count);
+
+                       if (count > 0)
+                               Element.show(elem);
+                       else
+                               Element.hide(elem);
+               }
+
+       } catch (e) {
+               exception_error("updateSelectedPrompt", e);
+       }
+}
+
 function toggleUnread_afh(effect) {
        try {
 
@@ -960,6 +982,8 @@ function selectArticles(mode) {
                        }
                });
 
+               updateSelectedPrompt();
+
        } catch (e) {
                exception_error("selectArticles", e);
        }
index 6067ca7d6bf894987add00be2df8d1f47b9d6599..d2e854d8f318515563e06043eb68e0ee23448a8c 100644 (file)
@@ -1019,3 +1019,6 @@ div.hl.active a.title {
        color : #4684ff;
 }
 
+#selected_prompt {
+       margin-right : 25px;
+}