Stubbing in menu options for marking as unred, saving stories, and sharing stories from the story detail in ios.

This commit is contained in:
Samuel Clay 2012-10-15 09:16:01 -07:00
parent d5c72cccb0
commit 2b11e6e2af
9 changed files with 307 additions and 71 deletions

View file

@ -331,6 +331,7 @@ def load_feeds_flat(request):
}
social_feeds = MSocialSubscription.feeds(**social_params)
social_profile = MSocialProfile.profile(user.pk)
starred_count = MStarredStory.objects(user_id=user.pk).count()
categories = None
if not user_subs:
@ -348,6 +349,7 @@ def load_feeds_flat(request):
"user_profile": user.profile,
"iphone_version": iphone_version,
"categories": categories,
'starred_count': starred_count,
}
return data

View file

@ -140,15 +140,14 @@
[appDelegate.feedDetailViewController openMoveView];
} else if (indexPath.row == 2) {
[appDelegate.feedDetailViewController instafetchFeed];
[appDelegate.feedDetailViewController.popoverController dismissPopoverAnimated:YES];
}
// if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [appDelegate.masterContainerViewController hidePopover];
// } else {
// [appDelegate.feedDetailViewController.popoverController dismissPopoverAnimated:YES];
// appDelegate.feedDetailViewController.popoverController = nil;
// }
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[appDelegate.masterContainerViewController hidePopover];
} else {
[appDelegate.feedDetailViewController.popoverController dismissPopoverAnimated:YES];
appDelegate.feedDetailViewController.popoverController = nil;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

View file

@ -10,7 +10,9 @@
@class NewsBlurAppDelegate;
@interface FontSettingsViewController : UIViewController {
@interface FontSettingsViewController : UIViewController
<UITableViewDelegate,
UITableViewDataSource> {
NewsBlurAppDelegate *appDelegate;
IBOutlet UILabel *smallFontSizeLabel;
@ -20,10 +22,13 @@
@property (nonatomic) IBOutlet NewsBlurAppDelegate *appDelegate;
@property ( nonatomic) IBOutlet UISegmentedControl *fontStyleSegment;
@property ( nonatomic) IBOutlet UISegmentedControl *fontSizeSegment;
@property (nonatomic) IBOutlet UITableView *menuTableView;
- (IBAction)changeFontStyle:(id)sender;
- (IBAction)changeFontSize:(id)sender;
- (void)setSanSerif;
- (void)setSerif;
- (UITableViewCell *)makeFontSelectionTableCell;
- (UITableViewCell *)makeFontSizeTableCell;
@end

View file

@ -12,9 +12,12 @@
@implementation FontSettingsViewController
#define kMenuOptionHeight 38
@synthesize appDelegate;
@synthesize fontStyleSegment;
@synthesize fontSizeSegment;
@synthesize menuTableView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
@ -28,10 +31,12 @@
- (void)viewDidLoad
{
[super viewDidLoad];
self.menuTableView.backgroundColor = UIColorFromRGB(0xF0FFF0);
self.menuTableView.separatorColor = UIColorFromRGB(0x8AA378);
}
- (void)viewWillAppear:(BOOL)animated {
self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate];
self.appDelegate = [NewsBlurAppDelegate sharedAppDelegate];
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
@ -112,4 +117,105 @@
[appDelegate.storyDetailViewController setFontStyle:@"Georgia"];
}
#pragma mark -
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 6;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIndentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIndentifier];
if (indexPath.row == 4) {
return [self makeFontSelectionTableCell];
} else if (indexPath.row == 5) {
return [self makeFontSizeTableCell];
}
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIndentifier];
}
cell.contentView.backgroundColor = UIColorFromRGB(0xBAE3A8);
cell.textLabel.backgroundColor = UIColorFromRGB(0xBAE3A8);
cell.textLabel.textColor = UIColorFromRGB(0x303030);
cell.textLabel.shadowColor = UIColorFromRGB(0xF0FFF0);
cell.textLabel.shadowOffset = CGSizeMake(0, 1);
cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.0];
if (cell.selected) {
cell.contentView.backgroundColor = UIColorFromRGB(0x639510);
cell.textLabel.backgroundColor = UIColorFromRGB(0x639510);
cell.selectedBackgroundView.backgroundColor = UIColorFromRGB(0x639510);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (indexPath.row == 0) {
cell.textLabel.text = [@"Save this story" uppercaseString];
cell.imageView.image = [UIImage imageNamed:@"bin_closed"];
} else if (indexPath.row == 1) {
cell.textLabel.text = [@"Mark as unread" uppercaseString];
cell.imageView.image = [UIImage imageNamed:@"arrow_branch"];
} else if (indexPath.row == 2) {
cell.textLabel.text = [@"Share this story" uppercaseString];
cell.imageView.image = [UIImage imageNamed:@"car"];
} else if (indexPath.row == 3) {
cell.textLabel.text = [@"Send to..." uppercaseString];
cell.imageView.image = [UIImage imageNamed:@"car"];
}
return cell;
}
- (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return kMenuOptionHeight;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
[appDelegate.storyDetailViewController markStoryAsSaved];
} else if (indexPath.row == 1) {
[appDelegate.storyDetailViewController markStoryAsUnread];
} else if (indexPath.row == 2) {
[appDelegate.storyDetailViewController openShareDialog];
} else if (indexPath.row == 3) {
[appDelegate.storyDetailViewController openSendToDialog];
}
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [appDelegate.masterContainerViewController hidePopover];
} else {
[appDelegate.storyDetailViewController.popoverController dismissPopoverAnimated:YES];
appDelegate.storyDetailViewController.popoverController = nil;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (UITableViewCell *)makeFontSelectionTableCell {
UITableViewCell *cell = [[UITableViewCell alloc] init];
cell.frame = CGRectMake(0, 0, 240, kMenuOptionHeight);
cell.backgroundColor = [UIColor redColor];
return cell;
}
- (UITableViewCell *)makeFontSizeTableCell {
UITableViewCell *cell = [[UITableViewCell alloc] init];
cell.frame = CGRectMake(0, 0, 240, kMenuOptionHeight);
cell.backgroundColor = [UIColor redColor];
return cell;
}
@end

View file

@ -1,19 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1181</string>
<string key="NS.object.0">1926</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIView</string>
<string>IBUISegmentedControl</string>
<string>IBUITableView</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@ -38,7 +39,7 @@
<object class="IBUISegmentedControl" id="301635770">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{20, 20}, {234, 30}}</string>
<string key="NSFrame">{{3, 20}, {234, 30}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="583946447"/>
@ -72,7 +73,7 @@
<object class="IBUISegmentedControl" id="583946447">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{20, 81}, {234, 30}}</string>
<string key="NSFrame">{{3, 81}, {234, 30}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
@ -118,11 +119,33 @@
<reference ref="4"/>
</array>
</object>
<object class="IBUITableView" id="120081234">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, -1}, {240, 223}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="301635770"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIAlwaysBounceVertical">YES</bool>
<int key="IBUISeparatorStyle">1</int>
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
<float key="IBUIRowHeight">44</float>
<float key="IBUISectionHeaderHeight">22</float>
<float key="IBUISectionFooterHeight">22</float>
</object>
</array>
<string key="NSFrameSize">{274, 130}</string>
<string key="NSFrameSize">{240, 222}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="301635770"/>
<reference key="NSNextKeyView" ref="120081234"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -164,6 +187,14 @@
</object>
<int key="connectionID">34</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">menuTableView</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="120081234"/>
</object>
<int key="connectionID">38</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">changeFontStyle:</string>
@ -182,6 +213,22 @@
</object>
<int key="connectionID">29</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="120081234"/>
<reference key="destination" ref="841351856"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="120081234"/>
<reference key="destination" ref="841351856"/>
</object>
<int key="connectionID">37</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@ -208,6 +255,7 @@
<array class="NSMutableArray" key="children">
<reference ref="301635770"/>
<reference ref="583946447"/>
<reference ref="120081234"/>
</array>
<reference key="parent" ref="0"/>
</object>
@ -221,6 +269,11 @@
<reference key="object" ref="583946447"/>
<reference key="parent" ref="766721923"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">35</int>
<reference key="object" ref="120081234"/>
<reference key="parent" ref="766721923"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@ -232,12 +285,13 @@
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<integer value="0" key="28.IUISegmentedControlInspectorSelectedSegmentMetadataKey"/>
<string key="35.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">34</int>
<int key="maxID">38</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -439,12 +493,34 @@
<string key="minorKey">./Classes/DashboardViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FeedDetailMenuViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="appDelegate">NewsBlurAppDelegate</string>
<string key="menuTableView">UITableView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="appDelegate">
<string key="name">appDelegate</string>
<string key="candidateClassName">NewsBlurAppDelegate</string>
</object>
<object class="IBToOneOutletInfo" key="menuTableView">
<string key="name">menuTableView</string>
<string key="candidateClassName">UITableView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/FeedDetailMenuViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">FeedDetailViewController</string>
<string key="superclassName">BaseViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="doOpenMarkReadActionSheet:">id</string>
<string key="doOpenSettingsActionSheet">id</string>
<string key="doOpenSettingsActionSheet:">id</string>
<string key="selectIntelligence">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
@ -452,8 +528,8 @@
<string key="name">doOpenMarkReadActionSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="doOpenSettingsActionSheet">
<string key="name">doOpenSettingsActionSheet</string>
<object class="IBActionInfo" key="doOpenSettingsActionSheet:">
<string key="name">doOpenSettingsActionSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="selectIntelligence">
@ -649,7 +725,7 @@
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="appDelegate">NewsBlurAppDelegate</string>
<string key="instructionsLabel">UIButton</string>
<string key="instructionsLabel">UILabel</string>
<string key="nextButton">UIBarButtonItem</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
@ -659,7 +735,7 @@
</object>
<object class="IBToOneOutletInfo" key="instructionsLabel">
<string key="name">instructionsLabel</string>
<string key="candidateClassName">UIButton</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="nextButton">
<string key="name">nextButton</string>
@ -674,32 +750,26 @@
<object class="IBPartialClassDescription">
<string key="className">FirstTimeUserAddSitesViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="tapCategoryButton:">id</string>
<string key="tapGoogleReaderButton">id</string>
<string key="tapNextButton">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="tapCategoryButton:">
<string key="name">tapCategoryButton:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="tapGoogleReaderButton">
<string key="name">tapGoogleReaderButton</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="tapNextButton">
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">tapNextButton</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">tapNextButton</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">tapNextButton</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="activityIndicator">UIActivityIndicatorView</string>
<string key="appDelegate">NewsBlurAppDelegate</string>
<string key="categoriesTable">UITableView</string>
<string key="googleReaderButton">UIButton</string>
<string key="googleReaderButtonWrapper">UIView</string>
<string key="instructionLabel">UILabel</string>
<string key="nextButton">UIBarButtonItem</string>
<string key="scrollView">UIScrollView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="activityIndicator">
@ -710,6 +780,10 @@
<string key="name">appDelegate</string>
<string key="candidateClassName">NewsBlurAppDelegate</string>
</object>
<object class="IBToOneOutletInfo" key="categoriesTable">
<string key="name">categoriesTable</string>
<string key="candidateClassName">UITableView</string>
</object>
<object class="IBToOneOutletInfo" key="googleReaderButton">
<string key="name">googleReaderButton</string>
<string key="candidateClassName">UIButton</string>
@ -726,6 +800,10 @@
<string key="name">nextButton</string>
<string key="candidateClassName">UIBarButtonItem</string>
</object>
<object class="IBToOneOutletInfo" key="scrollView">
<string key="name">scrollView</string>
<string key="candidateClassName">UIScrollView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@ -802,6 +880,7 @@
<string key="fontSizeSegment">UISegmentedControl</string>
<string key="fontStyleSegment">UISegmentedControl</string>
<string key="largeFontSizeLabel">UILabel</string>
<string key="menuTableView">UITableView</string>
<string key="smallFontSizeLabel">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
@ -821,6 +900,10 @@
<string key="name">largeFontSizeLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="menuTableView">
<string key="name">menuTableView</string>
<string key="candidateClassName">UITableView</string>
</object>
<object class="IBToOneOutletInfo" key="smallFontSizeLabel">
<string key="name">smallFontSizeLabel</string>
<string key="candidateClassName">UILabel</string>
@ -1109,6 +1192,7 @@
<string key="addSiteViewController">AddSiteViewController</string>
<string key="dashboardViewController">DashboardViewController</string>
<string key="feedDashboardViewController">FeedDashboardViewController</string>
<string key="feedDetailMenuViewController">FeedDetailMenuViewController</string>
<string key="feedDetailViewController">FeedDetailViewController</string>
<string key="feedsMenuViewController">FeedsMenuViewController</string>
<string key="feedsViewController">NewsBlurViewController</string>
@ -1143,6 +1227,10 @@
<string key="name">feedDashboardViewController</string>
<string key="candidateClassName">FeedDashboardViewController</string>
</object>
<object class="IBToOneOutletInfo" key="feedDetailMenuViewController">
<string key="name">feedDetailMenuViewController</string>
<string key="candidateClassName">FeedDetailMenuViewController</string>
</object>
<object class="IBToOneOutletInfo" key="feedDetailViewController">
<string key="name">feedDetailViewController</string>
<string key="candidateClassName">FeedDetailViewController</string>
@ -1269,6 +1357,8 @@
<string key="homeButton">UIBarButtonItem</string>
<string key="innerView">UIView</string>
<string key="intelligenceControl">UISegmentedControl</string>
<string key="noFocusMessage">UIView</string>
<string key="toolbarLeftMargin">UIBarButtonItem</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="appDelegate">
@ -1299,6 +1389,14 @@
<string key="name">intelligenceControl</string>
<string key="candidateClassName">UISegmentedControl</string>
</object>
<object class="IBToOneOutletInfo" key="noFocusMessage">
<string key="name">noFocusMessage</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="toolbarLeftMargin">
<string key="name">toolbarLeftMargin</string>
<string key="candidateClassName">UIBarButtonItem</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@ -1592,6 +1690,6 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">1181</string>
<string key="IBCocoaTouchPluginVersion">1926</string>
</data>
</archive>

