implemented a mentions view
This commit is contained in:
parent
1e92b50515
commit
da7cc71f4e
9 changed files with 215 additions and 89 deletions
|
@ -11,17 +11,9 @@
|
|||
|
||||
@implementation ViewDelegate
|
||||
|
||||
-(id)initWithWebView:(WebView *) view {
|
||||
|
||||
if ( self = [super init] ) {
|
||||
webView = view;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
@synthesize timelineView, mentionsView;
|
||||
|
||||
|
||||
- (void)webView:(WebView *)_webView addMessageToConsole:(NSDictionary *)message;{
|
||||
- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message;{
|
||||
|
||||
if (![message isKindOfClass:[NSDictionary class]]) return;
|
||||
|
||||
|
@ -41,4 +33,15 @@
|
|||
[[NSWorkspace sharedWorkspace] openURL:[request URL]];
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
|
||||
NSString *action = @"home_timeline";
|
||||
|
||||
if (sender == mentionsView) {
|
||||
action = @"mentions";
|
||||
}
|
||||
|
||||
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:
|
||||
@"setTimeout(function(){ twittia_instance = new Twittia('%@'); }, 1);", action]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Reference in a new issue