summaryrefslogtreecommitdiff
path: root/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-06 20:41:51 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-06 20:41:51 -0700
commit5b54612d91129afb92aee01e14984e7e2e401709 (patch)
treee402fa98b02ddad2482fd6491c2b9b6915048a5c /ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
parente58047eaa020e2810dd20ce6cc2eac32de071481 (diff)
downloadinfinitytier-5b54612d91129afb92aee01e14984e7e2e401709.tar.gz
infinitytier-5b54612d91129afb92aee01e14984e7e2e401709.zip
Pass authtoken in from user, and add a wrapper for web UI on Mac.
Diffstat (limited to 'ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m')
-rw-r--r--ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m54
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m b/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
new file mode 100644
index 00000000..2765a2e3
--- /dev/null
+++ b/ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
@@ -0,0 +1,54 @@
+#import "WindowController.h"
+
+
+@interface WindowController() {
+
+}
+
+-(void) notificationCenter;
+
+@end
+
+@implementation WindowController
+
+@synthesize contentView, url;
+
+- (id) initWithURL:(NSString *) relativeURL{
+ self = [super initWithWindowNibName:@"Window"];
+ self.url = [NSURL URLWithString:relativeURL relativeToURL:[[NSBundle mainBundle] resourceURL]];
+
+ [self.window setFrameAutosaveName:@"MacGapWindow"];
+ [self notificationCenter];
+
+ return self;
+}
+
+-(id) initWithRequest: (NSURLRequest *)request{
+ self = [super initWithWindowNibName:@"Window"];
+ [self notificationCenter];
+ [[self.contentView.webView mainFrame] loadRequest:request];
+
+ return self;
+}
+
+-(void) notificationCenter{
+ [[NSNotificationCenter defaultCenter] addObserver:self.contentView
+ selector:@selector(windowResized:)
+ name:NSWindowDidResizeNotification
+ object:[self window]];
+}
+
+- (void)windowDidLoad
+{
+ [super windowDidLoad];
+
+ if (self.url != nil) {
+ [self.contentView.webView setMainFrameURL:[self.url absoluteString]];
+ }
+
+
+ // Implement this method to handle any initialization after your
+ // window controller's window has been loaded from its nib file.
+}
+
+@end