Adding preference to move to next feed/folder when marking read.

This commit is contained in:
Samuel Clay 2014-09-09 15:01:12 -07:00
parent 4d57092142
commit 8db52c89c1
4 changed files with 38 additions and 1 deletions

View file

@ -286,7 +286,12 @@ NEWSBLUR.AssetModel = Backbone.Router.extend({
cutoff_timestamp: cutoff_timestamp,
direction: direction
}, callback);
_.each(feed_ids, function(feed_id) {
var feed = self.get_feed(feed_id);
if (!feed) return;
feed.set({'ps': 0, 'nt': 0, 'ng': 0});
});
if (mark_active) {
this.stories.each(function(story) {
if ((!direction || direction == "older") &&

View file

@ -2117,6 +2117,9 @@
this.model.mark_feed_as_read([feed_id], cutoff_timestamp, direction,
feed_id == this.active_feed, _.bind(function() {
if (NEWSBLUR.assets.preference('markread_nextfeed') == 'nextfeed') {
this.show_next_feed(1);
}
this.feeds_unread_count(feed_id);
}, this));
},
@ -2136,6 +2139,9 @@
if (!this.socket || !this.socket.socket || !this.socket.socket.connected) {
this.force_feeds_refresh(null, false, feeds);
}
if (NEWSBLUR.assets.preference('markread_nextfeed') == 'nextfeed') {
this.show_next_feed(1);
}
}, this));
},

View file

@ -504,6 +504,25 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
'Mark a story as read',
$.make('div', { className: 'NB-preference-sublabel' }, 'Clicking on a story marks it as read immediately.')
])
]),
$.make('div', { className: 'NB-preference NB-preference-markreadnextfeed' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', [
$.make('input', { id: 'NB-preference-markreadnextfeed-1', type: 'radio', name: 'markread_nextfeed', value: 'nextfeed' }),
$.make('label', { 'for': 'NB-preference-markreadnextfeed-1' }, [
'Open the next site/folder'
])
]),
$.make('div', [
$.make('input', { id: 'NB-preference-markreadnextfeed-0', type: 'radio', name: 'markread_nextfeed', value: "nothing" }),
$.make('label', { 'for': 'NB-preference-markreadnextfeed-0' }, [
'Stay on the same feed/folder'
])
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'After marking feed/folder read'
])
])
]),
@ -872,6 +891,12 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
return false;
}
});
$('input[name=markread_nextfeed]', $modal).each(function() {
if ($(this).val() == NEWSBLUR.Preferences.markread_nextfeed) {
$(this).attr('checked', true);
return false;
}
});
$('input[name=read_story_delay]', $modal).each(function() {
if ($(this).val() == ""+NEWSBLUR.Preferences.read_story_delay) {
$(this).attr('checked', true);

View file

@ -79,6 +79,7 @@
'show_content_preview' : true,
'doubleclick_feed' : 'open',
'doubleclick_unread' : 'markread',
'markread_nextfeed' : 'nextfeed',
'story_share_twitter' : true,
'story_share_facebook' : true,
'story_share_readitlater' : false,