summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-12-10 18:36:38 +0400
committerAndrew Dolgov <[email protected]>2011-12-10 18:36:38 +0400
commit2ea34cc1501409f9f62d83f43de3ee494b2d73db (patch)
treed799d412cf6767822941b9110623a7143d8d2590 /viewfeed.js
parente6f1a1b747fd2e77c910dc048cb44ca622da4a79 (diff)
add mark above/below as read to headline context menu
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/viewfeed.js b/viewfeed.js
index 360384c17..f34a071fd 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -1172,12 +1172,13 @@ function catchupBatchedArticles() {
}
}
-function catchupRelativeToArticle(below) {
+function catchupRelativeToArticle(below, id) {
try {
+ if (!id) id = getActiveArticleId();
- if (!getActiveArticleId()) {
+ if (!id) {
alert(__("No article is selected."));
return;
}
@@ -1188,7 +1189,7 @@ function catchupRelativeToArticle(below) {
if (!below) {
for (var i = 0; i < visible_ids.length; i++) {
- if (visible_ids[i] != getActiveArticleId()) {
+ if (visible_ids[i] != id) {
var e = $("RROW-" + visible_ids[i]);
if (e && e.hasClassName("Unread")) {
@@ -1200,7 +1201,7 @@ function catchupRelativeToArticle(below) {
}
} else {
for (var i = visible_ids.length-1; i >= 0; i--) {
- if (visible_ids[i] != getActiveArticleId()) {
+ if (visible_ids[i] != id) {
var e = $("RROW-" + visible_ids[i]);
if (e && e.hasClassName("Unread")) {
@@ -1934,7 +1935,20 @@ function initHeadlinesMenu() {
hlOpenInNewTab(event, this.getParent().callerRowId);
}}));
-// menu.addChild(new dijit.MenuSeparator());
+ menu.addChild(new dijit.MenuSeparator());
+
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark above as read"),
+ onClick: function(event) {
+ catchupRelativeToArticle(0, this.getParent().callerRowId);
+ }}));
+
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark below as read"),
+ onClick: function(event) {
+ catchupRelativeToArticle(1, this.getParent().callerRowId);
+ }}));
+
var labels = dijit.byId("feedTree").model.getItemsInCategory(-2);