add a %d articles selected element

This commit is contained in:
Andrew Dolgov 2013-04-15 13:16:14 +04:00
parent 884f2aee91
commit e43a9c4a01
4 changed files with 34 additions and 0 deletions

View File

@ -49,6 +49,7 @@ class Feeds extends Handler_Protected {
// right part // right part
$reply .= "<span class='r'>"; $reply .= "<span class='r'>";
$reply .= "<span id='selected_prompt'></span>";
$reply .= "<span id='feed_title'>"; $reply .= "<span id='feed_title'>";
if ($feed_site_url) { if ($feed_site_url) {

View File

@ -368,6 +368,9 @@ function toggleSelectRow2(sender, row, is_cdm) {
row.addClassName('Selected'); row.addClassName('Selected');
else else
row.removeClassName('Selected'); row.removeClassName('Selected');
if (typeof updateSelectedPrompt != undefined)
updateSelectedPrompt();
} }
@ -379,6 +382,9 @@ function toggleSelectRow(sender, row) {
row.addClassName('Selected'); row.addClassName('Selected');
else else
row.removeClassName('Selected'); row.removeClassName('Selected');
if (typeof updateSelectedPrompt != undefined)
updateSelectedPrompt();
} }
function checkboxToggleElement(elem, id) { function checkboxToggleElement(elem, id) {

View File

@ -639,11 +639,33 @@ function toggleSelected(id, force_on) {
if (cb) cb.attr("checked", true); if (cb) cb.attr("checked", true);
} }
} }
updateSelectedPrompt();
} catch (e) { } catch (e) {
exception_error("toggleSelected", 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) { function toggleUnread_afh(effect) {
try { try {
@ -960,6 +982,8 @@ function selectArticles(mode) {
} }
}); });
updateSelectedPrompt();
} catch (e) { } catch (e) {
exception_error("selectArticles", e); exception_error("selectArticles", e);
} }

View File

@ -1019,3 +1019,6 @@ div.hl.active a.title {
color : #4684ff; color : #4684ff;
} }
#selected_prompt {
margin-right : 25px;
}