diff --git a/media/css/reader.css b/media/css/reader.css index 16abeabe5..63c64d824 100644 --- a/media/css/reader.css +++ b/media/css/reader.css @@ -4248,7 +4248,7 @@ form.opml_import_form input { margin: 11px 0 0 4px; width: 16px; height: 16px; - background: transparent url('/media/embed/icons/circular/g_icn_folder.png') no-repeat 0 0; + background: transparent url('/media/embed/icons/circular/g_icn_folder_add.png') no-repeat 0 0; background-size: 16px; cursor: pointer; } diff --git a/media/img/icons/circular/g_icn_folder_add.png b/media/img/icons/circular/g_icn_folder_add.png new file mode 100644 index 000000000..1d3042132 Binary files /dev/null and b/media/img/icons/circular/g_icn_folder_add.png differ diff --git a/media/ios/Classes/AddSiteViewController.h b/media/ios/Classes/AddSiteViewController.h index 2da3c634e..e5d822fc0 100644 --- a/media/ios/Classes/AddSiteViewController.h +++ b/media/ios/Classes/AddSiteViewController.h @@ -47,6 +47,7 @@ - (IBAction)checkSiteAddress; - (void)reloadSearchResults; - (IBAction)toggleAddFolder:(id)sender; +- (NSArray *)folders; @property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate; @property (nonatomic) IBOutlet UITextField *inFolderInput; diff --git a/media/ios/Classes/AddSiteViewController.m b/media/ios/Classes/AddSiteViewController.m index 56af819d8..0b480bd5e 100644 --- a/media/ios/Classes/AddSiteViewController.m +++ b/media/ios/Classes/AddSiteViewController.m @@ -354,13 +354,21 @@ #pragma mark - #pragma mark Folder Picker +- (NSArray *)folders { + return _.without([appDelegate dictFoldersArray], + @[@"saved_stories", + @"river_blurblogs", + @"river_global", + @"everything"]); +} + - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { - return [[appDelegate dictFoldersArray] count] - 2; + return [[self folders] count]; } - (NSString *)pickerView:(UIPickerView *)pickerView @@ -369,7 +377,7 @@ numberOfRowsInComponent:(NSInteger)component { if (row == 0) { return @"— Top Level —"; } else { - return [[appDelegate dictFoldersArray] objectAtIndex:row + 2]; + return [[self folders] objectAtIndex:row]; } } @@ -380,7 +388,7 @@ numberOfRowsInComponent:(NSInteger)component { if (row == 0) { folder_title = @"— Top Level —"; } else { - folder_title = [[appDelegate dictFoldersArray] objectAtIndex:row + 2]; + folder_title = [[self folders] objectAtIndex:row]; } [inFolderInput setText:folder_title]; } diff --git a/media/ios/Classes/MoveSiteViewController.m b/media/ios/Classes/MoveSiteViewController.m index 9c016f160..6cf166185 100644 --- a/media/ios/Classes/MoveSiteViewController.m +++ b/media/ios/Classes/MoveSiteViewController.m @@ -241,6 +241,7 @@ if ([folder isEqualToString:@"everything"]) continue; if ([folder isEqualToString:@"river_blurblogs"]) continue; if ([folder isEqualToString:@"river_global"]) continue; + if ([folder isEqualToString:@"saved_stories"]) continue; if ([[folder trim] isEqualToString:@""]) continue; if (appDelegate.isRiverView) { if (![folder containsString:appDelegate.activeFolder]) { diff --git a/media/ios/Classes/NBContainerViewController.m b/media/ios/Classes/NBContainerViewController.m index 1e096034c..106c5c424 100644 --- a/media/ios/Classes/NBContainerViewController.m +++ b/media/ios/Classes/NBContainerViewController.m @@ -463,7 +463,7 @@ self.storyPageControl.nextPage.webView.hidden = YES; self.storyPageControl.bottomPlaceholderToolbar.hidden = NO; self.storyPageControl.progressViewContainer.hidden = YES; - self.storyPageControl.navigationItem.rightBarButtonItems = nil; +// self.storyPageControl.navigationItem.rightBarButtonItems = nil; [self.storyPageControl resetPages]; int unreadCount = appDelegate.unreadCount; if (unreadCount == 0) { diff --git a/media/ios/Classes/NewsBlurAppDelegate.m b/media/ios/Classes/NewsBlurAppDelegate.m index c5feac675..1c5e9c812 100644 --- a/media/ios/Classes/NewsBlurAppDelegate.m +++ b/media/ios/Classes/NewsBlurAppDelegate.m @@ -761,10 +761,8 @@ [feedDetailViewController.navigationItem setBackBarButtonItem: newBackButton]; UINavigationController *navController = self.navigationController; [navController pushViewController:storyPageControl animated:YES]; - //self.storyDetailViewController.navigationItem.titleView = nil; [navController.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:feedTitle style:UIBarButtonItemStyleBordered target:nil action:nil]]; navController.navigationItem.hidesBackButton = YES; -// navController.navigationBar.tintColor = [UIColor colorWithRed:0.16f green:0.36f blue:0.46 alpha:0.9]; } } diff --git a/media/ios/Classes/NewsBlurViewController.m b/media/ios/Classes/NewsBlurViewController.m index 6dd801ebd..1465e442e 100644 --- a/media/ios/Classes/NewsBlurViewController.m +++ b/media/ios/Classes/NewsBlurViewController.m @@ -159,6 +159,8 @@ static const CGFloat kFolderTitleHeight = 28; [[UIBarButtonItem appearance] setBackButtonBackgroundImage:i1 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; + [[UIBarButtonItem appearance] setTintColor:UIColorFromRGB(0x404040)]; + [[UIBarButtonItem appearance] setBackButtonBackgroundImage:i2 forState:UIControlStateNormal @@ -194,21 +196,28 @@ static const CGFloat kFolderTitleHeight = 28; forState:UIControlStateHighlighted barMetrics:UIBarMetricsLandscapePhone]; - [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] + [[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: UIColorFromRGB(0x404040), UITextAttributeTextColor, UIColorFromRGB(0xFAFAFA), UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], UITextAttributeTextShadowOffset, nil] forState:UIControlStateNormal]; - [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] + [[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: UIColorFromRGB(0xF0F0F0), UITextAttributeTextColor, UIColorFromRGB(0x202020), UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], UITextAttributeTextShadowOffset, nil] - forState:UIControlStateHighlighted|UIControlStateSelected]; - [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] + forState:UIControlStateSelected]; + [[UIBarButtonItem appearance] + setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: + UIColorFromRGB(0xF0F0F0), UITextAttributeTextColor, + UIColorFromRGB(0x202020), UITextAttributeTextShadowColor, + [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], UITextAttributeTextShadowOffset, + nil] + forState:UIControlStateHighlighted]; + [[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: UIColorFromRGB(0xB0B0B0), UITextAttributeTextColor, UIColorFromRGB(0xFAFAFA), UITextAttributeTextShadowColor, diff --git a/media/ios/Classes/OriginalStoryViewController.h b/media/ios/Classes/OriginalStoryViewController.h index b59900c64..554cb4e40 100644 --- a/media/ios/Classes/OriginalStoryViewController.h +++ b/media/ios/Classes/OriginalStoryViewController.h @@ -47,9 +47,13 @@ static const CGFloat kButtonWidth = 48.0f; @property (nonatomic) IBOutlet UITextField *pageUrl; @property (nonatomic) IBOutlet UIToolbar *toolbar; +- (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; - (IBAction) doCloseOriginalStoryViewController; - (IBAction) doOpenActionSheet; - (IBAction)loadAddress:(id)sender; +- (IBAction)webViewGoBack:(id)sender; +- (IBAction)webViewGoForward:(id)sender; +- (IBAction)webViewRefresh:(id)sender; - (void)updateTitle:(UIWebView*)aWebView; - (void)updateAddress:(NSURLRequest*)request; - (void)updateButtons; diff --git a/media/ios/Classes/OriginalStoryViewController.m b/media/ios/Classes/OriginalStoryViewController.m index 0e9c270d8..a99735544 100644 --- a/media/ios/Classes/OriginalStoryViewController.m +++ b/media/ios/Classes/OriginalStoryViewController.m @@ -12,6 +12,7 @@ #import "TransparentToolbar.h" #import "SHK.h" #import "MBProgressHUD.h" +#import "UIBarButtonItem+Image.h" @implementation OriginalStoryViewController @@ -36,7 +37,6 @@ - (void)viewWillAppear:(BOOL)animated { // NSLog(@"Original Story View: %@", [appDelegate activeOriginalStoryURL]); - toolbar.tintColor = UIColorFromRGB(0x183353); NSURLRequest *request = [[NSURLRequest alloc] initWithURL:appDelegate.activeOriginalStoryURL] ; [self updateAddress:request]; [self.pageTitle setText:[[appDelegate activeStory] objectForKey:@"story_title"]]; @@ -57,11 +57,19 @@ return YES; } +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [self layoutForInterfaceOrientation:toInterfaceOrientation]; +} + - (void)viewDidLoad { CGRect navBarFrame = self.view.bounds; navBarFrame.size.height = kNavBarHeight; UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:navBarFrame]; navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; + toolbar.autoresizingMask = toolbar.autoresizingMask | UIViewAutoresizingFlexibleHeight | UIViewContentModeBottom; + [navBar + setBackgroundImage:[UIImage imageNamed:@"toolbar_tall_background.png"] + forBarMetrics:UIBarMetricsDefault]; CGRect labelFrame = CGRectMake(kMargin, kSpacer, navBar.bounds.size.width - 2*kMargin, @@ -70,9 +78,9 @@ label.autoresizingMask = UIViewAutoresizingFlexibleWidth; label.backgroundColor = [UIColor clearColor]; label.font = [UIFont systemFontOfSize:12]; - label.textColor = [UIColor colorWithRed:0.97f green:0.98f blue:0.99 alpha:0.95]; - label.shadowColor = [UIColor colorWithRed:0.06f green:0.12f blue:0.16f alpha:0.4f]; - label.shadowOffset = CGSizeMake(0.0f, 1.0f); + label.textColor = UIColorFromRGB(0x404040); + label.shadowColor = UIColorFromRGB(0xFAFAFA); + label.shadowOffset = CGSizeMake(0.0f, -1.0f); label.textAlignment = UITextAlignmentCenter; label.text = [[appDelegate activeStory] objectForKey:@"story_title"]; [navBar addSubview:label]; @@ -119,18 +127,66 @@ [self.view addSubview:navBar]; - CGRect webViewFrame = CGRectMake(0, + UIImage *backImage = [UIImage imageNamed:@"barbutton_back.png"]; + UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; + backButton.bounds = CGRectMake(0, 0, 44, 44); + [backButton setImage:backImage forState:UIControlStateNormal]; + [backButton addTarget:self action:@selector(webViewGoBack:) forControlEvents:UIControlEventTouchUpInside]; + [back setCustomView:backButton]; + + UIImage *forwardImage = [UIImage imageNamed:@"barbutton_forward.png"]; + UIButton *forwardButton = [UIButton buttonWithType:UIButtonTypeCustom]; + forwardButton.bounds = CGRectMake(0, 0, 44, 44); + [forwardButton setImage:forwardImage forState:UIControlStateNormal]; + [forwardButton addTarget:self action:@selector(webViewGoForward:) forControlEvents:UIControlEventTouchUpInside]; + [forward setCustomView:forwardButton]; + + UIImage *refreshImage = [UIImage imageNamed:@"barbutton_refresh.png"]; + UIButton *refreshButton = [UIButton buttonWithType:UIButtonTypeCustom]; + refreshButton.bounds = CGRectMake(0, 0, 44, 44); + [refreshButton setImage:refreshImage forState:UIControlStateNormal]; + [refreshButton addTarget:self action:@selector(webViewRefresh:) forControlEvents:UIControlEventTouchUpInside]; + [refresh setCustomView:refreshButton]; + + UIImage *sendtoImage = [UIImage imageNamed:@"barbutton_sendto.png"]; + UIButton *sendtoButton = [UIButton buttonWithType:UIButtonTypeCustom]; + sendtoButton.bounds = CGRectMake(0, 0, 44, 44); + [sendtoButton setImage:sendtoImage forState:UIControlStateNormal]; + [sendtoButton addTarget:self action:@selector(doOpenActionSheet) forControlEvents:UIControlEventTouchUpInside]; + [pageAction setCustomView:sendtoButton]; + + CGRect webViewFrame = CGRectMake(0, navBarFrame.origin.y + navBarFrame.size.height, self.view.frame.size.width, self.view.frame.size.height - kNavBarHeight - 44); self.webView.frame = webViewFrame; - - navBar.tintColor = UIColorFromRGB(0x183353); - - } +- (IBAction)webViewGoBack:(id)sender { + [webView goBack]; +} + +- (IBAction)webViewGoForward:(id)sender { + [webView goForward]; +} + +- (IBAction)webViewRefresh:(id)sender { + [webView reload]; +} + +- (void) layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + CGSize toolbarSize = [self.toolbar sizeThatFits:self.view.bounds.size]; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + self.toolbar.frame = CGRectMake(-10.0f, + CGRectGetHeight(self.view.bounds) - toolbarSize.height, + toolbarSize.width + 20, toolbarSize.height); + } else { + self.toolbar.frame = (CGRect){CGPointMake(0.f, CGRectGetHeight(self.view.bounds) - + toolbarSize.height), toolbarSize}; + self.webView.frame = (CGRect){CGPointMake(0, kNavBarHeight), CGSizeMake(CGRectGetWidth(self.view.bounds), CGRectGetMinY(self.toolbar.frame) - kNavBarHeight)}; + } +} - (BOOL)textFieldShouldReturn:(UITextField *)textField { diff --git a/media/ios/Classes/StoryPageControl.m b/media/ios/Classes/StoryPageControl.m index 19862ea9f..744da9f8e 100644 --- a/media/ios/Classes/StoryPageControl.m +++ b/media/ios/Classes/StoryPageControl.m @@ -851,7 +851,7 @@ - (IBAction)toggleFontSize:(id)sender { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { - [appDelegate.masterContainerViewController showFontSettingsPopover:sender]; + [appDelegate.masterContainerViewController showFontSettingsPopover:self.fontSettingsButton]; } else { if (self.popoverController == nil) { self.popoverController = [[WEPopoverController alloc] diff --git a/media/ios/NewsBlur.xcodeproj/project.pbxproj b/media/ios/NewsBlur.xcodeproj/project.pbxproj index 70aa8a91c..00c9b0be1 100755 --- a/media/ios/NewsBlur.xcodeproj/project.pbxproj +++ b/media/ios/NewsBlur.xcodeproj/project.pbxproj @@ -205,6 +205,21 @@ FF22FE4E16E41EB40046165A /* disclosure_down.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE4C16E41EB40046165A /* disclosure_down.png */; }; FF22FE4F16E41EB40046165A /* disclosure_down@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE4D16E41EB40046165A /* disclosure_down@2x.png */; }; FF22FE5116E42C600046165A /* world@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE5016E42C600046165A /* world@2x.png */; }; + FF22FE5E16E53ADC0046165A /* Underscore+Functional.m in Sources */ = {isa = PBXBuildFile; fileRef = FF22FE5516E53ADC0046165A /* Underscore+Functional.m */; }; + FF22FE5F16E53ADC0046165A /* Underscore.m in Sources */ = {isa = PBXBuildFile; fileRef = FF22FE5816E53ADC0046165A /* Underscore.m */; }; + FF22FE6016E53ADC0046165A /* USArrayWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = FF22FE5A16E53ADC0046165A /* USArrayWrapper.m */; }; + FF22FE6116E53ADC0046165A /* USDictionaryWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = FF22FE5D16E53ADC0046165A /* USDictionaryWrapper.m */; }; + FF22FE6316E54B350046165A /* g_icn_folder_add.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6216E54B350046165A /* g_icn_folder_add.png */; }; + FF22FE6616E54E590046165A /* barbutton_back.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6416E54E590046165A /* barbutton_back.png */; }; + FF22FE6716E54E590046165A /* barbutton_back@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6516E54E590046165A /* barbutton_back@2x.png */; }; + FF22FE6A16E54F590046165A /* barbutton_forward.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6816E54F590046165A /* barbutton_forward.png */; }; + FF22FE6B16E54F590046165A /* barbutton_forward@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6916E54F590046165A /* barbutton_forward@2x.png */; }; + FF22FE6E16E554540046165A /* barbutton_refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6C16E554540046165A /* barbutton_refresh.png */; }; + FF22FE6F16E554540046165A /* barbutton_refresh@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE6D16E554540046165A /* barbutton_refresh@2x.png */; }; + FF22FE7216E554FD0046165A /* barbutton_sendto.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE7016E554FD0046165A /* barbutton_sendto.png */; }; + FF22FE7316E554FD0046165A /* barbutton_sendto@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE7116E554FD0046165A /* barbutton_sendto@2x.png */; }; + FF22FE7616E557D80046165A /* toolbar_tall_background.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE7416E557D80046165A /* toolbar_tall_background.png */; }; + FF22FE7716E557D80046165A /* toolbar_tall_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FF22FE7516E557D80046165A /* toolbar_tall_background@2x.png */; }; FF29708B16DD7AA400E92F85 /* segment_active.png in Resources */ = {isa = PBXBuildFile; fileRef = FF29708916DD7AA400E92F85 /* segment_active.png */; }; FF29708C16DD7AA400E92F85 /* segment_inactive.png in Resources */ = {isa = PBXBuildFile; fileRef = FF29708A16DD7AA400E92F85 /* segment_inactive.png */; }; FF29708E16DD7C8A00E92F85 /* segment_left_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = FF29708D16DD7C8A00E92F85 /* segment_left_selected.png */; }; @@ -650,6 +665,27 @@ FF22FE4C16E41EB40046165A /* disclosure_down.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = disclosure_down.png; sourceTree = ""; }; FF22FE4D16E41EB40046165A /* disclosure_down@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "disclosure_down@2x.png"; sourceTree = ""; }; FF22FE5016E42C600046165A /* world@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "world@2x.png"; sourceTree = ""; }; + FF22FE5416E53ADC0046165A /* Underscore+Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Underscore+Functional.h"; sourceTree = ""; }; + FF22FE5516E53ADC0046165A /* Underscore+Functional.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Underscore+Functional.m"; sourceTree = ""; }; + FF22FE5616E53ADC0046165A /* Underscore-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Underscore-Prefix.pch"; sourceTree = ""; }; + FF22FE5716E53ADC0046165A /* Underscore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Underscore.h; sourceTree = ""; }; + FF22FE5816E53ADC0046165A /* Underscore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Underscore.m; sourceTree = ""; }; + FF22FE5916E53ADC0046165A /* USArrayWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USArrayWrapper.h; sourceTree = ""; }; + FF22FE5A16E53ADC0046165A /* USArrayWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = USArrayWrapper.m; sourceTree = ""; }; + FF22FE5B16E53ADC0046165A /* USConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USConstants.h; sourceTree = ""; }; + FF22FE5C16E53ADC0046165A /* USDictionaryWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USDictionaryWrapper.h; sourceTree = ""; }; + FF22FE5D16E53ADC0046165A /* USDictionaryWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = USDictionaryWrapper.m; sourceTree = ""; }; + FF22FE6216E54B350046165A /* g_icn_folder_add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = g_icn_folder_add.png; sourceTree = ""; }; + FF22FE6416E54E590046165A /* barbutton_back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = barbutton_back.png; sourceTree = ""; }; + FF22FE6516E54E590046165A /* barbutton_back@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "barbutton_back@2x.png"; sourceTree = ""; }; + FF22FE6816E54F590046165A /* barbutton_forward.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = barbutton_forward.png; sourceTree = ""; }; + FF22FE6916E54F590046165A /* barbutton_forward@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "barbutton_forward@2x.png"; sourceTree = ""; }; + FF22FE6C16E554540046165A /* barbutton_refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = barbutton_refresh.png; sourceTree = ""; }; + FF22FE6D16E554540046165A /* barbutton_refresh@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "barbutton_refresh@2x.png"; sourceTree = ""; }; + FF22FE7016E554FD0046165A /* barbutton_sendto.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = barbutton_sendto.png; sourceTree = ""; }; + FF22FE7116E554FD0046165A /* barbutton_sendto@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "barbutton_sendto@2x.png"; sourceTree = ""; }; + FF22FE7416E557D80046165A /* toolbar_tall_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = toolbar_tall_background.png; sourceTree = ""; }; + FF22FE7516E557D80046165A /* toolbar_tall_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "toolbar_tall_background@2x.png"; sourceTree = ""; }; FF29708916DD7AA400E92F85 /* segment_active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = segment_active.png; sourceTree = ""; }; FF29708A16DD7AA400E92F85 /* segment_inactive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = segment_inactive.png; sourceTree = ""; }; FF29708D16DD7C8A00E92F85 /* segment_left_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = segment_left_selected.png; sourceTree = ""; }; @@ -960,6 +996,7 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + FF22FE5316E53ADC0046165A /* Underscore */, 43A4BABE15C8663600F3B8D4 /* Popover */, 43A3912E15B73A7B0074B212 /* AFNetworking */, 43F6A7A215B0E1A40092EE91 /* NSAttributedString+Attributes.h */, @@ -1142,6 +1179,17 @@ 431B857615A132B600DCE497 /* Images */ = { isa = PBXGroup; children = ( + FF22FE7416E557D80046165A /* toolbar_tall_background.png */, + FF22FE7516E557D80046165A /* toolbar_tall_background@2x.png */, + FF22FE7016E554FD0046165A /* barbutton_sendto.png */, + FF22FE7116E554FD0046165A /* barbutton_sendto@2x.png */, + FF22FE6C16E554540046165A /* barbutton_refresh.png */, + FF22FE6D16E554540046165A /* barbutton_refresh@2x.png */, + FF22FE6816E54F590046165A /* barbutton_forward.png */, + FF22FE6916E54F590046165A /* barbutton_forward@2x.png */, + FF22FE6416E54E590046165A /* barbutton_back.png */, + FF22FE6516E54E590046165A /* barbutton_back@2x.png */, + FF22FE6216E54B350046165A /* g_icn_folder_add.png */, FF22FE5016E42C600046165A /* world@2x.png */, FF22FE4416E410A60046165A /* folder_collapse.png */, FF22FE4516E410A60046165A /* folder_expand.png */, @@ -1512,6 +1560,23 @@ name = Foundation; sourceTree = ""; }; + FF22FE5316E53ADC0046165A /* Underscore */ = { + isa = PBXGroup; + children = ( + FF22FE5416E53ADC0046165A /* Underscore+Functional.h */, + FF22FE5516E53ADC0046165A /* Underscore+Functional.m */, + FF22FE5616E53ADC0046165A /* Underscore-Prefix.pch */, + FF22FE5716E53ADC0046165A /* Underscore.h */, + FF22FE5816E53ADC0046165A /* Underscore.m */, + FF22FE5916E53ADC0046165A /* USArrayWrapper.h */, + FF22FE5A16E53ADC0046165A /* USArrayWrapper.m */, + FF22FE5B16E53ADC0046165A /* USConstants.h */, + FF22FE5C16E53ADC0046165A /* USDictionaryWrapper.h */, + FF22FE5D16E53ADC0046165A /* USDictionaryWrapper.m */, + ); + path = Underscore; + sourceTree = ""; + }; FF29708816DD7AA400E92F85 /* segmented */ = { isa = PBXGroup; children = ( @@ -2134,6 +2199,17 @@ FF22FE4E16E41EB40046165A /* disclosure_down.png in Resources */, FF22FE4F16E41EB40046165A /* disclosure_down@2x.png in Resources */, FF22FE5116E42C600046165A /* world@2x.png in Resources */, + FF22FE6316E54B350046165A /* g_icn_folder_add.png in Resources */, + FF22FE6616E54E590046165A /* barbutton_back.png in Resources */, + FF22FE6716E54E590046165A /* barbutton_back@2x.png in Resources */, + FF22FE6A16E54F590046165A /* barbutton_forward.png in Resources */, + FF22FE6B16E54F590046165A /* barbutton_forward@2x.png in Resources */, + FF22FE6E16E554540046165A /* barbutton_refresh.png in Resources */, + FF22FE6F16E554540046165A /* barbutton_refresh@2x.png in Resources */, + FF22FE7216E554FD0046165A /* barbutton_sendto.png in Resources */, + FF22FE7316E554FD0046165A /* barbutton_sendto@2x.png in Resources */, + FF22FE7616E557D80046165A /* toolbar_tall_background.png in Resources */, + FF22FE7716E557D80046165A /* toolbar_tall_background@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2287,6 +2363,10 @@ FF67D3B2168924C40057A7DA /* TrainerViewController.m in Sources */, FF1660CD16D6FD8A00AF8541 /* SmallInteractionCell.m in Sources */, FF4151C016DED9660013E84B /* UIBarButtonItem+Image.m in Sources */, + FF22FE5E16E53ADC0046165A /* Underscore+Functional.m in Sources */, + FF22FE5F16E53ADC0046165A /* Underscore.m in Sources */, + FF22FE6016E53ADC0046165A /* USArrayWrapper.m in Sources */, + FF22FE6116E53ADC0046165A /* USDictionaryWrapper.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/media/ios/NewsBlur_Prefix.pch b/media/ios/NewsBlur_Prefix.pch index 1aca75e15..cb0a6f7d9 100644 --- a/media/ios/NewsBlur_Prefix.pch +++ b/media/ios/NewsBlur_Prefix.pch @@ -1,6 +1,9 @@ #ifdef __OBJC__ #import #import + #import "Underscore.h" + + #define _ Underscore #define UIColorFromRGB(rgbValue) [UIColor \ colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ @@ -10,8 +13,8 @@ // #define BACKGROUND_REFRESH_SECONDS -5 #define BACKGROUND_REFRESH_SECONDS -10*60 - #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"] -// #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"] +// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"] + #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"] #define NEWSBLUR_LINK_COLOR 0x405BA8 #define NEWSBLUR_HIGHLIGHT_COLOR 0xd2e6fd diff --git a/media/ios/Popover/WEPopoverContainerView.m b/media/ios/Popover/WEPopoverContainerView.m index 1319c1011..bc35d4d80 100755 --- a/media/ios/Popover/WEPopoverContainerView.m +++ b/media/ios/Popover/WEPopoverContainerView.m @@ -324,7 +324,6 @@ permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections theArrowRect.origin.y = CGRectGetMinY(theBgRect) - upArrowImage.size.height + properties.topBgMargin; } } - bgFrame = CGRectOffset(theBgRect, theOffset.x, theOffset.y); CGFloat minMargin = MIN(minMarginLeft, minMarginRight); minMargin = MIN(minMargin, minMarginTop); diff --git a/media/ios/Resources-iPhone/AddSiteViewController.xib b/media/ios/Resources-iPhone/AddSiteViewController.xib index 63fc8bd7d..cb6ce5c71 100644 --- a/media/ios/Resources-iPhone/AddSiteViewController.xib +++ b/media/ios/Resources-iPhone/AddSiteViewController.xib @@ -62,7 +62,7 @@ NO IBCocoaTouchFramework Adding... - + 3 MC4zMzMzMzMzMzMzAA @@ -171,6 +171,7 @@ {{0, 500}, {320, 216}} + _NS:624 IBCocoaTouchFramework YES @@ -181,7 +182,7 @@ {{20, 96}, {250, 31}} - + _NS:294 NO YES @@ -193,19 +194,19 @@ 3 Choose a folder - + YES 17 IBCocoaTouchFramework - + Helvetica-Bold Helvetica 2 12 - + Helvetica-Bold 12 16 @@ -226,7 +227,7 @@ 3 Search by site title or address... - + YES 18 @@ -265,7 +266,7 @@ 3 New folder title - + YES 18 @@ -277,8 +278,8 @@ IBCocoaTouchFramework 1 - - + + @@ -340,10 +341,10 @@ YES IBCocoaTouchFramework - + 289 - {{272, 100}, {28, 24}} + {{270, 96}, {50, 32}} @@ -353,10 +354,10 @@ IBCocoaTouchFramework 0 0 - 4 - 4 - 6 - 6 + 8 + 8 + 8 + 26 Button @@ -369,7 +370,7 @@ NSImage - g_icn_folder_rss.png + g_icn_folder_add.png 2 @@ -514,7 +515,7 @@ addFolderButton - + 69 @@ -619,7 +620,7 @@ toggleAddFolder: - + 7 @@ -663,7 +664,7 @@ - + @@ -752,7 +753,7 @@ 67 - + @@ -840,12 +841,10 @@ YES YES - addFolder addSite checkSiteAddress doAddButton doCancelButton - selectAddTypeSignup toggleAddFolder: @@ -855,28 +854,20 @@ id id id - id - id YES YES - addFolder addSite checkSiteAddress doAddButton doCancelButton - selectAddTypeSignup toggleAddFolder: YES - - addFolder - id - addSite id @@ -893,10 +884,6 @@ doCancelButton id - - selectAddTypeSignup - id - toggleAddFolder: id @@ -911,7 +898,6 @@ addButton addFolderButton addFolderInput - addTypeControl addingLabel appDelegate cancelButton @@ -930,7 +916,6 @@ UIBarButtonItem UIButton UITextField - UISegmentedControl UILabel NewsBlurAppDelegate UIBarButtonItem @@ -952,7 +937,6 @@ addButton addFolderButton addFolderInput - addTypeControl addingLabel appDelegate cancelButton @@ -983,10 +967,6 @@ addFolderInput UITextField - - addTypeControl - UISegmentedControl - addingLabel UILabel @@ -3373,7 +3353,7 @@ YES 3 - g_icn_folder_rss.png + g_icn_folder_add.png {32, 32} 2083 diff --git a/media/ios/Resources-iPhone/OriginalStoryViewController.xib b/media/ios/Resources-iPhone/OriginalStoryViewController.xib index 91fefd1ca..5bccf6f20 100644 --- a/media/ios/Resources-iPhone/OriginalStoryViewController.xib +++ b/media/ios/Resources-iPhone/OriginalStoryViewController.xib @@ -1,22 +1,22 @@ - 1280 - 11C74 - 1938 - 1138.23 - 567.00 + 1552 + 12C3006 + 3084 + 1187.34 + 625.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 + 2083 YES - IBUIWebView + IBProxyObject IBUIBarButtonItem IBUIToolbar IBUIView - IBProxyObject + IBUIWebView YES @@ -43,7 +43,7 @@ YES - 274 + 306 {{0, 44}, {320, 372}} @@ -4456,30 +4456,27 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {{0, 416}, {320, 44}} - NO - NO + + YES IBCocoaTouchFramework YES NSImage - back_button.png + barbutton_back.png IBCocoaTouchFramework + 44 - - IBCocoaTouchFramework - - 5 - NSImage - forward_button.png + barbutton_forward.png IBCocoaTouchFramework + 44 @@ -4487,30 +4484,23 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 5 - - IBCocoaTouchFramework - - 5 - - - IBCocoaTouchFramework - - 5 - + + NSImage + barbutton_refresh.png + IBCocoaTouchFramework + 44 - 13 - - - IBCocoaTouchFramework - - 5 + + NSImage + barbutton_sendto.png + IBCocoaTouchFramework + 44 - 9 @@ -4518,6 +4508,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {{0, 20}, {320, 460}} + 3 MQA @@ -4577,6 +4568,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 45 + + + refresh + + + + 60 + delegate @@ -4663,12 +4662,8 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - - - - @@ -4687,21 +4682,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - - 36 - - - - - 40 - - - - - 41 - - - 44 @@ -4712,11 +4692,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - - 57 - - - @@ -4730,17 +4705,13 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 1.IBPluginDependency 14.IBPluginDependency 17.IBPluginDependency - 36.IBPluginDependency 4.IBPluginDependency - 40.IBPluginDependency - 41.IBPluginDependency 44.IBPluginDependency 5.IBPluginDependency 52.IBPluginDependency - 57.IBPluginDependency 6.IBPluginDependency - + YES OriginalStoryViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -4754,10 +4725,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 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 @@ -4772,52 +4739,53 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - 58 + 60 YES - AddViewController + ActivityModule + UIView + + IBProjectSource + ./Classes/ActivityModule.h + + + + AddSiteViewController UIViewController YES YES - addFolder addSite checkSiteAddress doAddButton doCancelButton - selectAddTypeSignup + toggleAddFolder: - + YES id id id id id - id YES YES - addFolder addSite checkSiteAddress doAddButton doCancelButton - selectAddTypeSignup + toggleAddFolder: - + YES - - addFolder - id - addSite id @@ -4835,7 +4803,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE id - selectAddTypeSignup + toggleAddFolder: id @@ -4846,47 +4814,37 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES activityIndicator addButton + addFolderButton addFolderInput - addTypeControl addingLabel appDelegate cancelButton - emailLabel errorLabel folderPicker inFolderInput navBar - passwordLabel - passwordOptionalLabel siteActivityIndicator siteAddressInput siteScrollView siteTable - usernameLabel - usernameOrEmailLabel - + YES UIActivityIndicatorView UIBarButtonItem + UIButton UITextField - UISegmentedControl UILabel NewsBlurAppDelegate UIBarButtonItem UILabel - UILabel UIPickerView UITextField UINavigationBar - UILabel - UILabel UIActivityIndicatorView UITextField UIScrollView UITableView - UILabel - UILabel @@ -4895,26 +4853,21 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES activityIndicator addButton + addFolderButton addFolderInput - addTypeControl addingLabel appDelegate cancelButton - emailLabel errorLabel folderPicker inFolderInput navBar - passwordLabel - passwordOptionalLabel siteActivityIndicator siteAddressInput siteScrollView siteTable - usernameLabel - usernameOrEmailLabel - + YES activityIndicator @@ -4925,12 +4878,12 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE UIBarButtonItem - addFolderInput - UITextField + addFolderButton + UIButton - addTypeControl - UISegmentedControl + addFolderInput + UITextField addingLabel @@ -4944,10 +4897,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE cancelButton UIBarButtonItem - - emailLabel - UILabel - errorLabel UILabel @@ -4964,14 +4913,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE navBar UINavigationBar - - passwordLabel - UILabel - - - passwordOptionalLabel - UILabel - siteActivityIndicator UIActivityIndicatorView @@ -4988,59 +4929,245 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE siteTable UITableView - - usernameLabel - UILabel - - - usernameOrEmailLabel - UILabel - IBProjectSource - ./Classes/AddViewController.h + ./Classes/AddSiteViewController.h - FeedDetailViewController + BaseViewController + UIViewController + + IBProjectSource + ./Classes/BaseViewController.h + + + + DashboardViewController UIViewController YES YES - doOpenSettingsActionSheet - markAllRead - selectIntelligence + doLogout: + tapSegmentedButton: - + YES id id - id YES YES - doOpenSettingsActionSheet - markAllRead - selectIntelligence + doLogout: + tapSegmentedButton: - + YES - doOpenSettingsActionSheet + doLogout: id - markAllRead + tapSegmentedButton: + id + + + + + YES + + YES + activitiesModule + appDelegate + feedbackWebView + interactionsModule + segmentedButton + toolbar + topToolbar + + + YES + ActivityModule + NewsBlurAppDelegate + UIWebView + InteractionsModule + UISegmentedControl + UIToolbar + UIToolbar + + + + YES + + YES + activitiesModule + appDelegate + feedbackWebView + interactionsModule + segmentedButton + toolbar + topToolbar + + + YES + + activitiesModule + ActivityModule + + + appDelegate + NewsBlurAppDelegate + + + feedbackWebView + UIWebView + + + interactionsModule + InteractionsModule + + + segmentedButton + UISegmentedControl + + + toolbar + UIToolbar + + + topToolbar + UIToolbar + + + + + IBProjectSource + ./Classes/DashboardViewController.h + + + + FeedDetailMenuViewController + UIViewController + + YES + + YES + changeOrder: + changeReadFilter: + + + YES + id + id + + + + YES + + YES + changeOrder: + changeReadFilter: + + + YES + + changeOrder: id - selectIntelligence + changeReadFilter: + id + + + + + YES + + YES + appDelegate + menuTableView + orderSegmentedControl + readFilterSegmentedControl + + + YES + NewsBlurAppDelegate + UITableView + UISegmentedControl + UISegmentedControl + + + + YES + + YES + appDelegate + menuTableView + orderSegmentedControl + readFilterSegmentedControl + + + YES + + appDelegate + NewsBlurAppDelegate + + + menuTableView + UITableView + + + orderSegmentedControl + UISegmentedControl + + + readFilterSegmentedControl + UISegmentedControl + + + + + IBProjectSource + ./Classes/FeedDetailMenuViewController.h + + + + FeedDetailViewController + BaseViewController + + YES + + YES + doOpenMarkReadActionSheet: + doOpenSettingsActionSheet: + + + YES + id + id + + + + YES + + YES + doOpenMarkReadActionSheet: + doOpenSettingsActionSheet: + + + YES + + doOpenMarkReadActionSheet: + id + + + doOpenSettingsActionSheet: id @@ -5051,18 +5178,24 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES appDelegate feedMarkReadButton - feedScoreSlider - feedViewToolbar - intelligenceControl + rightToolbar + separatorBarButton + settingsBarButton + spacer2BarButton + spacer3BarButton + spacerBarButton storyTitlesTable - + YES NewsBlurAppDelegate UIBarButtonItem - UISlider - UIToolbar - UISegmentedControl + TransparentToolbar + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem UITableView @@ -5072,12 +5205,15 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES appDelegate feedMarkReadButton - feedScoreSlider - feedViewToolbar - intelligenceControl + rightToolbar + separatorBarButton + settingsBarButton + spacer2BarButton + spacer3BarButton + spacerBarButton storyTitlesTable - + YES appDelegate @@ -5088,16 +5224,28 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE UIBarButtonItem - feedScoreSlider - UISlider + rightToolbar + TransparentToolbar - feedViewToolbar - UIToolbar + separatorBarButton + UIBarButtonItem - intelligenceControl - UISegmentedControl + settingsBarButton + UIBarButtonItem + + + spacer2BarButton + UIBarButtonItem + + + spacer3BarButton + UIBarButtonItem + + + spacerBarButton + UIBarButtonItem storyTitlesTable @@ -5111,16 +5259,310 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - LoginViewController + FeedsMenuViewController + UIViewController + + YES + + YES + appDelegate + menuTableView + + + YES + NewsBlurAppDelegate + UITableView + + + + YES + + YES + appDelegate + menuTableView + + + YES + + appDelegate + NewsBlurAppDelegate + + + menuTableView + UITableView + + + + + IBProjectSource + ./Classes/FeedsMenuViewController.h + + + + FindSitesViewController + UIViewController + + YES + + YES + appDelegate + sitesSearchBar + sitesTable + + + YES + NewsBlurAppDelegate + UISearchBar + UITableView + + + + YES + + YES + appDelegate + sitesSearchBar + sitesTable + + + YES + + appDelegate + NewsBlurAppDelegate + + + sitesSearchBar + UISearchBar + + + sitesTable + UITableView + + + + + IBProjectSource + ./Classes/FindSitesViewController.h + + + + FirstTimeUserAddFriendsViewController UIViewController - selectLoginSignup + YES + + YES + tapFacebookButton + tapNextButton + tapTwitterButton + toggleAutoFollowFriends: + + + YES + id + id + id + id + + + + YES + + YES + tapFacebookButton + tapNextButton + tapTwitterButton + toggleAutoFollowFriends: + + + YES + + tapFacebookButton + id + + + tapNextButton + id + + + tapTwitterButton + id + + + toggleAutoFollowFriends: + id + + + + + YES + + YES + appDelegate + facebookActivityIndicator + facebookButton + friendsLabel + nextButton + twitterActivityIndicator + twitterButton + + + YES + NewsBlurAppDelegate + UIActivityIndicatorView + UIButton + UILabel + UIBarButtonItem + UIActivityIndicatorView + UIButton + + + + YES + + YES + appDelegate + facebookActivityIndicator + facebookButton + friendsLabel + nextButton + twitterActivityIndicator + twitterButton + + + YES + + appDelegate + NewsBlurAppDelegate + + + facebookActivityIndicator + UIActivityIndicatorView + + + facebookButton + UIButton + + + friendsLabel + UILabel + + + nextButton + UIBarButtonItem + + + twitterActivityIndicator + UIActivityIndicatorView + + + twitterButton + UIButton + + + + + IBProjectSource + ./Classes/FirstTimeUserAddFriendsViewController.h + + + + FirstTimeUserAddNewsBlurViewController + UIViewController + + YES + + YES + tapNewsBlurButton: + tapNextButton + tapPopularButton: + + + YES + id + id + id + + + + YES + + YES + tapNewsBlurButton: + tapNextButton + tapPopularButton: + + + YES + + tapNewsBlurButton: + id + + + tapNextButton + id + + + tapPopularButton: + id + + + + + YES + + YES + appDelegate + instructionsLabel + nextButton + + + YES + NewsBlurAppDelegate + UILabel + UIBarButtonItem + + + + YES + + YES + appDelegate + instructionsLabel + nextButton + + + YES + + appDelegate + NewsBlurAppDelegate + + + instructionsLabel + UILabel + + + nextButton + UIBarButtonItem + + + + + IBProjectSource + ./Classes/FirstTimeUserAddNewsBlurViewController.h + + + + FirstTimeUserAddSitesViewController + UIViewController + + tapNextButton id - selectLoginSignup + tapNextButton - selectLoginSignup + tapNextButton id @@ -5130,33 +5572,23 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES activityIndicator appDelegate - authenticatingLabel - emailInput - emailLabel - errorLabel - loginControl - passwordInput - passwordLabel - passwordOptionalLabel - usernameInput - usernameLabel - usernameOrEmailLabel + categoriesTable + googleReaderButton + googleReaderButtonWrapper + instructionLabel + nextButton + scrollView - + YES UIActivityIndicatorView NewsBlurAppDelegate + UITableView + UIButton + UIView UILabel - UITextField - UILabel - UILabel - UISegmentedControl - UITextField - UILabel - UILabel - UITextField - UILabel - UILabel + UIBarButtonItem + UIScrollView @@ -5165,19 +5597,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES activityIndicator appDelegate - authenticatingLabel - emailInput - emailLabel - errorLabel - loginControl - passwordInput - passwordLabel - passwordOptionalLabel - usernameInput - usernameLabel - usernameOrEmailLabel + categoriesTable + googleReaderButton + googleReaderButtonWrapper + instructionLabel + nextButton + scrollView - + YES activityIndicator @@ -5188,9 +5615,390 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE NewsBlurAppDelegate - authenticatingLabel + categoriesTable + UITableView + + + googleReaderButton + UIButton + + + googleReaderButtonWrapper + UIView + + + instructionLabel UILabel + + nextButton + UIBarButtonItem + + + scrollView + UIScrollView + + + + + IBProjectSource + ./Classes/FirstTimeUserAddSitesViewController.h + + + + FirstTimeUserViewController + UIViewController + + tapNextButton + id + + + tapNextButton + + tapNextButton + id + + + + YES + + YES + appDelegate + footer + header + logo + nextButton + + + YES + NewsBlurAppDelegate + UILabel + UILabel + UIImageView + UIBarButtonItem + + + + YES + + YES + appDelegate + footer + header + logo + nextButton + + + YES + + appDelegate + NewsBlurAppDelegate + + + footer + UILabel + + + header + UILabel + + + logo + UIImageView + + + nextButton + UIBarButtonItem + + + + + IBProjectSource + ./Classes/FirstTimeUserViewController.h + + + + FontSettingsViewController + UIViewController + + YES + + YES + changeFontSize: + changeFontStyle: + + + YES + id + id + + + + YES + + YES + changeFontSize: + changeFontStyle: + + + YES + + changeFontSize: + id + + + changeFontStyle: + id + + + + + YES + + YES + appDelegate + fontSizeSegment + fontStyleSegment + largeFontSizeLabel + menuTableView + smallFontSizeLabel + + + YES + NewsBlurAppDelegate + UISegmentedControl + UISegmentedControl + UILabel + UITableView + UILabel + + + + YES + + YES + appDelegate + fontSizeSegment + fontStyleSegment + largeFontSizeLabel + menuTableView + smallFontSizeLabel + + + YES + + appDelegate + NewsBlurAppDelegate + + + fontSizeSegment + UISegmentedControl + + + fontStyleSegment + UISegmentedControl + + + largeFontSizeLabel + UILabel + + + menuTableView + UITableView + + + smallFontSizeLabel + UILabel + + + + + IBProjectSource + ./Classes/FontSettingsViewController.h + + + + FriendsListViewController + UIViewController + + YES + + YES + appDelegate + friendSearchBar + friendsTable + + + YES + NewsBlurAppDelegate + UISearchBar + UITableView + + + + YES + + YES + appDelegate + friendSearchBar + friendsTable + + + YES + + appDelegate + NewsBlurAppDelegate + + + friendSearchBar + UISearchBar + + + friendsTable + UITableView + + + + + IBProjectSource + ./Classes/FriendsListViewController.h + + + + InteractionsModule + UIView + + IBProjectSource + ./Classes/InteractionsModule.h + + + + LoginViewController + UIViewController + + YES + + YES + selectLogin + selectLoginSignup + selectSignUp + tapLoginButton + tapSignUpButton + + + YES + id + id + id + id + id + + + + YES + + YES + selectLogin + selectLoginSignup + selectSignUp + tapLoginButton + tapSignUpButton + + + YES + + selectLogin + id + + + selectLoginSignup + id + + + selectSignUp + id + + + tapLoginButton + id + + + tapSignUpButton + id + + + + + YES + + YES + appDelegate + emailInput + emailLabel + errorLabel + logInView + loginControl + passwordInput + passwordLabel + passwordOptionalLabel + selectLoginButton + selectSignUpButton + signUpPasswordInput + signUpUsernameInput + signUpView + usernameInput + usernameLabel + usernameOrEmailLabel + + + YES + NewsBlurAppDelegate + UITextField + UILabel + UILabel + UIView + UISegmentedControl + UITextField + UILabel + UILabel + UIButton + UIButton + UITextField + UITextField + UIView + UITextField + UILabel + UILabel + + + + YES + + YES + appDelegate + emailInput + emailLabel + errorLabel + logInView + loginControl + passwordInput + passwordLabel + passwordOptionalLabel + selectLoginButton + selectSignUpButton + signUpPasswordInput + signUpUsernameInput + signUpView + usernameInput + usernameLabel + usernameOrEmailLabel + + + YES + + appDelegate + NewsBlurAppDelegate + emailInput UITextField @@ -5203,6 +6011,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE errorLabel UILabel + + logInView + UIView + loginControl UISegmentedControl @@ -5219,6 +6031,26 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE passwordOptionalLabel UILabel + + selectLoginButton + UIButton + + + selectSignUpButton + UIButton + + + signUpPasswordInput + UITextField + + + signUpUsernameInput + UITextField + + + signUpView + UIView + usernameInput UITextField @@ -5239,30 +6071,242 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - NewsBlurAppDelegate - NSObject + MoveSiteViewController + UIViewController + + YES + + YES + doCancelButton + doMoveButton + moveFolder + moveSite + + + YES + id + id + id + id + + + + YES + + YES + doCancelButton + doMoveButton + moveFolder + moveSite + + + YES + + doCancelButton + id + + + doMoveButton + id + + + moveFolder + id + + + moveSite + id + + + YES YES - addViewController + activityIndicator + appDelegate + cancelButton + errorLabel + folderPicker + fromFolderInput + moveButton + movingLabel + navBar + titleLabel + toFolderInput + + + YES + UIActivityIndicatorView + NewsBlurAppDelegate + UIBarButtonItem + UILabel + UIPickerView + UITextField + UIBarButtonItem + UILabel + UINavigationBar + UILabel + UITextField + + + + YES + + YES + activityIndicator + appDelegate + cancelButton + errorLabel + folderPicker + fromFolderInput + moveButton + movingLabel + navBar + titleLabel + toFolderInput + + + YES + + activityIndicator + UIActivityIndicatorView + + + appDelegate + NewsBlurAppDelegate + + + cancelButton + UIBarButtonItem + + + errorLabel + UILabel + + + folderPicker + UIPickerView + + + fromFolderInput + UITextField + + + moveButton + UIBarButtonItem + + + movingLabel + UILabel + + + navBar + UINavigationBar + + + titleLabel + UILabel + + + toFolderInput + UITextField + + + + + IBProjectSource + ./Classes/MoveSiteViewController.h + + + + NBContainerViewController + UIViewController + + appDelegate + NewsBlurAppDelegate + + + appDelegate + + appDelegate + NewsBlurAppDelegate + + + + IBProjectSource + ./Classes/NBContainerViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + NewsBlurAppDelegate + BaseViewController + + YES + + YES + addSiteViewController + dashboardViewController + feedDashboardViewController + feedDetailMenuViewController feedDetailViewController + feedsMenuViewController feedsViewController + findSitesViewController + firstTimeUserAddFriendsViewController + firstTimeUserAddNewsBlurViewController + firstTimeUserAddSitesViewController + firstTimeUserViewController + fontSettingsViewController + friendsListViewController + ftuxNavigationController loginViewController + masterContainerViewController + moveSiteViewController navigationController originalStoryViewController + shareViewController storyDetailViewController + storyPageControl + trainerViewController + userProfileViewController window - + YES - AddViewController + AddSiteViewController + DashboardViewController + FeedDashboardViewController + FeedDetailMenuViewController FeedDetailViewController + FeedsMenuViewController NewsBlurViewController + FindSitesViewController + FirstTimeUserAddFriendsViewController + FirstTimeUserAddNewsBlurViewController + FirstTimeUserAddSitesViewController + FirstTimeUserViewController + FontSettingsViewController + FriendsListViewController + UINavigationController LoginViewController + NBContainerViewController + MoveSiteViewController UINavigationController OriginalStoryViewController + ShareViewController StoryDetailViewController + StoryPageControl + TrainerViewController + UserProfileViewController UIWindow @@ -5270,33 +6314,107 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - addViewController + addSiteViewController + dashboardViewController + feedDashboardViewController + feedDetailMenuViewController feedDetailViewController + feedsMenuViewController feedsViewController + findSitesViewController + firstTimeUserAddFriendsViewController + firstTimeUserAddNewsBlurViewController + firstTimeUserAddSitesViewController + firstTimeUserViewController + fontSettingsViewController + friendsListViewController + ftuxNavigationController loginViewController + masterContainerViewController + moveSiteViewController navigationController originalStoryViewController + shareViewController storyDetailViewController + storyPageControl + trainerViewController + userProfileViewController window - + YES - addViewController - AddViewController + addSiteViewController + AddSiteViewController + + + dashboardViewController + DashboardViewController + + + feedDashboardViewController + FeedDashboardViewController + + + feedDetailMenuViewController + FeedDetailMenuViewController feedDetailViewController FeedDetailViewController + + feedsMenuViewController + FeedsMenuViewController + feedsViewController NewsBlurViewController + + findSitesViewController + FindSitesViewController + + + firstTimeUserAddFriendsViewController + FirstTimeUserAddFriendsViewController + + + firstTimeUserAddNewsBlurViewController + FirstTimeUserAddNewsBlurViewController + + + firstTimeUserAddSitesViewController + FirstTimeUserAddSitesViewController + + + firstTimeUserViewController + FirstTimeUserViewController + + + fontSettingsViewController + FontSettingsViewController + + + friendsListViewController + FriendsListViewController + + + ftuxNavigationController + UINavigationController + loginViewController LoginViewController + + masterContainerViewController + NBContainerViewController + + + moveSiteViewController + MoveSiteViewController + navigationController UINavigationController @@ -5305,10 +6423,26 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE originalStoryViewController OriginalStoryViewController + + shareViewController + ShareViewController + storyDetailViewController StoryDetailViewController + + storyPageControl + StoryPageControl + + + trainerViewController + TrainerViewController + + + userProfileViewController + UserProfileViewController + window UIWindow @@ -5322,18 +6456,24 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE NewsBlurViewController - UIViewController + BaseViewController YES YES - doAddButton - doLogoutButton - doSwitchSitesUnread + sectionTapped: + sectionUntapped: + sectionUntappedOutside: selectIntelligence + showInteractionsPopover: + showSettingsPopover: + tapAddSite: - + YES + UIButton + UIButton + UIButton id id id @@ -5344,52 +6484,75 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - doAddButton - doLogoutButton - doSwitchSitesUnread + sectionTapped: + sectionUntapped: + sectionUntappedOutside: selectIntelligence + showInteractionsPopover: + showSettingsPopover: + tapAddSite: - + YES - doAddButton - id + sectionTapped: + UIButton - doLogoutButton - id + sectionUntapped: + UIButton - doSwitchSitesUnread - id + sectionUntappedOutside: + UIButton selectIntelligence id + + showInteractionsPopover: + id + + + showSettingsPopover: + id + + + tapAddSite: + id + YES YES - addButton + activitiesButton + addBarButton appDelegate feedScoreSlider feedTitlesTable feedViewToolbar + homeButton + innerView intelligenceControl - logoutButton - sitesButton + noFocusMessage + settingsBarButton + toolbarLeftMargin - + YES UIBarButtonItem + UIBarButtonItem NewsBlurAppDelegate UISlider UITableView UIToolbar + UIBarButtonItem + UIView UISegmentedControl + UIView UIBarButtonItem UIBarButtonItem @@ -5398,19 +6561,27 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - addButton + activitiesButton + addBarButton appDelegate feedScoreSlider feedTitlesTable feedViewToolbar + homeButton + innerView intelligenceControl - logoutButton - sitesButton + noFocusMessage + settingsBarButton + toolbarLeftMargin - + YES - addButton + activitiesButton + UIBarButtonItem + + + addBarButton UIBarButtonItem @@ -5429,16 +6600,28 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE feedViewToolbar UIToolbar + + homeButton + UIBarButtonItem + + + innerView + UIView + intelligenceControl UISegmentedControl - logoutButton + noFocusMessage + UIView + + + settingsBarButton UIBarButtonItem - sitesButton + toolbarLeftMargin UIBarButtonItem @@ -5450,7 +6633,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE OriginalStoryViewController - UIViewController + BaseViewController YES @@ -5458,12 +6641,18 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE doCloseOriginalStoryViewController doOpenActionSheet loadAddress: + webViewGoBack: + webViewGoForward: + webViewRefresh: - + YES id id id + id + id + id @@ -5473,8 +6662,11 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE doCloseOriginalStoryViewController doOpenActionSheet loadAddress: + webViewGoBack: + webViewGoForward: + webViewRefresh: - + YES doCloseOriginalStoryViewController @@ -5488,6 +6680,18 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE loadAddress: id + + webViewGoBack: + id + + + webViewGoForward: + id + + + webViewRefresh: + id + @@ -5505,7 +6709,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE toolbar webView - + YES NewsBlurAppDelegate UIBarButtonItem @@ -5534,7 +6738,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE toolbar webView - + YES appDelegate @@ -5584,36 +6788,50 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - StoryDetailViewController + ShareViewController UIViewController YES YES - doNextUnreadStory - doPreviousStory + doCancelButton: + doReplyToComment: + doShareThisStory: + doToggleButton: - + YES id id + id + id YES YES - doNextUnreadStory - doPreviousStory + doCancelButton: + doReplyToComment: + doShareThisStory: + doToggleButton: - + YES - doNextUnreadStory + doCancelButton: id - doPreviousStory + doReplyToComment: + id + + + doShareThisStory: + id + + + doToggleButton: id @@ -5622,22 +6840,100 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - activity appDelegate - buttonNext - buttonPrevious - progressView - toolbar + appdotnetButton + commentField + facebookButton + keyboardHeight + storyTitle + submitButton + twitterButton + + + YES + NewsBlurAppDelegate + UIButton + UITextView + UIButton + NSLayoutConstraint + UILabel + UIBarButtonItem + UIButton + + + + YES + + YES + appDelegate + appdotnetButton + commentField + facebookButton + keyboardHeight + storyTitle + submitButton + twitterButton + + + YES + + appDelegate + NewsBlurAppDelegate + + + appdotnetButton + UIButton + + + commentField + UITextView + + + facebookButton + UIButton + + + keyboardHeight + NSLayoutConstraint + + + storyTitle + UILabel + + + submitButton + UIBarButtonItem + + + twitterButton + UIButton + + + + + IBProjectSource + ./Classes/ShareViewController.h + + + + StoryDetailViewController + BaseViewController + + YES + + YES + appDelegate + feedTitleGradient + innerView + noStorySelectedLabel webView - + YES - UIBarButtonItem NewsBlurAppDelegate - UIBarButtonItem - UIBarButtonItem - UIProgressView - UIToolbar + UIView + UIView + UILabel UIWebView @@ -5645,39 +6941,29 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - activity appDelegate - buttonNext - buttonPrevious - progressView - toolbar + feedTitleGradient + innerView + noStorySelectedLabel webView - + YES - - activity - UIBarButtonItem - appDelegate NewsBlurAppDelegate - buttonNext - UIBarButtonItem + feedTitleGradient + UIView - buttonPrevious - UIBarButtonItem + innerView + UIView - progressView - UIProgressView - - - toolbar - UIToolbar + noStorySelectedLabel + UILabel webView @@ -5690,13 +6976,314 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE ./Classes/StoryDetailViewController.h + + StoryPageControl + BaseViewController + + YES + + YES + doNextUnreadStory + doPreviousStory + showOriginalSubview: + tapProgressBar: + toggleFontSize: + + + YES + id + id + id + id + id + + + + YES + + YES + doNextUnreadStory + doPreviousStory + showOriginalSubview: + tapProgressBar: + toggleFontSize: + + + YES + + doNextUnreadStory + id + + + doPreviousStory + id + + + showOriginalSubview: + id + + + tapProgressBar: + id + + + toggleFontSize: + id + + + + + YES + + YES + activity + appDelegate + bottomPlaceholderToolbar + buttonAction + buttonNext + buttonPrevious + fontSettingsButton + originalStoryButton + pageControl + progressView + progressViewContainer + rightToolbar + scrollView + separatorBarButton + spacer2BarButton + spacer3BarButton + spacerBarButton + subscribeButton + toolbar + + + YES + UIBarButtonItem + NewsBlurAppDelegate + UIToolbar + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIPageControl + UIProgressView + UIView + TransparentToolbar + UIScrollView + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIBarButtonItem + UIToolbar + + + + YES + + YES + activity + appDelegate + bottomPlaceholderToolbar + buttonAction + buttonNext + buttonPrevious + fontSettingsButton + originalStoryButton + pageControl + progressView + progressViewContainer + rightToolbar + scrollView + separatorBarButton + spacer2BarButton + spacer3BarButton + spacerBarButton + subscribeButton + toolbar + + + YES + + activity + UIBarButtonItem + + + appDelegate + NewsBlurAppDelegate + + + bottomPlaceholderToolbar + UIToolbar + + + buttonAction + UIBarButtonItem + + + buttonNext + UIBarButtonItem + + + buttonPrevious + UIBarButtonItem + + + fontSettingsButton + UIBarButtonItem + + + originalStoryButton + UIBarButtonItem + + + pageControl + UIPageControl + + + progressView + UIProgressView + + + progressViewContainer + UIView + + + rightToolbar + TransparentToolbar + + + scrollView + UIScrollView + + + separatorBarButton + UIBarButtonItem + + + spacer2BarButton + UIBarButtonItem + + + spacer3BarButton + UIBarButtonItem + + + spacerBarButton + UIBarButtonItem + + + subscribeButton + UIBarButtonItem + + + toolbar + UIToolbar + + + + + IBProjectSource + ./Classes/StoryPageControl.h + + + + TrainerViewController + BaseViewController + + doCloseDialog: + id + + + doCloseDialog: + + doCloseDialog: + id + + + + YES + + YES + appDelegate + closeButton + navBar + webView + + + YES + NewsBlurAppDelegate + UIBarButtonItem + UINavigationBar + TrainerWebView + + + + YES + + YES + appDelegate + closeButton + navBar + webView + + + YES + + appDelegate + NewsBlurAppDelegate + + + closeButton + UIBarButtonItem + + + navBar + UINavigationBar + + + webView + TrainerWebView + + + + + IBProjectSource + ./Classes/TrainerViewController.h + + + + TrainerWebView + UIWebView + + IBProjectSource + ./Classes/TrainerWebView.h + + + + TransparentToolbar + UIToolbar + + IBProjectSource + ./Classes/TransparentToolbar.h + + + + UserProfileViewController + UIViewController + + IBProjectSource + ./Classes/UserProfileViewController.h + + 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -5708,15 +7295,19 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES YES - back_button.png - forward_button.png + barbutton_back.png + barbutton_forward.png + barbutton_refresh.png + barbutton_sendto.png - + YES - {16, 24} - {16, 24} + {24, 24} + {24, 24} + {16, 18} + {20, 15} - 933 + 2083 diff --git a/media/ios/Resources/barbutton_back.png b/media/ios/Resources/barbutton_back.png new file mode 100644 index 000000000..c17114d8b Binary files /dev/null and b/media/ios/Resources/barbutton_back.png differ diff --git a/media/ios/Resources/barbutton_back@2x.png b/media/ios/Resources/barbutton_back@2x.png new file mode 100644 index 000000000..97a7aeae0 Binary files /dev/null and b/media/ios/Resources/barbutton_back@2x.png differ diff --git a/media/ios/Resources/barbutton_forward.png b/media/ios/Resources/barbutton_forward.png new file mode 100644 index 000000000..0e15ce701 Binary files /dev/null and b/media/ios/Resources/barbutton_forward.png differ diff --git a/media/ios/Resources/barbutton_forward@2x.png b/media/ios/Resources/barbutton_forward@2x.png new file mode 100644 index 000000000..54ed08020 Binary files /dev/null and b/media/ios/Resources/barbutton_forward@2x.png differ diff --git a/media/ios/Resources/barbutton_refresh.png b/media/ios/Resources/barbutton_refresh.png new file mode 100644 index 000000000..5d8c12375 Binary files /dev/null and b/media/ios/Resources/barbutton_refresh.png differ diff --git a/media/ios/Resources/barbutton_refresh@2x.png b/media/ios/Resources/barbutton_refresh@2x.png new file mode 100644 index 000000000..fadfd0450 Binary files /dev/null and b/media/ios/Resources/barbutton_refresh@2x.png differ diff --git a/media/ios/Resources/barbutton_sendto.png b/media/ios/Resources/barbutton_sendto.png new file mode 100644 index 000000000..4ff95ce1e Binary files /dev/null and b/media/ios/Resources/barbutton_sendto.png differ diff --git a/media/ios/Resources/barbutton_sendto@2x.png b/media/ios/Resources/barbutton_sendto@2x.png new file mode 100644 index 000000000..728bf3ebb Binary files /dev/null and b/media/ios/Resources/barbutton_sendto@2x.png differ diff --git a/media/ios/Resources/g_icn_folder_add.png b/media/ios/Resources/g_icn_folder_add.png new file mode 100644 index 000000000..1d3042132 Binary files /dev/null and b/media/ios/Resources/g_icn_folder_add.png differ diff --git a/media/ios/Resources/toolbar_tall_background.png b/media/ios/Resources/toolbar_tall_background.png new file mode 100644 index 000000000..35ead7e42 Binary files /dev/null and b/media/ios/Resources/toolbar_tall_background.png differ diff --git a/media/ios/Resources/toolbar_tall_background@2x.png b/media/ios/Resources/toolbar_tall_background@2x.png new file mode 100644 index 000000000..c33cee59a Binary files /dev/null and b/media/ios/Resources/toolbar_tall_background@2x.png differ diff --git a/media/ios/Underscore/USArrayWrapper.h b/media/ios/Underscore/USArrayWrapper.h new file mode 100755 index 000000000..aeb8179ac --- /dev/null +++ b/media/ios/Underscore/USArrayWrapper.h @@ -0,0 +1,72 @@ +// +// USArrayWrapper.h +// Underscore +// +// Created by Robert Böhnke on 5/13/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import + +#import "USConstants.h" + +@interface USArrayWrapper : NSObject + ++ (USArrayWrapper *)wrap:(NSArray *)array; + +- (id)init __attribute__((deprecated("You should Underscore.array() instead"))); + +@property (readonly) NSArray *unwrap; + +@property (readonly) id first; +@property (readonly) id last; + +@property (readonly) USArrayWrapper *(^head)(NSUInteger n); +@property (readonly) USArrayWrapper *(^tail)(NSUInteger n); + +@property (readonly) NSUInteger (^indexOf)(id obj); + +@property (readonly) USArrayWrapper *flatten; +@property (readonly) USArrayWrapper *(^without)(NSArray *values); + +@property (readonly) USArrayWrapper *shuffle; + +@property (readonly) id (^reduce)(id memo, UnderscoreReduceBlock block); +@property (readonly) id (^reduceRight)(id memo, UnderscoreReduceBlock block); + +@property (readonly) USArrayWrapper *(^each)(UnderscoreArrayIteratorBlock block); +@property (readonly) USArrayWrapper *(^map)(UnderscoreArrayMapBlock block); + +@property (readonly) USArrayWrapper *(^pluck)(NSString *keyPath); + +@property (readonly) USArrayWrapper *uniq; + +@property (readonly) id (^find)(UnderscoreTestBlock block); + +@property (readonly) USArrayWrapper *(^filter)(UnderscoreTestBlock block); +@property (readonly) USArrayWrapper *(^reject)(UnderscoreTestBlock block); + +@property (readonly) BOOL (^all)(UnderscoreTestBlock block); +@property (readonly) BOOL (^any)(UnderscoreTestBlock block); + +@property (readonly) USArrayWrapper *(^sort)(UnderscoreSortBlock block); + +@end diff --git a/media/ios/Underscore/USArrayWrapper.m b/media/ios/Underscore/USArrayWrapper.m new file mode 100755 index 000000000..3580c5a38 --- /dev/null +++ b/media/ios/Underscore/USArrayWrapper.m @@ -0,0 +1,305 @@ +// +// USArrayWrapper.m +// Underscore +// +// Created by Robert Böhnke on 5/13/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import "Underscore.h" + +#import "USArrayWrapper.h" + +@interface USArrayWrapper () + +- initWithArray:(NSArray *)array; + +@property (readwrite, retain) NSArray *array; + +@end + +@implementation USArrayWrapper + +#pragma mark Class methods + ++ (USArrayWrapper *)wrap:(NSArray *)array +{ + return [[USArrayWrapper alloc] initWithArray:[array copy]]; +} + +#pragma mark Lifecycle + +- (id)init +{ + return [super init]; +} + +- (id)initWithArray:(NSArray *)array +{ + if (self = [super init]) { + self.array = array; + } + return self; +} + +@synthesize array = _array; + +- (NSArray *)unwrap +{ + return [self.array copy]; +} + +#pragma mark Underscore methods + +- (id)first +{ + return self.array.count ? [self.array objectAtIndex:0] : nil; +} + +- (id)last +{ + return self.array.lastObject; +} + +- (USArrayWrapper *(^)(NSUInteger))head +{ + return ^USArrayWrapper *(NSUInteger count) { + NSRange range = NSMakeRange(0, MIN(self.array.count, count)); + NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range]; + NSArray *result = [self.array objectsAtIndexes:indexSet]; + + return [[USArrayWrapper alloc] initWithArray:result]; + }; +} + +- (USArrayWrapper *(^)(NSUInteger))tail +{ + return ^USArrayWrapper *(NSUInteger count) { + NSRange range; + if (count > self.array.count) { + range = NSMakeRange(0, self.array.count); + } else { + range = NSMakeRange(self.array.count - count, count); + } + + NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range]; + NSArray *result = [self.array objectsAtIndexes:indexSet]; + + return [[USArrayWrapper alloc] initWithArray:result]; + }; +} + +- (NSUInteger (^)(id))indexOf +{ + return ^NSUInteger (id obj) { + return [self.array indexOfObject:obj]; + }; +} + +- (USArrayWrapper *)flatten +{ + __weak NSArray *array = self.array; + __block NSArray *(^flatten)(NSArray *) = ^NSArray *(NSArray *input) { + NSMutableArray *result = [NSMutableArray array]; + + for (id obj in input) { + if ([obj isKindOfClass:[NSArray class]]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-retain-cycles" + [result addObjectsFromArray:flatten(obj)]; +#pragma clang diagnostic pop + } else { + [result addObject:obj]; + } + } + + // If the outmost call terminates, nil the reference to flatten to break + // the retain cycle + if (input == array) { + flatten = nil; + } + + return result; + }; + + return [USArrayWrapper wrap:flatten(self.array)]; +} + +- (USArrayWrapper *(^)(NSArray *))without +{ + return ^USArrayWrapper *(NSArray *value) { + return self.reject(^(id obj){ + return [value containsObject:obj]; + }); + }; +} + +- (USArrayWrapper *)shuffle +{ + NSMutableArray *result = [self.array mutableCopy]; + + for (NSInteger i = result.count - 1; i > 0; i--) { + [result exchangeObjectAtIndex:arc4random() % (i + 1) + withObjectAtIndex:i]; + } + + return [[USArrayWrapper alloc] initWithArray:result]; +} + +- (id (^)(id, UnderscoreReduceBlock))reduce +{ + return ^USArrayWrapper *(id memo, UnderscoreReduceBlock function) { + for (id obj in self.array) { + memo = function(memo, obj); + } + + return memo; + }; +} + +- (id (^)(id, UnderscoreReduceBlock))reduceRight +{ + return ^USArrayWrapper *(id memo, UnderscoreReduceBlock function) { + for (id obj in self.array.reverseObjectEnumerator) { + memo = function(memo, obj); + } + + return memo; + }; +} + +- (USArrayWrapper *(^)(UnderscoreArrayIteratorBlock))each +{ + return ^USArrayWrapper *(UnderscoreArrayIteratorBlock block) { + for (id obj in self.array) { + block(obj); + } + + return self; + }; +} + +- (USArrayWrapper *(^)(UnderscoreArrayMapBlock))map +{ + return ^USArrayWrapper *(UnderscoreArrayMapBlock block) { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:self.array.count]; + + for (id obj in self.array) { + id mapped = block(obj); + + if (mapped) { + [result addObject:mapped]; + } + } + + return [[USArrayWrapper alloc] initWithArray:result]; + }; +} + +- (USArrayWrapper *(^)(NSString *))pluck +{ + return ^USArrayWrapper *(NSString *keyPath) { + return self.map(^id (id obj) { + return [obj valueForKeyPath:keyPath]; + }); + }; +} + +- (USArrayWrapper *)uniq +{ + NSSet* uniqSet = [NSSet setWithArray:self.array]; + NSArray* result = [uniqSet allObjects]; + + return [[USArrayWrapper alloc] initWithArray:result]; +} + +- (id (^)(UnderscoreTestBlock))find +{ + return ^id (UnderscoreTestBlock test) { + for (id obj in self.array) { + if (test(obj)) { + return obj; + } + } + + return nil; + }; +} + +- (USArrayWrapper *(^)(UnderscoreTestBlock))filter +{ + return ^USArrayWrapper *(UnderscoreTestBlock test) { + return self.map(^id (id obj) { + return test(obj) ? obj : nil; + }); + }; +} + +- (USArrayWrapper *(^)(UnderscoreTestBlock))reject +{ + return ^USArrayWrapper *(UnderscoreTestBlock test) { + return self.filter(Underscore.negate(test)); + }; +} + +- (BOOL (^)(UnderscoreTestBlock))all +{ + return ^BOOL (UnderscoreTestBlock test) { + if (self.array.count == 0) { + return NO; + } + + BOOL result = YES; + + for (id obj in self.array) { + if (!test(obj)) { + return NO; + } + } + + return result; + }; +} + +- (BOOL (^)(UnderscoreTestBlock))any +{ + return ^BOOL (UnderscoreTestBlock test) { + BOOL result = NO; + + for (id obj in self.array) { + if (test(obj)) { + return YES; + } + } + + return result; + }; +} + +- (USArrayWrapper *(^)(UnderscoreSortBlock))sort +{ + return ^USArrayWrapper *(UnderscoreSortBlock block) { + NSArray *result = [self.array sortedArrayUsingComparator:block]; + return [[USArrayWrapper alloc] initWithArray:result]; + }; +} + +@end diff --git a/media/ios/Underscore/USConstants.h b/media/ios/Underscore/USConstants.h new file mode 100755 index 000000000..6ea85ecb2 --- /dev/null +++ b/media/ios/Underscore/USConstants.h @@ -0,0 +1,38 @@ +// +// USConstants.h +// Underscore +// +// Created by Robert Böhnke on 5/14/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import + +typedef BOOL (^UnderscoreTestBlock)(id obj); +typedef id (^UnderscoreReduceBlock)(id memo, id obj); + +typedef void (^UnderscoreArrayIteratorBlock)(id obj); +typedef id (^UnderscoreArrayMapBlock)(id obj); + +typedef void (^UnderscoreDictionaryIteratorBlock)(id key, id obj); +typedef id (^UnderscoreDictionaryMapBlock)(id key, id obj); + +typedef NSComparisonResult (^UnderscoreSortBlock)(id a, id b); diff --git a/media/ios/Underscore/USDictionaryWrapper.h b/media/ios/Underscore/USDictionaryWrapper.h new file mode 100755 index 000000000..bab8ac690 --- /dev/null +++ b/media/ios/Underscore/USDictionaryWrapper.h @@ -0,0 +1,57 @@ +// +// USDictionaryWrapper.h +// Underscore +// +// Created by Robert Böhnke on 5/14/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import + +#import "USArrayWrapper.h" + +#import "USConstants.h" + +@interface USDictionaryWrapper : NSObject + ++ (USDictionaryWrapper *)wrap:(NSDictionary *)dictionary; +- (NSDictionary *)unwrap; + +- (id)init __attribute__((deprecated("You should Underscore.dict() instead"))); + +@property (readonly) USArrayWrapper *keys; +@property (readonly) USArrayWrapper *values; + +@property (readonly) USDictionaryWrapper *(^each)(UnderscoreDictionaryIteratorBlock block); +@property (readonly) USDictionaryWrapper *(^map)(UnderscoreDictionaryMapBlock block); + +@property (readonly) USDictionaryWrapper *(^pick)(NSArray *keys); + +@property (readonly) USDictionaryWrapper *(^extend)(NSDictionary *source); +@property (readonly) USDictionaryWrapper *(^defaults)(NSDictionary *defaults); + +@property (readonly) USDictionaryWrapper *(^filterKeys)(UnderscoreTestBlock block); +@property (readonly) USDictionaryWrapper *(^filterValues)(UnderscoreTestBlock block); + +@property (readonly) USDictionaryWrapper *(^rejectKeys)(UnderscoreTestBlock block); +@property (readonly) USDictionaryWrapper *(^rejectValues)(UnderscoreTestBlock block); + +@end diff --git a/media/ios/Underscore/USDictionaryWrapper.m b/media/ios/Underscore/USDictionaryWrapper.m new file mode 100755 index 000000000..62f15943d --- /dev/null +++ b/media/ios/Underscore/USDictionaryWrapper.m @@ -0,0 +1,188 @@ +// +// USDictionaryWrapper.m +// Underscore +// +// Created by Robert Böhnke on 5/14/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import "Underscore.h" + +#import "USDictionaryWrapper.h" + +@interface USDictionaryWrapper () + +- initWithDictionary:(NSDictionary *)dictionary; + +@property (readwrite, retain) NSDictionary *dictionary; + +@end + +@implementation USDictionaryWrapper + +#pragma mark Class methods + ++ (USDictionaryWrapper *)wrap:(NSDictionary *)dictionary +{ + return [[USDictionaryWrapper alloc] initWithDictionary:[dictionary copy]]; +} + +#pragma mark Lifecycle + +- (id)init +{ + return [super init]; +} + +- (id)initWithDictionary:(NSDictionary *)dictionary +{ + if (self = [super init]) { + self.dictionary = dictionary; + } + return self; +} +@synthesize dictionary = _dictionary; + +- (NSDictionary *)unwrap +{ + return [self.dictionary copy]; +} + +#pragma mark Underscore methods + +- (USArrayWrapper *)keys +{ + return [USArrayWrapper wrap:self.dictionary.allKeys]; +} + +- (USArrayWrapper *)values +{ + return [USArrayWrapper wrap:self.dictionary.allValues]; +} + +- (USDictionaryWrapper *(^)(UnderscoreDictionaryIteratorBlock))each +{ + return ^USDictionaryWrapper *(UnderscoreDictionaryIteratorBlock block) { + [self.dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + block(key, obj); + }]; + + return self; + }; +} + +- (USDictionaryWrapper *(^)(UnderscoreDictionaryMapBlock))map +{ + return ^USDictionaryWrapper *(UnderscoreDictionaryMapBlock block) { + NSMutableDictionary *result = [NSMutableDictionary dictionary]; + + [self.dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id mapped = block(key, obj); + + if (mapped) { + [result setObject:mapped + forKey:key]; + } + }]; + + return [[USDictionaryWrapper alloc] initWithDictionary:result]; + }; +} + +- (USDictionaryWrapper *(^)(NSArray *))pick +{ + return ^USDictionaryWrapper *(NSArray *keys) { + __block NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:keys.count]; + + [self.dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + if ([keys containsObject:key]) { + [result setObject:obj + forKey:key]; + } + }]; + + return [[USDictionaryWrapper alloc] initWithDictionary:result]; + }; +} + +- (USDictionaryWrapper *(^)(NSDictionary *))extend +{ + return ^USDictionaryWrapper *(NSDictionary *source) { + __block NSMutableDictionary *result = [self.dictionary mutableCopy]; + + [source enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + [result setObject:obj + forKey:key]; + }]; + + return [[USDictionaryWrapper alloc] initWithDictionary:result]; + }; +} + +- (USDictionaryWrapper *(^)(NSDictionary *))defaults +{ + return ^USDictionaryWrapper *(NSDictionary *source) { + __block NSMutableDictionary *result = [self.dictionary mutableCopy]; + + [source enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + if (![result valueForKey:key]) { + [result setObject:obj + forKey:key]; + } + }]; + + return [[USDictionaryWrapper alloc] initWithDictionary:result]; + }; +} + +- (USDictionaryWrapper *(^)(UnderscoreTestBlock))filterKeys +{ + return ^USDictionaryWrapper *(UnderscoreTestBlock test) { + return self.map(^id (id key, id obj) { + return test(key) ? obj : nil; + }); + }; +} + +- (USDictionaryWrapper *(^)(UnderscoreTestBlock))filterValues +{ + return ^USDictionaryWrapper *(UnderscoreTestBlock test) { + return self.map(^id (id key, id obj) { + return test(obj) ? obj : nil; + }); + }; +} + +- (USDictionaryWrapper *(^)(UnderscoreTestBlock))rejectKeys +{ + return ^USDictionaryWrapper *(UnderscoreTestBlock test) { + return self.filterKeys(Underscore.negate(test)); + }; +} + +- (USDictionaryWrapper *(^)(UnderscoreTestBlock))rejectValues +{ + return ^USDictionaryWrapper *(UnderscoreTestBlock test) { + return self.filterValues(Underscore.negate(test)); + }; +} + +@end diff --git a/media/ios/Underscore/Underscore+Functional.h b/media/ios/Underscore/Underscore+Functional.h new file mode 100755 index 000000000..4fe658478 --- /dev/null +++ b/media/ios/Underscore/Underscore+Functional.h @@ -0,0 +1,89 @@ +// +// Underscore+Functional.h +// Underscore +// +// Created by Robert Böhnke on 7/15/12. +// Copyright (c) 2012 Robert Böhnke. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import "Underscore.h" + +@interface Underscore (FunctionalStyle) + +#pragma mark NSArray functional style methods + ++ (USArrayWrapper *(^)(NSArray *))array; + ++ (id (^)(NSArray *))first; ++ (id (^)(NSArray *))last; + ++ (NSArray *(^)(NSArray *array, NSUInteger n))head; ++ (NSArray *(^)(NSArray *array, NSUInteger n))tail; + ++ (NSUInteger (^)(NSArray *array, id obj))indexOf; + ++ (NSArray *(^)(NSArray *array))flatten; ++ (NSArray *(^)(NSArray *array, NSArray *values))without; + ++ (NSArray *(^)(NSArray *array))shuffle; + ++ (id (^)(NSArray *array, id memo, UnderscoreReduceBlock block))reduce; ++ (id (^)(NSArray *array, id memo, UnderscoreReduceBlock block))reduceRight; + ++ (void (^)(NSArray *array, UnderscoreArrayIteratorBlock block))arrayEach; ++ (NSArray *(^)(NSArray *array, UnderscoreArrayMapBlock block))arrayMap; + ++ (NSArray *(^)(NSArray *array, NSString *keyPath))pluck; + ++ (NSArray *(^)(NSArray *array))uniq; + ++ (id (^)(NSArray *array, UnderscoreTestBlock block))find; + ++ (NSArray *(^)(NSArray *array, UnderscoreTestBlock block))filter; ++ (NSArray *(^)(NSArray *array, UnderscoreTestBlock block))reject; + ++ (BOOL (^)(NSArray *array, UnderscoreTestBlock block))all; ++ (BOOL (^)(NSArray *array, UnderscoreTestBlock block))any; + ++ (NSArray *(^)(NSArray *array, UnderscoreSortBlock block))sort; + +#pragma mark NSDictionary style methods + ++ (USDictionaryWrapper *(^)(NSDictionary *dictionary))dict; + ++ (NSArray *(^)(NSDictionary *dictionary))keys; ++ (NSArray *(^)(NSDictionary *dictionary))values; + ++ (void (^)(NSDictionary *dictionary, UnderscoreDictionaryIteratorBlock block))dictEach; ++ (NSDictionary *(^)(NSDictionary *dictionary, UnderscoreDictionaryMapBlock block))dictMap; + ++ (NSDictionary *(^)(NSDictionary *dictionary, NSArray *keys))pick; + ++ (NSDictionary *(^)(NSDictionary *dictionary, NSDictionary *source))extend; ++ (NSDictionary *(^)(NSDictionary *dictionary, NSDictionary *defaults))defaults; + ++ (NSDictionary *(^)(NSDictionary *dictionary, UnderscoreTestBlock block))filterKeys; ++ (NSDictionary *(^)(NSDictionary *dictionary, UnderscoreTestBlock block))filterValues; + ++ (NSDictionary *(^)(NSDictionary *dictionary, UnderscoreTestBlock block))rejectKeys; ++ (NSDictionary *(^)(NSDictionary *dictionary, UnderscoreTestBlock block))rejectValues; + +@end diff --git a/media/ios/Underscore/Underscore+Functional.m b/media/ios/Underscore/Underscore+Functional.m new file mode 100755 index 000000000..9e16c9710 --- /dev/null +++ b/media/ios/Underscore/Underscore+Functional.m @@ -0,0 +1,261 @@ +// +// Underscore+Functional.m +// Underscore +// +// Created by Robert Böhnke on 7/15/12. +// Copyright (c) 2012 Robert Böhnke. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import "Underscore+Functional.h" + +@implementation Underscore (Functional) + +#pragma mark NSArray shortcuts + ++ (USArrayWrapper *(^)(NSArray *))array +{ + return ^(NSArray *array) { + return [USArrayWrapper wrap:array]; + }; +} + ++ (id (^)(NSArray *))first +{ + return ^(NSArray *array) { + return Underscore.array(array).first; + }; +} + ++ (id (^)(NSArray *))last +{ + return ^(NSArray *array) { + return Underscore.array(array).last; + }; +} + ++ (NSArray *(^)(NSArray *, NSUInteger))head +{ + return ^(NSArray *array, NSUInteger n) { + return Underscore.array(array).head(n).unwrap; + }; +} + ++ (NSArray *(^)(NSArray *, NSUInteger))tail +{ + return ^(NSArray *array, NSUInteger n) { + return Underscore.array(array).tail(n).unwrap; + }; +} + ++ (NSUInteger (^)(NSArray *, id))indexOf +{ + return ^(NSArray *array, id obj) { + return Underscore.array(array).indexOf(obj); + }; +} + ++ (NSArray *(^)(NSArray *))flatten +{ + return ^(NSArray *array) { + return Underscore.array(array).flatten.unwrap; + }; +} + ++ (NSArray *(^)(NSArray *))uniq +{ + return ^(NSArray *array) { + return Underscore.array(array).uniq.unwrap; + }; +} + ++ (NSArray *(^)(NSArray *, NSArray *))without +{ + return ^(NSArray *array, NSArray *values) { + return Underscore.array(array).without(values).unwrap; + }; +} + ++ (NSArray *(^)(NSArray *))shuffle +{ + return ^(NSArray *array) { + return Underscore.array(array).shuffle.unwrap; + }; +} + ++(id (^)(NSArray *, id, UnderscoreReduceBlock))reduce +{ + return ^(NSArray *array, id memo, UnderscoreReduceBlock block) { + return Underscore.array(array).reduce(memo, block); + }; +} + ++ (id (^)(NSArray *, id, UnderscoreReduceBlock))reduceRight +{ + return ^(NSArray *array, id memo, UnderscoreReduceBlock block) { + return Underscore.array(array).reduceRight(memo, block); + }; +} + ++ (void (^)(NSArray *, UnderscoreArrayIteratorBlock))arrayEach +{ + return ^(NSArray *array, UnderscoreArrayIteratorBlock block) { + Underscore.array(array).each(block); + }; +} + ++ (NSArray *(^)(NSArray *array, UnderscoreArrayMapBlock block))arrayMap +{ + return ^(NSArray *array, UnderscoreArrayMapBlock block) { + return Underscore.array(array).map(block).unwrap; + }; +} + ++ (NSArray *(^)(NSArray *, NSString *))pluck +{ + return ^(NSArray *array, NSString *keyPath) { + return Underscore.array(array).pluck(keyPath).unwrap; + }; +} + ++ (id (^)(NSArray *, UnderscoreTestBlock))find +{ + return ^(NSArray *array, UnderscoreTestBlock block) { + return Underscore.array(array).find(block); + }; +} + ++ (NSArray *(^)(NSArray *, UnderscoreTestBlock))filter +{ + return ^(NSArray *array, UnderscoreTestBlock block) { + return Underscore.array(array).filter(block).unwrap; + }; +} ++ (NSArray *(^)(NSArray *, UnderscoreTestBlock))reject +{ + return ^(NSArray *array, UnderscoreTestBlock block) { + return Underscore.array(array).reject(block).unwrap; + }; +} + ++ (BOOL (^)(NSArray *, UnderscoreTestBlock))all +{ + return ^(NSArray *array, UnderscoreTestBlock block) { + return Underscore.array(array).all(block); + }; +} ++ (BOOL (^)(NSArray *, UnderscoreTestBlock))any +{ + return ^(NSArray *array, UnderscoreTestBlock block) { + return Underscore.array(array).any(block); + }; +} + ++ (NSArray *(^)(NSArray *, UnderscoreSortBlock))sort +{ + return ^(NSArray *array, UnderscoreSortBlock block) { + return Underscore.array(array).sort(block).unwrap; + }; +} + +#pragma mark NSDictionary shortcuts + ++ (USDictionaryWrapper *(^)(NSDictionary *))dict +{ + return ^(NSDictionary *dictionary) { + return [USDictionaryWrapper wrap:dictionary]; + }; +} + ++ (NSArray *(^)(NSDictionary *))keys +{ + return ^(NSDictionary *dictionary) { + return [USDictionaryWrapper wrap:dictionary].keys.unwrap; + }; +} ++ (NSArray *(^)(NSDictionary *))values +{ + return ^(NSDictionary *dictionary) { + return [USDictionaryWrapper wrap:dictionary].values.unwrap; + }; +} + ++ (void (^)(NSDictionary *, UnderscoreDictionaryIteratorBlock))dictEach +{ + return ^(NSDictionary *dictionary, UnderscoreDictionaryIteratorBlock block) { + Underscore.dict(dictionary).each(block); + }; +} + ++ (NSDictionary *(^)(NSDictionary *, UnderscoreDictionaryMapBlock))dictMap +{ + return ^(NSDictionary *dictionary, UnderscoreDictionaryMapBlock block) { + return Underscore.dict(dictionary).map(block).unwrap; + }; +} + ++ (NSDictionary *(^)(NSDictionary *, NSArray *))pick +{ + return ^(NSDictionary *dictionary, NSArray *keys) { + return [USDictionaryWrapper wrap:dictionary].pick(keys).unwrap; + }; +} + ++ (NSDictionary *(^)(NSDictionary *, NSDictionary *))extend +{ + return ^(NSDictionary *dictionary, NSDictionary *source) { + return [USDictionaryWrapper wrap:dictionary].extend(source).unwrap; + }; +} ++ (NSDictionary *(^)(NSDictionary *, NSDictionary *))defaults +{ + return ^(NSDictionary *dictionary, NSDictionary *defaults) { + return [USDictionaryWrapper wrap:dictionary].defaults(defaults).unwrap; + }; +} + ++ (NSDictionary *(^)(NSDictionary *, UnderscoreTestBlock))filterKeys +{ + return ^(NSDictionary *dictionary, UnderscoreTestBlock block) { + return [USDictionaryWrapper wrap:dictionary].filterKeys(block).unwrap; + }; +} ++ (NSDictionary *(^)(NSDictionary *, UnderscoreTestBlock))filterValues +{ + return ^(NSDictionary *dictionary, UnderscoreTestBlock block) { + return [USDictionaryWrapper wrap:dictionary].filterValues(block).unwrap; + }; +} + ++ (NSDictionary *(^)(NSDictionary *, UnderscoreTestBlock))rejectKeys +{ + return ^(NSDictionary *dictionary, UnderscoreTestBlock block) { + return [USDictionaryWrapper wrap:dictionary].rejectKeys(block).unwrap; + }; +} + ++ (NSDictionary *(^)(NSDictionary *, UnderscoreTestBlock))rejectValues +{ + return ^(NSDictionary *dictionary, UnderscoreTestBlock block) { + return [USDictionaryWrapper wrap:dictionary].rejectValues(block).unwrap; + }; +} + +@end diff --git a/media/ios/Underscore/Underscore-Prefix.pch b/media/ios/Underscore/Underscore-Prefix.pch new file mode 100755 index 000000000..46c3c9ac9 --- /dev/null +++ b/media/ios/Underscore/Underscore-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Underscore' target in the 'Underscore' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/media/ios/Underscore/Underscore.h b/media/ios/Underscore/Underscore.h new file mode 100755 index 000000000..40d0f3f53 --- /dev/null +++ b/media/ios/Underscore/Underscore.h @@ -0,0 +1,50 @@ +// +// Underscore.h +// Underscore +// +// Created by Robert Böhnke on 4/29/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import + +#import "USConstants.h" +#import "USArrayWrapper.h" +#import "USDictionaryWrapper.h" + +@interface Underscore : NSObject + ++ (UnderscoreTestBlock(^)(UnderscoreTestBlock))negate; ++ (UnderscoreTestBlock(^)(id obj))isEqual; + ++ (UnderscoreTestBlock)isArray; ++ (UnderscoreTestBlock)isDictionary; ++ (UnderscoreTestBlock)isNull; ++ (UnderscoreTestBlock)isNumber; ++ (UnderscoreTestBlock)isString; + ++ (UnderscoreSortBlock)compare; + +- (id)init __deprecated; + +@end + +#import "Underscore+Functional.h" diff --git a/media/ios/Underscore/Underscore.m b/media/ios/Underscore/Underscore.m new file mode 100755 index 000000000..048de044b --- /dev/null +++ b/media/ios/Underscore/Underscore.m @@ -0,0 +1,100 @@ +// +// Underscore.m +// Underscore +// +// Created by Robert Böhnke on 5/14/12. +// Copyright (C) 2012 Robert Böhnke +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +#import "Underscore.h" + +#if !__has_feature(objc_arc) +# error Underscore.m requires Automatic Reference Counting to be enabled +#endif + +@implementation Underscore + ++ (UnderscoreTestBlock (^)(UnderscoreTestBlock))negate +{ + return ^UnderscoreTestBlock (UnderscoreTestBlock test) { + return ^BOOL (id obj) { + return !test(obj); + }; + }; +} + ++ (UnderscoreTestBlock(^)(id obj))isEqual +{ + return ^UnderscoreTestBlock (id obj) { + return ^BOOL (id other) { + return [obj isEqual:other]; + }; + }; +} + ++ (UnderscoreTestBlock)isArray +{ + return ^BOOL (id obj) { + return [obj isKindOfClass:[NSArray class]]; + }; +} + ++ (UnderscoreTestBlock)isDictionary +{ + return ^BOOL (id obj) { + return [obj isKindOfClass:[NSDictionary class]]; + }; +} + ++ (UnderscoreTestBlock)isNull +{ + return ^BOOL (id obj) { + return [obj isKindOfClass:[NSNull class]]; + }; +} + ++ (UnderscoreTestBlock)isNumber +{ + return ^BOOL (id obj) { + return [obj isKindOfClass:[NSNumber class]]; + }; +} + ++ (UnderscoreTestBlock)isString +{ + return ^BOOL (id obj) { + return [obj isKindOfClass:[NSString class]]; + }; +} + ++ (UnderscoreSortBlock)compare +{ + return ^NSComparisonResult(id a, id b){ + return [a compare:b]; + }; +} + +- (id)init +{ + return [super init]; +} + +@end