Merge branch 'master' into organizer

* master:
  v4.6.1 of the iOS app. Submitted to the app store + enterprise deployment.
  Fixing HTML in sent messages.
  Stubbing in marking read above scroll.
  Marking story as read if mouse lock position is below the top story.
This commit is contained in:
Samuel Clay 2014-12-12 11:24:48 -08:00
commit 2513a5d0dc
8 changed files with 49 additions and 11 deletions

View file

@ -656,13 +656,14 @@
NSMutableArray *activityItems = [[NSMutableArray alloc] init];
if (title) [activityItems addObject:title];
if (url) [activityItems addObject:url];
if (text) [activityItems addObject:text];
NSString *maybeFeedTitle = feedTitle ? [NSString stringWithFormat:@" via %@", feedTitle] : @"";
if (text) [activityItems addObject:[NSString stringWithFormat:@"<html><body><br><br><hr style=\"border: none; overflow: hidden; height: 1px;width: 100%%;background-color: #C0C0C0;\"><br><a href=\"%@\">%@</a>%@<br>%@</body></html>", [url absoluteString], title, maybeFeedTitle, text]];
// if (images) [activityItems addObject:images];
NSMutableArray *appActivities = [[NSMutableArray alloc] init];
if (url) [appActivities addObject:[[TUSafariActivity alloc] init]];
if (url) [appActivities addObject:[[ARChromeActivity alloc]
initWithCallbackURL:[NSURL URLWithString:@"newsblur://"]]];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:appActivities];

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.6.0</string>
<string>4.6.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -58,7 +58,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4.6.0</string>
<string>4.6.1</string>
<key>FacebookAppID</key>
<string>230426707030569</string>
<key>LSRequiresIPhoneOS</key>

Binary file not shown.

View file

@ -35,7 +35,7 @@
<key>bundle-identifier</key>
<string>com.newsblur.NewsBlur</string>
<key>bundle-version</key>
<string>4.6.0</string>
<string>4.6.1</string>
<key>kind</key>
<string>software</string>
<key>title</key>

View file

@ -3860,6 +3860,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc.";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -3900,6 +3901,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc.";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

View file

@ -254,7 +254,6 @@ NEWSBLUR.Collections.Stories = Backbone.Collection.extend({
mark_read: function(story, options) {
options = options || {};
var delay = NEWSBLUR.assets.preference('read_story_delay');
if (options.skip_delay) {
delay = 0;
} else if (options.force) {
@ -265,7 +264,7 @@ NEWSBLUR.Collections.Stories = Backbone.Collection.extend({
clearTimeout(this.read_story_delay);
this.read_story_delay = _.delay(_.bind(function() {
var _mark_read = _.bind(function() {
if (!delay || (delay && this.active_story.id == story.id)) {
var feed = NEWSBLUR.assets.get_feed(NEWSBLUR.reader.active_feed);
if (!feed) {
@ -275,7 +274,13 @@ NEWSBLUR.Collections.Stories = Backbone.Collection.extend({
this.update_read_count(story, {previously_read: read});
}, this));
}
}, this), delay * 1000);
}, this);
if (delay) {
this.read_story_delay = _.delay(_mark_read, delay * 1000);
} else {
_mark_read();
}
},
mark_unread: function(story, options) {

View file

@ -10,7 +10,9 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
},
initialize: function() {
_.bindAll(this, 'check_feed_view_scrolled_to_bottom', 'scroll');
_.bindAll(this, 'check_feed_view_scrolled_to_bottom',
'check_feed_view_scrolling_from_top',
'scroll');
this.collection.bind('reset', this.reset_flags, this);
this.collection.bind('reset', this.render, this);
this.collection.bind('reset', this.reset_story_positions, this);
@ -31,7 +33,8 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
story_pane_position: null,
feed_title_floater_feed_id: null,
feed_view_story_positions: {},
feed_view_story_positions_keys: []
feed_view_story_positions_keys: [],
latest_mark_read_scroll_position: -1
};
this.flags = {
mousemove_timeout: false
@ -558,6 +561,21 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
}
},
check_feed_view_scrolling_from_top: function(scroll_top) {
var cursor_position = NEWSBLUR.reader.cache.mouse_position_y + scroll_top;
var positions = this.cache.feed_view_story_positions_keys;
_.any(positions, _.bind(function(position) {
if (position > cursor_position) return true;
if (position <= this.cache.latest_mark_read_scroll_position) return false;
var story = this.cache.feed_view_story_positions[position];
if (!story.get('read_status')) story.mark_read();
this.cache.latest_mark_read_scroll_position = position;
return false;
}, this));
},
reset_story_positions: function(models) {
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
if (NEWSBLUR.assets.preference('feed_view_single_story')) return;
@ -655,7 +673,8 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
(story_view == 'page' && NEWSBLUR.reader.flags['page_view_showing_feed_view'])) &&
!NEWSBLUR.reader.flags['scrolling_by_selecting_story_title'] &&
!NEWSBLUR.assets.preference('feed_view_single_story')) {
var from_top = NEWSBLUR.reader.cache.mouse_position_y + NEWSBLUR.reader.$s.$feed_scroll.scrollTop();
var scroll_top = NEWSBLUR.reader.$s.$feed_scroll.scrollTop();
var from_top = NEWSBLUR.reader.cache.mouse_position_y + scroll_top;
var position = from_top - offset;
var positions = this.cache.feed_view_story_positions_keys;
var closest = $.closest(position, positions);
@ -668,6 +687,9 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
}
this.check_feed_view_scrolled_to_bottom();
if (scroll_top < 10 || NEWSBLUR.assets.preference('mark_read_on_scroll_titles')) {
this.check_feed_view_scrolling_from_top(scroll_top);
}
}
if ((NEWSBLUR.reader.flags['river_view'] || NEWSBLUR.reader.flags['social_view']) &&

View file

@ -64,6 +64,7 @@ NEWSBLUR.Views.StoryTitlesView = Backbone.View.extend({
clear: function() {
_.invoke(this.stories, 'destroy');
this.cache = {};
},
append_river_premium_only_notification: function() {
@ -287,6 +288,13 @@ NEWSBLUR.Views.StoryTitlesView = Backbone.View.extend({
if (visible_height + scroll_y >= total_height) {
NEWSBLUR.reader.load_page_of_feed_stories({scroll_to_loadbar: false});
}
if (NEWSBLUR.assets.preference('mark_read_on_scroll_titles')) {
this.mark_read_stories_above_scroll(scroll_y);
}
},
mark_read_stories_above_scroll: function(scroll_y) {
}
});