Everybody gets unread count in title.

This commit is contained in:
Samuel Clay 2013-01-03 18:53:01 -08:00
parent aefd8de78c
commit a39cbfb814
3 changed files with 18 additions and 38 deletions

View file

@ -3547,6 +3547,7 @@
}
this.show_story_titles_above_intelligence_level({'animate': true, 'follow': true});
NEWSBLUR.app.sidebar_header.toggle_hide_read_preference();
NEWSBLUR.app.sidebar_header.count();
NEWSBLUR.assets.folders.update_all_folder_visibility();
NEWSBLUR.app.feed_list.scroll_to_show_selected_feed();
NEWSBLUR.app.feed_list.scroll_to_show_selected_folder();

View file

@ -271,19 +271,6 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
'Site sidebar order'
])
]),
$.make('div', { className: 'NB-preference NB-preference-showunreadcountsintitle' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', [
$.make('input', { id: 'NB-preference-showunreadcountsintitle-1', type: 'checkbox', name: 'show_unread_counts_in_title', value: 0 }),
$.make('label', { 'for': 'NB-preference-showunreadcountsintitle-1' }, [
'Show unread counts in the window title'
])
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Window title'
])
]),
$.make('div', { className: 'NB-preference NB-preference-ssl' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', [
@ -634,12 +621,6 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
return false;
}
});
$('input[name=show_unread_counts_in_title]', $modal).each(function() {
if (NEWSBLUR.Preferences.show_unread_counts_in_title) {
$(this).attr('checked', true);
return false;
}
});
$('input[name=open_feed_action]', $modal).each(function() {
if ($(this).val() == NEWSBLUR.Preferences.open_feed_action) {
$(this).attr('checked', true);

View file

@ -61,29 +61,27 @@ NEWSBLUR.Views.SidebarHeader = Backbone.View.extend({
},
count: function() {
// 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')) {
var title = '(';
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['ng']);
}
if (unread_view <= 0) {
counts.push(this.unread_counts['nt']);
}
if (unread_view <= 1) {
counts.push(this.unread_counts['ps']);
}
if (!this.unread_counts['ng'] && !this.unread_counts['ps']) {
counts = [this.unread_counts['nt']];
}
title += counts.join('/') + ') NewsBlur';
document.title = title;
if (!NEWSBLUR.Globals.is_authenticated) return;
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['ng']);
}
if (unread_view <= 0) {
counts.push(this.unread_counts['nt']);
}
if (unread_view <= 1) {
counts.push(this.unread_counts['ps']);
}
if (!this.unread_counts['ng'] && !this.unread_counts['ps']) {
counts = [this.unread_counts['nt']];
}
var title = '(' + counts.join('/') + ') NewsBlur';
document.title = title;
},
count_unreads_across_all_sites: function() {