View file

@ -76,6 +76,10 @@ UIScrollViewDelegate> {
- (void)showShareHUD:(NSString *)msg;
- (void)refreshComments:(NSString *)replyId;
- (void)finishMarkAsRead:(ASIHTTPRequest *)request;
- (void)openSendToDialog;
- (void)markStoryAsUnread;
- (void)markStoryAsSaved;
- (void)openShareDialog;
- (void)finishLikeComment:(ASIHTTPRequest *)request;
- (void)subscribeToBlurblog;
- (void)finishSubscribeToBlurblog:(ASIHTTPRequest *)request;

View file

@ -21,6 +21,7 @@
#import "NBContainerViewController.h"
#import "DataUtilities.h"
#import "JSON.h"
#import "SHK.h"
@interface StoryDetailViewController ()
@ -987,29 +988,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
}
return NO;
} else if ([action isEqualToString:@"share"]) {
// test to see if the user has commented
// search for the comment from friends comments
NSArray *friendComments = [appDelegate.activeStory objectForKey:@"friend_comments"];
NSString *currentUserId = [NSString stringWithFormat:@"%@", [appDelegate.dictUserProfile objectForKey:@"user_id"]];
for (int i = 0; i < friendComments.count; i++) {
NSString *userId = [NSString stringWithFormat:@"%@",
[[friendComments objectAtIndex:i] objectForKey:@"user_id"]];
if([userId isEqualToString:currentUserId]){
appDelegate.activeComment = [friendComments objectAtIndex:i];
}
}
if (appDelegate.activeComment == nil) {
[appDelegate showShareView:@"share"
setUserId:nil
setUsername:nil
setReplyId:nil];
} else {
[appDelegate showShareView:@"edit-share"
setUserId:nil
setUsername:nil
setReplyId:nil];
}
[self openShareDialog];
return NO;
} else if ([action isEqualToString:@"show-profile"]) {
appDelegate.activeUserProfileId = [NSString stringWithFormat:@"%@", [urlComponents objectAtIndex:2]];
@ -1285,6 +1264,49 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
// NSLog(@"results in mark as read is %@", results);
}
- (void)openSendToDialog {
NSURL *url = [NSURL URLWithString:[appDelegate.activeStory
objectForKey:@"story_permalink"]];
SHKItem *item = [SHKItem URL:url title:[appDelegate.activeStory
objectForKey:@"story_title"]];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
[actionSheet showInView:self.view];
}
- (void)openShareDialog {
// test to see if the user has commented
// search for the comment from friends comments
NSArray *friendComments = [appDelegate.activeStory objectForKey:@"friend_comments"];
NSString *currentUserId = [NSString stringWithFormat:@"%@", [appDelegate.dictUserProfile objectForKey:@"user_id"]];
for (int i = 0; i < friendComments.count; i++) {
NSString *userId = [NSString stringWithFormat:@"%@",
[[friendComments objectAtIndex:i] objectForKey:@"user_id"]];
if([userId isEqualToString:currentUserId]){
appDelegate.activeComment = [friendComments objectAtIndex:i];
}
}
if (appDelegate.activeComment == nil) {
[appDelegate showShareView:@"share"
setUserId:nil
setUsername:nil
setReplyId:nil];
} else {
[appDelegate showShareView:@"edit-share"
setUserId:nil
setUsername:nil
setReplyId:nil];
}
}
- (void)markStoryAsSaved {
}
- (void)markStoryAsUnread {
}
# pragma mark
# pragma mark Subscribing to blurblog
@ -1579,7 +1601,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
if ([self.popoverController respondsToSelector:@selector(setContainerViewProperties:)]) {
[self.popoverController setContainerViewProperties:[self improvedContainerViewProperties]];
}
[self.popoverController setPopoverContentSize:CGSizeMake(274, 130)];
[self.popoverController setPopoverContentSize:CGSizeMake(240, 228)];
[self.popoverController presentPopoverFromBarButtonItem:self.fontSettingsButton
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];

View file

@ -1155,12 +1155,12 @@
431B857415A1324200DCE497 /* Story */ = {
isa = PBXGroup;
children = (
7842ECF511D44A530066CF9D /* StoryDetailViewController.h */,
7842ECF611D44A530066CF9D /* StoryDetailViewController.m */,
43763ACE158F90B100B3DBE2 /* FontSettingsViewController.h */,
43763ACF158F90B100B3DBE2 /* FontSettingsViewController.m */,
78095EC6128F30B500230C8E /* OriginalStoryViewController.h */,
78095EC7128F30B500230C8E /* OriginalStoryViewController.m */,
7842ECF511D44A530066CF9D /* StoryDetailViewController.h */,
7842ECF611D44A530066CF9D /* StoryDetailViewController.m */,
);
name = Story;
sourceTree = "<group>";

View file

@ -15,8 +15,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