cdm: tweak the way hotkey article dismissing works; toggle select article by clicking on it

This commit is contained in:
Andrew Dolgov 2010-11-10 11:38:55 +03:00
parent 779560b7a3
commit bfa0e7921d
4 changed files with 25 additions and 4 deletions

View File

@ -5477,6 +5477,8 @@
print "</div>";
print "<div class=\"cdmContent\" $content_hidden
title=\"".__("Click to select article")."\"
onclick=\"toggleSelected($id);\"
id=\"CICD-$id\">";
print "<div class=\"cdmContentInner\">";

View File

@ -17,7 +17,7 @@
<tr><td class='n'>S</td><td><?php echo __("Toggle published") ?></td></tr>
<tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
<tr><td class='n'>T</td><td><?php echo __("Edit tags") ?></td></tr>
<tr><td class='n'>D</td><td><?php echo __("In combined mode, dismiss article") ?></td></tr>
<tr><td class='n'>D</td><td><?php echo __("In combined mode, dismiss selected articles") ?></td></tr>
<tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
<tr><td class='n'>c n/c p</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
<tr><td class='n'>N/P</td><td><?php echo __("Scroll article content") ?></td></tr>

View File

@ -1006,8 +1006,9 @@ function hotkey_handler(e) {
}
if (keycode == 68 && shift_key) { // shift-D
if (isCdmMode() && active_post_id) {
cdmDismissArticle(active_post_id);
if (isCdmMode()) {
//cdmDismissArticle(active_post_id);
cdmDismissSelectedArticles();
}
}

View File

@ -2366,3 +2366,21 @@ function cdmDismissArticle(id) {
exception_error("cdmDismissArticle", e);
}
}
function cdmDismissSelectedArticles() {
try {
var ids = getSelectedArticleIds2();
for (var i = 0; i < ids.length; i++) {
var elem = $("RROW-" + ids[i]);
new Effect.Fade(elem, {duration : 0.5});
}
if (ids.length > 0)
selectionToggleUnread(false);
} catch (e) {
exception_error("cdmDismissArticle", e);
}
}