5 // Created by Pieter de Bie on 08-10-08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "PBWebController.h"
12 @implementation PBWebController
14 @synthesize startFile;
18 NSString* file = [[NSBundle mainBundle] pathForResource:startFile ofType:@"html"];
19 NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:file]];
22 [view setUIDelegate:self];
23 [view setFrameLoadDelegate:self];
24 [[view mainFrame] loadRequest:request];
27 - (void) webView:(id) v didFinishLoadForFrame:(id) frame
29 id script = [view windowScriptObject];
30 [script setValue: self forKey:@"Controller"];
32 finishedLoading = YES;
33 if ([self respondsToSelector:@selector(didLoad)])
34 [self performSelector:@selector(didLoad)];
37 - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)dictionary
39 NSLog(@"Error from webkit!");
42 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
47 + (BOOL)isKeyExcludedFromWebScript:(const char *)name {
51 #pragma mark Functions to be used from JavaScript
52 - (void) log: (NSString*) logMessage