Correctly saving story layout and view settings for both feeds and folders. Now to get RSS feeds.

This commit is contained in:
Samuel Clay 2015-08-22 17:54:04 -07:00
parent 09c950ef89
commit 5dda0617f6
2 changed files with 53 additions and 22 deletions

View file

@ -8579,22 +8579,27 @@ form.opml_import_form input {
.NB-modal-exception .NB-exception-block-only { .NB-modal-exception .NB-exception-block-only {
display: block; display: block;
} }
.NB-modal-exception.NB-modal-feed-settings .NB-modal-title { .NB-modal-exception.NB-modal-feed-settings .NB-modal-title,
.NB-modal-exception.NB-modal-folder-settings .NB-modal-title {
display: block; display: block;
} }
.NB-modal-exception .NB-modal-title.NB-exception-block-only { .NB-modal-exception .NB-modal-title.NB-exception-block-only {
display: block; display: block;
} }
.NB-modal-exception.NB-modal-folder-settings .NB-exception-block-only,
.NB-modal-exception.NB-modal-feed-settings .NB-exception-block-only { .NB-modal-exception.NB-modal-feed-settings .NB-exception-block-only {
display: none; display: none;
} }
.NB-modal-exception.NB-modal-feed-settings .NB-exception-only, .NB-modal-exception.NB-modal-feed-settings .NB-exception-only,
.NB-modal-exception.NB-modal-feed-settings .NB-exception-block-only { .NB-modal-exception.NB-modal-folder-settings .NB-exception-only,
.NB-modal-exception.NB-modal-feed-settings .NB-exception-block-only,
.NB-modal-exception.NB-modal-folder-settings .NB-exception-block-only {
display: none; display: none;
} }
.NB-modal-exception .NB-settings-only { .NB-modal-exception .NB-settings-only {
display: none; display: none;
} }
.NB-modal-exception.NB-modal-folder-settings .NB-settings-only,
.NB-modal-exception.NB-modal-feed-settings .NB-settings-only { .NB-modal-exception.NB-modal-feed-settings .NB-settings-only {
display: block; display: block;
} }
@ -8653,20 +8658,23 @@ form.opml_import_form input {
.NB-modal-exception .NB-fieldset-fields .NB-error { .NB-modal-exception .NB-fieldset-fields .NB-error {
padding: 6px 0 6px 4px; padding: 6px 0 6px 4px;
} }
.NB-modal-feed-settings .NB-exception-option-status { .NB-modal-feed-settings .NB-exception-option-status,
.NB-modal-folder-settings .NB-exception-option-status {
color: #3945C0; color: #3945C0;
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
opacity: 0; opacity: 0;
} }
.NB-modal-feed-settings .NB-preference-label { .NB-modal-feed-settings .NB-preference-label,
.NB-modal-folder-settings .NB-preference-label {
float: left; float: left;
margin: 10px 0; margin: 10px 0;
width: 102px; width: 102px;
clear: both; clear: both;
} }
.NB-modal-feed-settings .NB-preference-options { .NB-modal-feed-settings .NB-preference-options,
.NB-modal-folder-settings .NB-preference-options {
margin: 6px 0; margin: 6px 0;
float: left; float: left;
overflow: hidden; overflow: hidden;

View file

@ -27,15 +27,16 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
NEWSBLUR.Modal.prototype.initialize_feed.call(this, this.feed_id); NEWSBLUR.Modal.prototype.initialize_feed.call(this, this.feed_id);
} }
this.make_modal(); this.make_modal();
this.show_recommended_options_meta(); if (this.feed) {
this.show_recommended_options_meta();
_.delay(_.bind(function() {
this.get_feed_settings();
}, this), 50);
}
this.handle_cancel(); this.handle_cancel();
this.open_modal(); this.open_modal();
this.initialize_feed(this.feed_id); this.initialize_feed(this.feed_id);
_.delay(_.bind(function() {
this.get_feed_settings();
}, this), 50);
this.$modal.bind('click', $.rescope(this.handle_click, this)); this.$modal.bind('click', $.rescope(this.handle_click, this));
this.$modal.bind('change', $.rescope(this.handle_change, this)); this.$modal.bind('change', $.rescope(this.handle_change, this));
}, },
@ -43,9 +44,17 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
initialize_feed: function(feed_id) { initialize_feed: function(feed_id) {
var view_setting = this.model.view_setting(feed_id, 'view'); var view_setting = this.model.view_setting(feed_id, 'view');
var story_layout = this.model.view_setting(feed_id, 'layout'); var story_layout = this.model.view_setting(feed_id, 'layout');
NEWSBLUR.Modal.prototype.initialize_feed.call(this, feed_id);
$('input[name=feed_link]', this.$modal).val(this.feed.get('feed_link')); if (this.feed) {
$('input[name=feed_address]', this.$modal).val(this.feed.get('feed_address')); NEWSBLUR.Modal.prototype.initialize_feed.call(this, feed_id);
$('input[name=feed_link]', this.$modal).val(this.feed.get('feed_link'));
$('input[name=feed_address]', this.$modal).val(this.feed.get('feed_address'));
$(".NB-exception-option-page", this.$modal).toggle(this.feed.is_feed() || this.feed.is_social());
$(".NB-view-setting-original", this.$modal).toggle(this.feed.is_feed() || this.feed.is_social());
} else if (this.folder) {
NEWSBLUR.Modal.prototype.initialize_folder.call(this, feed_id);
}
$('input[name=view_settings]', this.$modal).each(function() { $('input[name=view_settings]', this.$modal).each(function() {
if ($(this).val() == view_setting) { if ($(this).val() == view_setting) {
$(this).attr('checked', true); $(this).attr('checked', true);
@ -59,12 +68,18 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
} }
}); });
$(".NB-exception-option-page", this.$modal).toggle(this.feed.is_feed() || this.feed.is_social()); if (this.folder) {
$(".NB-view-setting-original", this.$modal).toggle(this.feed.is_feed() || this.feed.is_social()); this.$modal.addClass('NB-modal-folder-settings');
if (this.feed.get('exception_type')) {
this.$modal.removeClass('NB-modal-feed-settings'); this.$modal.removeClass('NB-modal-feed-settings');
$(".NB-modal-title", this.$modal).text("Folder Settings");
} else if (this.feed.get('exception_type')) {
this.$modal.removeClass('NB-modal-folder-settings');
this.$modal.removeClass('NB-modal-feed-settings');
$(".NB-modal-title", this.$modal).text("Fix a misbehaving site");
} else { } else {
this.$modal.removeClass('NB-modal-folder-settings');
this.$modal.addClass('NB-modal-feed-settings'); this.$modal.addClass('NB-modal-feed-settings');
$(".NB-modal-title", this.$modal).text("Site Settings");
} }
this.resize(); this.resize();
@ -202,7 +217,7 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
]) ])
]) ])
]), ]),
$.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-feed NB-modal-submit' }, [ (this.feed && $.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-feed NB-modal-submit' }, [
$.make('h5', [ $.make('h5', [
$.make('div', { className: 'NB-exception-option-meta' }), $.make('div', { className: 'NB-exception-option-meta' }),
$.make('span', { className: 'NB-exception-option-option NB-exception-only' }, 'Option 2:'), $.make('span', { className: 'NB-exception-option-option NB-exception-only' }, 'Option 2:'),
@ -223,8 +238,8 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
$.make('div', { className: 'NB-exception-feed-history' }) $.make('div', { className: 'NB-exception-feed-history' })
])) ]))
]) ])
]), ])),
($.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-page NB-modal-submit' }, [ (this.feed && $.make('div', { className: 'NB-fieldset NB-exception-option NB-exception-option-page NB-modal-submit' }, [
$.make('h5', [ $.make('h5', [
$.make('div', { className: 'NB-exception-option-meta' }), $.make('div', { className: 'NB-exception-option-meta' }),
$.make('span', { className: 'NB-exception-option-option NB-exception-only' }, 'Option 3:'), $.make('span', { className: 'NB-exception-option-option NB-exception-only' }, 'Option 3:'),
@ -488,11 +503,19 @@ _.extend(NEWSBLUR.ReaderFeedException.prototype, {
}); });
$.targetIs(e, { tagSelector: 'input[name=view_settings]' }, function($t, $p){ $.targetIs(e, { tagSelector: 'input[name=view_settings]' }, function($t, $p){
self.model.view_setting(self.feed_id, {'view': $t.val()}); if (self.folder) {
self.folder.view_setting({'view': $t.val()});
} else {
NEWSBLUR.assets.view_setting(self.feed_id, {'view': $t.val()});
}
self.animate_saved(); self.animate_saved();
}); });
$.targetIs(e, { tagSelector: 'input[name=story_layout]' }, function($t, $p){ $.targetIs(e, { tagSelector: 'input[name=story_layout]' }, function($t, $p){
self.model.view_setting(self.feed_id, {'layout': $t.val()}); if (self.folder) {
self.folder.view_setting({'layout': $t.val()});
} else {
NEWSBLUR.assets.view_setting(self.feed_id, {'layout': $t.val()});
}
self.animate_saved(); self.animate_saved();
}); });
} }