diff --git a/media/iphone/Classes/FeedDetailViewController.m b/media/iphone/Classes/FeedDetailViewController.m index e8985c07a..24f429e73 100644 --- a/media/iphone/Classes/FeedDetailViewController.m +++ b/media/iphone/Classes/FeedDetailViewController.m @@ -51,6 +51,8 @@ } - (void)viewWillAppear:(BOOL)animated { + NSLog(@"appDelegate.activeFeed is %@", appDelegate.activeFeed); + self.pageFinished = NO; [MBProgressHUD hideHUDForView:self.view animated:YES]; diff --git a/media/iphone/Classes/FeedsMenuViewController.xib b/media/iphone/Classes/FeedsMenuViewController.xib index c0736663b..61e205e94 100644 --- a/media/iphone/Classes/FeedsMenuViewController.xib +++ b/media/iphone/Classes/FeedsMenuViewController.xib @@ -65,10 +65,10 @@ 5 - Cancel IBCocoaTouchFramework 2 + 1 @@ -78,7 +78,6 @@ {{0, 44}, {320, 416}} - _NS:9 3 @@ -176,8 +175,8 @@ 1 - + @@ -380,6 +379,28 @@ ./Classes/BaseViewController.h + + FeedDashboardViewController + UIViewController + + NewsBlurAppDelegate + UIToolbar + + + + appDelegate + NewsBlurAppDelegate + + + toolbar + UIToolbar + + + + IBProjectSource + ./Classes/FeedDashboardViewController.h + + FeedDetailViewController BaseViewController @@ -463,7 +484,6 @@ NewsBlurAppDelegate UITableView - UITableView UIToolbar @@ -475,10 +495,6 @@ menuTableView UITableView - - tableView - UITableView - toolbar UIToolbar @@ -522,6 +538,7 @@ UIView NewsBlurAppDelegate UIButton + UIImageView UIBarButtonItem UIToolbar UIButton @@ -548,6 +565,10 @@ googleReaderButton UIButton + + logo + UIImageView + nextButton UIBarButtonItem @@ -589,6 +610,8 @@ NewsBlurAppDelegate + UISegmentedControl + UISegmentedControl UILabel UILabel @@ -597,6 +620,14 @@ appDelegate NewsBlurAppDelegate + + fontSizeSegment + UISegmentedControl + + + fontStyleSegment + UISegmentedControl + largeFontSizeLabel UILabel @@ -770,6 +801,57 @@ ./Classes/LoginViewController.h + + MGSplitViewController + UIViewController + + id + id + id + id + + + + showMasterPopover: + id + + + toggleMasterBeforeDetail: + id + + + toggleMasterView: + id + + + toggleSplitOrientation: + id + + + + id + UIViewController + UIViewController + + + + delegate + id + + + detailViewController + UIViewController + + + masterViewController + UIViewController + + + + IBProjectSource + ./Classes/MGSplitViewController.h + + MoveSiteViewController UIViewController @@ -866,6 +948,7 @@ BaseViewController AddSiteViewController + FeedDashboardViewController FeedDetailViewController FeedsMenuViewController NewsBlurViewController @@ -876,7 +959,8 @@ MoveSiteViewController UINavigationController OriginalStoryViewController - UISplitViewController + ShareViewController + MGSplitViewController UINavigationController SplitStoryDetailViewController StoryDetailViewController @@ -887,6 +971,10 @@ addSiteViewController AddSiteViewController + + feedDashboardViewController + FeedDashboardViewController + feedDetailViewController FeedDetailViewController @@ -927,9 +1015,13 @@ originalStoryViewController OriginalStoryViewController + + shareViewController + ShareViewController + splitStoryController - UISplitViewController + MGSplitViewController splitStoryDetailNavigationController @@ -960,8 +1052,9 @@ id UIButton UIButton + UIButton id - id + id @@ -976,12 +1069,16 @@ sectionUntapped: UIButton + + sectionUntappedOutside: + UIButton + selectIntelligence id - - showMenuButton + + showMenuButton: id @@ -1116,19 +1213,88 @@ - SplitStoryDetailViewController + ShareViewController UIViewController - - appDelegate - NewsBlurAppDelegate - - - appDelegate - + + id + id + id + id + + + + doCancelButton: + id + + + doReplyToComment: + id + + + doShareThisStory: + id + + + doToggleButton: + id + + + + NewsBlurAppDelegate + UITextView + UIButton + UIBarButtonItem + UIBarButtonItem + UIButton + + + appDelegate NewsBlurAppDelegate + + commentField + UITextView + + + facebookButton + UIButton + + + submitButton + UIBarButtonItem + + + toolbarTitle + UIBarButtonItem + + + twitterButton + UIButton + + + + IBProjectSource + ./Classes/ShareViewController.h + + + SplitStoryDetailViewController + UIViewController + + NewsBlurAppDelegate + MGSplitViewController + + + + appDelegate + NewsBlurAppDelegate + + + splitController + MGSplitViewController + + IBProjectSource ./Classes/SplitStoryDetailViewController.h @@ -1138,11 +1304,16 @@ StoryDetailViewController UIViewController + id id id id + + doNextStory + id + doNextUnreadStory id @@ -1161,6 +1332,7 @@ NewsBlurAppDelegate UIBarButtonItem UIBarButtonItem + UIBarButtonItem UIBarButtonItem UIView UIPopoverController @@ -1185,6 +1357,10 @@ buttonNext UIBarButtonItem + + buttonNextStory + UIBarButtonItem + buttonPrevious UIBarButtonItem diff --git a/media/iphone/Classes/NewsBlurAppDelegate.m b/media/iphone/Classes/NewsBlurAppDelegate.m index aa6bbf8cf..1228e9b18 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.m +++ b/media/iphone/Classes/NewsBlurAppDelegate.m @@ -701,11 +701,24 @@ id feedId = [self.activeStory objectForKey:@"story_feed_id"]; NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId]; int activeIndex = [[activeFeedStoryLocations objectAtIndex:activeLocation] intValue]; - NSDictionary *feed = [self.dictFeeds objectForKey:feedIdStr]; - NSDictionary *story = [activeFeedStories objectAtIndex:activeIndex]; - if (self.activeFeed != feed) { - self.activeFeed = feed; + NSDictionary *feed; + + if (self.isSocialView) { + feed = [self.dictActiveFeeds objectForKey:feedIdStr]; + if (!feed) { + feed = [self.dictFeeds objectForKey:feedIdStr]; + } + } else { + feed = [self.dictFeeds objectForKey:feedIdStr]; } + + NSDictionary *story = [activeFeedStories objectAtIndex:activeIndex]; +// if (self.activeFeed != feed) { +// self.activeFeed = feed; +// } + + NSLog(@"feed is %@", feed); + NSLog(@"story is %@", story); [self.recentlyReadStories addObject:[NSNumber numberWithInt:activeLocation]]; [self markStoryRead:story feed:feed]; diff --git a/media/iphone/Classes/StoryDetailViewController.h b/media/iphone/Classes/StoryDetailViewController.h index 016684b22..e2413d490 100644 --- a/media/iphone/Classes/StoryDetailViewController.h +++ b/media/iphone/Classes/StoryDetailViewController.h @@ -9,6 +9,7 @@ #import @class NewsBlurAppDelegate; +@class ASIHTTPRequest; @interface StoryDetailViewController : UIViewController { NewsBlurAppDelegate *appDelegate; @@ -48,7 +49,8 @@ - (void)changeWebViewWidth:(int)width; - (void)refreshComments; -- (void)markedAsRead; +- (void)finishMarkAsRead:(ASIHTTPRequest *)request; +- (void)requestFailed:(ASIHTTPRequest *)request; - (void)setActiveStory; - (IBAction)toggleFontSize:(id)sender; - (void)setFontStyle:(NSString *)fontStyle; diff --git a/media/iphone/Classes/StoryDetailViewController.m b/media/iphone/Classes/StoryDetailViewController.m index 252e4a670..86cfcdcaf 100644 --- a/media/iphone/Classes/StoryDetailViewController.m +++ b/media/iphone/Classes/StoryDetailViewController.m @@ -15,6 +15,7 @@ #import "ASIFormDataRequest.h" #import "Base64.h" #import "Utilities.h" +#import "JSON.h" @implementation StoryDetailViewController @@ -534,25 +535,59 @@ shouldStartLoadWithRequest:(NSURLRequest *)request - (void)markStoryAsRead { if ([[appDelegate.activeStory objectForKey:@"read_status"] intValue] != 1) { + NSLog(@"appDelegate.activeStory %@", appDelegate.activeStory); [appDelegate markActiveStoryRead]; - NSString *urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_read", - NEWSBLUR_URL]; + NSString *urlString; + + if (appDelegate.isSocialView) { + urlString = [NSString stringWithFormat:@"http://%@/reader/mark_social_stories_as_read", + NEWSBLUR_URL]; + } else { + urlString = [NSString stringWithFormat:@"http://%@/reader/mark_story_as_read", + NEWSBLUR_URL]; + } + NSURL *url = [NSURL URLWithString:urlString]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; - [request setPostValue:[appDelegate.activeStory - objectForKey:@"id"] - forKey:@"story_id"]; - [request setPostValue:[appDelegate.activeStory - objectForKey:@"story_feed_id"] - forKey:@"feed_id"]; - [request setDidFinishSelector:@selector(markedAsRead)]; - [request setDidFailSelector:@selector(markedAsRead)]; + + if (appDelegate.isSocialView) { + NSString *usersFeedStoriesStr = [NSString stringWithFormat:@"{\"%@\":{\"%@\":[\"%@\"]}}", + [appDelegate.activeStory objectForKey:@"social_user_id"], + [appDelegate.activeStory objectForKey:@"story_feed_id"], + [appDelegate.activeStory objectForKey:@"id"]]; + + NSLog(@"usersFeedStoriesStr is %@", usersFeedStoriesStr); + + [request setPostValue:usersFeedStoriesStr forKey:@"users_feeds_stories"]; + } else { + [request setPostValue:[appDelegate.activeStory + objectForKey:@"id"] + forKey:@"story_id"]; + [request setPostValue:[appDelegate.activeStory + objectForKey:@"story_feed_id"] + forKey:@"feed_id"]; + } + + [request setDidFinishSelector:@selector(finishMarkAsRead:)]; + [request setDidFailSelector:@selector(finishedWithError:)]; [request setDelegate:self]; [request startAsynchronous]; } } +- (void)requestFailed:(ASIHTTPRequest *)request { + NSLog(@"Error in mark as read is %@", [request error]); +} + +- (void)finishMarkAsRead:(ASIHTTPRequest *)request { + NSString *responseString = [request responseString]; + NSDictionary *results = [[NSDictionary alloc] + initWithDictionary:[responseString JSONValue]]; + NSLog(@"results in mark as read is %@", results); + [results release]; +} + - (void)refreshComments { NSString *commentsString = [self getComments]; NSString *jsString = [[NSString alloc] initWithFormat:@ @@ -563,9 +598,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } -- (void)markedAsRead { - -} + - (IBAction)doNextUnreadStory { int nextIndex = [appDelegate indexOfNextUnreadStory]; diff --git a/media/iphone/Resources-iPhone/FeedDetailTableCell.xib b/media/iphone/Resources-iPhone/FeedDetailTableCell.xib index 0593a9c8e..0481862cf 100644 --- a/media/iphone/Resources-iPhone/FeedDetailTableCell.xib +++ b/media/iphone/Resources-iPhone/FeedDetailTableCell.xib @@ -48,10 +48,11 @@ YES - 291 - {{172, 44}, {119, 15}} + 289 + {{266, 44}, {184, 15}} + 1 MSAxIDEAA @@ -90,7 +91,7 @@ 290 - {{20, 7}, {271, 34}} + {{20, 7}, {431, 34}} @@ -131,7 +132,7 @@ 294 - {{20, 44}, {150, 15}} + {{20, 44}, {235, 15}} @@ -170,7 +171,7 @@ IBCocoaTouchFramework - {300, 63} + {460, 63} @@ -185,7 +186,7 @@ IBCocoaTouchFramework - {320, 64} + {480, 64} @@ -196,7 +197,7 @@ FeedDetailCellIdentifier - + 292 YES @@ -208,16 +209,20 @@ 292 - {{0, -1}, {320, 20}} + {{0, -1}, {481, 20}} + + _NS:196 IBCocoaTouchFramework - 292 - {{172, 59}, {119, 15}} + 289 + {{330, 64}, {119, 15}} + + YES 7 @@ -243,9 +248,10 @@ - 292 - {{20, 22}, {271, 34}} + 294 + {{20, 22}, {429, 34}} + YES @@ -274,6 +280,7 @@ 292 {{20, 59}, {150, 15}} + YES @@ -300,14 +307,16 @@ 292 {{2, 31}, {16, 16}} + NO NO IBCocoaTouchFramework - {300, 91} + {460, 91} + NO @@ -317,7 +326,9 @@ IBCocoaTouchFramework - {320, 92} + {480, 92} + + 1 @@ -433,8 +444,8 @@ YES - + @@ -464,10 +475,10 @@ YES - + diff --git a/media/iphone/Resources-iPhone/NewsBlurViewController.xib b/media/iphone/Resources-iPhone/NewsBlurViewController.xib index a5c34a627..384b6b127 100644 --- a/media/iphone/Resources-iPhone/NewsBlurViewController.xib +++ b/media/iphone/Resources-iPhone/NewsBlurViewController.xib @@ -153,6 +153,15 @@ 5 + + + NSImage + settings_icon.png + + IBCocoaTouchFramework + 1 + + @@ -213,6 +222,14 @@ 68 + + + homeButton + + + + 83 + dataSource @@ -245,6 +262,14 @@ 70 + + + showMenuButton: + + + + 84 + @@ -296,6 +321,7 @@ + @@ -328,6 +354,11 @@ + + 82 + + + @@ -346,6 +377,7 @@ 63.IBPluginDependency 79.IBPluginDependency 8.IBPluginDependency + 82.IBPluginDependency YES @@ -361,6 +393,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -375,7 +408,7 @@ - 81 + 84 @@ -1275,6 +1308,99 @@ ./Classes/LoginViewController.h + + MGSplitViewController + UIViewController + + YES + + YES + showMasterPopover: + toggleMasterBeforeDetail: + toggleMasterView: + toggleSplitOrientation: + + + YES + id + id + id + id + + + + YES + + YES + showMasterPopover: + toggleMasterBeforeDetail: + toggleMasterView: + toggleSplitOrientation: + + + YES + + showMasterPopover: + id + + + toggleMasterBeforeDetail: + id + + + toggleMasterView: + id + + + toggleSplitOrientation: + id + + + + + YES + + YES + delegate + detailViewController + masterViewController + + + YES + id + UIViewController + UIViewController + + + + YES + + YES + delegate + detailViewController + masterViewController + + + YES + + delegate + id + + + detailViewController + UIViewController + + + masterViewController + UIViewController + + + + + IBProjectSource + ./Classes/MGSplitViewController.h + + MoveSiteViewController UIViewController @@ -1465,7 +1591,7 @@ UINavigationController OriginalStoryViewController ShareViewController - UISplitViewController + MGSplitViewController UINavigationController SplitStoryDetailViewController StoryDetailViewController @@ -1551,7 +1677,7 @@ splitStoryController - UISplitViewController + MGSplitViewController splitStoryDetailNavigationController @@ -1588,7 +1714,7 @@ sectionUntapped: sectionUntappedOutside: selectIntelligence - showMenuButton + showMenuButton: YES @@ -1609,7 +1735,7 @@ sectionUntapped: sectionUntappedOutside: selectIntelligence - showMenuButton + showMenuButton: YES @@ -1634,7 +1760,7 @@ id - showMenuButton + showMenuButton: id @@ -1909,8 +2035,6 @@ appDelegate commentField facebookButton - siteFavicon - siteInformation submitButton toolbarTitle twitterButton @@ -1920,8 +2044,6 @@ NewsBlurAppDelegate UITextView UIButton - UIImageView - UILabel UIBarButtonItem UIBarButtonItem UIButton @@ -1934,8 +2056,6 @@ appDelegate commentField facebookButton - siteFavicon - siteInformation submitButton toolbarTitle twitterButton @@ -1954,14 +2074,6 @@ facebookButton UIButton - - siteFavicon - UIImageView - - - siteInformation - UILabel - submitButton UIBarButtonItem @@ -1985,14 +2097,35 @@ SplitStoryDetailViewController UIViewController - appDelegate - NewsBlurAppDelegate + YES + + YES + appDelegate + splitController + + + YES + NewsBlurAppDelegate + MGSplitViewController + - appDelegate - - appDelegate - NewsBlurAppDelegate + YES + + YES + appDelegate + splitController + + + YES + + appDelegate + NewsBlurAppDelegate + + + splitController + MGSplitViewController + @@ -2007,6 +2140,7 @@ YES YES + doNextStory doNextUnreadStory doPreviousStory toggleFontSize: @@ -2016,18 +2150,24 @@ id id id + id YES YES + doNextStory doNextUnreadStory doPreviousStory toggleFontSize: YES + + doNextStory + id + doNextUnreadStory id @@ -2050,6 +2190,7 @@ appDelegate buttonAction buttonNext + buttonNextStory buttonPrevious feedTitleGradient popoverController @@ -2064,6 +2205,7 @@ UIBarButtonItem UIBarButtonItem UIBarButtonItem + UIBarButtonItem UIView UIPopoverController UIProgressView @@ -2079,6 +2221,7 @@ appDelegate buttonAction buttonNext + buttonNextStory buttonPrevious feedTitleGradient popoverController @@ -2104,6 +2247,10 @@ buttonNext UIBarButtonItem + + buttonNextStory + UIBarButtonItem + buttonPrevious UIBarButtonItem @@ -2150,8 +2297,17 @@ YES 3 - 16-List.png - {16, 16} + YES + + YES + 16-List.png + settings_icon.png + + + YES + {16, 16} + {19, 20} + 1181 diff --git a/media/iphone/Resources-iPhone/StoryDetailViewController.xib b/media/iphone/Resources-iPhone/StoryDetailViewController.xib index 36661aa76..c46be6c62 100644 --- a/media/iphone/Resources-iPhone/StoryDetailViewController.xib +++ b/media/iphone/Resources-iPhone/StoryDetailViewController.xib @@ -4458,7 +4458,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 290 - {{132, 17}, {56, 11}} + {{112, 17}, {56, 11}} NO @@ -4514,6 +4514,15 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 20 + + + NSImage + 06-arrow-south.png + + IBCocoaTouchFramework + 1 + + Next unread IBCocoaTouchFramework @@ -4626,6 +4635,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 58 + + + doNextStory + + + + 74 + @@ -4671,6 +4688,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + @@ -4723,6 +4741,11 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + + 73 + + + @@ -4744,6 +4767,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 48.IBPluginDependency 63.IBPluginDependency 64.IBPluginDependency + 73.IBPluginDependency YES @@ -4762,6 +4786,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -4776,7 +4801,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - 71 + 74 @@ -6664,6 +6689,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES 3 + + 06-arrow-south.png + {10, 12} + 1181