"]];
}
}
NSString *storyHeader = [NSString stringWithFormat:@"",
[story_tags length] ? [appDelegate.activeStory objectForKey:@"long_parsed_date"] : [appDelegate.activeStory objectForKey:@"short_parsed_date"],
[appDelegate.activeStory objectForKey:@"story_title"],
story_author,
story_tags];
NSString *htmlString = [NSString stringWithFormat:@"%@ %@
%@
",
imgCssString, storyHeader,
[appDelegate.activeStory objectForKey:@"story_content"]];
[webView loadHTMLString:htmlString
baseURL:[NSURL URLWithString:[appDelegate.activeFeed
objectForKey:@"feed_link"]]];
}
- (IBAction)doNextUnreadStory {
int nextIndex = [appDelegate indexOfNextStory];
if (nextIndex == -1) {
} else {
[appDelegate setActiveStory:[[appDelegate activeFeedStories] objectAtIndex:nextIndex]];
[self showStory];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
[UIView setAnimationBeginsFromCurrentState:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:NO];
[UIView commitAnimations];
}
}
- (IBAction)doPreviousStory {
NSInteger nextIndex = [appDelegate indexOfPreviousStory];
if (nextIndex == -1) {
} else {
[appDelegate setActiveStory:[[appDelegate activeFeedStories] objectAtIndex:nextIndex]];
[self showStory];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
[UIView setAnimationBeginsFromCurrentState:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:NO];
[UIView commitAnimations];
}
}
- (void)showOriginalSubview:(id)sender {
NSURL *url = [NSURL URLWithString:[appDelegate.activeStory
objectForKey:@"story_permalink"]];
[appDelegate showOriginalStory:url];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.webView = nil;
self.appDelegate = nil;
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSURL *url = [request URL];
[appDelegate showOriginalStory:url];
//[url release];
return NO;
}
return YES;
}
- (void)webViewDidStartLoad:(UIWebView *)webView {
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
}
- (void)dealloc {
[appDelegate release];
[webView release];
[super dealloc];
}
@end