print "<td class='hlMarkedPic'>$marked_pic</td>";
print "<td class='hlMarkedPic'>$published_pic</td>";
-# if ($line["feed_title"]) {
-# print "<td class='hlContent'>$content_link</td>";
-# print "<td class='hlFeed'>
-# <a href=\"javascript:viewfeed($feed_id, '', false)\">".
-# truncate_string($line["feed_title"],30)."</a> </td>";
-# } else {
-
- print "<td onclick='view($id)' class='hlContent$hlc_suffix' valign='middle' id='HLC-$id'>";
+ print "<td onclick='return hlClicked(event,$id)'
+ title=\"".__("Click to select, ctrl-click selects multiple")."\"
+ class='hlContent$hlc_suffix' valign='middle' id='HLC-$id'>";
print "<a id=\"RTITLE-$id\"
href=\"" . htmlspecialchars($line["link"]) . "\"
print $labels_str;
-# <a href=\"javascript:viewfeed($feed_id, '', false)\">".
-# $line["feed_title"]."</a>
-
if (!get_pref($link, 'VFEED_GROUP_BY_FEED')) {
if (@$line["feed_title"]) {
print "<span class=\"hlFeed\">
}
}
-// print "<img id='HLL-$id' class='hlLoading'
-// src='images/indicator_tiny.gif' style='display : none'>";
-
print "</td>";
-# }
-
- print "<td class=\"hlUpdated\" onclick='view($id)'><nobr>$updated_fmt </nobr></td>";
+
+ print "<td class=\"hlUpdated\"
+ onclick='return hlClicked(event,$id)'><nobr>$updated_fmt
+ </nobr></td>";
print "<td class='hlMarkedPic'>$score_pic</td>";
print "</div>";
print "<div class=\"cdmContent\" $content_hidden
- title=\"".__("Click to select article")."\"
- onclick=\"toggleSelected($id);\"
+ title=\"".__("Click to select, ctrl-click selects multiple")."\"
+ onclick=\"return cdmClicked(event, $id);\"
id=\"CICD-$id\">";
print "<div class=\"cdmContentInner\">";
$article_content = sanitize_rss($link, $line["content_preview"],
false, false, $feed_site_url);
+ if (!$article_content) $article_content = " ";
+
print "<div id=\"POSTNOTE-$id\">";
if ($line['note']) {
print format_article_note($id, $line['note']);
print "<img src=\"images/digest_checkbox.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\"
- onclick=\"cdmDismissArticle($id)\"
+ onclick=\"dismissArticle($id)\"
alt='Dismiss' title='".__('Dismiss article')."'>";
print "</div>";
<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 selected articles") ?></td></tr>
+ <tr><td class='n'>D</td><td><?php echo __("Dismiss selected articles") ?></td></tr>
+ <tr><td class='n'>X</td><td><?php echo __("Dismiss read 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>
}
if (keycode == 68 && shift_key) { // shift-D
- if (isCdmMode()) {
- //cdmDismissArticle(active_post_id);
- cdmDismissSelectedArticles();
- }
+ dismissSelectedArticles();
+ }
+
+ if (keycode == 88 && shift_key) { // shift-X
+ dismissReadArticles();
}
if (keycode == 78 || keycode == 40) { // n, down
}
}
-function cdmDismissArticle(id) {
+function dismissArticle(id) {
try {
var elem = $("RROW-" + id);
new Effect.Fade(elem, {duration : 0.5});
} catch (e) {
- exception_error("cdmDismissArticle", e);
+ exception_error("dismissArticle", e);
}
}
-function cdmDismissSelectedArticles() {
+function dismissSelectedArticles() {
try {
var ids = getSelectedArticleIds2();
selectionToggleUnread(false);
} catch (e) {
- exception_error("cdmDismissArticle", e);
+ exception_error("dismissSelectedArticles", e);
}
}
+
+function dismissReadArticles() {
+ try {
+
+ var ids = getVisibleArticleIds();
+
+ for (var i = 0; i < ids.length; i++) {
+ var elem = $("RROW-" + ids[i]);
+
+ if (elem.className && !elem.className.match("Unread") &&
+ !elem.className.match("Selected")) {
+
+ new Effect.Fade(elem, {duration : 0.5});
+ }
+ }
+
+ } catch (e) {
+ exception_error("dismissSelectedArticles", e);
+ }
+}
+
+function getVisibleArticleIds() {
+ try {
+ if (isCdmMode()) {
+ return cdmGetVisibleArticles();
+ } else {
+ return getVisibleHeadlineIds();
+ }
+ } catch (e) {
+ exception_error("getVisibleArticleIds");
+ }
+}
+
+function cdmClicked(event, id) {
+ try {
+ var shift_key = event.shiftKey;
+
+ if (!event.ctrlKey) {
+ cdmSelectArticles("none");
+ toggleSelected(id);
+
+ var elem = $("RROW-" + id);
+
+ if (elem)
+ elem.className = elem.className.replace("Unread", "");
+
+ var query = "?op=rpc&subop=catchupSelected" +
+ "&cmode=0&ids=" + param_escape(id);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ handle_rpc_reply(transport);
+ } });
+
+ } else {
+ toggleSelected(id);
+ }
+
+ } catch (e) {
+ exception_error("cdmClicked");
+ }
+
+ return false;
+}
+
+function hlClicked(event, id) {
+ try {
+ var shift_key = event.shiftKey;
+
+ if (!event.ctrlKey) {
+ view(id);
+ } else {
+ toggleSelected(id);
+ }
+
+ } catch (e) {
+ exception_error("hlClicked");
+ }
+
+ return false;
+}