Merge branch 'master' into saved

* master:
  Using story's original text is present for send to sharing.
This commit is contained in:
Samuel Clay 2014-05-29 12:56:24 -07:00
commit 7f05f11f2c
2 changed files with 10 additions and 1 deletions

View file

@ -448,6 +448,10 @@
NSDictionary *feed = [self getFeed:feedId];
NSString *feedTitle = [feed objectForKey:@"feed_title"];
if ([activeStory objectForKey:@"original_text"]) {
text = [activeStory objectForKey:@"original_text"];
}
return [self showSendTo:vc
sender:sender
withUrl:url

View file

@ -1649,10 +1649,15 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
return;
}
NSString *originalText = [[[results objectForKey:@"original_text"]stringByReplacingOccurrencesOfString:@"\'" withString:@"\\'"]
NSString *originalText = [[[results objectForKey:@"original_text"]
stringByReplacingOccurrencesOfString:@"\'" withString:@"\\'"]
stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
NSString *jsString = [NSString stringWithFormat:@"document.getElementById('NB-story').innerHTML = '%@'; loadImages();",
originalText];
NSMutableDictionary *newActiveStory = [appDelegate.activeStory mutableCopy];
[newActiveStory setObject:[results objectForKey:@"original_text"] forKey:@"original_text"];
appDelegate.activeStory = newActiveStory;
[self.webView stringByEvaluatingJavaScriptFromString:jsString];
[MBProgressHUD hideHUDForView:self.webView animated:YES];