diff working

This commit is contained in:
glaullon
2010-06-15 20:17:07 -07:00
parent 8b357d40e9
commit 936a3b4cae
4 changed files with 37 additions and 15 deletions
+22 -8
View File
@@ -56,8 +56,9 @@
items, GROUP_ITEMS,
nil]];
[scopeBar reloadData];
[webViewFileViwer setUIDelegate:self];
[webViewFileViwer setFrameLoadDelegate:self];
}
[webViewFileViwer setResourceLoadDelegate:self];}
- (void)dealloc
@@ -68,11 +69,6 @@
#pragma mark JavaScript log.js methods
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)sel
{
if (sel == @selector(selectCommit:)) return NO;
return YES;
}
- (void) selectCommit:(NSString*)c
{
@@ -140,6 +136,25 @@
[self scopeBar:scopeBar selectedStateChanged:true forItem:show inGroup:0];
}
# pragma mark WebKitDelegate methods
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)sel
{
return NO; //![controller respondsToSelector:sel];
// if (sel == @selector(selectCommit:)) return NO;
// return YES;
}
- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame
{
id script = [sender windowScriptObject];
[script setValue:controller forKey:@"Controller"];
}
- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)dictionary
{
NSLog(@"Error from webkit: %@", dictionary);
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
@@ -147,7 +162,7 @@
NSString *path = [NSString stringWithFormat:@"html/views/%@", show];
NSString *formatFile = [[NSBundle mainBundle] pathForResource:@"format" ofType:@"html" inDirectory:path];
NSString *testFile = [NSString stringWithFormat:@"%@/test.html",NSHomeDirectory()];
//NSString *testFile = [NSString stringWithFormat:@"%@/test.html",NSHomeDirectory()];
NSString *format;
if(formatFile!=nil)
format=[NSString stringWithContentsOfURL:[NSURL fileURLWithPath:formatFile] encoding:NSUTF8StringEncoding error:nil];
@@ -167,7 +182,6 @@
NSLog(@"didFinishLoadForFrame -> txt: '%@'",([txt length]>180)?[txt substringToIndex:180]:txt);
id script = [webViewFileViwer windowScriptObject];
[script setValue:self forKey:@"Controler"];
[script callWebScriptMethod:@"showFile"
withArguments:[NSArray arrayWithObjects:txt, nil]];
+12
View File
@@ -2039,6 +2039,10 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.6;
VALID_ARCHS = "i386 x86_64";
};
name = Debug;
};
@@ -2046,11 +2050,15 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = required;
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.6;
VALID_ARCHS = "i386 x86_64";
};
name = Release;
};
@@ -2130,6 +2138,10 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.6;
VALID_ARCHS = "i386 x86_64";
};
name = Install;
};
+1 -1
View File
@@ -65,7 +65,7 @@
fileViewerController=[[FileViewerController alloc] retain];
[fileViewerController setCommit:true];
[fileViewerController initWithRepository:repository andController:self];
[fileViewerController initWithRepository:repository andController:webController];
[fileViewerController loadView];
// XXXX :( ?
+2 -6
View File
@@ -1,10 +1,6 @@
// If we run from a Safari instance, we don't
// have a Controller object. Instead, we fake it by
// using the console
if (typeof Controller == 'undefined') {
Controller = console;
Controller.log_ = console.log;
}
var highlightDiff = function(diff, element, callbacks) {
if (!diff || diff == "")
@@ -188,7 +184,7 @@ var highlightDiff = function(diff, element, callbacks) {
sindex = "index=" + lindex.toString() + " ";
if (firstChar == "+") {
if (Controller.isFeatureEnabled_("showWhitespaceDifferences")) {
if (window.Controller.isFeatureEnabled_("showWhitespaceDifferences")) {
// Highlight trailing whitespace
if (m = l.match(/\s+$/))
l = l.replace(/\s+$/, "<span class='whitespace'>" + m + "</span>");
@@ -228,5 +224,5 @@ var highlightDiff = function(diff, element, callbacks) {
// TODO: Replace this with a performance pref call
if (false)
Controller.log_("Total time:" + (new Date().getTime() - start));
alert("Total time:" + (new Date().getTime() - start));
}