Handling errors on unauthenticated users trying to do stuff they shouldn't be doing.

This commit is contained in:
Samuel Clay 2010-08-11 23:02:17 -04:00
parent 49bd217332
commit 47720c60a7
3 changed files with 34 additions and 18 deletions

View file

@ -2523,12 +2523,13 @@ background: transparent;
visibility: visible;
}
.NB-menu-manage .NB-menu-manage-feed-delete.NB-menu-manage-feed-delete-cancel {
background: transparent url('../img/icons/silk/arrow_rotate_clockwise.png') no-repeat 24px 0;
background: transparent url('../img/icons/silk/arrow_rotate_clockwise.png') no-repeat 0 0;
display: block;
visibility: visible;
}
.NB-menu-manage .NB-menu-manage-feed-delete-confirm .NB-menu-manage-image {
background: transparent url('../img/icons/silk/exclamation.png') no-repeat 24px 0;
background: transparent url('../img/icons/silk/exclamation.png') no-repeat 0 1px;
font-weight: bold;
}

View file

@ -247,8 +247,12 @@ NEWSBLUR.AssetModel.Reader.prototype = {
get_feeds_trainer: function(callback) {
var self = this;
this.make_request('/reader/get_feeds_trainer', {}, callback,
null, {'ajax_group': 'feed'});
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/reader/get_feeds_trainer', {}, callback,
null, {'ajax_group': 'feed'});
} else {
if ($.isFunction(callback)) callback();
}
},
refresh_feeds: function(callback, has_unfetched_feeds) {
@ -366,17 +370,27 @@ NEWSBLUR.AssetModel.Reader.prototype = {
},
process_opml_import: function(data, callback) {
var self = this;
this.make_request('/import/process', data, callback);
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/import/process', data, callback);
} else {
if ($.isFunction(callback)) callback();
}
},
save_classifier_story: function(story_id, data, callback) {
this.make_request('/classifier/save/story/', data, callback);
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/classifier/save/story/', data, callback);
} else {
if ($.isFunction(callback)) callback();
}
},
save_classifier_publisher: function(data, callback) {
this.make_request('/classifier/save/publisher', data, callback);
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/classifier/save/publisher', data, callback);
} else {
if ($.isFunction(callback)) callback();
}
},
get_feed_classifier: function(feed_id, callback) {
@ -389,7 +403,11 @@ NEWSBLUR.AssetModel.Reader.prototype = {
delete_publisher: function(feed_id, callback) {
delete this.feeds[feed_id];
this.make_request('/reader/delete_feed', {'feed_id': feed_id}, callback, null);
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/reader/delete_feed', {'feed_id': feed_id}, callback, null);
} else {
if ($.isFunction(callback)) callback();
}
},
save_add_url: function(url, folder, callback) {

View file

@ -96,7 +96,7 @@
center__paneSelector: ".left-center",
center__resizable: false,
south__paneSelector: ".left-south",
south__size: 30,
south__size: 31,
south__resizable: false,
south__spacing_open: 0
});
@ -540,11 +540,8 @@
$('#story_taskbar').css({'display': 'block'});
$feed_list.css({'display': 'none'});
this.make_feeds_folder($feed_list, folders);
this.$s.$feed_link_loader.fadeOut(250, function() {
$feed_list.fadeIn(750);
});
this.$s.$feed_link_loader.fadeOut(250);
this.check_feed_fetch_progress();
@ -584,7 +581,7 @@
]);
(function($feeds, $folder) {
setTimeout(function() {
$feeds.append($folder);
$feeds.css({'display': 'none'}).append($folder).fadeIn(500);
$('.unread_count', $feeds).corner('4px');
}, 50);
})($feeds, $folder);
@ -692,11 +689,11 @@
setTimeout(function() {
$progress.css({'display': 'block', 'opacity': 0}).animate({
'opacity': 1,
'bottom': 30
'bottom': 31
}, {
'duration': 750
});
self.$s.$feed_list.animate({'bottom': 72}, {'duration': 750});
self.$s.$feed_list.animate({'bottom': 73}, {'duration': 750});
}, 1000);
}
},