diff --git a/media/iphone/Classes/ActivityModule.h b/media/iphone/Classes/ActivityModule.h new file mode 100644 index 000000000..a34bd15e4 --- /dev/null +++ b/media/iphone/Classes/ActivityModule.h @@ -0,0 +1,31 @@ +// +// ActivityModule.h +// NewsBlur +// +// Created by Roy Yang on 7/11/12. +// Copyright (c) 2012 NewsBlur. All rights reserved. +// + +#import + +@class NewsBlurAppDelegate; +@class ASIHTTPRequest; + +@interface ActivityModule : UIView + { + NewsBlurAppDelegate *appDelegate; + UITableView *activitiesTable; + NSArray *activitiesArray; + + BOOL isSelf; +} + +@property (nonatomic, retain) NewsBlurAppDelegate *appDelegate; +@property (nonatomic, retain) UITableView *activitiesTable; +@property (nonatomic, retain) NSArray *activitiesArray; +@property (nonatomic, readwrite) BOOL isSelf; + +- (void)refreshWithActivities:(NSArray *)activities asSelf:(BOOL)asSelf; + +@end diff --git a/media/iphone/Classes/ActivityModule.m b/media/iphone/Classes/ActivityModule.m new file mode 100644 index 000000000..144320911 --- /dev/null +++ b/media/iphone/Classes/ActivityModule.m @@ -0,0 +1,123 @@ +// +// ActivityModule.m +// NewsBlur +// +// Created by Roy Yang on 7/11/12. +// Copyright (c) 2012 NewsBlur. All rights reserved. +// + +#import "ActivityModule.h" +#import "NewsBlurAppDelegate.h" +#import "Utilities.h" +#import "ASIHTTPRequest.h" +#import "JSON.h" + +@implementation ActivityModule + +@synthesize appDelegate; +@synthesize activitiesTable; +@synthesize activitiesArray; +@synthesize isSelf; + + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + } + return self; +} + +- (void)dealloc { + [appDelegate release]; + [activitiesTable release]; + [activitiesArray release]; + [super dealloc]; +} + +- (void)layoutSubviews { + [super layoutSubviews]; +} + + +- (void)refreshWithActivities:(NSArray *)activities asSelf:(BOOL)asSelf { + self.isSelf = asSelf; + self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate]; + self.activitiesArray = activities; + + self.activitiesTable = [[[UITableView alloc] init] autorelease]; + self.activitiesTable.dataSource = self; + self.activitiesTable.delegate = self; + self.activitiesTable.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); + + [self addSubview:self.activitiesTable]; + [self.activitiesTable reloadData]; +} + +#pragma mark - +#pragma mark Table View - Interactions List + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + int activitesCount = [self.activitiesArray count]; + if (activitesCount) { + return activitesCount; + } else { + return 0; + } +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:CellIdentifier] autorelease]; + } + + int activitesCount = [self.activitiesArray count]; + if (activitesCount) { + + NSDictionary *activity = [self.activitiesArray objectAtIndex:indexPath.row]; + NSString *category = [activity objectForKey:@"category"]; + NSString *content = [activity objectForKey:@"content"]; + NSString *title = [activity objectForKey:@"title"]; + NSString *username = self.isSelf ? @"You" : @"Stub for username"; + NSString *withUserUsername = [[activity objectForKey:@"with_user"] objectForKey:@"username"]; + + + if ([category isEqualToString:@"follow"]) { + cell.textLabel.text = [NSString stringWithFormat:@"%@ followed %@", username, withUserUsername]; + + } else if ([category isEqualToString:@"comment_reply"]) { + cell.textLabel.text = [NSString stringWithFormat:@"%@ replied to %@", username, withUserUsername]; + + } else if ([category isEqualToString:@"sharedstory"]) { + cell.textLabel.text = [NSString stringWithFormat:@"%@ shared %@ : %@", username, title, content]; + + // star and feedsub are always private. + } else if ([category isEqualToString:@"star"]) { + cell.textLabel.text = [NSString stringWithFormat:@"You saved %@", content]; + + } else if ([category isEqualToString:@"feedsub"]) { + + cell.textLabel.text = [NSString stringWithFormat:@"You subscribed to %@", content]; + } + + cell.textLabel.font = [UIFont systemFontOfSize:13]; + } + + return cell; +} + + + +@end diff --git a/media/iphone/Classes/DashboardViewController.h b/media/iphone/Classes/DashboardViewController.h index c2d99a596..11d768a2c 100644 --- a/media/iphone/Classes/DashboardViewController.h +++ b/media/iphone/Classes/DashboardViewController.h @@ -25,6 +25,8 @@ - (IBAction)doLogout:(id)sender; - (void)refreshInteractions; +- (void)refreshActivity; - (void)finishLoadInteractions:(ASIHTTPRequest *)request; +- (void)finishLoadActivities:(ASIHTTPRequest *)request; - (void)requestFailed:(ASIHTTPRequest *)request; @end diff --git a/media/iphone/Classes/DashboardViewController.m b/media/iphone/Classes/DashboardViewController.m index 6fbe38af9..f54b7dc52 100644 --- a/media/iphone/Classes/DashboardViewController.m +++ b/media/iphone/Classes/DashboardViewController.m @@ -8,6 +8,7 @@ #import "DashboardViewController.h" #import "NewsBlurAppDelegate.h" +#import "ActivityModule.h" #import "JSON.h" @implementation DashboardViewController @@ -77,14 +78,42 @@ [request startAsynchronous]; } +- (void)refreshActivity { + NSString *urlString = [NSString stringWithFormat:@"http://%@/social/profile?user_id=%@", + NEWSBLUR_URL, + [appDelegate.dictUserProfile objectForKey:@"user_id"]]; + + NSURL *url = [NSURL URLWithString:urlString]; + ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; + [request setDidFinishSelector:@selector(finishLoadActivities:)]; + [request setDidFailSelector:@selector(requestFailed:)]; + [request setDelegate:self]; + [request startAsynchronous]; +} + +- (void)finishLoadActivities:(ASIHTTPRequest *)request { + NSString *responseString = [request responseString]; + NSDictionary *results = [[NSDictionary alloc] + initWithDictionary:[responseString JSONValue]]; + + appDelegate.dictUserActivity = [results objectForKey:@"activities"]; + [results release]; + + ActivityModule *activity = [[ActivityModule alloc] init]; + activity.frame = CGRectMake(20, 510, 438, 300); + activity.backgroundColor = [UIColor redColor]; + [activity refreshWithActivities:appDelegate.dictUserActivity asSelf:YES]; + [self.view addSubview:activity]; + [activity release]; +} + + - (void)finishLoadInteractions:(ASIHTTPRequest *)request { NSString *responseString = [request responseString]; NSDictionary *results = [[NSDictionary alloc] initWithDictionary:[responseString JSONValue]]; appDelegate.dictUserInteractions = [results objectForKey:@"interactions"]; - - NSLog(@"appDelegate.dictUserInteractions finishLoadInteractions is %i", [appDelegate.dictUserInteractions count]); [results release]; [self.interactionsTable reloadData]; } diff --git a/media/iphone/Classes/NewsBlurAppDelegate.h b/media/iphone/Classes/NewsBlurAppDelegate.h index d314d3dac..230ad1cef 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.h +++ b/media/iphone/Classes/NewsBlurAppDelegate.h @@ -94,6 +94,7 @@ NSDictionary * dictSocialFeeds; NSDictionary * dictUserProfile; NSMutableArray * dictUserInteractions; + NSMutableArray * dictUserActivity; NSMutableArray * dictFoldersArray; } @@ -152,6 +153,7 @@ @property (nonatomic, retain) NSDictionary *dictSocialFeeds; @property (nonatomic, retain) NSDictionary *dictUserProfile; @property (nonatomic, retain) NSMutableArray *dictUserInteractions; +@property (nonatomic, retain) NSMutableArray *dictUserActivity; @property (nonatomic, retain) NSMutableArray *dictFoldersArray; + (NewsBlurAppDelegate*) sharedAppDelegate; diff --git a/media/iphone/Classes/NewsBlurAppDelegate.m b/media/iphone/Classes/NewsBlurAppDelegate.m index 59c3f3bf9..2b930541b 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.m +++ b/media/iphone/Classes/NewsBlurAppDelegate.m @@ -85,6 +85,7 @@ @synthesize dictSocialFeeds; @synthesize dictUserProfile; @synthesize dictUserInteractions; +@synthesize dictUserActivity; @synthesize dictFoldersArray; + (NewsBlurAppDelegate*) sharedAppDelegate { @@ -172,6 +173,7 @@ [dictSocialFeeds release]; [dictUserProfile release]; [dictUserInteractions release]; + [dictUserActivity release]; [dictFoldersArray release]; [super dealloc]; @@ -689,7 +691,10 @@ - (void)hideStoryDetailView { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - [self.splitStoryDetailNavigationController popViewControllerAnimated:YES]; + [self.splitStoryDetailNavigationController popToRootViewControllerAnimated:YES]; + [self.navigationController popToRootViewControllerAnimated:YES]; + } else { + [self.navigationController popViewControllerAnimated:YES]; } } diff --git a/media/iphone/Classes/NewsBlurViewController.m b/media/iphone/Classes/NewsBlurViewController.m index 563aaba62..e2089cb17 100644 --- a/media/iphone/Classes/NewsBlurViewController.m +++ b/media/iphone/Classes/NewsBlurViewController.m @@ -20,7 +20,7 @@ #define kTableViewRowHeight 40; -#define kBlurblogTableViewRowHeight 45; +#define kBlurblogTableViewRowHeight 46; @implementation NewsBlurViewController @@ -109,9 +109,9 @@ [self.intelligenceControl setImage:[UIImage imageNamed:@"16-List.png"] forSegmentAtIndex:0]; - [self.intelligenceControl setImage:[UIImage imageNamed:@"unread.png"] + [self.intelligenceControl setImage:[UIImage imageNamed:@"unread_color.png"] forSegmentAtIndex:1]; - [self.intelligenceControl setImage:[UIImage imageNamed:@"focused.png"] + [self.intelligenceControl setImage:[UIImage imageNamed:@"focused_color.png"] forSegmentAtIndex:2]; [self.intelligenceControl addTarget:self action:@selector(selectIntelligence) @@ -259,11 +259,12 @@ //} + // adding user avatar to left NSString *url = [NSString stringWithFormat:@"%@", [[results objectForKey:@"social_profile"] objectForKey:@"photo_url"]]; NSURL * imageURL = [NSURL URLWithString:url]; NSData * imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage * userAvatarImage = [UIImage imageWithData:imageData]; - userAvatarImage = [self roundCorneredImage:userAvatarImage radius:6]; + userAvatarImage = [Utilities roundCorneredImage:userAvatarImage radius:6]; UIButton *userAvatarButton = [UIButton buttonWithType:UIButtonTypeCustom]; userAvatarButton.bounds = CGRectMake(0, 0, 32, 32); @@ -273,17 +274,29 @@ initWithCustomView:userAvatarButton]; self.navigationItem.leftBarButtonItem = userAvatar; - [userAvatar release]; + + // adding settings button to right + +// UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] init]; +// +// settingsButton.title = @"\u2699"; +// UIFont *f1 = [UIFont fontWithName:@"Helvetica" size:24.0]; +// NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:f1, UITextAttributeFont, nil]; +// [settingsButton setTitleTextAttributes:dict forState:UIControlStateNormal]; +// +// self.navigationItem.rightBarButtonItem = settingsButton; +// [settingsButton release]; NSMutableDictionary *sortedFolders = [[NSMutableDictionary alloc] init]; NSArray *sortedArray; - // Set up dictUserProfile + // Set up dictUserProfile and dictUserActivity appDelegate.dictUserProfile = [results objectForKey:@"social_profile"]; + appDelegate.dictUserActivity = [results objectForKey:@"activities"]; [appDelegate.dashboardViewController refreshInteractions]; - - + [appDelegate.dashboardViewController refreshActivity]; + // Set up dictSocialFeeds NSArray *socialFeedsArray = [results objectForKey:@"social_feeds"]; NSMutableArray *socialFolder = [[NSMutableArray alloc] init]; @@ -572,9 +585,9 @@ int headerLabelHeight, folderImageViewY, disclosureImageViewY; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { - headerLabelHeight = 30; - folderImageViewY = 7; - disclosureImageViewY = 8; + headerLabelHeight = 24; + folderImageViewY = 4; + disclosureImageViewY = 5; } else { headerLabelHeight = 20; folderImageViewY = 2; @@ -675,7 +688,7 @@ // return 0; // } if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){ - return 31; + return 25; }else{ return 21; } @@ -954,7 +967,7 @@ NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage *faviconImage = [UIImage imageWithData:imageData]; - faviconImage = [self roundCorneredImage:faviconImage radius:6]; + faviconImage = [Utilities roundCorneredImage:faviconImage radius:6]; [Utilities saveImage:faviconImage feedId:feed_id]; } @@ -967,15 +980,7 @@ }); } -- (UIImage *)roundCorneredImage: (UIImage*) orig radius:(CGFloat) r { - UIGraphicsBeginImageContextWithOptions(orig.size, NO, 0); - [[UIBezierPath bezierPathWithRoundedRect:(CGRect){CGPointZero, orig.size} - cornerRadius:r] addClip]; - [orig drawInRect:(CGRect){CGPointZero, orig.size}]; - UIImage* result = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return result; -} + - (void)saveAndDrawFavicons:(ASIHTTPRequest *)request { NSString *responseString = [request responseString]; diff --git a/media/iphone/Classes/ProfileBadge.m b/media/iphone/Classes/ProfileBadge.m index cb695cfd5..206fd74a3 100644 --- a/media/iphone/Classes/ProfileBadge.m +++ b/media/iphone/Classes/ProfileBadge.m @@ -72,7 +72,7 @@ int yCoordinatePointer = 0; // USERNAME - UILabel *user = [[UILabel alloc] initWithFrame:CGRectMake(120,10,230,20)]; + UILabel *user = [[UILabel alloc] initWithFrame:CGRectMake(120, 10, 190, 20)]; user.text = [profile objectForKey:@"username"]; user.textColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:1.0]; user.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; @@ -107,6 +107,20 @@ bio.text = [profile objectForKey:@"bio"]; bio.textColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:1.0]; bio.font = [UIFont fontWithName:@"Helvetica" size:12]; + bio.lineBreakMode = UILineBreakModeTailTruncation; + bio.numberOfLines = 2; + + + // Calculate the expected size based on the font and linebreak mode of your label + CGSize maximumLabelSize = CGSizeMake(190, 40); + CGSize expectedLabelSize = [[profile objectForKey:@"bio"] + sizeWithFont:bio.font + constrainedToSize:maximumLabelSize + lineBreakMode:bio.lineBreakMode]; + CGRect newFrame = bio.frame; + newFrame.size.height = expectedLabelSize.height; + bio.frame = newFrame; + self.userDescription = bio; [self addSubview:self.userDescription]; [bio release]; @@ -121,6 +135,8 @@ [[profile objectForKey:@"follower_count"] intValue] == 1 ? @"" : @"s"]; stats.text = statsStr; stats.font = [UIFont fontWithName:@"Helvetica" size:10]; + stats.textColor = UIColorFromRGB(0xAE5D15); + self.userStats = stats; [self addSubview:self.userStats]; [stats release]; @@ -133,13 +149,14 @@ } if ([photo_url rangeOfString:@"twimg"].location != NSNotFound) { - photo_url = [photo_url stringByReplacingOccurrencesOfString:@"_normal" withString:@""]; + photo_url = [photo_url stringByReplacingOccurrencesOfString:@"_normal" withString:@"_bigger"]; } NSURL *imageURL = [NSURL URLWithString:photo_url]; NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; UIImage *image = [UIImage imageWithData:imageData]; - UIImageView *avatar = [[UIImageView alloc] initWithImage:image]; + image = [Utilities roundCorneredImage:image radius:6]; + UIImageView *avatar = [[UIImageView alloc] initWithImage:image]; avatar.frame = CGRectMake(10, 10, 100, 100); self.userAvatar = avatar; [self addSubview:self.userAvatar]; @@ -147,7 +164,7 @@ // FOLLOW BUTTON UIButton *follow = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - follow.frame = CGRectMake(120, 80, 100, 30); + follow.frame = CGRectMake(120, 83, 100, 30); // check if self NSString *currentUserId = [NSString stringWithFormat:@"%@", [self.appDelegate.dictUserProfile objectForKey:@"user_id"]]; diff --git a/media/iphone/Classes/StoryDetailViewController.m b/media/iphone/Classes/StoryDetailViewController.m index 375de2768..8e859ce8e 100644 --- a/media/iphone/Classes/StoryDetailViewController.m +++ b/media/iphone/Classes/StoryDetailViewController.m @@ -317,16 +317,21 @@ for (int i = 0; i < replies.count; i++) { NSDictionary *reply_dict = [replies objectAtIndex:i]; NSDictionary *user = [self getUser:[[reply_dict objectForKey:@"user_id"] intValue]]; + NSString *editStr = [NSString stringWithFormat:@ + "
" + "
edit
" + "
"]; + NSString *reply = [NSString stringWithFormat:@ "
" - " " + " " + " " + " " "
%@
" "
%@ ago
" - "
" - "
edit
" - "
" "
%@
" "
", + [user objectForKey:@"user_id"], [user objectForKey:@"photo_url"], [user objectForKey:@"username"], [reply_dict objectForKey:@"publish_date"], diff --git a/media/iphone/Classes/UserProfileViewController.h b/media/iphone/Classes/UserProfileViewController.h index 92b0cd577..1e4278392 100644 --- a/media/iphone/Classes/UserProfileViewController.h +++ b/media/iphone/Classes/UserProfileViewController.h @@ -11,6 +11,7 @@ @class NewsBlurAppDelegate; @class ProfileBadge; +@class ActivityModule; @interface UserProfileViewController : UIViewController { NewsBlurAppDelegate *appDelegate; @@ -18,13 +19,12 @@ UILabel *followingCount; UILabel *followersCount; ProfileBadge *profileBadge; + ActivityModule *activityModule; } -@property (retain, nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate; -@property (retain, nonatomic) IBOutlet ProfileBadge *profileBadge; - -@property (retain, nonatomic) IBOutlet UILabel *followingCount; -@property (retain, nonatomic) IBOutlet UILabel *followersCount; +@property (retain, nonatomic) NewsBlurAppDelegate *appDelegate; +@property (retain, nonatomic) ProfileBadge *profileBadge; +@property (retain, nonatomic) ActivityModule *activityModule; - (void)getUserProfile; - (void)requestFinished:(ASIHTTPRequest *)request; diff --git a/media/iphone/Classes/UserProfileViewController.m b/media/iphone/Classes/UserProfileViewController.m index de74bbae1..47c301cd8 100644 --- a/media/iphone/Classes/UserProfileViewController.m +++ b/media/iphone/Classes/UserProfileViewController.m @@ -11,15 +11,15 @@ #import "ASIHTTPRequest.h" #import "JSON.h" #import "ProfileBadge.h" +#import "ActivityModule.h" #import "Utilities.h" #import "MBProgressHUD.h" @implementation UserProfileViewController @synthesize appDelegate; -@synthesize followingCount; -@synthesize followersCount; @synthesize profileBadge; +@synthesize activityModule; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { @@ -38,16 +38,22 @@ ProfileBadge *badge = [[ProfileBadge alloc] init]; badge.frame = CGRectMake(0, 0, 320, 140); self.profileBadge = badge; + + ActivityModule *activity = [[ActivityModule alloc] init]; + activity.frame = CGRectMake(0, badge.frame.size.height, 320, 300); + self.activityModule = activity; self.view.frame = CGRectMake(0, 0, 320, 500); + self.view.backgroundColor = [UIColor whiteColor]; [self.view addSubview:self.profileBadge]; + [badge release]; + [activity release]; } - (void)viewDidUnload { - [self setFollowingCount:nil]; - [self setFollowersCount:nil]; + [self setActivityModule:nil]; [self setProfileBadge:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. @@ -65,9 +71,8 @@ - (void)dealloc { [appDelegate release]; - [followingCount release]; - [followersCount release]; [profileBadge release]; + [activityModule release]; [super dealloc]; } @@ -78,10 +83,10 @@ - (void)getUserProfile { [MBProgressHUD hideHUDForView:self.view animated:YES]; MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; - HUD.labelText = @"Finding..."; + HUD.labelText = @"Profiling..."; [self.profileBadge initProfile]; - NSString *urlString = [NSString stringWithFormat:@"http://%@/social/settings/%@", + NSString *urlString = [NSString stringWithFormat:@"http://%@/social/profile?user_id=%@", NEWSBLUR_URL, appDelegate.activeUserProfileId]; NSURL *url = [NSURL URLWithString:urlString]; @@ -107,8 +112,9 @@ } [MBProgressHUD hideHUDForView:self.view animated:YES]; - [self.profileBadge refreshWithProfile:results]; - + [self.profileBadge refreshWithProfile:[results objectForKey:@"user_profile"]]; + [self.activityModule refreshWithActivities:[results objectForKey:@"activities"]]; + [results release]; } diff --git a/media/iphone/Classes/Utilities.h b/media/iphone/Classes/Utilities.h index 456a16415..e0f61d4a3 100644 --- a/media/iphone/Classes/Utilities.h +++ b/media/iphone/Classes/Utilities.h @@ -15,5 +15,6 @@ + (void)saveImage:(UIImage *)image feedId:(NSString *)filename; + (UIImage *)getImage:(NSString *)filename; + (void)saveimagesToDisk; ++ (UIImage *)roundCorneredImage:(UIImage *)orig radius:(CGFloat)r; @end diff --git a/media/iphone/Classes/Utilities.m b/media/iphone/Classes/Utilities.m index 030e8598e..24351885b 100644 --- a/media/iphone/Classes/Utilities.m +++ b/media/iphone/Classes/Utilities.m @@ -58,4 +58,14 @@ static NSMutableDictionary *imageCache; } copy] autorelease]); } ++ (UIImage *)roundCorneredImage: (UIImage*) orig radius:(CGFloat) r { + UIGraphicsBeginImageContextWithOptions(orig.size, NO, 0); + [[UIBezierPath bezierPathWithRoundedRect:(CGRect){CGPointZero, orig.size} + cornerRadius:r] addClip]; + [orig drawInRect:(CGRect){CGPointZero, orig.size}]; + UIImage* result = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return result; +} + @end \ No newline at end of file diff --git a/media/iphone/NewsBlur.xcodeproj/project.pbxproj b/media/iphone/NewsBlur.xcodeproj/project.pbxproj index c9172ad04..be968cc52 100755 --- a/media/iphone/NewsBlur.xcodeproj/project.pbxproj +++ b/media/iphone/NewsBlur.xcodeproj/project.pbxproj @@ -115,6 +115,11 @@ 437F975E15ACF5D20007136B /* read@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F975815ACF5D20007136B /* read@2x.png */; }; 437F975F15ACF5D20007136B /* unread.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F975915ACF5D20007136B /* unread.png */; }; 437F976015ACF5D20007136B /* unread@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F975A15ACF5D20007136B /* unread@2x.png */; }; + 437F976915ADFD980007136B /* focused_color.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F976515ADFD980007136B /* focused_color.png */; }; + 437F976A15ADFD980007136B /* focused_color@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F976615ADFD980007136B /* focused_color@2x.png */; }; + 437F976B15ADFD980007136B /* unread_color.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F976715ADFD980007136B /* unread_color.png */; }; + 437F976C15ADFD980007136B /* unread_color@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 437F976815ADFD980007136B /* unread_color@2x.png */; }; + 437F976F15AE21290007136B /* ActivityModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 437F976E15AE21280007136B /* ActivityModule.m */; }; 4389E9E9159B931900BEA604 /* Screen Shot 2012-06-27 at 12.14.10 PM.png in Resources */ = {isa = PBXBuildFile; fileRef = 4389E9E8159B931900BEA604 /* Screen Shot 2012-06-27 at 12.14.10 PM.png */; }; 438F525D159B65E200211B65 /* 16-List.png in Resources */ = {isa = PBXBuildFile; fileRef = 438F525B159B65E200211B65 /* 16-List.png */; }; 438F5262159B6F8C00211B65 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 438F5261159B6F0400211B65 /* MBProgressHUD.m */; }; @@ -373,6 +378,12 @@ 437F975815ACF5D20007136B /* read@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "read@2x.png"; sourceTree = ""; }; 437F975915ACF5D20007136B /* unread.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unread.png; sourceTree = ""; }; 437F975A15ACF5D20007136B /* unread@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unread@2x.png"; sourceTree = ""; }; + 437F976515ADFD980007136B /* focused_color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = focused_color.png; sourceTree = ""; }; + 437F976615ADFD980007136B /* focused_color@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "focused_color@2x.png"; sourceTree = ""; }; + 437F976715ADFD980007136B /* unread_color.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unread_color.png; sourceTree = ""; }; + 437F976815ADFD980007136B /* unread_color@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unread_color@2x.png"; sourceTree = ""; }; + 437F976D15AE21280007136B /* ActivityModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityModule.h; sourceTree = ""; }; + 437F976E15AE21280007136B /* ActivityModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActivityModule.m; sourceTree = ""; }; 4389E9E8159B931900BEA604 /* Screen Shot 2012-06-27 at 12.14.10 PM.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Screen Shot 2012-06-27 at 12.14.10 PM.png"; sourceTree = ""; }; 438F525B159B65E200211B65 /* 16-List.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "16-List.png"; sourceTree = ""; }; 438F5260159B6F0400211B65 /* MBProgressHUD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = ""; }; @@ -773,6 +784,8 @@ 431B856C15A0D91E00DCE497 /* UserProfileViewController.m */, 431B857F15A23C6B00DCE497 /* ProfileBadge.h */, 431B858015A23C6B00DCE497 /* ProfileBadge.m */, + 437F976D15AE21280007136B /* ActivityModule.h */, + 437F976E15AE21280007136B /* ActivityModule.m */, ); name = Social; sourceTree = ""; @@ -840,6 +853,10 @@ 431B857615A132B600DCE497 /* Images */ = { isa = PBXGroup; children = ( + 437F976515ADFD980007136B /* focused_color.png */, + 437F976615ADFD980007136B /* focused_color@2x.png */, + 437F976715ADFD980007136B /* unread_color.png */, + 437F976815ADFD980007136B /* unread_color@2x.png */, 437F975515ACF5D20007136B /* focused.png */, 437F975615ACF5D20007136B /* focused@2x.png */, 437F975715ACF5D20007136B /* read.png */, @@ -1606,6 +1623,10 @@ 437F975E15ACF5D20007136B /* read@2x.png in Resources */, 437F975F15ACF5D20007136B /* unread.png in Resources */, 437F976015ACF5D20007136B /* unread@2x.png in Resources */, + 437F976915ADFD980007136B /* focused_color.png in Resources */, + 437F976A15ADFD980007136B /* focused_color@2x.png in Resources */, + 437F976B15ADFD980007136B /* unread_color.png in Resources */, + 437F976C15ADFD980007136B /* unread_color@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1725,6 +1746,7 @@ 431B856E15A0D91E00DCE497 /* UserProfileViewController.m in Sources */, 431B858115A23C6B00DCE497 /* ProfileBadge.m in Sources */, 437F974C15ACA0ED0007136B /* DashboardViewController.m in Sources */, + 437F976F15AE21290007136B /* ActivityModule.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/media/iphone/Resources-iPad/Classes/FeedDetailViewController~ipad.xib b/media/iphone/Resources-iPad/Classes/FeedDetailViewController~ipad.xib index e6964927d..91e5d32ab 100644 --- a/media/iphone/Resources-iPad/Classes/FeedDetailViewController~ipad.xib +++ b/media/iphone/Resources-iPad/Classes/FeedDetailViewController~ipad.xib @@ -73,7 +73,6 @@ {{0, 960}, {320, 44}} - 1 MC4yMjcwMjkxMjggMC4zNjIxMzU3NzY0IDAuNDU2NTIxNzM5MQA @@ -216,8 +215,8 @@ YES - + @@ -526,6 +525,64 @@ ./Classes/BaseViewController.h + + DashboardViewController + UIViewController + + doLogout: + id + + + doLogout: + + doLogout: + id + + + + YES + + YES + appDelegate + bottomToolbar + interactionsTable + + + YES + NewsBlurAppDelegate + UIToolbar + UITableView + + + + YES + + YES + appDelegate + bottomToolbar + interactionsTable + + + YES + + appDelegate + NewsBlurAppDelegate + + + bottomToolbar + UIToolbar + + + interactionsTable + UITableView + + + + + IBProjectSource + ./Classes/DashboardViewController.h + + FeedDashboardViewController UIViewController @@ -1526,6 +1583,7 @@ YES addSiteViewController + dashboardViewController feedDashboardViewController feedDetailViewController feedsMenuViewController @@ -1542,7 +1600,6 @@ shareViewController splitStoryController splitStoryDetailNavigationController - splitStoryDetailViewController storyDetailViewController userProfileViewController window @@ -1550,6 +1607,7 @@ YES AddSiteViewController + DashboardViewController FeedDashboardViewController FeedDetailViewController FeedsMenuViewController @@ -1566,7 +1624,6 @@ ShareViewController MGSplitViewController UINavigationController - SplitStoryDetailViewController StoryDetailViewController UserProfileViewController UIWindow @@ -1577,6 +1634,7 @@ YES addSiteViewController + dashboardViewController feedDashboardViewController feedDetailViewController feedsMenuViewController @@ -1593,7 +1651,6 @@ shareViewController splitStoryController splitStoryDetailNavigationController - splitStoryDetailViewController storyDetailViewController userProfileViewController window @@ -1604,6 +1661,10 @@ addSiteViewController AddSiteViewController + + dashboardViewController + DashboardViewController + feedDashboardViewController FeedDashboardViewController @@ -1668,10 +1729,6 @@ splitStoryDetailNavigationController UINavigationController - - splitStoryDetailViewController - SplitStoryDetailViewController - storyDetailViewController StoryDetailViewController @@ -1954,6 +2011,25 @@ ./Classes/OriginalStoryViewController.h + + ProfileBadge + UIView + + doFollowButton: + id + + + doFollowButton: + + doFollowButton: + id + + + + IBProjectSource + ./Classes/ProfileBadge.h + + ShareViewController UIViewController @@ -2068,83 +2144,6 @@ ./Classes/ShareViewController.h - - SocialBadge - UIView - - doFollowButton: - id - - - doFollowButton: - - doFollowButton: - id - - - - IBProjectSource - ./Classes/SocialBadge.h - - - - SplitStoryDetailViewController - UIViewController - - doLogoutButton: - id - - - doLogoutButton: - - doLogoutButton: - id - - - - YES - - YES - appDelegate - bottomToolbar - scrollView - - - YES - NewsBlurAppDelegate - UIToolbar - UIScrollView - - - - YES - - YES - appDelegate - bottomToolbar - scrollView - - - YES - - appDelegate - NewsBlurAppDelegate - - - bottomToolbar - UIToolbar - - - scrollView - UIScrollView - - - - - IBProjectSource - ./Classes/SplitStoryDetailViewController.h - - StoryDetailViewController UIViewController @@ -2304,14 +2303,14 @@ appDelegate followersCount followingCount - socialBadge + profileBadge YES NewsBlurAppDelegate UILabel UILabel - SocialBadge + ProfileBadge @@ -2321,7 +2320,7 @@ appDelegate followersCount followingCount - socialBadge + profileBadge YES @@ -2338,8 +2337,8 @@ UILabel - socialBadge - SocialBadge + profileBadge + ProfileBadge diff --git a/media/iphone/Resources/focused_color.png b/media/iphone/Resources/focused_color.png new file mode 100644 index 000000000..000d53ec2 Binary files /dev/null and b/media/iphone/Resources/focused_color.png differ diff --git a/media/iphone/Resources/focused_color@2x.png b/media/iphone/Resources/focused_color@2x.png new file mode 100644 index 000000000..c1ea635ec Binary files /dev/null and b/media/iphone/Resources/focused_color@2x.png differ diff --git a/media/iphone/Resources/unread_color.png b/media/iphone/Resources/unread_color.png new file mode 100644 index 000000000..d6f6b9835 Binary files /dev/null and b/media/iphone/Resources/unread_color.png differ diff --git a/media/iphone/Resources/unread_color@2x.png b/media/iphone/Resources/unread_color@2x.png new file mode 100644 index 000000000..d23666e7f Binary files /dev/null and b/media/iphone/Resources/unread_color@2x.png differ diff --git a/media/iphone/sample_text.html b/media/iphone/sample_text.html index afd16d362..8924e3f3e 100644 --- a/media/iphone/sample_text.html +++ b/media/iphone/sample_text.html @@ -1,2 +1 @@ - -
Don’t be glum, Lisa! Why not re-read one of your favorite...


