From: Andrew Dolgov Date: Mon, 15 Apr 2013 09:16:14 +0000 (+0400) Subject: add a %d articles selected element X-Git-Tag: 1.7.9~25^2~224 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e43a9c4a01bf095b740e35711c79f6a0ca3374ba;p=tt-rss.git add a %d articles selected element --- diff --git a/classes/feeds.php b/classes/feeds.php index 2f8dcb5e..c7b7a83e 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -49,6 +49,7 @@ class Feeds extends Handler_Protected { // right part $reply .= ""; + $reply .= ""; $reply .= ""; if ($feed_site_url) { diff --git a/js/functions.js b/js/functions.js index 07eed2ad..9336433c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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) { diff --git a/js/viewfeed.js b/js/viewfeed.js index da5ded64..519ab344 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -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); } diff --git a/tt-rss.css b/tt-rss.css index 6067ca7d..d2e854d8 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1019,3 +1019,6 @@ div.hl.active a.title { color : #4684ff; } +#selected_prompt { + margin-right : 25px; +}