mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding unread counter to All Sites.
This commit is contained in:
parent
820c79909e
commit
ac5eec0322
2 changed files with 23 additions and 12 deletions
|
@ -2029,10 +2029,20 @@
|
|||
}
|
||||
|
||||
if (feed) {
|
||||
NEWSBLUR.app.story_unread_counter = new NEWSBLUR.Views.FeedCount({model: feed}).render();
|
||||
NEWSBLUR.app.story_unread_counter = new NEWSBLUR.Views.FeedCount({
|
||||
model: feed
|
||||
}).render();
|
||||
} else if (folder) {
|
||||
if (!folder.folder_view) return; // No counter for river blurblog yet.
|
||||
NEWSBLUR.app.story_unread_counter = new NEWSBLUR.Views.FolderCount({collection: folder.folder_view.collection}).render();
|
||||
var collection;
|
||||
if (!folder.folder_view) {
|
||||
// River blurblog gets a special collection
|
||||
collection = NEWSBLUR.assets.folders;
|
||||
} else {
|
||||
collection = folder.folder_view.collection;
|
||||
}
|
||||
NEWSBLUR.app.story_unread_counter = new NEWSBLUR.Views.FolderCount({
|
||||
collection: collection
|
||||
}).render();
|
||||
}
|
||||
|
||||
NEWSBLUR.app.story_unread_counter.$el.css({'opacity': 0});
|
||||
|
|
|
@ -41,9 +41,9 @@ NEWSBLUR.Views.SidebarHeader = Backbone.View.extend({
|
|||
</div>\
|
||||
', {
|
||||
feeds_count : (this.feeds_count ? Inflector.pluralize(' site', this.feeds_count, true) : ' '),
|
||||
positive_count : this.unread_counts['positive'],
|
||||
neutral_count : this.unread_counts['neutral'],
|
||||
negative_count : this.unread_counts['negative'],
|
||||
positive_count : this.unread_counts['ps'],
|
||||
neutral_count : this.unread_counts['nt'],
|
||||
negative_count : this.unread_counts['ng'],
|
||||
hide_read_feeds : !!hide_read_feeds
|
||||
});
|
||||
|
||||
|
@ -61,7 +61,8 @@ NEWSBLUR.Views.SidebarHeader = Backbone.View.extend({
|
|||
},
|
||||
|
||||
count: function() {
|
||||
this.unread_counts = this.count_unreads_across_all_sites();
|
||||
// this.unread_counts = this.count_unreads_across_all_sites();
|
||||
this.unread_counts = NEWSBLUR.assets.folders.unread_counts();
|
||||
this.feeds_count = this.count_feeds();
|
||||
|
||||
if (NEWSBLUR.assets.preference('show_unread_counts_in_title')) {
|
||||
|
@ -69,16 +70,16 @@ NEWSBLUR.Views.SidebarHeader = Backbone.View.extend({
|
|||
var counts = [];
|
||||
var unread_view = _.isNumber(this.options.unread_view) && this.options.unread_view || NEWSBLUR.assets.preference('unread_view');
|
||||
if (unread_view <= -1) {
|
||||
counts.push(this.unread_counts['negative']);
|
||||
counts.push(this.unread_counts['ng']);
|
||||
}
|
||||
if (unread_view <= 0) {
|
||||
counts.push(this.unread_counts['neutral']);
|
||||
counts.push(this.unread_counts['nt']);
|
||||
}
|
||||
if (unread_view <= 1) {
|
||||
counts.push(this.unread_counts['positive']);
|
||||
counts.push(this.unread_counts['ps']);
|
||||
}
|
||||
if (!this.unread_counts['negative'] && !this.unread_counts['positive']) {
|
||||
counts = [this.unread_counts['neutral']];
|
||||
if (!this.unread_counts['ng'] && !this.unread_counts['ps']) {
|
||||
counts = [this.unread_counts['nt']];
|
||||
}
|
||||
title += counts.join('/') + ') NewsBlur';
|
||||
document.title = title;
|
||||
|
|
Loading…
Add table
Reference in a new issue