Don’t be glum, Lisa! Why not re-read one of your favorite books?

Shared by 2 people
Shared by:
Post to Blurblog
\ No newline at end of file +
New work is fun work.


New work is fun work.

Shared by 4 people
Shared by:
samuel
3 hours ago
reply
Oh snap. Oh snap. Oh snap.
mgeraci
3 hours ago
daaaaamn
silent__thought
2 hours ago
Need iOS love. :(
samuel
2 hours ago
I'll see what I can do about that. iOS is sitting behind me. Shhh, big news coming in a couple days (as soon as I launch this thing).
smadin
3 hours ago
reply
iiiinteresting.
roy
3 hours ago
reply
A screenshot is worth a thousand words!
Post to Blurblog
\ No newline at end of file diff --git a/media/iphone/storyDetailView.css b/media/iphone/storyDetailView.css index 06efc41fb..c0deb8b68 100644 --- a/media/iphone/storyDetailView.css +++ b/media/iphone/storyDetailView.css @@ -267,6 +267,10 @@ div + p { clear: both; } +#story_pane .nb-feed-story-comments { + max-width: none; +} + .NB-story-title { clear: left; margin: 8px 0 4px; diff --git a/media/iphone/storyDetailView.js b/media/iphone/storyDetailView.js index 63717b564..8ee0fcae8 100644 --- a/media/iphone/storyDetailView.js +++ b/media/iphone/storyDetailView.js @@ -7,7 +7,7 @@ $('.NB-story img').bind('load', function() { }); $('a.NB-show-profile').click(function(){ - var offset = $(this).offset(); + var offset = $('img', this).offset(); console.log(offset); var url = $(this).attr('href') + "/" + offset.left + "/" + (offset.top - window.pageYOffset) + "/" + offset.width + "/" + offset.height; window.location = url;