added opening conversation view in new window to OS X
This commit is contained in:
parent
11e6da5592
commit
142b4d4dd3
13 changed files with 481 additions and 37 deletions
70
Mac/NewConversationWindowController.m
Normal file
70
Mac/NewConversationWindowController.m
Normal file
|
@ -0,0 +1,70 @@
|
|||
//
|
||||
// NewConversationWindowController.m
|
||||
// Bungloo
|
||||
//
|
||||
// Created by Jeena on 16/04/2013.
|
||||
//
|
||||
//
|
||||
|
||||
#import "NewConversationWindowController.h"
|
||||
#import "Controller.h"
|
||||
|
||||
@implementation NewConversationWindowController
|
||||
|
||||
@synthesize postId, entity, timelineView, viewDelegate;
|
||||
|
||||
- (id)initWithWindow:(NSWindow *)window
|
||||
{
|
||||
self = [super initWithWindow:window];
|
||||
if (self) {
|
||||
// Initialization code here.
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithPostId:(NSString *)_postId entity:(NSString *)_entity andViewDelegate:(ViewDelegate *)_viewDelegate;
|
||||
{
|
||||
self = [super initWithWindowNibName:@"NewConversationWindowController"];
|
||||
if (self) {
|
||||
self.postId = _postId;
|
||||
self.entity = _entity;
|
||||
self.viewDelegate = _viewDelegate;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
[super windowDidLoad];
|
||||
|
||||
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
|
||||
NSString *index_string;
|
||||
NSURL *url;
|
||||
|
||||
|
||||
Controller *controller = (Controller *)[[NSApplication sharedApplication] delegate];
|
||||
[controller stringFromFile: @"index.html" url: &url content: &index_string];
|
||||
|
||||
[self.viewDelegate.conversationViews addObject:timelineView];
|
||||
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[timelineView setFrameLoadDelegate:viewDelegate];
|
||||
[timelineView setPolicyDelegate:viewDelegate];
|
||||
[timelineView setUIDelegate:viewDelegate];
|
||||
[[timelineView windowScriptObject] setValue:controller forKey:@"controller"];
|
||||
[[timelineView windowScriptObject] setValue:self forKey:@"conversationViewController"];
|
||||
|
||||
}
|
||||
|
||||
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
Reference in a new issue