diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index b3a1c88..f1dd4a7 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -79,10 +79,7 @@ //[scopeBarView setTopShade:207/255.0 bottomShade:180/255.0]; [self updateBranchFilterMatrix]; - NSString *path = [NSString stringWithFormat:@"html/views/%@", @"blame"]; - NSString* file = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; - NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:file]]; - [[webViewFileViwer mainFrame] loadRequest:request]; + [webViewFileViwer setFrameLoadDelegate:self]; [super awakeFromNib]; } @@ -696,7 +693,14 @@ - (IBAction)updateFileViwer:(id)sender { - + NSString *path = [NSString stringWithFormat:@"html/views/%@", @"blame"]; + NSString* file = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; + NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:file]]; + [[webViewFileViwer mainFrame] loadRequest:request]; +} + +- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame +{ NSArray *objects = [treeController selectedObjects]; NSArray *content = [treeController content]; @@ -705,10 +709,10 @@ currentFileBrowserSelectionPath = [treeItem.fullPath componentsSeparatedByString:@"/"]; id script = [webViewFileViwer windowScriptObject]; - [script callWebScriptMethod:@"showFileBlame" withArguments:[NSArray arrayWithObjects:[treeItem contents:[displayControl selectedSegment]], nil]]; } } + @end diff --git a/html/views/blame/blame.js b/html/views/blame/blame.js index f231700..91043bf 100644 --- a/html/views/blame/blame.js +++ b/html/views/blame/blame.js @@ -1,4 +1,4 @@ -var showFileBlame = function(txt) { +var showFile = function(txt) { $("txt").style.display = ""; $("txt").innerHTML="
"+txt+"
"; return;