Refactor JSBridge to simplify adding new methods. Add log(message) and a stub for fileExistsInMod(file,mod).

This commit is contained in:
Paul Chote
2010-11-17 12:31:52 +13:00
parent 40235db52e
commit f42f39f9c9
5 changed files with 56 additions and 11 deletions

View File

@@ -18,8 +18,8 @@
- (void) awakeFromNib
{
game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:@"/Users/paul/src/OpenRA"]];
jsbridge = [[JSBridge alloc] initWithController:self];
[[JSBridge sharedInstance] setController:self];
NSTableColumn *col = [outlineView tableColumnWithIdentifier:@"mods"];
ImageAndTextCell *imageAndTextCell = [[[ImageAndTextCell alloc] init] autorelease];
[col setDataCell:imageAndTextCell];
@@ -153,7 +153,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
#pragma mark WebView delegates
- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame
{
[windowObject setValue:jsbridge forKey:@"external"];
[windowObject setValue:[JSBridge sharedInstance] forKey:@"external"];
}
@end