mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-11-01 09:09:51 +00:00
Adding preference to toggle global shared stories and infrequent site stories on web.
This commit is contained in:
parent
9e0fa678d3
commit
2f5a5adbd1
3 changed files with 68 additions and 6 deletions
|
|
@ -196,6 +196,25 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
|
|||
'Window title'
|
||||
])
|
||||
]),
|
||||
$.make('div', { className: 'NB-preference NB-preference-showglobalsharedstories' }, [
|
||||
$.make('div', { className: 'NB-preference-options' }, [
|
||||
$.make('div', [
|
||||
$.make('input', { id: 'NB-preference-showglobalsharedstories-1', type: 'checkbox', name: 'show_global_shared_stories', value: 0 }),
|
||||
$.make('label', { 'for': 'NB-preference-showglobalsharedstories-1' }, [
|
||||
'Show Global Shared Stories'
|
||||
])
|
||||
]),
|
||||
$.make('div', [
|
||||
$.make('input', { id: 'NB-preference-showinfrequentsitestories-1', type: 'checkbox', name: 'show_infrequent_site_stories', value: 0 }),
|
||||
$.make('label', { 'for': 'NB-preference-showinfrequentsitestories-1' }, [
|
||||
'Show Infrequent Site Stories'
|
||||
])
|
||||
])
|
||||
]),
|
||||
$.make('div', { className: 'NB-preference-label'}, [
|
||||
'Special Folders'
|
||||
])
|
||||
]),
|
||||
$.make('div', { className: 'NB-preference NB-preference-autoopenfolder' }, [
|
||||
$.make('div', { className: 'NB-preference-options' }, [
|
||||
$.make('div', [
|
||||
|
|
@ -995,6 +1014,18 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
$('input[name=show_global_shared_stories]', $modal).each(function() {
|
||||
if (NEWSBLUR.Preferences.show_global_shared_stories) {
|
||||
$(this).attr('checked', true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$('input[name=show_infrequent_site_stories]', $modal).each(function() {
|
||||
if (NEWSBLUR.Preferences.show_infrequent_site_stories) {
|
||||
$(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);
|
||||
|
|
@ -1249,6 +1280,10 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
|
|||
NEWSBLUR.app.feed_list.make_feeds();
|
||||
NEWSBLUR.app.feed_list.make_social_feeds();
|
||||
}
|
||||
if (self.original_preferences['show_global_shared_stories'] != form['show_global_shared_stories'] ||
|
||||
self.original_preferences['show_infrequent_site_stories'] != form['show_infrequent_site_stories']) {
|
||||
NEWSBLUR.app.feed_list.toggle_filter_feeds();
|
||||
}
|
||||
if (self.original_preferences['ssl'] != form['ssl']) {
|
||||
NEWSBLUR.reader.check_and_load_ssl();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ NEWSBLUR.Views.FeedList = Backbone.View.extend({
|
|||
}
|
||||
NEWSBLUR.assets.feeds.bind('add', this.update_dashboard_count, this);
|
||||
NEWSBLUR.assets.feeds.bind('remove', this.update_dashboard_count, this);
|
||||
|
||||
},
|
||||
|
||||
make_feeds: function(options) {
|
||||
|
|
@ -104,22 +105,20 @@ NEWSBLUR.Views.FeedList = Backbone.View.extend({
|
|||
// this.load_sortable_feeds();
|
||||
_.delay(_.bind(NEWSBLUR.reader.update_starred_count, NEWSBLUR.reader), 250);
|
||||
NEWSBLUR.reader.check_hide_getting_started();
|
||||
$('.NB-feeds-header-river-sites-container,.NB-feeds-header-river-infrequent-container').css({
|
||||
|
||||
$('.NB-feeds-header-river-sites-container').css({
|
||||
'display': 'block',
|
||||
'opacity': 0
|
||||
}).animate({'opacity': 1}, {'duration': 700});
|
||||
}
|
||||
|
||||
$('.NB-feeds-header-river-global-container').css({
|
||||
'display': 'block',
|
||||
'opacity': 0
|
||||
}).animate({'opacity': 1}, {'duration': 700});
|
||||
|
||||
if (NEWSBLUR.reader.flags['showing_feed_in_tryfeed_view'] ||
|
||||
NEWSBLUR.reader.flags['showing_social_feed_in_tryfeed_view']) {
|
||||
NEWSBLUR.reader.hide_tryfeed_view();
|
||||
NEWSBLUR.reader.force_feed_refresh();
|
||||
}
|
||||
|
||||
this.toggle_filter_feeds();
|
||||
|
||||
_.defer(_.bind(function() {
|
||||
NEWSBLUR.reader.open_dialog_after_feeds_loaded();
|
||||
|
|
@ -137,6 +136,32 @@ NEWSBLUR.Views.FeedList = Backbone.View.extend({
|
|||
return this;
|
||||
},
|
||||
|
||||
toggle_filter_feeds: function() {
|
||||
if (NEWSBLUR.assets.preference('show_global_shared_stories')) {
|
||||
$('.NB-feeds-header-river-global-container').css({
|
||||
'display': 'block',
|
||||
'opacity': 0
|
||||
}).animate({'opacity': 1}, {'duration': 700});
|
||||
} else {
|
||||
$('.NB-feeds-header-river-global-container').css({
|
||||
'display': 'none',
|
||||
'opacity': 0
|
||||
});
|
||||
}
|
||||
|
||||
if (NEWSBLUR.assets.preference('show_infrequent_site_stories')) {
|
||||
$('.NB-feeds-header-river-infrequent-container').css({
|
||||
'display': 'block',
|
||||
'opacity': 0
|
||||
}).animate({'opacity': 1}, {'duration': 700});
|
||||
} else {
|
||||
$('.NB-feeds-header-river-infrequent-container').css({
|
||||
'display': 'none',
|
||||
'opacity': 0
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
make_social_feeds: function() {
|
||||
var $social_feeds = $('.NB-socialfeeds', this.$s.$social_feeds);
|
||||
var profile = NEWSBLUR.assets.user_profile;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@
|
|||
'story_button_placement' : "right",
|
||||
'timezone' : "{{ user_profile.timezone }}",
|
||||
'title_counts' : true,
|
||||
'show_global_shared_stories': true,
|
||||
'show_infrequent_site_stories': true,
|
||||
'full_width_story' : false,
|
||||
'truncate_story' : 'social',
|
||||
'autoopen_folder' : false,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue