Showing loading bar in all views. Also being more aggressive in finding urls when adding.

This commit is contained in:
Samuel Clay 2013-06-30 17:00:31 -07:00
parent 5cc0cd3754
commit e6da8d034d
4 changed files with 8 additions and 3 deletions

View file

@ -325,7 +325,7 @@ class Feed(models.Model):
create_okay = False create_okay = False
if feedfinder.isFeed(url): if feedfinder.isFeed(url):
create_okay = True create_okay = True
elif aggressive: elif fetch:
# Could still be a feed. Just check if there are entries # Could still be a feed. Just check if there are entries
fp = feedparser.parse(url) fp = feedparser.parse(url)
if len(fp.entries): if len(fp.entries):

View file

@ -1447,6 +1447,7 @@
this.switch_taskbar_view(this.story_view); this.switch_taskbar_view(this.story_view);
this.setup_mousemove_on_views(); this.setup_mousemove_on_views();
this.make_feed_title_in_stories(); this.make_feed_title_in_stories();
NEWSBLUR.app.story_titles.show_loading();
NEWSBLUR.app.taskbar_info.hide_stories_error(); NEWSBLUR.app.taskbar_info.hide_stories_error();
this.model.fetch_starred_stories(1, _.bind(this.post_open_starred_stories, this), this.model.fetch_starred_stories(1, _.bind(this.post_open_starred_stories, this),
@ -1527,6 +1528,7 @@
feeds = this.active_folder.feed_ids_in_folder(); feeds = this.active_folder.feed_ids_in_folder();
} }
this.cache['river_feeds_with_unreads'] = feeds; this.cache['river_feeds_with_unreads'] = feeds;
NEWSBLUR.app.story_titles.show_loading();
NEWSBLUR.app.taskbar_info.hide_stories_error(); NEWSBLUR.app.taskbar_info.hide_stories_error();
NEWSBLUR.app.taskbar_info.show_stories_progress_bar(feeds.length); NEWSBLUR.app.taskbar_info.show_stories_progress_bar(feeds.length);
this.model.fetch_river_stories(this.active_feed, feeds, 1, this.model.fetch_river_stories(this.active_feed, feeds, 1,
@ -1629,6 +1631,7 @@
} }
} }
NEWSBLUR.app.story_titles.show_loading();
NEWSBLUR.app.taskbar_info.hide_stories_error(); NEWSBLUR.app.taskbar_info.hide_stories_error();
NEWSBLUR.app.taskbar_info.show_stories_progress_bar(100); // Assume 100 followees for popular NEWSBLUR.app.taskbar_info.show_stories_progress_bar(100); // Assume 100 followees for popular
this.model.fetch_river_blurblogs_stories(this.active_feed, 1, this.model.fetch_river_blurblogs_stories(this.active_feed, 1,
@ -1717,6 +1720,7 @@
this.switch_taskbar_view(this.story_view); this.switch_taskbar_view(this.story_view);
this.setup_mousemove_on_views(); this.setup_mousemove_on_views();
NEWSBLUR.app.story_titles.show_loading();
NEWSBLUR.app.taskbar_info.hide_stories_error(); NEWSBLUR.app.taskbar_info.hide_stories_error();
NEWSBLUR.app.taskbar_info.show_stories_progress_bar(); NEWSBLUR.app.taskbar_info.show_stories_progress_bar();
this.model.fetch_social_stories(this.active_feed, 1, this.model.fetch_social_stories(this.active_feed, 1,

View file

@ -93,6 +93,7 @@ NEWSBLUR.Views.StoryTitlesView = Backbone.View.extend({
}, },
show_loading: function(options) { show_loading: function(options) {
options = options || {};
if (NEWSBLUR.assets.flags['no_more_stories']) return; if (NEWSBLUR.assets.flags['no_more_stories']) return;
var $story_titles = NEWSBLUR.reader.$s.$story_titles; var $story_titles = NEWSBLUR.reader.$s.$story_titles;

View file

@ -102,7 +102,7 @@ class URLGatekeeper:
_debuglog("gatekeeper of %s says %s" % (url, allow)) _debuglog("gatekeeper of %s says %s" % (url, allow))
return allow return allow
def get(self, url, check=True): def get(self, url, check=False):
if check and not self.can_fetch(url): return '' if check and not self.can_fetch(url): return ''
try: try:
return requests.get(url, headers=dict(self.urlopener.addheaders)).content return requests.get(url, headers=dict(self.urlopener.addheaders)).content