diff --git a/media/iphone/Classes/FontSettingsViewController.h b/media/iphone/Classes/FontSettingsViewController.h index 5c40b582a..ca5b0fffb 100644 --- a/media/iphone/Classes/FontSettingsViewController.h +++ b/media/iphone/Classes/FontSettingsViewController.h @@ -18,10 +18,12 @@ } @property (nonatomic, retain) IBOutlet NewsBlurAppDelegate *appDelegate; -@property (nonatomic, retain) IBOutlet UILabel *smallFontSizeLabel; -@property (nonatomic, retain) IBOutlet UILabel *largeFontSizeLabel; +@property (retain, nonatomic) IBOutlet UISegmentedControl *fontStyleSegment; +@property (retain, nonatomic) IBOutlet UISegmentedControl *fontSizeSgement; - (IBAction)changeFontStyle:(id)sender; - (IBAction)changeFontSize:(id)sender; +- (void)setSanSerif; +- (void)setSerif; @end diff --git a/media/iphone/Classes/FontSettingsViewController.m b/media/iphone/Classes/FontSettingsViewController.m index c5cada1bf..4a5ee61f6 100644 --- a/media/iphone/Classes/FontSettingsViewController.m +++ b/media/iphone/Classes/FontSettingsViewController.m @@ -13,8 +13,8 @@ @implementation FontSettingsViewController @synthesize appDelegate; -@synthesize smallFontSizeLabel; -@synthesize largeFontSizeLabel; +@synthesize fontStyleSegment; +@synthesize fontSizeSgement; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { @@ -29,13 +29,46 @@ { self.contentSizeForViewInPopover = CGSizeMake(274.0,130.0); [super viewDidLoad]; +} + +- (void)viewWillAppear:(BOOL)animated { + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([userPreferences stringForKey:@"fontStyle"]) { + if ([[userPreferences stringForKey:@"fontStyle"] isEqualToString:@"NB-san-serif"]) { + [self setSanSerif]; + } else if ([[userPreferences stringForKey:@"fontStyle"] isEqualToString:@"NB-serif"]) { + [self setSerif]; + } + } + int userPreferenceFontSize = [userPreferences integerForKey:@"fontSize"]; + if(userPreferenceFontSize){ + switch (userPreferenceFontSize) { + case 12: + [fontSizeSgement setSelectedSegmentIndex:0]; + break; + case 14: + [fontSizeSgement setSelectedSegmentIndex:1]; + break; + case 16: + [fontSizeSgement setSelectedSegmentIndex:2]; + break; + case 22: + [fontSizeSgement setSelectedSegmentIndex:3]; + break; + case 26: + [fontSizeSgement setSelectedSegmentIndex:4]; + break; + default: + break; + } + } // Do any additional setup after loading the view from its nib. } - (void)viewDidUnload { - smallFontSizeLabel = nil; - largeFontSizeLabel = nil; + [self setFontStyleSegment:nil]; + [self setFontSizeSgement:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; @@ -48,31 +81,49 @@ - (void)dealloc { [appDelegate release]; - [smallFontSizeLabel release]; - [largeFontSizeLabel release]; + [fontStyleSegment release]; + [fontSizeSgement release]; [super dealloc]; } - (IBAction)changeFontStyle:(id)sender { if ([sender selectedSegmentIndex] == 0) { - UIFont *smallFont = [UIFont fontWithName:@"Helvetica" size:15.0]; - [self.smallFontSizeLabel setFont:smallFont]; - UIFont *largeFont = [UIFont fontWithName:@"Georgia" size:24.0]; - [self.largeFontSizeLabel setFont:largeFont]; - [appDelegate.storyDetailViewController setFontStyle:@"Helvetica"]; - + [self setSanSerif]; } else { - UIFont *smallFont = [UIFont fontWithName:@"Georgia" size:15.0]; - [self.smallFontSizeLabel setFont:smallFont]; - UIFont *largeFont = [UIFont fontWithName:@"Georgia" size:24.0]; - [self.largeFontSizeLabel setFont:largeFont]; - [appDelegate.storyDetailViewController setFontStyle:@"Georgia"]; + [self setSerif]; } - } -- (IBAction)changeFontSize:(UISlider *)sender { - [appDelegate.storyDetailViewController setFontSize:[sender value]]; +- (IBAction)changeFontSize:(id)sender { + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([sender selectedSegmentIndex] == 0) { + [appDelegate.storyDetailViewController setFontSize:12]; + [userPreferences setInteger:12 forKey:@"fontSize"]; + } else if ([sender selectedSegmentIndex] == 1) { + [appDelegate.storyDetailViewController setFontSize:14]; + [userPreferences setInteger:14 forKey:@"fontSize"]; + } else if ([sender selectedSegmentIndex] == 2) { + [appDelegate.storyDetailViewController setFontSize:16]; + [userPreferences setInteger:16 forKey:@"fontSize"]; + } else if ([sender selectedSegmentIndex] == 3) { + [appDelegate.storyDetailViewController setFontSize:22]; + [userPreferences setInteger:22 forKey:@"fontSize"]; + } else if ([sender selectedSegmentIndex] == 4) { + [appDelegate.storyDetailViewController setFontSize:26]; + [userPreferences setInteger:26 forKey:@"fontSize"]; + } + [userPreferences synchronize]; } + +- (void)setSanSerif { + [fontStyleSegment setSelectedSegmentIndex:0]; + [appDelegate.storyDetailViewController setFontStyle:@"Helvetica"]; +} + +- (void)setSerif { + [fontStyleSegment setSelectedSegmentIndex:1]; + [appDelegate.storyDetailViewController setFontStyle:@"Georgia"]; +} + @end diff --git a/media/iphone/Classes/FontSettingsViewController.xib b/media/iphone/Classes/FontSettingsViewController.xib index 63a927af9..704c69a35 100644 --- a/media/iphone/Classes/FontSettingsViewController.xib +++ b/media/iphone/Classes/FontSettingsViewController.xib @@ -11,11 +11,9 @@ 1181 - IBUISlider - IBUISegmentedControl - IBUIView - IBUILabel IBProxyObject + IBUIView + IBUISegmentedControl com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -37,87 +35,13 @@ 292 - - - 292 - {{20, 90}, {42, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBIPadFramework - A - - 1 - MCAwIDAAA - - - 0 - 10 - - 1 - 15 - - - Helvetica - 15 - 16 - - - - - 292 - {{232, 89}, {42, 21}} - - - _NS:9 - NO - YES - 7 - NO - IBIPadFramework - A - - - 0 - 10 - - 1 - 24 - - - Helvetica - 24 - 16 - - - - - 292 - {{48, 90}, {178, 23}} - - - - _NS:9 - NO - IBIPadFramework - 0 - 0 - 100 - 50 - 150 - 292 {{20, 20}, {234, 30}} - + _NS:9 NO IBIPadFramework @@ -145,6 +69,55 @@ + + + 292 + {{20, 81}, {234, 30}} + + + + _NS:9 + NO + IBIPadFramework + 2 + 5 + 2 + + 12pt + 14pt + 16pt + 22pt + 26pt + + + + + + + + + + + + + + + + + {0, 0} + {0, 0} + {0, 0} + {0, 0} + {0, 0} + + + + + + + + + {274, 130} @@ -177,28 +150,19 @@ - largeFontSizeLabel + fontStyleSegment - + - 19 + 32 - smallFontSizeLabel + fontSizeSgement - + - 17 - - - - changeFontSize: - - - 13 - - 13 + 33 @@ -209,6 +173,15 @@ 12 + + + changeFontSize: + + + 13 + + 29 + @@ -234,9 +207,7 @@ - - - + @@ -246,18 +217,8 @@ - 8 - - - - - 7 - - - - - 4 - + 28 + @@ -269,15 +230,14 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + - 22 + 33 @@ -410,6 +370,28 @@ ./Classes/BaseViewController.h + + FeedDashboardViewController + UIViewController + + NewsBlurAppDelegate + UIToolbar + + + + appDelegate + NewsBlurAppDelegate + + + toolbar + UIToolbar + + + + IBProjectSource + ./Classes/FeedDashboardViewController.h + + FeedDetailViewController BaseViewController @@ -477,89 +459,41 @@ - FeedsViewController - BaseViewController - - id - id - id - UIButton - UIButton - id - - - - doAddButton - id - - - doLogoutButton - id - - - doSwitchSitesUnread - id - - - sectionTapped: - UIButton - - - sectionUntapped: - UIButton - - - selectIntelligence - id - - - - UIBarButtonItem - NewsBlurAppDelegate - UISlider - UITableView - UIToolbar - UISegmentedControl - UIBarButtonItem - UIBarButtonItem - - - - addButton + FeedsMenuViewController + UIViewController + + tapCancelButton: + UIBarButtonItem + + + tapCancelButton: + + tapCancelButton: UIBarButtonItem + + + NewsBlurAppDelegate + UITableView + UIToolbar + + appDelegate NewsBlurAppDelegate - - feedScoreSlider - UISlider - - - feedTitlesTable + + menuTableView UITableView - - feedViewToolbar + + toolbar UIToolbar - - intelligenceControl - UISegmentedControl - - - logoutButton - UIBarButtonItem - - - sitesButton - UIBarButtonItem - IBProjectSource - ./Classes/FeedsViewController.h + ./Classes/FeedsMenuViewController.h @@ -595,6 +529,7 @@ UIView NewsBlurAppDelegate UIButton + UIImageView UIBarButtonItem UIToolbar UIButton @@ -621,6 +556,10 @@ googleReaderButton UIButton + + logo + UIImageView + nextButton UIBarButtonItem @@ -662,6 +601,8 @@ NewsBlurAppDelegate + UISegmentedControl + UISegmentedControl UILabel UILabel @@ -670,6 +611,14 @@ appDelegate NewsBlurAppDelegate + + fontSizeSgement + UISegmentedControl + + + fontStyleSegment + UISegmentedControl + largeFontSizeLabel UILabel @@ -939,8 +888,10 @@ BaseViewController AddSiteViewController + FeedDashboardViewController FeedDetailViewController - FeedsViewController + FeedsMenuViewController + NewsBlurViewController FirstTimeUserViewController FontSettingsViewController GoogleReaderViewController @@ -948,6 +899,7 @@ MoveSiteViewController UINavigationController OriginalStoryViewController + ShareViewController UISplitViewController UINavigationController SplitStoryDetailViewController @@ -959,13 +911,21 @@ addSiteViewController AddSiteViewController + + feedDashboardViewController + FeedDashboardViewController + feedDetailViewController FeedDetailViewController + + feedsMenuViewController + FeedsMenuViewController + feedsViewController - FeedsViewController + NewsBlurViewController firstTimeUserViewController @@ -995,6 +955,10 @@ originalStoryViewController OriginalStoryViewController + + shareViewController + ShareViewController + splitStoryController UISplitViewController @@ -1021,6 +985,87 @@ ./Classes/NewsBlurAppDelegate.h + + NewsBlurViewController + BaseViewController + + id + UIButton + UIButton + id + id + + + + doSwitchSitesUnread + id + + + sectionTapped: + UIButton + + + sectionUntapped: + UIButton + + + selectIntelligence + id + + + showMenuButton + id + + + + NewsBlurAppDelegate + UISlider + UITableView + UIToolbar + UIBarButtonItem + UISegmentedControl + UIPopoverController + UIBarButtonItem + + + + appDelegate + NewsBlurAppDelegate + + + feedScoreSlider + UISlider + + + feedTitlesTable + UITableView + + + feedViewToolbar + UIToolbar + + + homeButton + UIBarButtonItem + + + intelligenceControl + UISegmentedControl + + + popoverController + UIPopoverController + + + sitesButton + UIBarButtonItem + + + + IBProjectSource + ./Classes/NewsBlurViewController.h + + OriginalStoryViewController BaseViewController @@ -1102,6 +1147,72 @@ ./Classes/OriginalStoryViewController.h + + ShareViewController + UIViewController + + id + id + id + + + + doCancelButton: + id + + + doShareThisStory: + id + + + doToggleButton: + id + + + + NewsBlurAppDelegate + UITextView + UIButton + UISegmentedControl + UIImageView + UILabel + UIButton + + + + appDelegate + NewsBlurAppDelegate + + + commentField + UITextView + + + facebookButton + UIButton + + + fontSizeSegment + UISegmentedControl + + + siteFavicon + UIImageView + + + siteInformation + UILabel + + + twitterButton + UIButton + + + + IBProjectSource + ./Classes/ShareViewController.h + + SplitStoryDetailViewController UIViewController @@ -1127,6 +1238,7 @@ id id + id id @@ -1138,6 +1250,10 @@ doPreviousStory id + + doShareButton: + id + toggleFontSize: id diff --git a/media/iphone/Classes/NewsBlurAppDelegate.h b/media/iphone/Classes/NewsBlurAppDelegate.h index 2ac886cb1..1465be193 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.h +++ b/media/iphone/Classes/NewsBlurAppDelegate.h @@ -134,10 +134,9 @@ - (void)showLogin; - (void)showFeedsMenu; - (void)hideFeedsMenu; -- (void)pushFeedDetailToMasterPopover; + - (void)showAdd; - (void)showMasterPopover; -- (void)showPopover; - (void)showMoveSite; - (void)loadFeedDetailView; - (void)loadRiverFeedDetailView; diff --git a/media/iphone/Classes/NewsBlurAppDelegate.m b/media/iphone/Classes/NewsBlurAppDelegate.m index e54702967..c009d3797 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.m +++ b/media/iphone/Classes/NewsBlurAppDelegate.m @@ -438,7 +438,7 @@ // the storyDetailView is full screen if (self.feedDetailPortraitYCoordinate == 960) { - storyDetailViewController.view.frame = CGRectMake(0,0,storyDetailViewController.view.frame.size.width, 960); + storyDetailViewController.view.frame = CGRectMake(0, 0, 768, 960); feedDashboardViewController.view.frame = CGRectMake(0, 0, storyDetailViewController.view.frame.size.width, diff --git a/media/iphone/Classes/ShareViewController.h b/media/iphone/Classes/ShareViewController.h index f4d0f6b1b..876c0e1f0 100644 --- a/media/iphone/Classes/ShareViewController.h +++ b/media/iphone/Classes/ShareViewController.h @@ -18,14 +18,12 @@ @property (retain, nonatomic) IBOutlet UILabel *siteInformation; @property (retain, nonatomic) IBOutlet UITextView *commentField; @property (nonatomic, retain) IBOutlet NewsBlurAppDelegate *appDelegate; +@property (retain, nonatomic) IBOutlet UIButton *facebookButton; +@property (retain, nonatomic) IBOutlet UIButton *twitterButton; - (void)setSiteInfo; - (IBAction)doCancelButton:(id)sender; - (IBAction)doToggleButton:(id)sender; - (IBAction)doShareThisStory:(id)sender; -@property (retain, nonatomic) IBOutlet UIButton *facebookButton; -@property (retain, nonatomic) IBOutlet UIButton *twitterButton; - - @end diff --git a/media/iphone/Classes/ShareViewController.m b/media/iphone/Classes/ShareViewController.m index 25abd5d28..6fcb2568d 100644 --- a/media/iphone/Classes/ShareViewController.m +++ b/media/iphone/Classes/ShareViewController.m @@ -35,20 +35,14 @@ { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. - commentField.layer.borderWidth = 1.0f; commentField.layer.cornerRadius = 8; commentField.layer.borderColor = [[UIColor grayColor] CGColor]; - NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; - - NSLog(@"facebook %d", [userPreferences integerForKey:@"shareToFacebook"]); - NSLog(@"twitter %d", [userPreferences integerForKey:@"shareToTwitter"]); - + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; if ([userPreferences integerForKey:@"shareToFacebook"]){ facebookButton.selected = YES; } - if ([userPreferences integerForKey:@"shareToTwitter"]){ twitterButton.selected = YES; } @@ -133,18 +127,10 @@ [userPreferences setInteger:1 forKey:@"shareToTwitter"]; } } - [userPreferences synchronize]; - NSLog(@"facebook %d", [userPreferences integerForKey:@"shareToFacebook"]); - NSLog(@"twitter %d", [userPreferences integerForKey:@"shareToTwitter"]); - } -- (IBAction)doShareThisStory:(id)sender { - for (id key in appDelegate.activeStory) { - NSLog(@"Key in appDelegate.activeStory is %@" , key); - } - +- (IBAction)doShareThisStory:(id)sender { NSString *urlString = [NSString stringWithFormat:@"http://%@/social/share_story", NEWSBLUR_URL]; @@ -189,7 +175,7 @@ CGRect shareViewFrame = self.view.frame; CGRect storyDetailViewFrame = appDelegate.storyDetailViewController.view.frame; - NSLog(@"Keyboard y is %f", keyboardFrame.size.height); + //NSLog(@"Keyboard y is %f", keyboardFrame.size.height); shareViewFrame.origin.y = shareViewFrame.origin.y + keyboardFrame.size.height; storyDetailViewFrame.size.height = storyDetailViewFrame.size.height + keyboardFrame.size.height; @@ -213,7 +199,7 @@ CGRect shareViewFrame = self.view.frame; CGRect storyDetailViewFrame = appDelegate.storyDetailViewController.view.frame; - NSLog(@"Keyboard y is %f", keyboardFrame.size.height); + //NSLog(@"Keyboard y is %f", keyboardFrame.size.height); shareViewFrame.origin.y = shareViewFrame.origin.y - keyboardFrame.size.height; storyDetailViewFrame.size.height = storyDetailViewFrame.size.height - keyboardFrame.size.height; diff --git a/media/iphone/Classes/StoryDetailViewController.h b/media/iphone/Classes/StoryDetailViewController.h index fc7c07213..86bb70b7e 100644 --- a/media/iphone/Classes/StoryDetailViewController.h +++ b/media/iphone/Classes/StoryDetailViewController.h @@ -37,7 +37,6 @@ @property (nonatomic, retain) IBOutlet UIView *feedTitleGradient; @property (retain,nonatomic) UIPopoverController *popoverController; -- (void)showPopover; - (void)setNextPreviousButtons; - (void)markStoryAsRead; - (void)showStory; diff --git a/media/iphone/Classes/StoryDetailViewController.m b/media/iphone/Classes/StoryDetailViewController.m index 707416479..550672763 100644 --- a/media/iphone/Classes/StoryDetailViewController.m +++ b/media/iphone/Classes/StoryDetailViewController.m @@ -98,15 +98,23 @@ target:self action:@selector(showOriginalSubview:) ]; + + UIBarButtonItem *fontSettingsButton = [[UIBarButtonItem alloc] + initWithTitle:@"Aa" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(toggleFontSize:) + ]; if (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad) { - appDelegate.splitStoryDetailViewController.navigationItem.rightBarButtonItem = originalButton; + appDelegate.splitStoryDetailViewController.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:originalButton, fontSettingsButton, nil]; } else { - self.navigationItem.rightBarButtonItem = originalButton; + self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:originalButton, fontSettingsButton, nil]; } [originalButton release]; - + [fontSettingsButton release]; + [super viewDidAppear:animated]; } @@ -117,6 +125,7 @@ self.activeStoryId = nil; [webView loadHTMLString:@"" baseURL:[NSURL URLWithString:@""]]; } + [popoverController dismissPopoverAnimated:YES]; } #pragma mark - @@ -162,7 +171,7 @@ } if (areFriends && [share_user_ids count]) { - avatarString = [avatarString stringByAppendingString:@""]; } return avatarString; @@ -170,7 +179,6 @@ - (NSString *)getComments { NSString *comments = @""; - NSLog(@"the sharecount is %@", [appDelegate.activeStory objectForKey:@"share_count"]); if ([appDelegate.activeStory objectForKey:@"share_count"] != [NSNull null]) { NSArray *comments_array = [appDelegate.activeStory objectForKey:@"comments"]; comments = [comments stringByAppendingString:[NSString stringWithFormat:@ @@ -183,10 +191,9 @@ "
" "%@" "
" - - + "%@" - + "", [[appDelegate.activeStory objectForKey:@"share_count"] intValue] == 1 ? [NSString stringWithFormat:@"1 person"] : @@ -194,8 +201,9 @@ [self getAvatars:NO], [self getAvatars:YES] ]]; - + for (int i = 0; i < comments_array.count; i++) { + NSDictionary *comment_dict = [comments_array objectAtIndex:i]; NSDictionary *user = [self getUser:[[comment_dict objectForKey:@"user_id"] intValue]]; NSString *comment = [NSString stringWithFormat:@ @@ -222,7 +230,6 @@ comments = [comments stringByAppendingString:comment]; } comments = [comments stringByAppendingString:[NSString stringWithFormat:@""]]; - } return comments; } @@ -262,15 +269,17 @@ } - (void)showStory { + NSString *commentsString = [self getComments]; + NSString *customImgCssString, *universalImgCssString, *sharingHtmlString; + NSString *customBodyClass = @""; - for (id key in appDelegate.activeStory) { - - NSLog(@"key is: %@ value: %@", key, [appDelegate.activeStory objectForKey:key]); + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([userPreferences stringForKey:@"fontStyle"]){ + customBodyClass = [customBodyClass stringByAppendingString:[userPreferences stringForKey:@"fontStyle"]]; + } else { + customBodyClass = [customBodyClass stringByAppendingString:@"NB-san-serif"]; } - NSString *commentsString = [self getComments]; - - NSString *customImgCssString, *universalImgCssString, *sharingHtmlString; // set up layout values based on iPad/iPhone universalImgCssString = [NSString stringWithFormat:@ "" @@ -333,20 +342,21 @@ story_tags]; NSString *htmlString = [NSString stringWithFormat:@ "%@ %@" - "%@" + "%@" "
%@
" "%@" // comments "%@" // share "", universalImgCssString, customImgCssString, + customBodyClass, storyHeader, [appDelegate.activeStory objectForKey:@"story_content"], commentsString, sharingHtmlString ]; -// NSLog(@"\n\n\n\nstory content\n\n\n%@
%@
\n\n\n", storyHeader, [appDelegate.activeStory objectForKey:@"story_content"]); + NSLog(@"\n\n\n\nhtmlString:\n\n\n%@\n\n\n", htmlString); NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; @@ -414,9 +424,18 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } - (void)webViewDidStartLoad:(UIWebView *)webView { + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([userPreferences integerForKey:@"fontSize"]){ + [self setFontSize:[userPreferences integerForKey:@"fontSize"]]; + } + } - (void)webViewDidFinishLoad:(UIWebView *)webView { + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([userPreferences integerForKey:@"fontSize"]){ + [self setFontSize:[userPreferences integerForKey:@"fontSize"]]; + } } #pragma mark - @@ -571,13 +590,21 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } - (void)setFontSize:(float)fontSize { - NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%f%%'", + NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.fontSize= '%fpx'", fontSize]; [self.webView stringByEvaluatingJavaScriptFromString:jsString]; [jsString release]; } - (void)setFontStyle:(NSString *)fontStyle { + NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults]; + if ([fontStyle isEqualToString:@"Helvetica"]) { + [userPreferences setObject:@"NB-san-serif" forKey:@"fontStyle"]; + } else { + [userPreferences setObject:@"NB-serif" forKey:@"fontStyle"]; + } + [userPreferences synchronize]; + NSString *jsString = [[NSString alloc] initWithFormat:@"document.getElementsByTagName('body')[0].style.fontFamily= '%@'", fontStyle]; [self.webView stringByEvaluatingJavaScriptFromString:jsString]; diff --git a/media/iphone/NewsBlur.xcodeproj/project.pbxproj b/media/iphone/NewsBlur.xcodeproj/project.pbxproj index 262139be5..d5fbf141c 100755 --- a/media/iphone/NewsBlur.xcodeproj/project.pbxproj +++ b/media/iphone/NewsBlur.xcodeproj/project.pbxproj @@ -612,6 +612,8 @@ 437AA8AB15922D13005463F5 /* FeedDashboardViewController.m */, 439DAB1D1590DA350019B0EB /* FeedsMenuViewController.h */, 439DAB1E1590DA350019B0EB /* FeedsMenuViewController.m */, + 43763ACE158F90B100B3DBE2 /* FontSettingsViewController.h */, + 43763ACF158F90B100B3DBE2 /* FontSettingsViewController.m */, 28D7ACF60DDB3853001CB0EB /* NewsBlurViewController.h */, 28D7ACF70DDB3853001CB0EB /* NewsBlurViewController.m */, FFCE7AE513D49165009A98F6 /* FeedTableCell.h */, @@ -634,8 +636,6 @@ 7842ECF611D44A530066CF9D /* StoryDetailViewController.m */, FFE5322D144C8AC300ACFDE0 /* Utilities.h */, FFE5322E144C8AC300ACFDE0 /* Utilities.m */, - 43763ACE158F90B100B3DBE2 /* FontSettingsViewController.h */, - 43763ACF158F90B100B3DBE2 /* FontSettingsViewController.m */, ); path = Classes; sourceTree = ""; diff --git a/media/iphone/ShareKit/Configuration/LegacySHKConfigurator.m b/media/iphone/ShareKit/Configuration/LegacySHKConfigurator.m index 27235f156..c72215bb0 100755 --- a/media/iphone/ShareKit/Configuration/LegacySHKConfigurator.m +++ b/media/iphone/ShareKit/Configuration/LegacySHKConfigurator.m @@ -41,6 +41,7 @@ - (void)dealloc { [configuration release]; + [super dealloc]; } - (id)init diff --git a/media/iphone/sample_text.html b/media/iphone/sample_text.html index 7e4b85655..6a0ed3bf1 100644 --- a/media/iphone/sample_text.html +++ b/media/iphone/sample_text.html @@ -1,38 +1 @@ - - - - - - - - - - - - -
Defining Tetris: How courts judge gaming clones
- - -
-
The fact that it's hard to tell which one is Tetris and which one is Mino bolstered the copyright infringement claim.
- -
-
- - - -

Besides handling the rights and distribution for every official version of Tetris, The Tetris Company is also responsible for protecting the Tetris brand from unlicensed knock-offs. In the recent past, it's done this by forcing platform holders like Apple to remove unofficial copies of the game from the iOS App Store as soon as they pop up, for instance.

-

But the company went a little farther further in the case of iPhone Tetris clone Mino, taking developer Xio Interactive to court to protect the Tetris copyright. A New Jersey circuit court judge recently ruled in favor of The Tetris Company in that case, issuing a ruling that highlights the legal challenges in determining what separates a hackneyed clone from a game that is merely "inspired" by an existing title.

-

What makes Tetris Tetris?

-

While game designers usually have a pretty easy time telling when their game design has been ripped off by a clone, proving actual copyright infringement in court is usually an uphill battle. That's because copyright law doesn't actually protect the basic idea and underlying rules of a game, which need a duly filed and approved patent to be locked down. The copyright on a game only protects the "expression" of those rules, which usually covers things like character art, music and sound effects. That makes it relatively easy for a clone to mimic the successful engine of a game while making just enough changes on the surface to avoid a successful legal challenge.

Read more | Comments

-


-

- -
- - - +
Number of the Day
4,500,000: The number of pigeon craps it would take to destroy a Smart Car. As calculated by Smart Car.

image of Twitterer @adtothebone tweeting: 'Saw a bird had crapped on a Smart Car. Totaled it.' followed by Smart Car's official Twitter account tweeting in response: 'Couldn't have been one bird, @adtothebone. Sounds more like 4.5 million. (Seriously, we did the math.)' followed by a graphic showing it would've taken 4.5 million pigeon craps, 360,000 turkey craps, or 45,000 emu craps to destroy a Smart Car.

Win.
Shared by 5 people
Shared by:
smadin
2 days
reply
heh.
roy
2 days
Classic.
samuel
2 days
reply
Nailed it.
lilliealbert
2 days
reply
pretty good
\ No newline at end of file diff --git a/media/iphone/storyDetailView.css b/media/iphone/storyDetailView.css index a432d54e4..df522e4cc 100644 --- a/media/iphone/storyDetailView.css +++ b/media/iphone/storyDetailView.css @@ -1,12 +1,74 @@ body { - line-height: 1.6; - font-size: 17px; - font-family: 'Lucida Grande', Helvetica, Arial; text-rendering: optimizeLegibility; margin: 0; background: #f6f6f6; } +.NB-story-author { + color: #969696; + text-transform: uppercase; + margin: 4px 8px 0px 0; + text-shadow: 0 1px 0 #F9F9F9; + float: left; +} + +.NB-story-tags { + overflow: hidden; + padding: 5px 0 0 0; + text-transform: uppercase; +} + +.NB-story-tag { + float: left; + font-weight: normal; + padding: 0px 4px 0px; + margin: 0px 4px 4px 0; + background-color: #C6CBC3; + color: #505050; + text-shadow: 0 1px 0 #E7E7E7; + -webkit-border-radius: 4px; +} + +.NB-story-date { + color: #454D6C; +} + +/* FONT RENDERING */ + +body { + line-height: 1.6em; + font-size: 16px; +} + +.NB-san-serif { + font-family: Helvetica; +} + +.NB-serif { + font-family: georgia; +} + + +.NB-story-author { + font-size: 10px; + line-height: 12px +} + +.NB-story-tags { + line-height: 12px; +} + +.NB-story-tag { + font-size: 9px; +} + +.NB-story-date { + font-size: 11px; + line-height: 13px; +} + +/* END: FONT RENDERING */ + h1, h2, h3, h4, h5, h6, div, table, span, pre, code { overflow: auto; } @@ -23,11 +85,11 @@ blockquote { } h1, h2, h3, h4, h5, h6, div, table, span, pre, code, img { - max-width: 588px; + max-width: 588px; } div { - width: auto !important; + width: auto !important; } p { @@ -40,15 +102,15 @@ small { } .NB-header { - font-size: 22px; - line-height: 29px; - font-weight: 600; - background-color: #E0E0E0; - border-bottom: 1px solid #A0A0A0; - padding: 15px 90px; - text-shadow: 1px 1px 0 #EFEFEF; - overflow: hidden; - max-width: none; + font-size: 22px; + line-height: 1.1em; + font-weight: 600; + background-color: #E0E0E0; + border-bottom: 1px solid #A0A0A0; + padding: 15px 90px; + text-shadow: 1px 1px 0 #EFEFEF; + overflow: hidden; + max-width: none; } .NB-story { @@ -59,10 +121,6 @@ small { display: block; } -.NB-story img.NB-tracker { - -} - .NB-story img { max-width: 572px !important; margin: 0 auto; @@ -97,44 +155,6 @@ small { margin: 30px 90px !important; } - - -.NB-story-author { - color: #969696; - font-size: 10px; - text-transform: uppercase; - margin: 4px 8px 0px 0; - text-shadow: 0 1px 0 #F9F9F9; - float: left; - line-height: 12px -} - -.NB-story-tags { - overflow: hidden; - line-height: 12px; - padding: 5px 0 0 0; - text-transform: uppercase; -} - -.NB-story-tag { - float: left; - font-size: 10px; - font-weight: normal; - font-size: 9px; - padding: 0px 4px 0px; - margin: 0px 4px 4px 0; - background-color: #C6CBC3; - color: #505050; - text-shadow: 0 1px 0 #E7E7E7; - -webkit-border-radius: 4px; -} - -.NB-story-date { - font-size: 11px; - color: #454D6C; - line-height: 13px; -} - .NB-story-title { clear: left; margin: 8px 0 4px; diff --git a/media/iphone/storyDetailView.js b/media/iphone/storyDetailView.js index c2590dba5..3a31ecf2d 100644 --- a/media/iphone/storyDetailView.js +++ b/media/iphone/storyDetailView.js @@ -15,7 +15,6 @@ Zepto(function($) { $img.parent().addClass('NB-contains-image') } var width = $(img).width(); - console.log('width is' + width); if ($(img).attr('src').indexOf('feedburner') != -1) { $(img).addClass('NB-feedburner'); } else if (width > 300) {