mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
bd097b0eff
This changes the HTML part of GitX to be more consistent -- we now use a "views" directory where every web view has it's own directory. Furthermore, GitX-wide Javascript is added in the "lib" directory. The same is true for CSS in the "css" directory. Every view can have its own custom CSS and JS, and those are put in the views directory (without JS or CSS prefix directories).
42 lines
883 B
Objective-C
42 lines
883 B
Objective-C
//
|
|
// PBWebDiffController.m
|
|
// GitX
|
|
//
|
|
// Created by Pieter de Bie on 13-10-08.
|
|
// Copyright 2008 Pieter de Bie. All rights reserved.
|
|
//
|
|
|
|
#import "PBWebDiffController.h"
|
|
|
|
|
|
@implementation PBWebDiffController
|
|
|
|
- (void) awakeFromNib
|
|
{
|
|
startFile = @"diff";
|
|
[super awakeFromNib];
|
|
[diffController addObserver:self forKeyPath:@"diff" options:0 context:@"ChangedDiff"];
|
|
}
|
|
|
|
- (void) didLoad
|
|
{
|
|
[self showDiff:diffController.diff];
|
|
}
|
|
|
|
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(NSString *)context
|
|
{
|
|
if ([context isEqualToString: @"ChangedDiff"])
|
|
[self showDiff:diffController.diff];
|
|
}
|
|
|
|
- (void) showDiff: (NSString *) diff
|
|
{
|
|
if (diff == nil || !finishedLoading)
|
|
return;
|
|
|
|
id script = [view windowScriptObject];
|
|
[script callWebScriptMethod:@"showDiff" withArguments: [NSArray arrayWithObject:diff]];
|
|
}
|
|
|
|
@end
|