diff --git a/ApplicationController.m b/ApplicationController.m index 8efcded..13b4b94 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -31,7 +31,7 @@ if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load]) if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) - NSLog(@"Could not load QuickLook"); + DLog(@"Could not load QuickLook"); /* Value Transformers */ NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init]; @@ -55,7 +55,7 @@ int serviceVersion = [[NSUserDefaults standardUserDefaults] integerForKey:@"Services Version"]; if (serviceVersion < 2) { - NSLog(@"Updating services menu…"); + DLog(@"Updating services menu…"); NSUpdateDynamicServices(); [[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"Services Version"]; } @@ -245,7 +245,7 @@ fileManager = [NSFileManager defaultManager]; applicationSupportFolder = [self applicationSupportFolder]; if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) { - [fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil]; + [fileManager createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil]; } url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"GitTest.xml"]]; @@ -414,7 +414,7 @@ - (IBAction)reportAProblem:(id)sender { - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.lighthouseapp.com/tickets"]]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/laullon/gitx/issues"]]; } diff --git a/Commands/PBCommandFactory.h b/Commands/PBCommandFactory.h index a613c7b..477a52b 100644 --- a/Commands/PBCommandFactory.h +++ b/Commands/PBCommandFactory.h @@ -9,5 +9,5 @@ #import "PBGitRepository.h" @protocol PBCommandFactory -+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository; ++ (NSArray *) commandsForObject:(id) object repository:(PBGitRepository *) repository; @end diff --git a/Commands/PBCommandWithParameter.m b/Commands/PBCommandWithParameter.m index 9f50b51..15b8afe 100644 --- a/Commands/PBCommandWithParameter.m +++ b/Commands/PBCommandWithParameter.m @@ -16,7 +16,7 @@ @synthesize parameterDisplayName; - initWithCommand:(PBCommand *) aCommand parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName { - if (self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]]) { + if ((self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]])) { command = [aCommand retain]; parameterName = [param retain]; parameterDisplayName = [paramDisplayName retain]; diff --git a/Commands/PBOpenDocumentCommand.m b/Commands/PBOpenDocumentCommand.m index 16f6906..ff703ef 100644 --- a/Commands/PBOpenDocumentCommand.m +++ b/Commands/PBOpenDocumentCommand.m @@ -13,7 +13,7 @@ @implementation PBOpenDocumentCommand - (id) initWithDocumentAbsolutePath:(NSString *) path { - if (self = [super initWithDisplayName:@"Open" parameters:nil repository:nil]) { + if ((self = [super initWithDisplayName:@"Open" parameters:nil repository:nil])) { documentURL = [[NSURL alloc] initWithString:path]; } return self; diff --git a/Commands/PBRemoteCommandFactory.m b/Commands/PBRemoteCommandFactory.m index 2b02524..56f3146 100644 --- a/Commands/PBRemoteCommandFactory.m +++ b/Commands/PBRemoteCommandFactory.m @@ -58,7 +58,7 @@ return commands; } -+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository { ++ (NSArray *) commandsForObject:(id) object repository:(PBGitRepository *) repository { if ([object isKindOfClass:[PBGitSubmodule class]]) { return [PBRemoteCommandFactory commandsForSubmodule:(id)object inRepository:repository]; } diff --git a/Commands/PBRevealWithFinderCommand.m b/Commands/PBRevealWithFinderCommand.m index 2f94a58..055825f 100644 --- a/Commands/PBRevealWithFinderCommand.m +++ b/Commands/PBRevealWithFinderCommand.m @@ -17,7 +17,7 @@ return nil; } - if (self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil]) { + if ((self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil])) { documentURL = [[NSURL alloc] initWithString:path]; } return self; diff --git a/Commands/PBStashCommandFactory.m b/Commands/PBStashCommandFactory.m index 195cd7b..9601b40 100644 --- a/Commands/PBStashCommandFactory.m +++ b/Commands/PBStashCommandFactory.m @@ -22,7 +22,7 @@ @implementation PBStashCommandFactory -+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository { ++ (NSArray *) commandsForObject:(id) object repository:(PBGitRepository *) repository { NSArray *cmds = nil; if ([object isKindOfClass:[PBGitStash class]]) { cmds = [PBStashCommandFactory commandsForStash:(id)object repository:repository]; diff --git a/Controller/PBArgumentPickerController.m b/Controller/PBArgumentPickerController.m index 51d542e..420b547 100644 --- a/Controller/PBArgumentPickerController.m +++ b/Controller/PBArgumentPickerController.m @@ -13,7 +13,7 @@ @implementation PBArgumentPickerController - initWithCommandWithParameter:(PBCommandWithParameter *) aCommand { - if (self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self]) { + if ((self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self])) { cmdWithParameter = [aCommand retain]; } return self; diff --git a/Controller/PBGitResetController.h b/Controller/PBGitResetController.h index b7a8d30..d8672a5 100644 --- a/Controller/PBGitResetController.h +++ b/Controller/PBGitResetController.h @@ -7,8 +7,10 @@ // #import +#import "PBResetSheet.h" @class PBGitRepository; +@protocol PBGitRefish; @interface PBGitResetController : NSObject { PBGitRepository *repository; @@ -17,8 +19,8 @@ - (NSArray *) menuItems; - // actions +- (void) resetToRefish: (id) spec type: (PBResetType) type; - (void) resetHardToHead; @end diff --git a/Controller/PBGitResetController.m b/Controller/PBGitResetController.m index 773a74d..1ef3309 100644 --- a/Controller/PBGitResetController.m +++ b/Controller/PBGitResetController.m @@ -9,36 +9,25 @@ #import "PBGitResetController.h" #import "PBGitRepository.h" #import "PBCommand.h" +#import "PBGitRefish.h" +#import "PBResetSheet.h" -static NSString * const kCommandKey = @"command"; @implementation PBGitResetController - (id) initWithRepository:(PBGitRepository *) repo { - if (self = [super init]){ + if ((self = [super init])){ repository = [repo retain]; } return self; } - (void) resetHardToHead { - NSAlert *alert = [NSAlert alertWithMessageText:@"Reseting working copy and index" - defaultButton:@"Cancel" - alternateButton:nil - otherButton:@"Reset" - informativeTextWithFormat:@"Are you sure you want to reset your working copy and index? All changes to them will be gone!"]; - - NSArray *arguments = [NSArray arrayWithObjects:@"reset", @"--hard", @"HEAD", nil]; - PBCommand *cmd = [[PBCommand alloc] initWithDisplayName:@"Reset hard to HEAD" parameters:arguments repository:repository]; - cmd.commandTitle = cmd.displayName; - cmd.commandDescription = @"Reseting head"; - - NSMutableDictionary *info = [NSMutableDictionary dictionaryWithObject:cmd forKey:kCommandKey]; - - [alert beginSheetModalForWindow:[repository.windowController window] - modalDelegate:self - didEndSelector:@selector(confirmResetSheetDidEnd:returnCode:contextInfo:) - contextInfo:info]; + [self resetToRefish: [PBGitRef refFromString: @"HEAD"] type: PBResetTypeHard]; +} + +- (void) resetToRefish:(id) refish type:(PBResetType)type { + [PBResetSheet beginResetSheetForRepository: repository refish: refish andType: type]; } - (void) reset { @@ -70,18 +59,4 @@ static NSString * const kCommandKey = @"command"; [super dealloc]; } -#pragma mark - -#pragma mark Confirm Window - -- (void) confirmResetSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo -{ - [[sheet window] orderOut:nil]; - - if (returnCode != NSAlertDefaultReturn) { - PBCommand *cmd = [(NSDictionary *)contextInfo objectForKey:kCommandKey]; - [cmd invoke]; - } -} - - @end diff --git a/Controller/PBSubmoduleController.m b/Controller/PBSubmoduleController.m index 7da580b..cd45014 100644 --- a/Controller/PBSubmoduleController.m +++ b/Controller/PBSubmoduleController.m @@ -19,7 +19,7 @@ @synthesize submodules; - (id) initWithRepository:(PBGitRepository *) repo { - if (self = [super init]){ + if ((self = [super init])){ repository = [repo retain]; } return self; @@ -42,7 +42,8 @@ if ([submoduleLine length] == 0) continue; PBGitSubmodule *submodule = [[PBGitSubmodule alloc] initWithRawSubmoduleStatusString:submoduleLine]; - [loadedSubmodules addObject:submodule]; + if (submodule) + [loadedSubmodules addObject:submodule]; } NSMutableArray *groupedSubmodules = [[NSMutableArray alloc] init]; diff --git a/DBPrefsWindowController.h b/DBPrefsWindowController.h index 5cb711e..417b295 100644 --- a/DBPrefsWindowController.h +++ b/DBPrefsWindowController.h @@ -42,7 +42,7 @@ #import -@interface DBPrefsWindowController : NSWindowController { +@interface DBPrefsWindowController : NSWindowController { NSMutableArray *toolbarIdentifiers; NSMutableDictionary *toolbarViews; NSMutableDictionary *toolbarItems; diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 9baf874..7a5139c 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -2,17 +2,33 @@ 1050 - 10J567 - 788 + 10J869 + 1305 1038.35 - 462.00 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 788 + 1305 - + YES - + NSSegmentedCell + NSToolbar + NSToolbarFlexibleSpaceItem + NSSplitView + NSButton + NSSegmentedControl + NSButtonCell + NSTextFieldCell + NSToolbarSpaceItem + NSProgressIndicator + NSToolbarSeparatorItem + NSCustomView + NSCustomObject + NSView + NSWindowTemplate + NSTextField + NSToolbarItem YES @@ -47,7 +63,7 @@ YES YES - YES + NO YES 1 1 @@ -93,10 +109,9 @@ Clone Repository To - + 268 {{38, 14}, {40, 25}} - YES -2080244224 @@ -139,10 +154,9 @@ Refresh - + 268 {{8, 14}, {32, 25}} - YES -2080244224 @@ -181,10 +195,9 @@ View - + 268 {{0, 14}, {94, 25}} - YES 67239424 @@ -366,7 +379,6 @@ YES - {1.79769e+308, 1.79769e+308} {600, 450} @@ -383,6 +395,8 @@ 272 {184, 483} + + NSView @@ -390,11 +404,15 @@ 274 {{185, 0}, {705, 483}} + + NSView {{0, 31}, {890, 483}} + + YES 2 sourceSplitView @@ -404,6 +422,8 @@ 292 {{0, 1}, {515, 31}} + + NSView @@ -417,6 +437,8 @@ {{20, 7}, {16, 16}} + + 20746 100 @@ -425,6 +447,8 @@ 266 {{41, 8}, {188, 14}} + + YES 67239488 @@ -459,15 +483,19 @@ {{552, 0}, {246, 31}} + + NSView - {890, 514} + {{7, 11}, {890, 514}} + + - {{0, 0}, {1440, 878}} + {{0, 0}, {1680, 1028}} {600, 528} - {1.79769e+308, 1.79769e+308} + {1e+13, 1e+13} GitX 31 @@ -507,14 +535,6 @@ 356 - - - splitView - - - - 357 - sourceListControlsView @@ -595,6 +615,14 @@ 423 + + + mainSplitView + + + + 424 + @@ -831,10 +859,6 @@ 3.ImportedFromIB2 3.NSWindowTemplate.visibleAtLaunch 3.editorWindowContentRectSynchronizationRect - 3.windowTemplate.hasMaxSize - 3.windowTemplate.hasMinSize - 3.windowTemplate.maxSize - 3.windowTemplate.minSize 351.IBPluginDependency 352.IBPluginDependency 352.IBViewBoundsToFrameTransform @@ -874,10 +898,6 @@ {{15, 196}, {850, 418}} - - - {3.40282e+38, 3.40282e+38} - {600, 450} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -918,38 +938,20 @@ YES - - YES - + YES - - YES - + - 423 + 424 YES - - NSApplication - - IBProjectSource - NSApplication+GitXScripting.h - - - - NSCell - - IBProjectSource - View/CellTrackingRect.h - - PBGitWindowController NSWindowController @@ -1026,10 +1028,10 @@ YES contentSplitView finderItem + mainSplitView progressIndicator sourceListControlsView sourceSplitView - splitView statusField terminalItem @@ -1037,10 +1039,10 @@ YES NSView NSToolbarItem + NSSplitView NSProgressIndicator NSView NSView - NSSplitView NSTextField NSToolbarItem @@ -1051,10 +1053,10 @@ YES contentSplitView finderItem + mainSplitView progressIndicator sourceListControlsView sourceSplitView - splitView statusField terminalItem @@ -1068,6 +1070,10 @@ finderItem NSToolbarItem + + mainSplitView + NSSplitView + progressIndicator NSProgressIndicator @@ -1080,10 +1086,6 @@ sourceSplitView NSView - - splitView - NSSplitView - statusField NSTextField @@ -1096,616 +1098,7 @@ IBProjectSource - PBGitWindowController.h - - - - PBGitWindowController - NSWindowController - - IBUserSource - - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSObject - - IBFrameworkSource - ScriptingBridge.framework/Headers/SBApplication.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSProgressIndicator - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSProgressIndicator.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSSegmentedCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSSegmentedCell.h - - - - NSSegmentedControl - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSSegmentedControl.h - - - - NSSplitView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSSplitView.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - - - NSToolbarItem - NSObject - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSWindowController.h + ./Classes/PBGitWindowController.h @@ -1725,7 +1118,6 @@ YES - ../GitX.xcodeproj 3 YES diff --git a/GLFileView.h b/GLFileView.h index a734dd0..8084ddc 100644 --- a/GLFileView.h +++ b/GLFileView.h @@ -12,6 +12,7 @@ #import "PBGitCommit.h" #import "PBGitHistoryController.h" #import "PBRefContextDelegate.h" +#import "SearchWebView.h" @class PBGitGradientBarView; @@ -23,6 +24,8 @@ NSString *diffType; IBOutlet NSView *accessoryView; IBOutlet NSSplitView *fileListSplitView; + IBOutlet NSSearchField *searchField; + PBGitTree *lastFile; } - (void)showFile; @@ -42,6 +45,10 @@ +(BOOL)isImage:(NSString*)file; +(BOOL)isDiffHeader:(NSString*)line; +- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2; + +-(IBAction)updateSearch:(NSSearchField *)sender; + @property(retain) NSMutableArray *groups; @property(retain) NSString *logFormat; diff --git a/GLFileView.m b/GLFileView.m index a35b3bf..f6d68c6 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -20,6 +20,10 @@ @interface GLFileView () - (void)saveSplitViewPosition; ++ (NSString *)parseDiffBlock:(NSString *)txt; ++ (NSString *)parseDiffHeader:(NSString *)txt; ++ (NSString *)parseDiffChunk:(NSString *)txt; ++ (NSString *)parseBinaryDiff:(NSString *)txt; @end @@ -98,37 +102,52 @@ NSArray *files=[historyController.treeController selectedObjects]; if ([files count]>0) { PBGitTree *file=[files objectAtIndex:0]; - - NSString *fileTxt = @""; - if(startFile==@"fileview"){ - fileTxt=[file textContents:&theError]; - if(!theError) - fileTxt=[GLFileView parseHTML:fileTxt]; - }else if(startFile==@"blame"){ - fileTxt=[file blame:&theError]; - if(!theError) - fileTxt=[self parseBlame:fileTxt]; - }else if(startFile==@"log"){ - fileTxt=[file log:logFormat error:&theError]; - }else if(startFile==@"diff"){ - fileTxt=[file diff:diffType error:&theError]; - if(!theError) - fileTxt=[GLFileView parseDiff:fileTxt]; - } - - id script = [view windowScriptObject]; - if(!theError){ - NSString *filePath = [file fullPath]; - [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObjects:fileTxt, filePath, nil]]; - }else{ - [script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObjects:[theError localizedDescription], nil]]; - } + DLog(@"file=%@ == %@ => %d",file,lastFile,[file isEqualTo:lastFile]); + if(![file isEqualTo:lastFile]){ + lastFile=file; + + NSString *fileTxt = @""; + if(startFile==@"fileview"){ + fileTxt=[file textContents:&theError]; + if(!theError) + fileTxt=[GLFileView parseHTML:fileTxt]; + }else if(startFile==@"blame"){ + fileTxt=[file blame:&theError]; + if(!theError) + fileTxt=[self parseBlame:fileTxt]; + }else if(startFile==@"log"){ + fileTxt=[file log:logFormat error:&theError]; + }else if(startFile==@"diff"){ + fileTxt=[file diff:diffType error:&theError]; + if(!theError) + fileTxt=[GLFileView parseDiff:fileTxt]; + } + + id script = [view windowScriptObject]; + if(!theError){ + NSString *filePath = [file fullPath]; + fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"\t" withString:@"    "]; + DLog(@"file.sha='%@'",file.sha); + fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:file.sha]; + if(diffType==@"h") { + fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA}" withString:@"HEAD"]; + }else { + fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA}" withString:@"--"]; + } + [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObjects:fileTxt, filePath, nil]]; + }else{ + [script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObjects:[theError localizedDescription], nil]]; + } + [self updateSearch:searchField]; + } } + #ifdef DEBUG_BUILD - NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML]; + DOMHTMLElement *dom=(DOMHTMLElement *)[[[view mainFrame] DOMDocument] documentElement]; + NSString *domH=[dom outerHTML]; NSString *tmpFile=@"~/tmp/test.html"; - [dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil]; + [domH writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil]; #endif } @@ -139,6 +158,13 @@ [historyController selectCommit:[PBGitSHA shaWithString:c]]; } +// TODO: need to be refactoring +- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2; +{ + NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,file,nil]; + [historyController.repository handleInWorkDirForArguments:args]; +} + #pragma mark MGScopeBarDelegate methods - (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar @@ -193,6 +219,7 @@ [[view mainFrame] reload]; } } + lastFile=nil; } - (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar @@ -270,241 +297,286 @@ + (NSString *)parseDiff:(NSString *)txt { txt=[self parseHTML:txt]; - - NSArray *lines = [txt componentsSeparatedByString:@"\n"]; - NSString *line; + NSMutableString *res=[NSMutableString string]; + NSScanner *scan=[NSScanner scannerWithString:txt]; + NSString *block; + + if(![txt hasPrefix:@"diff --git"]) + [scan scanUpToString:@"diff --git" intoString:&block]; //move to first diff + + while([scan scanString:@"diff --git" intoString:NULL]){ // is a diff start? + [scan scanUpToString:@"\ndiff --git" intoString:&block]; + [res appendString:[GLFileView parseDiffBlock:[NSString stringWithFormat:@"diff --git %@",block]]]; + } + + return res; +} - int l_line,l_end; - int r_line,r_end; ++ (NSString *)parseDiffBlock:(NSString *)txt +{ + NSMutableString *res=[NSMutableString string]; + NSScanner *scan=[NSScanner scannerWithString:txt]; + NSString *block; + + [scan scanUpToString:@"\n@@ " intoString:&block]; + [res appendString:@""]; + [res appendString:[GLFileView parseDiffHeader:block]]; + [res appendString:@""]; + + if([block rangeOfString:@"Binary files"].location!=NSNotFound){ + [res appendString:[GLFileView parseBinaryDiff:block]]; + } + + while([scan scanString:@"@@ " intoString:NULL]){ + [scan scanUpToString:@"\n@@ " intoString:&block]; + [res appendString:[GLFileView parseDiffChunk:[NSString stringWithFormat:@"@@ %@",block]]]; + } + + [res appendString:@"
"]; + + return res; +} - int i=0; - do { - line=[lines objectAtIndex:i]; - if([GLFileView isStartDiff:line]){ - NSString *fileName=[self getFileName:line]; - [res appendString:[NSString stringWithFormat:@""]; ++ (NSString *)parseBinaryDiff:(NSString *)txt +{ + NSMutableString *res=[NSMutableString string]; + NSScanner *scan=[NSScanner scannerWithString:txt]; + NSString *block; + + [scan scanUpToString:@"Binary files" intoString:NULL]; + [scan scanUpToString:@"" intoString:&block]; + + NSArray *files=[self getFilesNames:block]; + [res appendString:@""]; + + return res; +} - if([self isBinaryFile:line]){ - NSArray *files=[self getFilesNames:line]; - if(![[files objectAtIndex:0] isAbsolutePath]){ - [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:0]]]; - if([GLFileView isImage:[files objectAtIndex:0]]){ - [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:0]]]; - } - } - if(![[files objectAtIndex:1] isAbsolutePath]){ - [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:1]]]; - if([GLFileView isImage:[files objectAtIndex:1]]){ - [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:1]]]; - } - } - }else{ - do{ - NSString *header=[line substringFromIndex:3]; - NSRange hr = NSMakeRange(0, [header rangeOfString:@" @@"].location); - header=[header substringWithRange:hr]; - - NSArray *pos=[header componentsSeparatedByString:@" "]; - NSArray *pos_l=[[pos objectAtIndex:0] componentsSeparatedByString:@","]; - NSArray *pos_r=[[pos objectAtIndex:1] componentsSeparatedByString:@","]; - - l_end=l_line=abs([[pos_l objectAtIndex:0]integerValue]); - if ([pos_l count]>1) { - l_end=l_line+[[pos_l objectAtIndex:1]integerValue]; - } - - r_end=r_line=[[pos_r objectAtIndex:0]integerValue]; - if ([pos_r count]>1) { - r_end=r_line+[[pos_r objectAtIndex:1]integerValue]; - } - - [res appendString:[NSString stringWithFormat:@"",line]]; - do{ - line=[lines objectAtIndex:++i]; - NSString *s=[line substringToIndex:1]; - if([s isEqualToString:@" "]){ - [res appendString:[NSString stringWithFormat:@"",l_line++,r_line++]]; - }else if([s isEqualToString:@"-"]){ - [res appendString:[NSString stringWithFormat:@"",l_line++]]; - }else if([s isEqualToString:@"+"]){ - [res appendString:[NSString stringWithFormat:@"",r_line++]]; - } - [res appendString:[NSString stringWithFormat:@"",[line substringFromIndex:1]]]; - }while((l_line
",fileName]]; - do{ - [res appendString:[NSString stringWithFormat:@"

%@

",line]]; - line=[lines objectAtIndex:++i]; - }while([GLFileView isDiffHeader:line]); - [res appendString:@"
"]; - if(![self isBinaryFile:line]){ - [res appendString:[NSString stringWithFormat:@"",fileName]]; - } - [res appendString:@"
"]; + [res appendString:[NSString stringWithFormat:@"%@
",[files objectAtIndex:0]]]; + if(![[files objectAtIndex:0] isAbsolutePath]){ + if([GLFileView isImage:[files objectAtIndex:0]]){ + [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:0]]]; + } + } + [res appendString:@"
=>"]; + [res appendString:[NSString stringWithFormat:@"%@
",[files objectAtIndex:1]]]; + if(![[files objectAtIndex:1] isAbsolutePath]){ + if([GLFileView isImage:[files objectAtIndex:1]]){ + [res appendString:[NSString stringWithFormat:@"",[files objectAtIndex:1]]]; + } + } + [res appendString:@"
%@
%@
%@
%d%d
%d
%d%@
"]; - }else { - i++; - } - }while(i<[lines count]); - - return res; ++ (NSString *)parseDiffChunk:(NSString *)txt +{ + NSEnumerator *lines = [[txt componentsSeparatedByString:@"\n"] objectEnumerator]; + NSMutableString *res=[NSMutableString string]; + + NSString *line; + int l_line; + int r_line; + + line=[lines nextObject]; + DLog(@"-=%@=-",line); + NSString *header=[line substringFromIndex:3]; + NSRange hr = NSMakeRange(0, [header rangeOfString:@" @@"].location); + header=[header substringWithRange:hr]; + + NSArray *pos=[header componentsSeparatedByString:@" "]; + NSArray *pos_l=[[pos objectAtIndex:0] componentsSeparatedByString:@","]; + NSArray *pos_r=[[pos objectAtIndex:1] componentsSeparatedByString:@","]; + + l_line=abs([[pos_l objectAtIndex:0]integerValue]); + r_line=[[pos_r objectAtIndex:0]integerValue]; + + [res appendString:[NSString stringWithFormat:@"%@",line]]; + while((line=[lines nextObject])){ + NSString *s=[line substringToIndex:1]; + if([s isEqualToString:@" "]){ + [res appendString:[NSString stringWithFormat:@"%d%d",l_line++,r_line++]]; + }else if([s isEqualToString:@"-"]){ + [res appendString:[NSString stringWithFormat:@"%d",l_line++]]; + }else if([s isEqualToString:@"+"]){ + [res appendString:[NSString stringWithFormat:@"%d",r_line++]]; + } + if(![s isEqualToString:@"\\"]){ + [res appendString:[NSString stringWithFormat:@"%@",[line substringFromIndex:1]]]; + } + } + return res; +} + ++ (NSString *)parseDiffHeader:(NSString *)txt +{ + NSEnumerator *lines = [[txt componentsSeparatedByString:@"\n"] objectEnumerator]; + NSMutableString *res=[NSMutableString string]; + + NSString *line=[lines nextObject]; + NSString *fileName=[self getFileName:line]; + [res appendString:[NSString stringWithFormat:@"
",fileName]]; + do{ + [res appendString:[NSString stringWithFormat:@"

%@

",line]]; + }while((line=[lines nextObject])); + [res appendString:@"
"]; + + if([txt rangeOfString:@"Binary files"].location==NSNotFound){ + [res appendString:[NSString stringWithFormat:@"",fileName]]; + } + + [res appendString:@""]; + + return res; } +(NSString *)getFileName:(NSString *)line { - NSRange b = [line rangeOfString:@"b/"]; - NSString *file=[line substringFromIndex:b.location+2]; - return file; + NSRange b = [line rangeOfString:@" b/"]; + NSString *file=[line substringFromIndex:b.location+3]; + DLog(@"line=%@",line); + DLog(@"file=%@",file); + return file; } +(NSArray *)getFilesNames:(NSString *)line { - NSString *a = nil; - NSString *b = nil; - NSScanner *scanner=[NSScanner scannerWithString:line]; - if([scanner scanString:@"Binary files " intoString:NULL]){ - [scanner scanUpToString:@" and" intoString:&a]; - [scanner scanString:@"and" intoString:NULL]; - [scanner scanUpToString:@" differ" intoString:&b]; - } - if (![a isAbsolutePath]) { - a=[a substringFromIndex:2]; - } - if (![b isAbsolutePath]) { - b=[b substringFromIndex:2]; - } - - return [NSArray arrayWithObjects:a,b,nil]; + NSString *a = nil; + NSString *b = nil; + NSScanner *scanner=[NSScanner scannerWithString:line]; + if([scanner scanString:@"Binary files " intoString:NULL]){ + [scanner scanUpToString:@" and" intoString:&a]; + [scanner scanString:@"and" intoString:NULL]; + [scanner scanUpToString:@" differ" intoString:&b]; + } + if (![a isAbsolutePath]) { + a=[a substringFromIndex:2]; + } + if (![b isAbsolutePath]) { + b=[b substringFromIndex:2]; + } + + return [NSArray arrayWithObjects:a,b,nil]; } +(NSString*)mimeTypeForFileName:(NSString*)name { NSString *mimeType = nil; - NSInteger i=[name rangeOfString:@"." options:NSBackwardsSearch].location; - if(i!=NSNotFound){ - NSString *ext=[name substringFromIndex:i+1]; - CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)ext, NULL); - if(UTI){ - CFStringRef registeredType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType); - if(registeredType){ - mimeType = NSMakeCollectable(registeredType); - } - CFRelease(UTI); - } - } + NSInteger i=[name rangeOfString:@"." options:NSBackwardsSearch].location; + if(i!=NSNotFound){ + NSString *ext=[name substringFromIndex:i+1]; + CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)ext, NULL); + if(UTI){ + CFStringRef registeredType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType); + if(registeredType){ + mimeType = NSMakeCollectable(registeredType); + } + CFRelease(UTI); + } + } return mimeType; } +(BOOL)isDiffHeader:(NSString*)line { - unichar c=[line characterAtIndex:0]; - return (c=='i') || (c=='m') || (c=='n') || (c=='d') || (c=='-') || (c=='+'); + unichar c=[line characterAtIndex:0]; + return (c=='i') || (c=='m') || (c=='n') || (c=='d') || (c=='-') || (c=='+'); } +(BOOL)isImage:(NSString*)file { - NSString *mimeType=[GLFileView mimeTypeForFileName:file]; - return (mimeType!=nil) && ([mimeType rangeOfString:@"image/" options:NSCaseInsensitiveSearch].location!=NSNotFound); + NSString *mimeType=[GLFileView mimeTypeForFileName:file]; + return (mimeType!=nil) && ([mimeType rangeOfString:@"image/" options:NSCaseInsensitiveSearch].location!=NSNotFound); } +(BOOL)isBinaryFile:(NSString *)line { - return (([line length]>12) && [[line substringToIndex:12] isEqualToString:@"Binary files"]); + return (([line length]>12) && [[line substringToIndex:12] isEqualToString:@"Binary files"]); } +(BOOL)isStartDiff:(NSString *)line { - return (([line length]>10) && [[line substringToIndex:10] isEqualToString:@"diff --git"]); + return (([line length]>10) && [[line substringToIndex:10] isEqualToString:@"diff --git"]); } +(BOOL)isStartBlock:(NSString *)line { - return (([line length]>3) && [[line substringToIndex:3] isEqualToString:@"@@ "]); + return (([line length]>3) && [[line substringToIndex:3] isEqualToString:@"@@ "]); } - (NSString *) parseBlame:(NSString *)txt { - txt=[GLFileView parseHTML:txt]; - - NSArray *lines = [txt componentsSeparatedByString:@"\n"]; - NSString *line; - NSMutableDictionary *headers=[NSMutableDictionary dictionary]; - NSMutableString *res=[NSMutableString string]; - - [res appendString:@"\n"]; - int i=0; - while(i<[lines count]){ - line=[lines objectAtIndex:i]; - NSArray *header=[line componentsSeparatedByString:@" "]; - if([header count]==4){ - NSString *commitID = (NSString *)[header objectAtIndex:0]; - int nLines=[(NSString *)[header objectAtIndex:3] intValue]; - [res appendFormat:@"\n",nLines]; - line=[lines objectAtIndex:++i]; - if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){ - NSString *author=[line stringByReplacingOccurrencesOfString:@"author" withString:@""]; - NSString *summary=nil; - while(summary==nil){ - line=[lines objectAtIndex:i++]; - if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){ - summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""]; - } - } - NSRange trunc_c={0,7}; - NSString *truncate_c=commitID; - if([commitID length]>8){ - truncate_c=[commitID substringWithRange:trunc_c]; - } - NSRange trunc={0,22}; - NSString *truncate_a=author; - if([author length]>22){ - truncate_a=[author substringWithRange:trunc]; - } - NSString *truncate_s=summary; - if([summary length]>30){ - truncate_s=[summary substringWithRange:trunc]; - } - NSString *block=[NSString stringWithFormat:@"\n\n"]; - }else{ - break; - } - [res appendString:@"\n"]; - } - [res appendString:@"

%@ %@

%@

\n",commitID,truncate_c,truncate_a,truncate_s]; - [headers setObject:block forKey:[header objectAtIndex:0]]; - } - [res appendString:[headers objectForKey:[header objectAtIndex:0]]]; - - NSMutableString *code=[NSMutableString string]; - do{ - line=[lines objectAtIndex:i++]; - }while([line characterAtIndex:0]!='\t'); - line=[line substringFromIndex:1]; - line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"    "]; - [code appendString:line]; - [code appendString:@"\n"]; - - int n; - for(n=1;n%@",[header objectAtIndex:2],code]; - [res appendString:@"
\n"]; - //NSLog(@"%@",res); - - return (NSString *)res; + txt=[GLFileView parseHTML:txt]; + + NSArray *lines = [txt componentsSeparatedByString:@"\n"]; + NSString *line; + NSMutableDictionary *headers=[NSMutableDictionary dictionary]; + NSMutableString *res=[NSMutableString string]; + + [res appendString:@"\n"]; + int i=0; + while(i<[lines count]){ + line=[lines objectAtIndex:i]; + NSArray *header=[line componentsSeparatedByString:@" "]; + if([header count]==4){ + NSString *commitID = (NSString *)[header objectAtIndex:0]; + int nLines=[(NSString *)[header objectAtIndex:3] intValue]; + [res appendFormat:@"\n",nLines]; + line=[lines objectAtIndex:++i]; + if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){ + NSString *author=[line stringByReplacingOccurrencesOfString:@"author" withString:@""]; + NSString *summary=nil; + while(summary==nil){ + line=[lines objectAtIndex:i++]; + if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){ + summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""]; + } + } + NSRange trunc_c={0,7}; + NSString *truncate_c=commitID; + if([commitID length]>8){ + truncate_c=[commitID substringWithRange:trunc_c]; + } + NSRange trunc={0,22}; + NSString *truncate_a=author; + if([author length]>22){ + truncate_a=[author substringWithRange:trunc]; + } + NSString *truncate_s=summary; + if([summary length]>30){ + truncate_s=[summary substringWithRange:trunc]; + } + NSString *block=[NSString stringWithFormat:@"\n\n"]; + }else{ + break; + } + [res appendString:@"\n"]; + } + [res appendString:@"

%@ %@

%@

\n",commitID,truncate_c,truncate_a,truncate_s]; + [headers setObject:block forKey:[header objectAtIndex:0]]; + } + [res appendString:[headers objectForKey:[header objectAtIndex:0]]]; + + NSMutableString *code=[NSMutableString string]; + do{ + line=[lines objectAtIndex:i++]; + }while([line characterAtIndex:0]!='\t'); + line=[line substringFromIndex:1]; + [code appendString:line]; + [code appendString:@"\n"]; + + int n; + for(n=1;n%@",[header objectAtIndex:2],code]; + [res appendString:@"
\n"]; + //DLog(@"%@",res); + + return (NSString *)res; } @@ -517,38 +589,38 @@ - (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { - return kFileListSplitViewLeftMin; + return kFileListSplitViewLeftMin; } - (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex { - return [splitView frame].size.width - [splitView dividerThickness] - kFileListSplitViewRightMin; + return [splitView frame].size.width - [splitView dividerThickness] - kFileListSplitViewRightMin; } // while the user resizes the window keep the left (file list) view constant and just resize the right view // unless the right view gets too small - (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize { - NSRect newFrame = [splitView frame]; - - float dividerThickness = [splitView dividerThickness]; - - NSView *leftView = [[splitView subviews] objectAtIndex:0]; - NSRect leftFrame = [leftView frame]; - leftFrame.size.height = newFrame.size.height; - - if ((newFrame.size.width - leftFrame.size.width - dividerThickness) < kFileListSplitViewRightMin) { - leftFrame.size.width = newFrame.size.width - kFileListSplitViewRightMin - dividerThickness; - } - - NSView *rightView = [[splitView subviews] objectAtIndex:1]; - NSRect rightFrame = [rightView frame]; - rightFrame.origin.x = leftFrame.size.width + dividerThickness; - rightFrame.size.width = newFrame.size.width - rightFrame.origin.x; - rightFrame.size.height = newFrame.size.height; - - [leftView setFrame:leftFrame]; - [rightView setFrame:rightFrame]; + NSRect newFrame = [splitView frame]; + + float dividerThickness = [splitView dividerThickness]; + + NSView *leftView = [[splitView subviews] objectAtIndex:0]; + NSRect leftFrame = [leftView frame]; + leftFrame.size.height = newFrame.size.height; + + if ((newFrame.size.width - leftFrame.size.width - dividerThickness) < kFileListSplitViewRightMin) { + leftFrame.size.width = newFrame.size.width - kFileListSplitViewRightMin - dividerThickness; + } + + NSView *rightView = [[splitView subviews] objectAtIndex:1]; + NSRect rightFrame = [rightView frame]; + rightFrame.origin.x = leftFrame.size.width + dividerThickness; + rightFrame.size.width = newFrame.size.width - rightFrame.origin.x; + rightFrame.size.height = newFrame.size.height; + + [leftView setFrame:leftFrame]; + [rightView setFrame:rightFrame]; } // NSSplitView does not save and restore the position of the SplitView correctly so do it manually @@ -570,6 +642,14 @@ [fileListSplitView setHidden:NO]; } +#pragma mark IBActions + +-(IBAction)updateSearch:(NSSearchField *)sender +{ + [view updateSearch:sender]; +} + +#pragma mark - @synthesize groups; diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index dc18665..32f8642 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -62,6 +62,7 @@ 31460CD6124185BA00B90AED /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB1124185BA00B90AED /* TODO */; }; 316E7202131EE9C600AFBB36 /* list_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7200131EE9C600AFBB36 /* list_Template.png */; }; 316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7201131EE9C600AFBB36 /* sidebar_Template.png */; }; + 31776089133569350025876E /* SearchWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 31776088133569350025876E /* SearchWebView.m */; }; 31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 31DAA7EC1317737100463846 /* gitx_l_pub.pem */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; @@ -72,6 +73,8 @@ 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */; }; 551BF11E112F376C00265053 /* gitx_askpasswd_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */; }; 551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */ = {isa = PBXBuildFile; fileRef = 551BF111112F371800265053 /* gitx_askpasswd */; }; + 65D58BC4132D27A8003F7290 /* PBResetSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65D58BC3132D27A7003F7290 /* PBResetSheet.xib */; }; + 65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D58BC6132D48C0003F7290 /* PBResetSheet.m */; }; 770B37ED0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */; }; 77C8280E06725ACE000B614F /* ApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C8280C06725ACE000B614F /* ApplicationController.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; @@ -138,10 +141,6 @@ D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; }; D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; }; - EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; - F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; - F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; - F50A41230EBB875D00208746 /* PBNiceSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = F50A41220EBB875D00208746 /* PBNiceSplitView.m */; }; F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; }; F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; @@ -352,6 +351,8 @@ 31460CB1124185BA00B90AED /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; 316E7200131EE9C600AFBB36 /* list_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = list_Template.png; sourceTree = ""; }; 316E7201131EE9C600AFBB36 /* sidebar_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sidebar_Template.png; sourceTree = ""; }; + 31776087133569350025876E /* SearchWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchWebView.h; sourceTree = ""; }; + 31776088133569350025876E /* SearchWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchWebView.m; sourceTree = ""; }; 31DAA7EC1317737100463846 /* gitx_l_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gitx_l_pub.pem; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX_Prefix.pch; sourceTree = ""; }; 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HistoryViewTemplate.png; path = Images/HistoryViewTemplate.png; sourceTree = ""; }; @@ -366,6 +367,9 @@ 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNSURLPathUserDefaultsTransfomer.m; sourceTree = ""; }; 551BF111112F371800265053 /* gitx_askpasswd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gitx_askpasswd; sourceTree = BUILT_PRODUCTS_DIR; }; 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gitx_askpasswd_main.m; sourceTree = ""; }; + 65D58BC3132D27A7003F7290 /* PBResetSheet.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PBResetSheet.xib; sourceTree = ""; }; + 65D58BC5132D48BF003F7290 /* PBResetSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBResetSheet.h; sourceTree = ""; }; + 65D58BC6132D48C0003F7290 /* PBResetSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBResetSheet.m; sourceTree = ""; }; 770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = GitTest_DataModel.xcdatamodel; sourceTree = ""; }; 77C82804067257F0000B614F /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 77C8280B06725ACE000B614F /* ApplicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationController.h; sourceTree = ""; }; @@ -468,12 +472,6 @@ D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = ""; }; D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = ""; }; D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = ""; }; - EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; - EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; - F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; - F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterDimple.tiff; path = Images/mainSplitterDimple.tiff; sourceTree = ""; }; - F50A41210EBB875D00208746 /* PBNiceSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBNiceSplitView.h; sourceTree = ""; }; - F50A41220EBB875D00208746 /* PBNiceSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNiceSplitView.m; sourceTree = ""; }; F50FE0E10E07BE9600854FCD /* PBGitRevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevisionCell.h; sourceTree = ""; }; F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = ""; }; F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = ""; }; @@ -827,7 +825,6 @@ 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */, F5F7D0641062E7940072C81C /* UpdateKey.pem */, 31DAA7EC1317737100463846 /* gitx_l_pub.pem */, - F50A41130EBB872D00208746 /* Widgets */, 47DBDB920E94F47200671A1E /* Preference Icons */, D26DC6440E782C9000C777B2 /* gitx.icns */, 8D1107310486CEB800E47090 /* Info.plist */, @@ -849,6 +846,7 @@ 21230ED11285EB5A0046E5A1 /* PBArgumentPicker.xib */, F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */, D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */, + 65D58BC3132D27A7003F7290 /* PBResetSheet.xib */, ); name = Resources; sourceTree = ""; @@ -940,6 +938,8 @@ D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */, D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */, D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */, + 65D58BC5132D48BF003F7290 /* PBResetSheet.h */, + 65D58BC6132D48C0003F7290 /* PBResetSheet.m */, ); name = Sheets; sourceTree = ""; @@ -981,15 +981,6 @@ name = "Source View Items"; sourceTree = ""; }; - F50A41130EBB872D00208746 /* Widgets */ = { - isa = PBXGroup; - children = ( - F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */, - F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */, - ); - name = Widgets; - sourceTree = ""; - }; F56174540E05887E001DCD79 /* Git */ = { isa = PBXGroup; children = ( @@ -1064,10 +1055,6 @@ F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */, F56244070E9684B0002B6C44 /* PBUnsortableTableHeader.h */, F56244080E9684B0002B6C44 /* PBUnsortableTableHeader.m */, - F50A41210EBB875D00208746 /* PBNiceSplitView.h */, - F50A41220EBB875D00208746 /* PBNiceSplitView.m */, - EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */, - EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, D823487410CB382C00944BDE /* Terminal.h */, @@ -1079,6 +1066,8 @@ D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */, D87129FE122B14EC00012334 /* GitXTextFieldCell.h */, D87129FF122B14EC00012334 /* GitXTextFieldCell.m */, + 31776087133569350025876E /* SearchWebView.h */, + 31776088133569350025876E /* SearchWebView.m */, ); name = Aux; sourceTree = ""; @@ -1387,8 +1376,6 @@ F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */, F5E92A230E88569500056E75 /* new_file.png in Resources */, F5E424110EA3E4D60046E362 /* PBDiffWindow.xib in Resources */, - F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */, - F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */, 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */, F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */, F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */, @@ -1441,6 +1428,7 @@ 31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */, 316E7202131EE9C600AFBB36 /* list_Template.png in Resources */, 316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */, + 65D58BC4132D27A8003F7290 /* PBResetSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1551,7 +1539,6 @@ F5E424150EA3E4E10046E362 /* PBDiffWindowController.m in Sources */, F5E424180EA3E4EB0046E362 /* PBWebDiffController.m in Sources */, F5FE6C030EB13BC900F30D12 /* PBServicesController.m in Sources */, - F50A41230EBB875D00208746 /* PBNiceSplitView.m in Sources */, F5FC41F40EBCBD4300191D80 /* PBGitXProtocol.m in Sources */, F574A2850EAE2EAC003F2CB1 /* PBRefController.m in Sources */, F5FC43FE0EBD08EE00191D80 /* PBRefMenuItem.m in Sources */, @@ -1560,7 +1547,6 @@ 47DBDB670E94EE8B00671A1E /* PBPrefsWindowController.m in Sources */, 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */, F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, - EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, @@ -1610,6 +1596,8 @@ 217FF0BA12A1CB3300785A65 /* PBSubmoduleController.m in Sources */, 217FF0BB12A1CB3300785A65 /* PBGitResetController.m in Sources */, 217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */, + 65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */, + 31776089133569350025876E /* SearchWebView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1794,6 +1782,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = libgit2; PRODUCT_NAME = GitX; + SDKROOT = ""; WRAPPER_EXTENSION = app; ZERO_LINK = YES; }; @@ -1820,6 +1809,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = libgit2; PRODUCT_NAME = GitX; + SDKROOT = ""; WRAPPER_EXTENSION = app; }; name = Release; @@ -1827,7 +1817,7 @@ 26FC0A890875C7B200E6366F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ENABLE_OBJC_GC = required; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD; @@ -1835,29 +1825,25 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_PREPROCESS = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; - RUN_CLANG_STATIC_ANALYZER = YES; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + SDKROOT = macosx10.5; }; name = Debug; }; 26FC0A8A0875C7B200E6366F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - x86_64, - ); + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ENABLE_OBJC_GC = required; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; INFOPLIST_PREPROCESS = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; - RUN_CLANG_STATIC_ANALYZER = YES; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + SDKROOT = macosx10.5; }; name = Release; }; @@ -1881,6 +1867,7 @@ ); PREBINDING = NO; PRODUCT_NAME = gitx_askpasswd; + SDKROOT = ""; }; name = Debug; }; @@ -1889,7 +1876,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1903,6 +1890,7 @@ ); PREBINDING = NO; PRODUCT_NAME = gitx_askpasswd; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; @@ -1924,6 +1912,7 @@ ); PREBINDING = NO; PRODUCT_NAME = gitx_askpasswd; + SDKROOT = ""; }; name = Install; }; @@ -1947,6 +1936,7 @@ ); PREBINDING = NO; PRODUCT_NAME = gitx; + SDKROOT = ""; ZERO_LINK = YES; }; name = Debug; @@ -1970,6 +1960,7 @@ ); PREBINDING = NO; PRODUCT_NAME = gitx; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; @@ -1981,6 +1972,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = libgit2; + SDKROOT = ""; }; name = Debug; }; @@ -1991,6 +1983,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; PRODUCT_NAME = libgit2; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; @@ -2002,6 +1995,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = "Generate PList Prefix"; + SDKROOT = ""; }; name = Debug; }; @@ -2013,6 +2007,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = NO; INFOPLIST_PREPROCESS = YES; PRODUCT_NAME = "Generate PList Prefix"; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; @@ -2049,6 +2044,7 @@ ); PREBINDING = NO; PRODUCT_NAME = GitXTesting; + SDKROOT = ""; }; name = Debug; }; @@ -2079,6 +2075,7 @@ ); PREBINDING = NO; PRODUCT_NAME = GitXTesting; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; @@ -2108,7 +2105,7 @@ ); PREBINDING = NO; PRODUCT_NAME = SpeedTest; - SDKROOT = macosx10.5; + SDKROOT = ""; }; name = Debug; }; @@ -2133,7 +2130,7 @@ ); PREBINDING = NO; PRODUCT_NAME = SpeedTest; - SDKROOT = iphoneos2.0; + SDKROOT = ""; ZERO_LINK = NO; }; name = Release; diff --git a/GitX_Prefix.pch b/GitX_Prefix.pch index 3416e4a..f1ce03e 100644 --- a/GitX_Prefix.pch +++ b/GitX_Prefix.pch @@ -5,3 +5,15 @@ #ifdef __OBJC__ #import #endif + +#ifndef DLog +#ifdef DEBUG +# define DLog(...) NSLog(__VA_ARGS__) +#else +# define DLog(...) /* */ +#endif +#endif + +#ifndef ALog +#define ALog(...) DLog(__VA_ARGS__) +#endif diff --git a/Images/mainSplitterBar.tiff b/Images/mainSplitterBar.tiff deleted file mode 100644 index 0e7425d..0000000 Binary files a/Images/mainSplitterBar.tiff and /dev/null differ diff --git a/Images/mainSplitterDimple.tiff b/Images/mainSplitterDimple.tiff deleted file mode 100644 index 8f69b30..0000000 Binary files a/Images/mainSplitterDimple.tiff and /dev/null differ diff --git a/MGScopeBar/MGScopeBar.m b/MGScopeBar/MGScopeBar.m index 28454e3..83c5789 100644 --- a/MGScopeBar/MGScopeBar.m +++ b/MGScopeBar/MGScopeBar.m @@ -451,11 +451,11 @@ // We're widening. See if we can expand this group and still be within availableWidth. if (((theoreticalOccupiedWidth - contractedWidth) + expandedWidth) > availableWidth) { // We'd be too wide if we expanded this group. Terminate iteration without updating _firstCollapsedGroup. - //NSLog(@"We'd be too wide if we expanded right now"); + //DLog(@"We'd be too wide if we expanded right now"); break; } // else, continue trying to expand groups. theoreticalOccupiedWidth = ((theoreticalOccupiedWidth - contractedWidth) + expandedWidth); - //NSLog(@"We can continue expanding"); + //DLog(@"We can continue expanding"); } // Update _firstCollapsedGroup appropriately. @@ -474,7 +474,7 @@ // Work out how many groups we need to actually change. NSRange changedRange = NSMakeRange(0, [_groups count]); BOOL adjusting = YES; - //NSLog(@"Old firstCollapsedGroup: %d, new: %d", oldFirstCollapsedGroup, _firstCollapsedGroup); + //DLog(@"Old firstCollapsedGroup: %d, new: %d", oldFirstCollapsedGroup, _firstCollapsedGroup); if (_firstCollapsedGroup != oldFirstCollapsedGroup) { if (narrower) { // Narrower. _firstCollapsedGroup will be less (earlier) than oldFirstCollapsedGroup. @@ -492,7 +492,7 @@ // If a change is required, ensure that each group is expanded or contracted as appropriate. if (adjusting || shouldAdjustPopups) { - //NSLog(@"Got %@ - modifying groups %@", ((narrower) ? @"narrower" : @"wider"), NSStringFromRange(changedRange)); + //DLog(@"Got %@ - modifying groups %@", ((narrower) ? @"narrower" : @"wider"), NSStringFromRange(changedRange)); NSInteger nextXCoord = NSNotFound; if (adjusting) { int i; diff --git a/Model/PBGitStash.m b/Model/PBGitStash.m index a042413..f0ad81e 100644 --- a/Model/PBGitStash.m +++ b/Model/PBGitStash.m @@ -16,7 +16,7 @@ @synthesize stashSourceMessage; - initWithRawStashLine:(NSString *) stashLineFromStashListOutput { - if (self = [super init]) { + if ((self = [super init])) { stashRawString = [stashLineFromStashListOutput retain]; NSArray *lineComponents = [stashLineFromStashListOutput componentsSeparatedByString:@":"]; name = [[lineComponents objectAtIndex:0] retain]; diff --git a/Model/PBGitSubmodule.h b/Model/PBGitSubmodule.h index 5d1db18..88d6789 100644 --- a/Model/PBGitSubmodule.h +++ b/Model/PBGitSubmodule.h @@ -13,6 +13,7 @@ typedef enum { PBGitSubmoduleStateNotInitialized, PBGitSubmoduleStateMatchingIndex, PBGitSubmoduleStateDoesNotMatchIndex, + PBGitSubmoduleStateFailed, } PBGitSubmoduleState; @interface PBGitSubmodule : NSObject { diff --git a/Model/PBGitSubmodule.m b/Model/PBGitSubmodule.m index cea00d0..507070f 100644 --- a/Model/PBGitSubmodule.m +++ b/Model/PBGitSubmodule.m @@ -32,9 +32,13 @@ - (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString { NSParameterAssert([submoduleStatusString length] > 0); - if (self = [super init]) { + if ((self = [super init])) { unichar status = [submoduleStatusString characterAtIndex:0]; submoduleState = [PBGitSubmodule submoduleStateFromCharacter:status]; + if (submoduleState == PBGitSubmoduleStateFailed) { + DLog(@"Submodule status failed:\n %@", submoduleStatusString); + return nil; + } NSScanner *scanner = [NSScanner scannerWithString:[submoduleStatusString substringFromIndex:1]]; NSString *sha1 = nil; NSString *fullPath = nil; @@ -47,7 +51,7 @@ shouldContinue = [scanner scanString:@"(" intoString:NULL]; } if (shouldContinue) { - shouldContinue = [scanner scanUpToString:@")" intoString:&coName]; + [scanner scanUpToString:@")" intoString:&coName]; } self.path = [fullPath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; coName = [coName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; @@ -114,7 +118,7 @@ } else if (character == '+') { state = PBGitSubmoduleStateDoesNotMatchIndex; } else if (character != ' ') { - NSAssert1(NO, @"Ooops unsupported submodule status character: %c", character); + return PBGitSubmoduleStateFailed; } return state; diff --git a/PBChangedFile.m b/PBChangedFile.m index 5a7492e..6905d71 100644 --- a/PBChangedFile.m +++ b/PBChangedFile.m @@ -26,9 +26,9 @@ { NSAssert(status == NEW || self.commitBlobSHA, @"File is not new, but doesn't have an index entry!"); if (!self.commitBlobSHA) - return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@\0", self.path]; + return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@", self.path]; else - return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path]; + return [NSString stringWithFormat:@"%@ %@\t%@", self.commitBlobMode, self.commitBlobSHA, self.path]; } + (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus { diff --git a/PBCloneRepsitoryToSheet.m b/PBCloneRepsitoryToSheet.m index f9c60d6..4d9a619 100644 --- a/PBCloneRepsitoryToSheet.m +++ b/PBCloneRepsitoryToSheet.m @@ -71,7 +71,7 @@ if (code == NSOKButton) { NSString *clonePath = [(NSOpenPanel *)sheet filename]; - NSLog(@"clone path = %@", clonePath); + DLog(@"clone path = %@", clonePath); [self.repository cloneRepositoryToPath:clonePath bare:self.isBare]; } } diff --git a/PBCollapsibleSplitView.h b/PBCollapsibleSplitView.h deleted file mode 100644 index 1a52c0d..0000000 --- a/PBCollapsibleSplitView.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// PBCollapsibleSplitView.h -// GitX -// -// This is a limited subclass of a SplitView. It adds methods to aid in -// collapsing/uncollapsing subviews using the mouse or programmatically. -// Right now it only works for vertical layouts and with two subviews. -// -// Created by Johannes Gilger on 6/21/09. -// Copyright 2009 Johannes Gilger. All rights reserved. -// - -#import -#import "PBNiceSplitView.h" - -@interface PBCollapsibleSplitView : PBNiceSplitView { - CGFloat topViewMin; - CGFloat bottomViewMin; - CGFloat splitterPosition; -} - -@property (readonly) CGFloat topViewMin; -@property (readonly) CGFloat bottomViewMin; - -- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin; -- (void)uncollapse; -- (void)keyDown:(NSEvent *)event; - -@end diff --git a/PBCollapsibleSplitView.m b/PBCollapsibleSplitView.m deleted file mode 100644 index 9665cac..0000000 --- a/PBCollapsibleSplitView.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// PBCollapsibleSplitView.m -// GitX -// -// Created by Johannes Gilger on 6/21/09. -// Copyright 2009 Johannes Gilger. All rights reserved. -// - -#import "PBCollapsibleSplitView.h" - -@implementation PBCollapsibleSplitView -@synthesize topViewMin, bottomViewMin; - -- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin { - topViewMin = topMin; - bottomViewMin = bottomMin; -} - -- (void)uncollapse { - for (NSView *subview in [self subviews]) { - if([self isSubviewCollapsed:subview]) { - [self setPosition:[self frame].size.height / 3 ofDividerAtIndex:0]; - [self adjustSubviews]; - } - } -} - -- (void)collapseSubview:(NSInteger)index { - // Already collapsed, just uncollapse - if ([self isSubviewCollapsed:[[self subviews] objectAtIndex:index]]) { - [self setPosition:splitterPosition ofDividerAtIndex:0]; - return; - } - - // Store splitterposition if the other view isn't collapsed - if (![self isSubviewCollapsed:[[self subviews] objectAtIndex:(index + 1) % 2]]) - splitterPosition = [[[self subviews] objectAtIndex:0] frame].size.height; - - if (index == 0) // Top view - [self setPosition:0.0 ofDividerAtIndex:0]; - else // Bottom view - [self setPosition:[self frame].size.height ofDividerAtIndex:0]; -} - -- (void)keyDown:(NSEvent *)event { - if (!([event modifierFlags] & NSShiftKeyMask && [event modifierFlags] & NSCommandKeyMask)) - return [super keyDown:event]; - - if ([event keyCode] == 0x07E) { // Up-Key - [self collapseSubview:0]; - [[self window] makeFirstResponder:[[self subviews] objectAtIndex:1]]; - } else if ([event keyCode] == 0x07D) { // Down-Key - [self collapseSubview:1]; - [[self window] makeFirstResponder:[[self subviews] objectAtIndex:0]]; - } -} -@end diff --git a/PBCommandMenuItem.m b/PBCommandMenuItem.m index 50becd2..8eff7cd 100644 --- a/PBCommandMenuItem.m +++ b/PBCommandMenuItem.m @@ -18,7 +18,7 @@ @synthesize command; - initWithCommand:(PBCommand *) aCommand { - if (self = [super init]) { + if ((self = [super init])) { self.command = aCommand; super.title = [aCommand displayName]; [self setTarget:aCommand]; diff --git a/PBCommitList.m b/PBCommitList.m index dbf33b4..b9a58ae 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -63,7 +63,7 @@ // a little bit depending on how much the bottom half of the split view is dragged down. - (NSRect)adjustScroll:(NSRect)proposedVisibleRect { - //NSLog(@"[%@ %s]: proposedVisibleRect: %@", [self class], _cmd, NSStringFromRect(proposedVisibleRect)); + //DLog(@"[%@ %s]: proposedVisibleRect: %@", [self class], _cmd, NSStringFromRect(proposedVisibleRect)); NSRect newRect = proposedVisibleRect; // !!! Andre Berg 20100330: only modify if -scrollSelectionToTopOfViewFrom: has set useAdjustScroll to YES @@ -74,18 +74,18 @@ NSInteger adj = rh - ny; // check the targeted row and see if we need to add or subtract the difference (if there is one)... NSRect sr = [self rectOfRow:[self selectedRow]]; - // NSLog(@"[%@ %s]: selectedRow %d, rect: %@", [self class], _cmd, [self selectedRow], NSStringFromRect(sr)); + // DLog(@"[%@ %s]: selectedRow %d, rect: %@", [self class], _cmd, [self selectedRow], NSStringFromRect(sr)); if (sr.origin.y > proposedVisibleRect.origin.y) { - // NSLog(@"[%@ %s] selectedRow.origin.y > proposedVisibleRect.origin.y. adding adj (%d)", [self class], _cmd, adj); + // DLog(@"[%@ %s] selectedRow.origin.y > proposedVisibleRect.origin.y. adding adj (%d)", [self class], _cmd, adj); newRect = NSMakeRect(newRect.origin.x, newRect.origin.y + adj, newRect.size.width, newRect.size.height); } else if (sr.origin.y < proposedVisibleRect.origin.y) { - // NSLog(@"[%@ %s] selectedRow.origin.y < proposedVisibleRect.origin.y. subtracting ny (%d)", [self class], _cmd, ny); + // DLog(@"[%@ %s] selectedRow.origin.y < proposedVisibleRect.origin.y. subtracting ny (%d)", [self class], _cmd, ny); newRect = NSMakeRect(newRect.origin.x, newRect.origin.y - ny , newRect.size.width, newRect.size.height); } else { - // NSLog(@"[%@ %s] selectedRow.origin.y == proposedVisibleRect.origin.y. leaving as is", [self class], _cmd); + // DLog(@"[%@ %s] selectedRow.origin.y == proposedVisibleRect.origin.y. leaving as is", [self class], _cmd); } } - //NSLog(@"[%@ %s]: newRect: %@", [self class], _cmd, NSStringFromRect(newRect)); + //DLog(@"[%@ %s]: newRect: %@", [self class], _cmd, NSStringFromRect(newRect)); return newRect; } diff --git a/PBDiffWindowController.m b/PBDiffWindowController.m index ae545d9..3d8456f 100644 --- a/PBDiffWindowController.m +++ b/PBDiffWindowController.m @@ -10,6 +10,7 @@ #import "PBGitRepository.h" #import "PBGitCommit.h" #import "PBGitDefaults.h" +#import "GLFileView.h" @implementation PBDiffWindowController @@ -21,6 +22,7 @@ return nil; diff = aDiff; + return self; } @@ -47,11 +49,15 @@ int retValue; NSString *diff = [startCommit.repository outputInWorkdirForArguments:arguments retValue:&retValue]; if (retValue) { - NSLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff); + DLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff); return; } + + diff=[GLFileView parseDiff:diff]; + diff=[diff stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[startCommit realSha]]; + diff=[diff stringByReplacingOccurrencesOfString:@"{SHA}" withString:[diffCommit realSha]]; - PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]]; + PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diff]; [diffController showWindow:nil]; } diff --git a/PBEasyPipe.h b/PBEasyPipe.h index 84793ee..94ed673 100644 --- a/PBEasyPipe.h +++ b/PBEasyPipe.h @@ -7,7 +7,7 @@ // #import - +#import "GitX_Prefix.pch" @interface PBEasyPipe : NSObject { diff --git a/PBEasyPipe.m b/PBEasyPipe.m index fe8efa8..da5c577 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -8,7 +8,6 @@ #import "PBEasyPipe.h" - @implementation PBEasyPipe + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args @@ -33,9 +32,9 @@ [task setCurrentDirectoryPath:dir]; if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Show Debug Messages"]) - NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); + DLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); #ifdef CLI - NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); + DLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); #endif NSPipe* pipe = [NSPipe pipe]; @@ -128,7 +127,7 @@ data = [handle readDataToEndOfFile]; } @catch (NSException * e) { - NSLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd)); + DLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd)); if ([NSThread currentThread] != [NSThread mainThread]) [task waitUntilExit]; diff --git a/PBGitBinary.h b/PBGitBinary.h index 5008b3d..3ec9ce0 100644 --- a/PBGitBinary.h +++ b/PBGitBinary.h @@ -7,6 +7,7 @@ // #import +#import "GitX_Prefix.pch" #define MIN_GIT_VERSION "1.6.0" diff --git a/PBGitBinary.m b/PBGitBinary.m index 6b1a488..b939044 100644 --- a/PBGitBinary.m +++ b/PBGitBinary.m @@ -43,7 +43,7 @@ static NSString* gitPath = nil; return YES; } - NSLog(@"Found a git binary at %@, but is only version %@", path, version); + DLog(@"Found a git binary at %@, but is only version %@", path, version); return NO; } @@ -80,7 +80,7 @@ static NSString* gitPath = nil; return; } - NSLog(@"Could not find a git binary higher than version " MIN_GIT_VERSION); + DLog(@"Could not find a git binary higher than version " MIN_GIT_VERSION); } + (NSString *) path; diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 4d236ac..6ea4c95 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -11,7 +11,6 @@ #import "PBChangedFile.h" #import "PBWebChangesController.h" #import "PBGitIndex.h" -#import "PBNiceSplitView.h" #define kCommitSplitViewPositionDefault @"Commit SplitView Position" @@ -172,6 +171,7 @@ [commitMessageView setEditable:YES]; [commitMessageView setString:@""]; [webController setStateMessage:[NSString stringWithFormat:[[notification userInfo] objectForKey:@"description"]]]; + [repository reloadRefs]; } - (void)commitFailed:(NSNotification *)notification @@ -228,16 +228,16 @@ - (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { - if (splitView == commitSplitView) + if (proposedMin < kCommitSplitViewTopViewMin) return kCommitSplitViewTopViewMin; - return proposedMin; } - (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex { - if (splitView == commitSplitView) - return [splitView frame].size.height - [splitView dividerThickness] - kCommitSplitViewBottomViewMin; + CGFloat max=[splitView frame].size.height - [splitView dividerThickness] - kCommitSplitViewBottomViewMin; + if (max < proposedMax) + return max; return proposedMax; } diff --git a/PBGitConfig.m b/PBGitConfig.m index 4bdbbc7..93e38d6 100644 --- a/PBGitConfig.m +++ b/PBGitConfig.m @@ -41,7 +41,7 @@ int ret; [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:array inDir:nil retValue:&ret]; if (ret) - NSLog(@"Writing to config file failed!"); + DLog(@"Writing to config file failed!"); [self didChangeValueForKey:[key substringToIndex:[key rangeOfString:@"."].location]]; } diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index 41401d6..d22ba6c 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -137,7 +137,7 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines]; if (currentLine > maxLines) - NSLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines); + DLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines); previous.nLines = currentLine; previous.sign = commit.sign; diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index d592943..fe373f5 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -10,7 +10,6 @@ #import "PBGitCommit.h" #import "PBGitTree.h" #import "PBViewController.h" -#import "PBCollapsibleSplitView.h" @class PBGitSidebarController; @class PBWebHistoryController; @@ -23,7 +22,7 @@ @class PBHistorySearchController; -@interface PBGitHistoryController : PBViewController { +@interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; @@ -32,7 +31,7 @@ IBOutlet NSOutlineView* fileBrowser; NSArray *currentFileBrowserSelectionPath; IBOutlet PBCommitList* commitList; - IBOutlet PBCollapsibleSplitView *historySplitView; + IBOutlet NSSplitView *historySplitView; IBOutlet PBWebHistoryController *webHistoryController; QLPreviewPanel* previewPanel; IBOutlet PBHistorySearchController *searchController; @@ -55,10 +54,11 @@ PBGitTree *gitTree; PBGitCommit *webCommit; PBGitCommit *selectedCommit; + PBGitCommit *selectedCommitBeforeRefresh; } @property (readonly) NSTreeController* treeController; -@property (readonly) PBCollapsibleSplitView *historySplitView; +@property (readonly) NSSplitView *historySplitView; @property (assign) int selectedCommitDetailsIndex; @property (retain) PBGitCommit *webCommit; @property (retain) PBGitTree* gitTree; @@ -106,7 +106,5 @@ - (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview; - (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex; -- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset; -- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset; @end diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index ab221f1..ff1c597 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -83,7 +83,7 @@ // Add a menu that allows a user to select which columns to view [[commitList headerView] setMenu:[self tableColumnMenu]]; - [historySplitView setTopMin:58.0 andBottomMin:100.0]; +// [historySplitView setTopMin:58.0 andBottomMin:100.0]; [historySplitView setHidden:YES]; [self performSelector:@selector(restoreSplitViewPositiion) withObject:nil afterDelay:0]; @@ -250,7 +250,9 @@ }else if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { [self updateStatus]; - if ([repository.currentBranch isSimpleRef]) + if (selectedCommitBeforeRefresh && [repository commitForSHA:[selectedCommitBeforeRefresh sha]]) + [self selectCommit:[selectedCommitBeforeRefresh sha]]; + else if ([repository.currentBranch isSimpleRef]) [self selectCommit:[repository shaForRef:[repository.currentBranch ref]]]; else [self selectCommit:[[self firstCommit] sha]]; @@ -405,11 +407,13 @@ - (IBAction) refresh:(id)sender { + selectedCommitBeforeRefresh = selectedCommit; [repository forceUpdateRevisions]; } - (void) updateView { + [self refresh: nil]; [self updateKeys]; } @@ -624,42 +628,6 @@ return FALSE; } -- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex -{ - return historySplitView.topViewMin; -} - -- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex -{ - return [splitView frame].size.height - [splitView dividerThickness] - historySplitView.bottomViewMin; -} - -// while the user resizes the window keep the upper (history) view constant and just resize the lower view -// unless the lower view gets too small -- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize -{ - NSRect newFrame = [splitView frame]; - - float dividerThickness = [splitView dividerThickness]; - - NSView *upperView = [[splitView subviews] objectAtIndex:0]; - NSRect upperFrame = [upperView frame]; - upperFrame.size.width = newFrame.size.width; - - if ((newFrame.size.height - upperFrame.size.height - dividerThickness) < historySplitView.bottomViewMin) { - upperFrame.size.height = newFrame.size.height - historySplitView.bottomViewMin - dividerThickness; - } - - NSView *lowerView = [[splitView subviews] objectAtIndex:1]; - NSRect lowerFrame = [lowerView frame]; - lowerFrame.origin.y = upperFrame.size.height + dividerThickness; - lowerFrame.size.height = newFrame.size.height - lowerFrame.origin.y; - lowerFrame.size.width = newFrame.size.width; - - [upperView setFrame:upperFrame]; - [lowerView setFrame:lowerFrame]; -} - // NSSplitView does not save and restore the position of the SplitView correctly so do it manually - (void)saveSplitViewPosition { @@ -680,6 +648,23 @@ } +- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex +{ + if (proposedMin < 100) + return 100; + return proposedMin; +} + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex +{ + CGFloat max=[splitView frame].size.height - [splitView dividerThickness] - 100; + if (max < proposedMax) + return max; + + return proposedMax; +} + + #pragma mark Repository Methods - (IBAction) createBranch:(id)sender diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index ab9760d..062c7ae 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -65,7 +65,7 @@ } } //NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; - //NSLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration); + //DLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration); [self sendCommits:commits]; [delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO]; diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 1671ac9..5f632e9 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -2,10 +2,10 @@ 1050 - 10J567 - 762 + 10J869 + 1305 1038.35 - 462.00 + 461.00 YES @@ -15,13 +15,38 @@ YES - 762 - 762 + 1305 + 30 - + YES - + WebView + NSButton + NSCustomObject + NSArrayController + NSSplitView + NSTableView + NSCustomView + NSDateFormatter + NSSearchField + NSTextField + NSSearchFieldCell + NSTextFieldCell + NSTreeController + NSButtonCell + NSTableColumn + NSSegmentedControl + NSBox + NSView + NSOutlineView + NSScrollView + NSTabViewItem + NSProgressIndicator + NSSegmentedCell + NSScroller + NSTableHeaderView + NSTabView YES @@ -113,6 +138,8 @@ 292 {{267, 3}, {71, 25}} + + YES -2080244224 @@ -155,6 +182,8 @@ 268 {{206, 3}, {37, 25}} + + YES -2080244224 @@ -179,6 +208,8 @@ 268 {{161, 3}, {37, 25}} + + YES -2080244224 @@ -203,6 +234,8 @@ 268 {{116, 3}, {37, 25}} + + YES -2080244224 @@ -227,6 +260,8 @@ 268 {{55, 3}, {37, 25}} + + YES -2080244224 @@ -251,6 +286,8 @@ 268 {{10, 3}, {37, 25}} + + YES -2080244224 @@ -275,6 +312,8 @@ 10 {{0, -2}, {955, 5}} + + {0, 0} 67239424 @@ -303,6 +342,8 @@ {{0, 404}, {955, 30}} + + PBGitGradientBarView @@ -318,8 +359,10 @@ 10 - {{0, 144}, {955, 5}} + {{0, 140}, {955, 5}} + + {0, 0} 67239424 @@ -350,14 +393,18 @@ 4352 - {955, 130} + {955, 126} + + YES 256 {955, 17} + + @@ -365,6 +412,8 @@ -2147483392 {{-26, 0}, {16, 17}} + + YES @@ -491,7 +540,7 @@ - MMMM d, yyyy h:mm a + d 'de' MMMM 'de' yyyy HH:mm NO @@ -618,8 +667,9 @@ 0 - {{0, 17}, {955, 130}} + {{0, 17}, {955, 126}} + @@ -630,6 +680,8 @@ -2147483392 {{837, 17}, {15, 179}} + + _doScroller: 0.87603306770324707 @@ -639,6 +691,8 @@ -2147483392 {{0, 123}, {852, 15}} + + 1 _doScroller: @@ -654,6 +708,7 @@ {955, 17} + @@ -661,9 +716,10 @@ - {955, 147} + {955, 143} - + + 560 @@ -683,6 +739,8 @@ {{740, 3}, {16, 16}} + + 20746 100 @@ -691,6 +749,8 @@ 265 {{765, 2}, {180, 19}} + + YES 343014976 @@ -752,6 +812,8 @@ 265 {{714, 3}, {43, 18}} + + YES 67239424 @@ -788,6 +850,8 @@ 265 {{630, 5}, {80, 14}} + + YES 68288064 @@ -809,6 +873,8 @@ 268 {{49, 2}, {57, 17}} + + 1 YES @@ -834,6 +900,8 @@ 268 {{114, 2}, {103, 17}} + + 2 YES @@ -855,6 +923,8 @@ 268 {{11, 2}, {30, 17}} + + YES 67239424 @@ -871,13 +941,17 @@ - {{0, 147}, {955, 24}} + {{0, 143}, {955, 24}} + + PBGitGradientBarView - {955, 171} + {955, 167} + + NSView @@ -888,8 +962,10 @@ 18 - {955, 233} + {955, 228} + + YES @@ -951,6 +1027,7 @@ {955, 233} + Details @@ -976,14 +1053,16 @@ 266 - {{5, 212.5}, {196, 19}} + {{5, 207}, {196, 19}} + + YES 343014976 268698624 - + LucidaGrande 9 3614 @@ -1051,8 +1130,10 @@ 4368 - {190, 208} + {190, 203} + + YES @@ -1105,8 +1186,9 @@ 0 - {{1, 1}, {190, 208}} + {{1, 1}, {190, 203}} + @@ -1115,8 +1197,10 @@ 256 - {{191, 1}, {15, 208}} + {{191, 1}, {15, 203}} + + _doScroller: 0.98701298701298701 @@ -1126,6 +1210,8 @@ -2147483392 {{-100, -100}, {502, 15}} + + 1 _doScroller: @@ -1133,9 +1219,10 @@ 0.99801188707351685 - {{0, 0.5}, {207, 210}} + {207, 205} - + + 18 @@ -1143,8 +1230,10 @@ QSAAAEEgAABBmAAAQZgAAA - {207, 235} + {207, 230} + + NSView @@ -1162,11 +1251,76 @@ 265 YES + + + 268 + {{50, 2}, {158, 19}} + + + + YES + + 343014976 + 268698688 + + + + YES + 1 + + + + 130560 + 0 + search + + _searchFieldSearch: + + 138690815 + 0 + + 400 + 75 + + + 130560 + 0 + clear + + YES + + YES + + YES + AXDescription + NSAccessibilityEncodedAttributesValueType + + + YES + cancel + + + + + + _searchFieldCancel: + + 138690815 + 0 + + 400 + 75 + + 255 + + 289 - {{41, 1.5}, {29, 19}} + {{216, 1}, {29, 19}} + + YES -2080244224 @@ -1191,18 +1345,22 @@ - {{665, 0}, {84, 24}} + {{490, 0}, {259, 24}} + + NSView - {{0, 211}, {749, 24}} + {{0, 206}, {749, 24}} + + MGScopeBar - 274 + 4370 YES @@ -1224,29 +1382,36 @@ public.url-name - {749, 210} + {749, 205} + - YES + NO YES - {{208, 0}, {749, 235}} + {{208, 0}, {749, 230}} + + NSView - {{-1, -1}, {957, 235}} + {{-1, -1}, {957, 230}} + + YES 2
- {955, 233} + {955, 228} + + Tree @@ -1264,18 +1429,24 @@ - {{0, 172}, {955, 233}} + {{0, 177}, {955, 228}} + + NSView {955, 405} - 2 + + + 3 {955, 434} + + NSView @@ -2091,6 +2262,22 @@ 495 + + + updateSearch: + + + + 506 + + + + searchField + + + + 508 + @@ -2649,6 +2836,7 @@ YES + @@ -2735,6 +2923,20 @@ + + 496 + + + YES + + + + + + 497 + + + @@ -2750,7 +2952,6 @@ 18.IBPluginDependency 19.CustomClassName 19.IBPluginDependency - 2.CustomClassName 2.IBEditorWindowLastContentRect 2.IBPluginDependency 2.ImportedFromIB2 @@ -2853,6 +3054,8 @@ 491.IBPluginDependency 492.IBPluginDependency 493.IBPluginDependency + 496.IBPluginDependency + 497.IBPluginDependency 50.IBPluginDependency 51.IBPluginDependency 6.IBPluginDependency @@ -2871,7 +3074,6 @@ com.apple.InterfaceBuilder.CocoaPlugin PBIconAndTextCell com.apple.InterfaceBuilder.CocoaPlugin - PBCollapsibleSplitView {{312, 577}, {852, 384}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2879,9 +3081,7 @@ YES - - YES - + com.apple.WebKitIBPlugin PBCommitList @@ -3013,9 +3213,7 @@ YES - - YES - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3057,25 +3255,23 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES - - YES - + - 495 + 508 @@ -3083,6 +3279,17 @@ GLFileView PBWebController + + updateSearch: + NSSearchField + + + updateSearch: + + updateSearch: + NSSearchField + + YES @@ -3090,6 +3297,7 @@ accessoryView fileListSplitView historyController + searchField typeBar @@ -3097,12 +3305,47 @@ NSView NSSplitView PBGitHistoryController + NSSearchField MGScopeBar + + YES + + YES + accessoryView + fileListSplitView + historyController + searchField + typeBar + + + YES + + accessoryView + NSView + + + fileListSplitView + NSSplitView + + + historyController + PBGitHistoryController + + + searchField + NSSearchField + + + typeBar + MGScopeBar + + + IBProjectSource - GLFileView.h + ./Classes/GLFileView.h @@ -3110,7 +3353,7 @@ NSFormatter IBProjectSource - GitXRelativeDateFormatter.h + ./Classes/GitXRelativeDateFormatter.h @@ -3120,9 +3363,16 @@ contextMenuDelegate id + + contextMenuDelegate + + contextMenuDelegate + id + + IBProjectSource - GitXTextFieldCell.h + ./Classes/GitXTextFieldCell.h @@ -3132,38 +3382,24 @@ delegate id - - IBProjectSource - MGScopeBar/MGScopeBar.h + + delegate + + delegate + id + - - - NSApplication IBProjectSource - NSApplication+GitXScripting.h - - - - NSCell - - IBProjectSource - View/CellTrackingRect.h - - - - NSOutlineView - - IBProjectSource - NSOutlineViewExt.h + ./Classes/MGScopeBar.h PBCollapsibleSplitView - PBNiceSplitView + NSSplitView IBProjectSource - PBCollapsibleSplitView.h + ./Classes/PBCollapsibleSplitView.h @@ -3186,9 +3422,38 @@ WebView + + YES + + YES + controller + searchController + webController + webView + + + YES + + controller + PBGitHistoryController + + + searchController + PBHistorySearchController + + + webController + PBWebHistoryController + + + webView + WebView + + + IBProjectSource - PBCommitList.h + ./Classes/PBCommitList.h @@ -3196,15 +3461,7 @@ NSView IBProjectSource - PBGitGradientBarView.h - - - - PBGitGradientBarView - NSView - - IBUserSource - + ./Classes/PBGitGradientBarView.h @@ -3218,7 +3475,6 @@ createBranch: createTag: merge: - openFilesAction: openSelectedFile: rebase: refresh: @@ -3228,8 +3484,6 @@ setDetailedView: setTreeView: showAddRemoteSheet: - showCommitsFromTree: - showInFinderAction: toggleQLPreviewPanel: updateSearch: @@ -3250,9 +3504,90 @@ id id id - id - id - id + + + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openSelectedFile: + rebase: + refresh: + selectNext: + selectPrevious: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + toggleQLPreviewPanel: + updateSearch: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + selectNext: + id + + + selectPrevious: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + toggleQLPreviewPanel: + id + + + updateSearch: + id + @@ -3304,17 +3639,118 @@ id + + YES + + YES + allBranchesFilterItem + cherryPickButton + commitController + commitList + fileBrowser + fileView + filesSearchField + historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView + searchController + searchField + selectedBranchFilterItem + treeController + upperToolbarView + webHistoryController + webView + + + YES + + allBranchesFilterItem + NSButton + + + cherryPickButton + NSButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + fileBrowser + NSOutlineView + + + fileView + GLFileView + + + filesSearchField + NSSearchField + + + historySplitView + PBCollapsibleSplitView + + + localRemoteBranchesFilterItem + NSButton + + + mergeButton + NSButton + + + rebaseButton + NSButton + + + refController + PBRefController + + + scopeBarView + PBGitGradientBarView + + + searchController + PBHistorySearchController + + + searchField + NSSearchField + + + selectedBranchFilterItem + NSButton + + + treeController + NSTreeController + + + upperToolbarView + PBGitGradientBarView + + + webHistoryController + PBWebHistoryController + + + webView + id + + + IBProjectSource - PBGitHistoryController.h - - - - PBGitHistoryController - PBViewController - - IBUserSource - + ./Classes/PBGitHistoryController.h @@ -3333,9 +3769,28 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + controller + + + YES + + contextMenuDelegate + id + + + controller + PBGitHistoryController + + + IBProjectSource - PBGitRevisionCell.h + ./Classes/PBGitRevisionCell.h @@ -3345,7 +3800,6 @@ YES YES - selectSearchMode: stepperPressed: updateSearch: @@ -3353,7 +3807,25 @@ YES id id - id + + + + YES + + YES + stepperPressed: + updateSearch: + + + YES + + stepperPressed: + id + + + updateSearch: + id + @@ -3377,9 +3849,48 @@ NSSegmentedControl + + YES + + YES + commitController + historyController + numberOfMatchesField + progressIndicator + searchField + stepper + + + YES + + commitController + NSArrayController + + + historyController + PBGitHistoryController + + + numberOfMatchesField + NSTextField + + + progressIndicator + NSProgressIndicator + + + searchField + NSSearchField + + + stepper + NSSegmentedControl + + + IBProjectSource - PBHistorySearchController.h + ./Classes/PBHistorySearchController.h @@ -3387,15 +3898,7 @@ NSTextFieldCell IBProjectSource - PBIconAndTextCell.h - - - - PBNiceSplitView - NSSplitView - - IBProjectSource - PBNiceSplitView.h + ./Classes/PBIconAndTextCell.h @@ -3405,53 +3908,21 @@ controller PBGitHistoryController + + controller + + controller + PBGitHistoryController + + IBProjectSource - PBQLOutlineView.h + ./Classes/PBQLOutlineView.h PBRefController NSObject - - YES - - YES - checkout: - cherryPick: - copyPatch: - copySHA: - createBranch: - createTag: - diffWithHEAD: - fetchRemote: - merge: - pullRemote: - pushDefaultRemoteForRef: - pushToRemote: - pushUpdatesToRemote: - rebaseHeadBranch: - showTagInfoSheet: - - - YES - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - PBRefMenuItem - - YES @@ -3469,21 +3940,38 @@ PBGitHistoryController - - IBProjectSource - PBRefController.h - - - - PBRefMenuItem - NSMenuItem - - refish - id + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + + branchPopUp + NSPopUpButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + historyController + PBGitHistoryController + + IBProjectSource - PBRefMenuItem.h + ./Classes/PBRefController.h @@ -3493,9 +3981,16 @@ controller NSArrayController + + controller + + controller + NSArrayController + + IBProjectSource - PBUnsortableTableHeader.h + ./Classes/PBUnsortableTableHeader.h @@ -3505,9 +4000,16 @@ refresh: id + + refresh: + + refresh: + id + + IBProjectSource - PBViewController.h + ./Classes/PBViewController.h @@ -3526,9 +4028,28 @@ WebView + + YES + + YES + repository + view + + + YES + + repository + id + + + view + WebView + + + IBProjectSource - PBWebController.h + ./Classes/PBWebController.h @@ -3547,762 +4068,46 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + IBProjectSource - PBWebHistoryController.h - - - - PBWebHistoryController - PBWebController - - view - WebView - - - IBUserSource - - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSArrayController - NSObjectController - - IBFrameworkSource - AppKit.framework/Headers/NSArrayController.h - - - - NSBox - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSBox.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSController - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSController.h - - - - NSDateFormatter - NSFormatter - - IBFrameworkSource - Foundation.framework/Headers/NSDateFormatter.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSManagedObjectContext - NSObject - - IBFrameworkSource - CoreData.framework/Headers/NSManagedObjectContext.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSObject - - IBFrameworkSource - ScriptingBridge.framework/Headers/SBApplication.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebDownload.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebEditingDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebFrameLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebJavaPlugIn.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPlugin.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPluginContainer.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebPolicyDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebResourceLoadDelegate.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebScriptObject.h - - - - NSObject - - IBFrameworkSource - WebKit.framework/Headers/WebUIDelegate.h - - - - NSObjectController - NSController - - IBFrameworkSource - AppKit.framework/Headers/NSObjectController.h - - - - NSOutlineView - NSTableView - - - - NSPopUpButton - NSButton - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButton.h - - - - NSProgressIndicator - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSProgressIndicator.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSScrollView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSScrollView.h - - - - NSScroller - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSScroller.h - - - - NSSearchField - NSTextField - - IBFrameworkSource - AppKit.framework/Headers/NSSearchField.h - - - - NSSearchFieldCell - NSTextFieldCell - - IBFrameworkSource - AppKit.framework/Headers/NSSearchFieldCell.h - - - - NSSegmentedCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSSegmentedCell.h - - - - NSSegmentedControl - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSSegmentedControl.h - - - - NSSplitView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSSplitView.h - - - - NSTabView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSTabView.h - - - - NSTabViewItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTabViewItem.h - - - - NSTableColumn - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableColumn.h - - - - NSTableHeaderView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSTableHeaderView.h - - - - NSTableView - NSControl - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSTreeController - NSObjectController - - IBFrameworkSource - AppKit.framework/Headers/NSTreeController.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSViewController - NSResponder - - view - NSView - - - IBFrameworkSource - AppKit.framework/Headers/NSViewController.h + ./Classes/PBWebHistoryController.h WebView - NSView - YES - - YES - goBack: - goForward: - makeTextLarger: - makeTextSmaller: - makeTextStandardSize: - reload: - reloadFromOrigin: - stopLoading: - takeStringURLFrom: - toggleContinuousSpellChecking: - toggleSmartInsertDelete: - - - YES - id - id - id - id - id - id - id - id - id - id - id + reloadFromOrigin: + id + + + reloadFromOrigin: + + reloadFromOrigin: + id - IBFrameworkSource - WebKit.framework/Headers/WebView.h + IBProjectSource + ./Classes/WebView.h @@ -4322,7 +4127,6 @@ YES - GitX.xcodeproj 3 YES diff --git a/PBGitIndex.m b/PBGitIndex.m index e41e5e5..4c63ab2 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -235,6 +235,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; return; repository.hasChanged = YES; + [repository reloadRefs]; amendEnvironment = nil; if (amend) @@ -299,7 +300,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; PBChangedFile *file = [stageFiles objectAtIndex:i]; - [input appendFormat:@"%@\0", file.path]; + [input appendFormat:@"%@", file.path]; } @@ -390,9 +391,9 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (void)discardChangesForFiles:(NSArray *)discardFiles { NSArray *paths = [discardFiles valueForKey:@"path"]; - NSString *input = [paths componentsJoinedByString:@"\0"]; + NSString *input = [paths componentsJoinedByString:@"\n"]; - NSArray *arguments = [NSArray arrayWithObjects:@"checkout-index", @"--index", @"--quiet", @"--force", @"-z", @"--stdin", nil]; + NSArray *arguments = [NSArray arrayWithObjects:@"checkout-index", @"--index", @"--quiet", @"--force", @"--stdin", nil]; int ret = 1; [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:[workingDirectory path] inputString:input retValue:&ret]; @@ -499,7 +500,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; // Other files (not tracked, not ignored) refreshStatus++; NSFileHandle *handle = [PBEasyPipe handleForCommand:[PBGitBinary path] - withArgs:[NSArray arrayWithObjects:@"ls-files", @"--others", @"--exclude-standard", @"-z", nil] + withArgs:[NSArray arrayWithObjects:@"ls-files", @"--others", @"--exclude-standard", nil] inDir:[workingDirectory path]]; [nc addObserver:self selector:@selector(readOtherFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; [handle readToEndOfFileInBackgroundAndNotify]; @@ -507,7 +508,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; // Unstaged files refreshStatus++; handle = [PBEasyPipe handleForCommand:[PBGitBinary path] - withArgs:[NSArray arrayWithObjects:@"diff-files", @"-z", nil] + withArgs:[NSArray arrayWithObjects:@"diff-files", nil] inDir:[workingDirectory path]]; [nc addObserver:self selector:@selector(readUnstagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; [handle readToEndOfFileInBackgroundAndNotify]; @@ -515,7 +516,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; // Staged files refreshStatus++; handle = [PBEasyPipe handleForCommand:[PBGitBinary path] - withArgs:[NSArray arrayWithObjects:@"diff-index", @"--cached", @"-z", [self parentTree], nil] + withArgs:[NSArray arrayWithObjects:@"diff-index", @"--cached", [self parentTree], nil] inDir:[workingDirectory path]]; [nc addObserver:self selector:@selector(readStagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; [handle readToEndOfFileInBackgroundAndNotify]; @@ -641,35 +642,27 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; return [NSArray array]; NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - // FIXME: throw an error? if (!string) return [NSArray array]; - // Strip trailing null - if ([string hasSuffix:@"\0"]) - string = [string substringToIndex:[string length]-1]; - if ([string length] == 0) return [NSArray array]; - return [string componentsSeparatedByString:@"\0"]; + string=[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + return [string componentsSeparatedByString:@"\n"]; } - (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines { - NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[lines count]/2]; - - // Fill the dictionary with the new information. These lines are in the form of: - // :00000 :0644 OTHER INDEX INFORMATION - // Filename - - NSAssert1([lines count] % 2 == 0, @"Lines must have an even number of lines: %@", lines); + NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[lines count]]; NSEnumerator *enumerator = [lines objectEnumerator]; - NSString *fileStatus; - while (fileStatus = [enumerator nextObject]) { - NSString *fileName = [enumerator nextObject]; - [dictionary setObject:[fileStatus componentsSeparatedByString:@" "] forKey:fileName]; + NSString *line; + while ((line = [enumerator nextObject])) { + NSArray *lineComp=[line componentsSeparatedByString:@"\t"]; + NSArray *fileStatus=[[lineComp objectAtIndex:0] componentsSeparatedByString:@" "]; + NSString *fileName = [lineComp objectAtIndex:1]; + [dictionary setObject:fileStatus forKey:fileName]; } return dictionary; diff --git a/PBGitMenuItem.m b/PBGitMenuItem.m index 38b6895..7d08c79 100644 --- a/PBGitMenuItem.m +++ b/PBGitMenuItem.m @@ -17,7 +17,7 @@ //--------------------------------------------------------------------------------------------- - initWithSourceObject:(id) anObject { - if (self = [super init]) { + if ((self = [super init])) { super.title = [anObject displayDescription]; sourceObject = [anObject retain]; } diff --git a/PBGitRepository.m b/PBGitRepository.m index 50be481..41bc6f0 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -143,7 +143,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; NSURL* gitDirURL = [PBGitRepository gitDirForURL:[self fileURL]]; if (!gitDirURL) { if (outError) { - NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileName]] + NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileURL]] forKey:NSLocalizedRecoverySuggestionErrorKey]; *outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo]; } @@ -690,22 +690,34 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; } NSString *remoteName = [remoteRef remoteName]; [arguments addObject:remoteName]; - + NSString *branchName = nil; - if ([ref isRemote] || !ref) { - branchName = @"all updates"; - } - else if ([ref isTag]) { - branchName = [NSString stringWithFormat:@"tag '%@'", [ref tagName]]; - [arguments addObject:@"tag"]; - [arguments addObject:[ref tagName]]; - } - else { - branchName = [ref shortName]; - [arguments addObject:branchName]; + NSString *actionType = nil; + + if ([config valueForKeyPath:[NSString stringWithFormat:@"remote.%@.mirror", remoteName]]) { + // we must check for mirror parameter in config. + // if we push branch name in this case to the arguments, push failed + actionType = @"Mirroring"; + } else { + + if ([ref isRemote] || !ref) { + branchName = @"all updates"; + } + else if ([ref isTag]) { + branchName = [NSString stringWithFormat:@"tag '%@'", [ref tagName]]; + [arguments addObject:@"tag"]; + [arguments addObject:[ref tagName]]; + } + else { + branchName = [ref shortName]; + [arguments addObject:branchName]; + } + + actionType = [NSString stringWithFormat:@"Pushing %@", branchName]; + } - NSString *description = [NSString stringWithFormat:@"Pushing %@ to %@", branchName, remoteName]; + NSString *description = [actionType stringByAppendingFormat:@" to %@", remoteName]; NSString *title = @"Pushing to remote"; [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; } @@ -1270,7 +1282,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; - (void) finalize { - NSLog(@"Dealloc of repository"); + //DLog(@"Dealloc of repository"); [super finalize]; } @end diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 8ab64e1..58992bf 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -165,7 +165,7 @@ using namespace std; if (parentString.size() != 0) { if (((parentString.size() + 1) % 41) != 0) { - NSLog(@"invalid parents: %zu", parentString.size()); + DLog(@"invalid parents: %zu", parentString.size()); continue; } int nParents = (parentString.size() + 1) / 41; @@ -191,7 +191,7 @@ using namespace std; stream >> c; // Remove separator stream >> c; if (c != '>' && c != '<' && c != '^' && c != '-') - NSLog(@"Error loading commits: sign not correct"); + DLog(@"Error loading commits: sign not correct"); [newCommit setSign: c]; } @@ -216,7 +216,7 @@ using namespace std; if (![currentThread isCancelled]) { NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; - NSLog(@"Loaded %i commits in %f seconds (%f/sec)", num, duration, num/duration); + DLog(@"Loaded %i commits in %f seconds (%f/sec)", num, duration, num/duration); // Make sure the commits are stored before exiting. NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; @@ -225,7 +225,7 @@ using namespace std; [self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO]; } else { - NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd)); + DLog(@"[%@ %@] thread has been canceled", [self class], NSStringFromSelector(_cmd)); } [task terminate]; diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 4126ff9..8bacbe2 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -13,7 +13,7 @@ @class PBGitHistoryController; @class PBGitCommitController; -@interface PBGitSidebarController : PBViewController { +@interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; IBOutlet NSOutlineView *sourceView; IBOutlet NSView *sourceListControlsView; diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index eee30ea..051ed59 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -170,8 +170,9 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; -(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote { - NSLog(@"remote.title=%@",[remote title]); - [remote setAlert:[self remoteNeedFetch:[remote title]]]; + DLog(@"remote.title=%@",[remote title]); + if([remote isKindOfClass:[PBGitSVRemoteItem class]]) + [remote setAlert:[self remoteNeedFetch:[remote title]]]; } -(NSNumber *)countCommintsOf:(NSString *)range @@ -244,7 +245,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged"; PBSourceViewItem *item = [self selectedItem]; if ([item isKindOfClass:[PBGitMenuItem class]]) { PBGitMenuItem *sidebarItem = (PBGitMenuItem *) item; - NSObject *sourceObject = [sidebarItem sourceObject]; + id sourceObject = [sidebarItem sourceObject]; if ([sourceObject isKindOfClass:[PBGitSubmodule class]]) { [[repository.submoduleController defaultCommandForSubmodule:(id)sourceObject] invoke]; } diff --git a/PBGitTree.m b/PBGitTree.m index f1ba694..ad9e1db 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -113,16 +113,6 @@ return NO; } -- (BOOL)hasBinaryHeader:(NSString*)contents -{ - if (!contents) - return NO; - - return [contents rangeOfString:@"\0" - options:0 - range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound; -} - - (BOOL)hasBinaryAttributes { // First ask git check-attr if the file has a binary attribute custom set @@ -231,12 +221,12 @@ } res=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff", sha, des,[self fullPath], nil]]; if ([res length]==0) { - NSLog(@"--%d",[res length]); + DLog(@"--%@",[res length]); if (anError != NULL) { *anError = [NSError errorWithDomain:@"diff" code:1 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"No Diff",NSLocalizedDescriptionKey,nil]]; } }else{ - NSLog(@"--%@",[res substringToIndex:80]); + DLog(@"--%@",[res substringToIndex:80]); } }else{ if (anError != NULL) { @@ -296,7 +286,7 @@ NSData* data = [handle readDataToEndOfFile]; [data writeToFile:newName atomically:YES]; } else { // Directory - [[NSFileManager defaultManager] createDirectoryAtPath:newName attributes:nil]; + [[NSFileManager defaultManager] createDirectoryAtPath:newName withIntermediateDirectories:YES attributes:nil error:nil]; for (PBGitTree* child in [self children]) [child saveToFolder: newName]; } @@ -383,7 +373,12 @@ - (void) finalize { if (localFileName) - [[NSFileManager defaultManager] removeFileAtPath:localFileName handler:nil]; + [[NSFileManager defaultManager] removeItemAtPath:localFileName error:nil]; [super finalize]; } + +- (BOOL)isEqualTo:(PBGitTree *)object +{ + return [sha isEqualTo:[object sha]] && [[self fullPath] isEqualTo:[object fullPath]]; +} @end diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 70b268d..0eb02df 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -14,14 +14,14 @@ @class PBViewController, PBGitSidebarController, PBGitCommitController; -@interface PBGitWindowController : NSWindowController { +@interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; PBViewController *contentController; PBGitSidebarController *sidebarController; IBOutlet NSView *sourceListControlsView; - IBOutlet NSSplitView *splitView; + IBOutlet NSSplitView *mainSplitView; IBOutlet NSView *sourceSplitView; IBOutlet NSView *contentSplitView; @@ -30,6 +30,9 @@ IBOutlet NSToolbarItem *terminalItem; IBOutlet NSToolbarItem *finderItem; + + NSArray *splitViews; + NSMutableArray *splitViewsSize; } @property (assign) __weak PBGitRepository *repository; @@ -42,7 +45,9 @@ - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output; -- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show; + +-(void)initChangeLayout; +-(IBAction)changeLayout:(id)sender; - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; @@ -50,7 +55,6 @@ - (IBAction) openInTerminal:(id)sender; - (IBAction) cloneTo:(id)sender; - (IBAction) refresh:(id)sender; -- (IBAction) changeLayout:(id)sender; - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 9ec67f2..e156c85 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -25,19 +25,19 @@ { if (!(self = [self initWithWindowNibName:@"RepositoryWindow"])) return nil; - + self.repository = theRepository; - + return self; } - (void)windowWillClose:(NSNotification *)notification { - NSLog(@"Window will close!"); - + //DLog(@"Window will close!"); + if (sidebarController) [sidebarController closeView]; - + if (contentController) [contentController removeObserver:self forKeyPath:@"status"]; } @@ -59,22 +59,23 @@ [[self window] setDelegate:self]; [[self window] setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge]; [[self window] setContentBorderThickness:31.0f forEdge:NSMinYEdge]; - + sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self]; [[sidebarController view] setFrame:[sourceSplitView bounds]]; [sourceSplitView addSubview:[sidebarController view]]; [sourceListControlsView addSubview:sidebarController.sourceListControlsView]; - + [[statusField cell] setBackgroundStyle:NSBackgroundStyleRaised]; [progressIndicator setUsesThreadedAnimation:YES]; - + NSImage *finderImage = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kFinderIcon)]; [finderItem setImage:finderImage]; - + NSImage *terminalImage = [[NSWorkspace sharedWorkspace] iconForFile:@"/Applications/Utilities/Terminal.app/"]; [terminalItem setImage:terminalImage]; - + [self showWindow:nil]; + [self initChangeLayout]; } - (void) removeAllContentSubViews @@ -88,17 +89,17 @@ { if (!controller || (contentController == controller)) return; - + if (contentController) [contentController removeObserver:self forKeyPath:@"status"]; - + [self removeAllContentSubViews]; - + contentController = controller; [[contentController view] setFrame:[contentSplitView bounds]]; [contentSplitView addSubview:[contentController view]]; - + [self setNextResponder: contentController]; [[self window] makeFirstResponder:[contentController firstResponder]]; [contentController updateView]; @@ -197,21 +198,22 @@ - (IBAction) refresh:(id)sender { - [contentController refresh:self]; + [sidebarController.historyViewController refresh: self]; + [sidebarController.commitViewController refresh: self]; } - (void) updateStatus { NSString *status = contentController.status; BOOL isBusy = contentController.isBusy; - + if (!status) { status = @""; isBusy = NO; } - + [statusField setStringValue:status]; - + if (isBusy) { [progressIndicator startAnimation:self]; [progressIndicator setHidden:NO]; @@ -228,7 +230,7 @@ [self updateStatus]; return; } - + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } @@ -237,47 +239,77 @@ [sidebarController setHistorySearch:searchString mode:mode]; } -- (IBAction) changeLayout:(id)sender{ - NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]); - NSSplitView *sp=nil; - switch ([sender selectedSegment]) { - case 0: - sp=splitView; - break; - case 1: - sp=[[sidebarController historyViewController] historySplitView]; - break; - } - NSLog(@"sp=%@",sp); - if(sp!=nil) { - [self collapseSplitView:sp show:[sender isSelectedForSegment:[sender selectedSegment]]]; - } +#pragma mark - SplitView changeLayout +-(void)initChangeLayout +{ + splitViews=[NSArray arrayWithObjects:mainSplitView,[[sidebarController historyViewController] historySplitView], nil]; + splitViewsSize=[NSMutableArray arrayWithCapacity:[splitViews count]]; + for (int n=0; n<[splitViews count]; n++) { + NSSplitView *splitView=[splitViews objectAtIndex:n]; + NSView *left=[[splitView subviews] objectAtIndex:0]; + [splitViewsSize addObject:[NSNumber numberWithInt:[left frame].size.width]]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(resizeSubviewsHandler:) + name:NSSplitViewWillResizeSubviewsNotification + object:splitView + ]; + } } -- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show{ - NSView *clipview = [[sp subviews] objectAtIndex:0]; - NSRect clipFrame = [clipview frame]; +- (IBAction)changeLayout:(id)sender +{ + NSInteger index=[sender selectedSegment]; + NSSplitView *splitView=[splitViews objectAtIndex:index]; + NSView *left=[[splitView subviews] objectAtIndex:0]; + + CGFloat pos; + if ([splitView isSubviewCollapsed:left]) + pos=[[splitViewsSize objectAtIndex:index] intValue]; + else + pos=[splitView minPossiblePositionOfDividerAtIndex:0]; - if ([sp isVertical]) { - clipFrame.size.width = kGitSplitViewMinWidth * show; - }else{ - clipFrame.size.height = kGitSplitViewMinWidth * show; - } + [splitView setPosition:pos ofDividerAtIndex:0 ]; +} - [[clipview animator] setFrame:clipFrame]; - [sp adjustSubviews]; +- (void)resizeSubviewsHandler:(NSNotification *)notif +{ + NSSplitView *splitView=[notif object]; + NSInteger index=[splitViews indexOfObject:splitView]; + NSView *left=[[splitView subviews] objectAtIndex:0]; + + NSNumber *pos; + if([splitView isVertical]){ + pos=[NSNumber numberWithInt:[left frame].size.width]; + }else{ + pos=[NSNumber numberWithInt:[left frame].size.height]; + } + + [splitViewsSize removeObjectAtIndex:index]; + [splitViewsSize insertObject:pos atIndex:index]; } #pragma mark - #pragma mark SplitView Delegates +- (BOOL)splitView:(NSSplitView *)sp canCollapseSubview:(NSView *)subview +{ + return TRUE; +} + +- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex +{ + NSUInteger index = [[splitView subviews] indexOfObject:subview]; + return index==0; +} + #pragma mark min/max widths while moving the divider - (CGFloat)splitView:(NSSplitView *)view constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { if (proposedMin < kGitSplitViewMinWidth) return kGitSplitViewMinWidth; - + return proposedMin; } @@ -285,7 +317,7 @@ { if (dividerIndex == 0) return kGitSplitViewMaxWidth; - + return proposedMax; } @@ -294,19 +326,19 @@ - (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize { NSRect newFrame = [sender frame]; - + float dividerThickness = [sender dividerThickness]; - + NSView *sourceView = [[sender subviews] objectAtIndex:0]; NSRect sourceFrame = [sourceView frame]; sourceFrame.size.height = newFrame.size.height; - + NSView *mainView = [[sender subviews] objectAtIndex:1]; NSRect mainFrame = [mainView frame]; mainFrame.origin.x = sourceFrame.size.width + dividerThickness; mainFrame.size.width = newFrame.size.width - mainFrame.origin.x; mainFrame.size.height = newFrame.size.height; - + [sourceView setFrame:sourceFrame]; [mainView setFrame:mainFrame]; } diff --git a/PBGitXProtocol.m b/PBGitXProtocol.m index 052a667..ea0e682 100644 --- a/PBGitXProtocol.m +++ b/PBGitXProtocol.m @@ -17,7 +17,7 @@ // note that this leaks! CFRetain(client); - if (self = [super initWithRequest:request cachedResponse:cachedResponse client:client]) + if ((self = [super initWithRequest:request cachedResponse:cachedResponse client:client])) { } @@ -47,10 +47,10 @@ if ([[url host] isEqualToString:@"app"]) { NSString *app=[[url path] substringFromIndex:1]; NSString *appPath=[[NSWorkspace sharedWorkspace] fullPathForApplication:app]; - NSLog(@"app=%@ appPath=%@",app,appPath); + DLog(@"app=%@ appPath=%@",app,appPath); if(appPath){ NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; - NSLog(@"icon=%@",icon); + DLog(@"icon=%@",icon); [[self client] URLProtocol:self didLoadData:[icon TIFFRepresentation]]; [[self client] URLProtocolDidFinishLoading:self]; }else{ diff --git a/PBNiceSplitView.h b/PBNiceSplitView.h deleted file mode 100644 index f5969e7..0000000 --- a/PBNiceSplitView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// PBNiceSplitView.h -// GitX -// -// Created by Pieter de Bie on 31-10-08. -// Copyright 2008 Pieter de Bie. All rights reserved. -// - -#import - -@interface PBNiceSplitView : NSSplitView { - -} - -@end diff --git a/PBNiceSplitView.m b/PBNiceSplitView.m deleted file mode 100644 index 994e6d4..0000000 --- a/PBNiceSplitView.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// PBNiceSplitView.m -// GitX -// -// Created by Pieter de Bie on 31-10-08. -// Copyright 2008 Pieter de Bie. All rights reserved. -// - -#import "PBNiceSplitView.h" - -static NSImage *bar; -static NSImage *grip; - -@implementation PBNiceSplitView - -+(void) initialize -{ - NSString *barPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterBar" ofType:@"tiff"]; - bar = [[NSImage alloc] initWithContentsOfFile: barPath]; - [bar setFlipped: YES]; - - NSString *gripPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterDimple" ofType:@"tiff"]; - grip = [[NSImage alloc] initWithContentsOfFile: gripPath]; - [grip setFlipped: YES]; -} - -- (void)drawDividerInRect:(NSRect)aRect -{ - // Draw bar and grip onto the canvas - NSRect gripRect = aRect; - gripRect.origin.x = (NSMidX(aRect) - ([grip size].width/2)); - gripRect.size.width = 8; - - [self lockFocus]; - [bar drawInRect:aRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; - [grip drawInRect:gripRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; - [self unlockFocus]; -} - -- (CGFloat)dividerThickness -{ - return 10.0; -} - -@end diff --git a/PBRefController.h b/PBRefController.h index 15df74b..321409f 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -31,6 +31,7 @@ - (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef; - (void) checkout:(PBRefMenuItem *)sender; +- (void) reset:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; - (void) cherryPick:(PBRefMenuItem *)sender; - (void) rebaseHeadBranch:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index 2ca8941..34e22da 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -149,6 +149,13 @@ [historyController.repository checkoutRefish:refish]; } +#pragma mark Reset + +- (void) reset:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository.resetController resetToRefish: refish type: PBResetTypeMixed]; +} #pragma mark Cherry Pick diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index aaaee1f..7b32b43 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -61,6 +61,10 @@ [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]]; [items addObject:[PBRefMenuItem separatorItem]]; + NSString *resetTitle = [NSString stringWithFormat:@"Reset %@ to %@", headRefName, targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle: resetTitle action:@selector(reset:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + // create branch NSString *createBranchTitle = [ref isRemoteBranch] ? [NSString stringWithFormat:@"Create branch that tracks %@…", targetRefName] : @"Create branch…"; [items addObject:[PBRefMenuItem itemWithTitle:createBranchTitle action:@selector(createBranch:) enabled:YES]]; @@ -156,7 +160,12 @@ [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; + + NSString *resetTitle = [NSString stringWithFormat:@"Reset %@ to here", headBranchName]; + [items addObject:[PBRefMenuItem itemWithTitle: resetTitle action:@selector(reset:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m index 0160431..39414ec 100644 --- a/PBRemoteProgressSheet.m +++ b/PBRemoteProgressSheet.m @@ -130,7 +130,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; - (void) checkTask:(NSTimer *)timer { if (![gitTask isRunning]) { - NSLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd)); + DLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd)); [self taskCompleted:nil]; } } diff --git a/PBResetSheet.h b/PBResetSheet.h new file mode 100644 index 0000000..edb8d06 --- /dev/null +++ b/PBResetSheet.h @@ -0,0 +1,35 @@ +// +// PBResetSheet.h +// GitX +// +// Created by Leszek Slazynski on 11-03-13. +// Copyright 2011 LSL. All rights reserved. +// + +#import + +@protocol PBGitRefish; +@class PBGitRepository; + +typedef enum PBResetType { + PBResetTypeNone, + PBResetTypeSoft, + PBResetTypeMixed, + PBResetTypeHard, + PBResetTypeMerge, + PBResetTypeKeep +} PBResetType; + +@interface PBResetSheet : NSWindowController { + IBOutlet NSSegmentedControl* resetType; + IBOutlet NSTabView* resetDesc; + PBResetType defaultType; + id targetRefish; + PBGitRepository* repository; +} + ++ (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id)refish andType:(PBResetType)type; +- (IBAction)resetBranch:(id)sender; +- (IBAction)cancel:(id)sender; + +@end diff --git a/PBResetSheet.m b/PBResetSheet.m new file mode 100644 index 0000000..df07b5e --- /dev/null +++ b/PBResetSheet.m @@ -0,0 +1,67 @@ +// +// PBResetSheet.m +// GitX +// +// Created by Leszek Slazynski on 11-03-13. +// Copyright 2011 LSL. All rights reserved. +// + +#import "PBResetSheet.h" +#import "PBGitRefish.h" +#import "PBCommand.h" +#import "PBGitRepository.h" + +static const char* StringFromResetType(PBResetType type) { + static const char* resetTypes[] = { + "none", "soft", "mixed", "hard", "merge", "keep" + }; + return resetTypes[type]; +} + +@implementation PBResetSheet + +- (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id)refish andType:(PBResetType)type { + defaultType = type; + targetRefish = refish; + repository = repo; + [NSApp beginSheet: [self window] + modalForWindow: [[repository windowController] window] + modalDelegate: self + didEndSelector: nil + contextInfo: NULL]; +} + ++ (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id)refish andType:(PBResetType)type { + PBResetSheet* sheet = [[self alloc] initWithWindowNibName: @"PBResetSheet"]; + [sheet beginResetSheetForRepository: repo refish: refish andType: type]; +} + +- (id) init { + if ( (self = [super initWithWindowNibName: @"PBResetSheet"]) ) { + defaultType = PBResetTypeMixed; + } + return self; +} + +- (void) windowDidLoad { + [resetType setSelectedSegment: defaultType - 1]; + [resetDesc selectTabViewItemAtIndex: defaultType - 1]; +} + +- (IBAction)resetBranch:(id)sender { + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; + PBResetType type = [resetType selectedSegment] + 1; + + NSString* type_arg = [NSString stringWithFormat: @"--%s", StringFromResetType(type)]; + NSArray *arguments = [NSArray arrayWithObjects:@"reset", type_arg, [targetRefish refishName], nil]; + PBCommand *cmd = [[PBCommand alloc] initWithDisplayName:@"Reset branch" parameters:arguments repository:repository]; + [cmd invoke]; +} + +- (IBAction)cancel:(id)sender { + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + +@end diff --git a/PBResetSheet.xib b/PBResetSheet.xib new file mode 100644 index 0000000..1cf0e70 --- /dev/null +++ b/PBResetSheet.xib @@ -0,0 +1,1109 @@ + + + + 1060 + 10J567 + 1305 + 1038.35 + 462.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1305 + + + YES + NSTabViewItem + NSView + NSWindowTemplate + NSTabView + NSSegmentedControl + NSSegmentedCell + NSTextField + NSTextFieldCell + NSButtonCell + NSButton + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + PBResetSheet + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{196, 240}, {480, 205}} + 544736256 + Reset branch + NSWindow + + + + 256 + + YES + + + 18 + {{16, 56}, {448, 78}} + + + + 2 + + YES + + 1 + + + 256 + + YES + + + 274 + {{0, 45}, {428, 13}} + + + 2 + YES + + 67239488 + 1346635776 + Resets the head but does not touch the index file nor the working tree at all. + + LucidaGrande + 10 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{0, 21}, {428, 16}} + + + 2 + YES + + 68288064 + 272892928 + This leaves all your changes intact - as changes to be committed. + + LucidaGrande-Bold + 12 + 16 + + + + + + + + {{10, 7}, {428, 58}} + + 2 + + soft + + + + + 2 + + + 256 + + YES + + + 274 + {{0, 45}, {428, 13}} + + + YES + + 67239488 + 272893952 + Resets the index but not the working tree and reports what has not been updated. + + + + + + + + + 268 + {{0, 21}, {428, 16}} + + + YES + + 68288064 + 272892928 + This preserves changes but they are not marked for commit. + + + + + + + + {{10, 7}, {428, 58}} + + + mixed + + + + + + + 256 + + YES + + + 274 + {{0, 32}, {428, 26}} + + + + YES + + 67239424 + 272891904 + Resets the index and working tree. Any changes to tracked files in the working tree are discarded. + + + + + + + + + 268 + {{0, 8}, {437, 16}} + + + + YES + + 68288064 + 272892928 + Warning! This discards all changes. It may be hard to recover them. + + + + + + + + {{10, 7}, {428, 58}} + + + + + hard + + + + + + + 256 + + YES + + + 274 + {{0, -95}, {428, 153}} + + YES + + 67239424 + 272891904 + Resets the index and updates the files in the working tree that are different between target and HEAD, but keeps those which are different between the index and working tree (i.e. which have changes which have not been added). If a file that is different between target and the index has unstaged changes, reset is aborted. + + + + + + + + {{10, 7}, {428, 58}} + + + merge + + + + + + + 256 + + YES + + + 274 + {{0, -95}, {428, 153}} + + YES + + 67239424 + 272891904 + UmVzZXRzIHRoZSBpbmRleCwgdXBkYXRlcyBmaWxlcyBpbiB0aGUgd29ya2luZyB0cmVlIHRoYXQgYXJl +IGRpZmZlcmVudCBiZXR3ZWVuIHRhcmdldCBhbmQgSEVBRCwgYnV0IGtlZXBzIHRob3NlIHdoaWNoIGFy +ZSBkaWZmZXJlbnQgYmV0d2VlbiBIRUFEIGFuZCB0aGUgd29ya2luZyB0cmVlIChpLmUuIHdoaWNoIGhh +dmUgbG9jYWwgY2hhbmdlcykuIElmIGEgZmlsZSB0aGF0IGlzIGRpZmZlcmVudCBiZXR3ZWVuIHRhcmdl +dCBhbmQgSEVBRCBoYXMgbG9jYWwgY2hhbmdlcywgcmVzZXQgaXMgYWJvcnRlZC4KA + + + + + + + + {{10, 7}, {428, 58}} + + + keep + + + + + + + LucidaGrande + 13 + 1044 + + 4 + YES + YES + + YES + + + + + + 268 + {{185, 138}, {275, 25}} + + + + 2 + YES + + 67239424 + 0 + + LucidaGrande + 13 + 16 + + + + YES + + soft + 0 + + + mixed + 1 + YES + 0 + + + hard + 0 + + + merge + 0 + + + keep + 0 + + + 1 + 2 + + + + + 268 + {{17, 143}, {83, 17}} + + + + 2 + YES + + 68288064 + 272630784 + Reset type: + + + YES + + + + + + + 289 + {{370, 12}, {96, 32}} + + + + 2 + YES + + 67239424 + 134217728 + Reset + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{274, 12}, {96, 32}} + + + + 2 + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + 268 + {{17, 168}, {446, 17}} + + + + 2 + YES + + 68288064 + 272630784 + Are you sure you want to reset current branch? + + LucidaGrande-Bold + 13 + 16 + + + + + + + + {{7, 11}, {480, 205}} + + + + 2 + + {{0, 0}, {1280, 778}} + {1e+13, 1e+13} + + + + + YES + + + takeSelectedTabViewItemFromSender: + + + + 20 + + + + window + + + + 57 + + + + resetBranch: + + + + 58 + + + + cancel: + + + + 59 + + + + resetType + + + + 60 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + Reset branch + + + 2 + + + YES + + + + + + + + + + + 3 + + + YES + + + + + + + + Type Description + + + 4 + + + YES + + + + soft + + + 5 + + + YES + + + + mixed + + + 6 + + + YES + + + + + + + 7 + + + YES + + + + + View + + + 8 + + + YES + + + + hard + + + 9 + + + YES + + + + + + + 10 + + + YES + + + + merge + + + 11 + + + YES + + + + + + 12 + + + YES + + + + keep + + + 13 + + + YES + + + + + + 14 + + + YES + + + + Type Select + + + 15 + + + Segmented Cell - soft, mixed, hard, merge, keep + + + 16 + + + YES + + + + Type Label + + + 17 + + + + + 31 + + + YES + + + + Reset + + + 32 + + + + + 35 + + + YES + + + + Are you sure + + + 36 + + + + + 37 + + + YES + + + + + + 38 + + + + + 39 + + + YES + + + + + + 40 + + + + + 41 + + + YES + + + + + + 42 + + + + + 43 + + + YES + + + + + + 44 + + + + + 29 + + + YES + + + + + + 30 + + + + + 50 + + + YES + + + + + + 51 + + + + + 53 + + + YES + + + + + + 54 + + + + + 55 + + + YES + + + + + + 56 + + + + + 33 + + + YES + + + + Cancel + + + 34 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 14.IBNSSegmentedControlTracker.RoundRobinState + 14.IBNSSegmentedControlTracker.WasGrowing + 14.IBPluginDependency + 15.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 2.IBPluginDependency + 29.IBPluginDependency + 3.IBAttributePlaceholdersKey + 3.IBPluginDependency + 30.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency + 33.IBPluginDependency + 33.IBViewIntegration.shadowBlurRadius + 33.IBViewIntegration.shadowColor + 33.IBViewIntegration.shadowOffsetHeight + 33.IBViewIntegration.shadowOffsetWidth + 34.IBPluginDependency + 35.IBPluginDependency + 36.IBPluginDependency + 37.IBPluginDependency + 38.IBPluginDependency + 39.IBPluginDependency + 4.IBPluginDependency + 40.IBPluginDependency + 41.IBPluginDependency + 42.IBPluginDependency + 43.IBPluginDependency + 44.IBPluginDependency + 5.IBPluginDependency + 50.IBPluginDependency + 51.IBPluginDependency + 53.IBPluginDependency + 54.IBPluginDependency + 55.IBPluginDependency + 56.IBPluginDependency + 7.notes + 7.showNotes + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + {196, 240} + {{357, 418}, {480, 270}} + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + InitialTabViewItem + + InitialTabViewItem + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + aaa + + + YES + + YES + NSFont + NSParagraphStyle + + + YES + + Helvetica + 12 + 16 + + + 4 + + + + + + + + + + YES + + + + + + YES + + + + + 60 + + + + YES + + PBResetSheet + NSWindowController + + YES + + YES + cancel: + resetBranch: + + + YES + id + id + + + + YES + + YES + cancel: + resetBranch: + + + YES + + cancel: + id + + + resetBranch: + id + + + + + YES + + YES + resetDesc + resetType + + + YES + NSTabView + NSSegmentedControl + + + + YES + + YES + resetDesc + resetType + + + YES + + resetDesc + NSTabView + + + resetType + NSSegmentedControl + + + + + IBProjectSource + ./Classes/PBResetSheet.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/PBSourceViewCell.m b/PBSourceViewCell.m index 06221d8..2c9fd5a 100644 --- a/PBSourceViewCell.m +++ b/PBSourceViewCell.m @@ -22,7 +22,7 @@ # pragma mark context menu delegate methods - init { - if (self = [super init]) { + if ((self = [super init])) { } return self; diff --git a/PBStashController.m b/PBStashController.m index eccde18..ec6bcf4 100644 --- a/PBStashController.m +++ b/PBStashController.m @@ -23,7 +23,7 @@ static NSString * const kCommandName = @"stash"; @synthesize stashes; - (id) initWithRepository:(PBGitRepository *) repo { - if (self = [super init]){ + if ((self = [super init])){ repository = [repo retain]; } return self; diff --git a/PBViewController.m b/PBViewController.m index 77e4f3f..a0de1da 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -19,7 +19,7 @@ { NSString *nibName = [[[self class] description] stringByReplacingOccurrencesOfString:@"Controller" withString:@"View"]; - if(self = [self initWithNibName:nibName bundle:nil]) { + if((self = [self initWithNibName:nibName bundle:nil])) { repository = theRepository; superController = controller; } diff --git a/PBWebController.m b/PBWebController.m index 7c18db8..f6cbee9 100644 --- a/PBWebController.m +++ b/PBWebController.m @@ -73,12 +73,12 @@ - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)dictionary { - NSLog(@"Error from webkit: %@", dictionary); + DLog(@"Error from webkit: %@", dictionary); } - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { - NSLog(@"Message from webkit: %@", message); + DLog(@"Message from webkit: %@", message); } - (NSURLRequest *)webView:(WebView *)sender @@ -114,7 +114,7 @@ - (void) log: (NSString*) logMessage { - NSLog(@"%@", logMessage); + DLog(@"%@", logMessage); } - (BOOL) isReachable:(NSString *)hostname @@ -189,7 +189,7 @@ { WebScriptObject *a = [callbacks objectForKey: object]; if (!a) { - NSLog(@"Could not find a callback for object: %@", object); + DLog(@"Could not find a callback for object: %@", object); return; } diff --git a/PBWebDiffController.m b/PBWebDiffController.m index 01efde7..8901c33 100644 --- a/PBWebDiffController.m +++ b/PBWebDiffController.m @@ -46,7 +46,15 @@ if ([diff length] == 0) [script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObject:@"There are no differences"]]; else - [script callWebScriptMethod:@"showDiff" withArguments:[NSArray arrayWithObject:diff]]; + [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:diff]]; } +// TODO: need to be refactoring +- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2; +{ + NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,file,nil]; + [repository handleInWorkDirForArguments:args]; +} + + @end diff --git a/PBWebHistoryController.h b/PBWebHistoryController.h index 7f4fc4a..74c600f 100644 --- a/PBWebHistoryController.h +++ b/PBWebHistoryController.h @@ -29,7 +29,7 @@ - (NSString *)parseHeader:(NSString *)txt withRefs:(NSString *)badges; - (NSMutableDictionary *)parseStats:(NSString *)txt; - (NSString *) someMethodThatReturnsSomeHashForSomeString:(NSString*)concat; -- (void) openFileMerge:(NSString*)file sha:(NSString *)sha; +- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2; @property (readonly) NSString* diff; @end diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 45ab3c4..b422132 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -116,6 +116,7 @@ NSString *html=[NSString stringWithFormat:@"%@%@
%@
",header,fileList,diffs]; + html=[html stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[NSString stringWithFormat:@"%@^",[currentSha string]]]; html=[html stringByReplacingOccurrencesOfString:@"{SHA}" withString:[currentSha string]]; [[view windowScriptObject] callWebScriptMethod:@"showCommit" withArguments:[NSArray arrayWithObject:html]]; @@ -224,10 +225,11 @@ [historyController selectCommit:[PBGitSHA shaWithString:sha]]; } -- (void) openFileMerge:(NSString*)file sha:(NSString *)sha +// TODO: need to be refactoring +- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2 { - NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",[NSString stringWithFormat:@"%@^",sha],sha,@"--",file,nil]; - [historyController.repository handleForArguments:args]; + NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,@"--",file,nil]; + [historyController.repository handleInWorkDirForArguments:args]; } @@ -260,7 +262,7 @@ contextMenuItemsForElement:(NSDictionary *)element if ([[ref shortName] isEqualToString:selectedRefString]) return [contextMenuDelegate menuItemsForRef:ref]; } - NSLog(@"Could not find selected ref!"); + DLog(@"Could not find selected ref!"); return defaultMenuItems; } if ([node hasAttributes] && [[node attributes] getNamedItem:@"representedFile"]) diff --git a/README.markdown b/README.markdown index b87b566..c0cbf3c 100644 --- a/README.markdown +++ b/README.markdown @@ -1,68 +1,79 @@ -GitX +GitX (L) --------------- -# What is GitX? +# What is GitX (L)? -GitX is a gitk like clone written specifically for OS X Leopard and higher. +GitX (L) is a gitk like clone written for OS X Leopard and higher. This means that it has a native interface and tries to integrate with the operating system as good as possible. Examples of this are drag and drop support and QuickLook support. - # Features The project is currently still in its starting phases. As time goes on, -hopefully more features will be added. Currently GitX supports the following: +hopefully more features will be added. Currently GitX (L) supports the following: + + * Commit view + * Commit/Parents/Tree SHA links + * File changes counts + * File Diffs + * Commit Tags and Refs + * File view + * Source Code Highlight + * Blame + * File History (log) + * Diff with local and HEAD + * Sidebar + * Branches + * Remotes + * Stashes + * Submodules + * Stage view + * Unstaged/Staged files + * Stage/Discard by lines + * Amend + * File diff - * History browsing of your repository - * See a nicely formatted diff of any revision - * Search based on author or revision subject - * Look at the complete tree of any revision - * Preview any file in the tree in a text view or with QuickLook - * Drag and drop files out of the tree view to copy them to your system - * Support for all parameters git rev-list has # License GitX is licensed under the GPL version 2. For more information, see the attached COPYING file. # Downloading -GitX is currently hosted at GitHub. It's project page can be found at -http://github.com/pieter/gitx. Recent binary releases can be found at -http://github.com/pieter/gitx/wikis. +GitX (L) is currently hosted at GitHub. It's project page can be found at -If you wish to follow GitX development, you can download the source code +https://github.com/laullon/gitx + +Recent binary releases can be found at + +http://gitx.laullon.com + +If you wish to follow GitX (L) development, you can download the source code through git: - git clone git://github.com/pieter/gitx + git clone https://github.com/laullon/gitx.git # Installation -The easiest way to get GitX running is to download the binary release from the -wiki. If you wish to compile it yourself, you will need XCode 3.0 or later. As +The easiest way to get GitX (L) running is to download the binary release from + +http://gitx.laullon.com + +If you wish to compile it yourself, you will need XCode 3.0 or later. As GitX makes use of features available only on Leopard (such as garbage collection), you will not be able to compile it on previous versions of OS X. - -To compile GitX, open the GitX.xcodeproj file and hit "Build". +To compile GitX (L), open the GitX.xcodeproj file and hit "Build". # Usage -GitX itself is fairly simple. Most of its power is in the 'gitx' binary, which +GitX (L) itself is fairly simple. Most of its power is in the 'gitx' binary, which you should install through the menu. the 'gitx' binary supports most of git -rev-list's arguments. For example, you can run `gitx --all' to display all -branches in the repository, or `gitx -- Documentation' to only show commits -relating to the 'Documentation' subdirectory. With `gitx -Shaha', gitx will -only show commits that contain the word 'haha'. Similarly, with 'gitx -v0.2.1..', you will get a list of all commits since version 0.2.1. +rev-list's arguments. For example, you can run `gitx --all` to display all +branches in the repository, or `gitx -- Documentation` to only show commits +relating to the 'Documentation' subdirectory. With `gitx -Shaha`, gitx will +only show commits that contain the word 'haha'. Similarly, with `gitx +v0.2.1..`, you will get a list of all commits since version 0.2.1. # Helping out -Any help on GitX is welcome. GitX is programmed in Objective-C, but even if -you are not a programmer you can do useful things. A short selection: - - * Create a nice icon; - * Help with the Javascript/HTML views, such as the diff view; - * File bug reports and feature requests. - -A TODO list can be found on the wiki: http://github.com/pieter/gitx/wikis/todo - +Any help on GitX (L) is welcome. diff --git a/SearchWebView.h b/SearchWebView.h new file mode 100644 index 0000000..6438df3 --- /dev/null +++ b/SearchWebView.h @@ -0,0 +1,19 @@ +// +// SearchWebView.h +// GitX +// +// Created by German Laullon on 19/03/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import +#import + +@interface WebView (SearchWebView) + +- (DOMRange *)highlightAllOccurencesOfString:(NSString*)str; +- (NSInteger)highlightAllOccurencesOfString:(NSString*)str inNode:(DOMNode *)node; +- (void)removeAllHighlights; +- (void)updateSearch:(NSSearchField *)sender; + +@end diff --git a/SearchWebView.m b/SearchWebView.m new file mode 100644 index 0000000..7daa148 --- /dev/null +++ b/SearchWebView.m @@ -0,0 +1,121 @@ +// +// SearchWebView.m +// GitX +// +// Created by German Laullon on 19/03/11. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "SearchWebView.h" + +@implementation WebView (SearchWebView) + +- (NSInteger)highlightAllOccurencesOfString:(NSString*)str inNode:(DOMNode *)_node +{ + NSInteger count=0; + DOMDocument *document=[[self mainFrame] DOMDocument]; + + DOMNodeList *nodes=[_node childNodes]; + DOMNode *node=[nodes item:0]; + while(node!=nil){ + if([node nodeType]==DOM_TEXT_NODE){ + NSString *block; + if([[node nodeValue] rangeOfString:str options:NSCaseInsensitiveSearch].location!=NSNotFound){ + NSScanner *scanner=[NSScanner scannerWithString:[node nodeValue]]; + [scanner setCharactersToBeSkipped:nil]; + [scanner setCaseSensitive:NO]; + while([scanner scanUpToString:str intoString:&block]){ + DOMNode *newNode=[document createTextNode:block]; + [[node parentNode] appendChild:newNode]; + + while([scanner scanString:str intoString:&block]){ + DOMElement *span=[document createElement:@"span"]; + [span setAttribute:@"id" value:[NSString stringWithFormat:@"SWVHL_%d",count++]]; + [span setAttribute:@"class" value:@"SWVHL"]; + newNode=[document createTextNode:block]; + [span appendChild:newNode]; + [[node parentNode] appendChild:span]; + } + } + [[node parentNode] removeChild:node]; + } + }else if([node nodeType]==DOM_ELEMENT_NODE){ + count+=[self highlightAllOccurencesOfString:str inNode:node]; + }else{ + DLog(@"--->%@",node); + } + node=[node nextSibling]; + } + + return count; +} + +- (DOMRange *)highlightAllOccurencesOfString:(NSString*)str +{ + NSInteger count=0; + DOMRange *res=nil; + + if([[[[self mainFrame] DOMDocument] documentElement] isKindOfClass:[DOMHTMLElement class]]){ + DOMHTMLElement *dom=(DOMHTMLElement *)[[[self mainFrame] DOMDocument] documentElement]; + if(![str isEqualToString:[dom getAttribute:@"searchStr"]]){ + [self removeAllHighlights]; + count=[self highlightAllOccurencesOfString:str inNode:dom]; + if(count>0){ + [dom setAttribute:@"searchStr" value:str]; + } + } + if([self searchFor:str direction:YES caseSensitive:NO wrap:YES]){ + res=[self selectedDOMRange]; + } + } + + return res; +} + +- (void)updateSearch:(NSSearchField *)sender +{ + NSString *searchString = [sender stringValue]; + DLog(@"searchString:%@",searchString); + + DOMRange *selection; + + if([searchString length]>0){ + selection=[self highlightAllOccurencesOfString:searchString]; + [[sender window] makeFirstResponder:sender]; + if(selection!=nil) + [self setSelectedDOMRange:selection affinity:NSSelectionAffinityDownstream]; + }else{ + [self removeAllHighlights]; + } +} + +- (void)removeAllHighlights:(DOMNode *)_node +{ + DOMNode *node=[_node firstChild]; + while(node!=nil){ + if ([node nodeType]==DOM_ELEMENT_NODE) { + if ([[(DOMElement *)node getAttribute:@"class"] isEqualToString:@"SWVHL"]) { + DOMNode *txt=[node firstChild]; + DOMNode *parent=[node parentNode]; + [node removeChild:txt]; + [parent insertBefore:txt refChild:node]; + [parent removeChild:node]; + [parent normalize]; + [self removeAllHighlights:parent]; + }else{ + [self removeAllHighlights:node]; + } + } + node=[node nextSibling]; + } +} + +- (void)removeAllHighlights +{ + if([[[[self mainFrame] DOMDocument] documentElement] isKindOfClass:[DOMHTMLElement class]]){ + DOMHTMLElement *dom=(DOMHTMLElement *)[[[self mainFrame] DOMDocument] documentElement]; + [self removeAllHighlights:dom]; + } +} + +@end diff --git a/build_libgit2.sh b/build_libgit2.sh index a94257d..27f4346 100755 --- a/build_libgit2.sh +++ b/build_libgit2.sh @@ -14,10 +14,11 @@ buildAction () { then export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path` git submodule init + git submodule sync git submodule update cd libgit2 rm -f libgit2.a - make CFLAGS="-arch i386 -arch ppc -arch x86_64" + make CFLAGS="-arch i386 -arch x86_64" ranlib libgit2.a else echo "error: Not a git repository." diff --git a/gitx_askpasswd_main.m b/gitx_askpasswd_main.m index b6a63ce..a2d65ba 100644 --- a/gitx_askpasswd_main.m +++ b/gitx_askpasswd_main.m @@ -30,7 +30,7 @@ #define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame" -@interface GAPAppDelegate : NSObject +@interface GAPAppDelegate : NSObject { NSPanel* mPasswordPanel; NSSecureTextField* mPasswordField; @@ -48,7 +48,7 @@ NSString* url; OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* password,UInt32 passwordLength); -@implementation GAPAppDelegate +@implementation GAPAppDelegate -(NSPanel*)passwordPanel:(NSString *)prompt remember:(BOOL)remember { @@ -167,7 +167,7 @@ OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* passw if ((rememberCheck!=nil) && [rememberCheck state]==NSOnState) { OSStatus status = StorePasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding], [url lengthOfBytesUsingEncoding:NSASCIIStringEncoding], - [pas cStringUsingEncoding:NSASCIIStringEncoding], + (void *)[pas cStringUsingEncoding:NSASCIIStringEncoding], [pas lengthOfBytesUsingEncoding:NSASCIIStringEncoding]); //Call if (status != noErr) { [[NSApplication sharedApplication] stopModalWithCode:-1]; @@ -329,14 +329,14 @@ int main( int argc, const char* argv[] ) void *passwordData = nil; SecKeychainItemRef itemRef = nil; - UInt32 passwordLength = nil; + UInt32 passwordLength = 0; OSStatus status = GetPasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding],[url lengthOfBytesUsingEncoding:NSASCIIStringEncoding],&passwordData,&passwordLength,&itemRef); if (status == noErr) { SecKeychainItemFreeContent (NULL,passwordData); NSString *pas=[[NSString stringWithCString:passwordData encoding:NSASCIIStringEncoding] substringToIndex:passwordLength]; printf( "%s", [pas UTF8String] ); - //NSLog(@"--> '%@'",pas); + //DLog(@"--> '%@'",pas); return 0; }else if (status != errSecItemNotFound) { return -1; diff --git a/html/css/GitX.css b/html/css/GitX.css index 7e84871..ea4b40f 100644 --- a/html/css/GitX.css +++ b/html/css/GitX.css @@ -24,3 +24,7 @@ body { -webkit-border-radius: 10px; } +.SWVHL{ + background-color: yellow; + black: black; +} diff --git a/html/lib/SearchWebView.js b/html/lib/SearchWebView.js new file mode 100644 index 0000000..c09aa88 --- /dev/null +++ b/html/lib/SearchWebView.js @@ -0,0 +1,100 @@ +// Based on http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/ + +// We're using a global variable to store the number of occurrences +var SearchResultCount = 0; +var SearchResultShow = 0; + +// helper function, recursively searches in elements and their child nodes +function HighlightAllOccurencesOfStringForElement(element,keyword) { + if (element) { + if (element.nodeType == 3) { // Text node + while (true) { + var value = element.nodeValue; // Search for keyword in text node + var idx = value.toLowerCase().indexOf(keyword); + + if (idx < 0) break; // not found, abort + + var span = document.createElement("span"); + var text = document.createTextNode(value.substr(idx,keyword.length)); + span.appendChild(text); + span.setAttribute("id","Highlight"+SearchResultCount); + span.setAttribute("class","Highlight"); + span.style.backgroundColor="yellow"; + span.style.color="black"; + text = document.createTextNode(value.substr(idx+keyword.length)); + element.deleteData(idx, value.length - idx); + var next = element.nextSibling; + element.parentNode.insertBefore(span, next); + element.parentNode.insertBefore(text, next); + element = text; + SearchResultCount++; // update the counter + } + } else if (element.nodeType == 1) { // Element node + if (element.style.display != "none" && element.nodeName.toLowerCase() != 'select') { + for (var i=0; i"+element.childNodes[i].getAttribute('class')); + HighlightAllOccurencesOfStringForElement(element.childNodes[i],keyword); + } + } + } + } + return SearchResultCount; +} + +// the main entry point to start the search +function HighlightAllOccurencesOfString(keyword) { + RemoveAllHighlights(); + var c=HighlightAllOccurencesOfStringForElement(document.body, keyword.toLowerCase()); + if(c>0){ + span=$("Highlight0"); + span.style.backgroundColor="cyan"; + } + return c; +} + +function HighlightNext(){ + alert("SearchResultShow="+SearchResultShow+" SearchResultCount="+SearchResultCount); + if(SearchResultCount>0){ + var span=$("Highlight"+SearchResultShow); + span.style.backgroundColor="yellow"; + SearchResultShow++; + if(SearchResultShow >= SearchResultCount) + SearchResultShow=0; + span=$("Highlight"+SearchResultShow); + span.style.backgroundColor="cyan"; + location.href = "#Highlight"+SearchResultShow; + } +} + +// helper function, recursively removes the highlights in elements and their childs +function RemoveAllHighlightsForElement(element) { + if (element) { + if (element.nodeType == 1) { + if (element.getAttribute("class") == "Highlight") { + var text = element.removeChild(element.firstChild); + element.parentNode.insertBefore(text,element); + element.parentNode.removeChild(element); + return true; + } else { + var normalize = false; + for (var i=element.childNodes.length-1; i>=0; i--) { + if (RemoveAllHighlightsForElement(element.childNodes[i])) { + normalize = true; + } + } + if (normalize) { + element.normalize(); + } + } + } + } + return false; +} + +// the main entry point to remove the highlights +function RemoveAllHighlights() { + SearchResultCount = 0; + SearchResultShow=0; + RemoveAllHighlightsForElement(document.body); +} diff --git a/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt b/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt deleted file mode 100644 index 3f9959f..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf b/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf deleted file mode 100644 index 1b4d90a..0000000 Binary files a/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf and /dev/null differ diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js deleted file mode 100644 index b40d1aa..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.AS3 = function() -{ - // Created by Peter Atoria @ http://iAtoria.com - - var inits = 'class interface function package'; - - var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + - 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + - 'extends false final finally flash_proxy for get if implements import in include Infinity ' + - 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + - 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + - 'return set static String super switch this throw true try typeof uint undefined unescape ' + - 'use void while with' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable - { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); -}; - -SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js deleted file mode 100644 index 0d7a7e7..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Bash = function() -{ - var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le'; - var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + - 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + - 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + - 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + - 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + - 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + - 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + - 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + - 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + - 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + - 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + - 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + - 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + - 'vi watch wc whereis which who whoami Wget xargs yes' - ; - - this.findMatches = function(regexList, code) - { - code = code.replace(/>/g, '>').replace(/</g, '<'); - this.code = code; - return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]); - }; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands - ]; -} - -SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js deleted file mode 100644 index e9446c2..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.CSharp = function() -{ - var keywords = 'abstract as base bool break byte case catch char checked class const ' + - 'continue decimal default delegate do double else enum event explicit ' + - 'extern false finally fixed float for foreach get goto if implicit in int ' + - 'interface internal is lock long namespace new null object operator out ' + - 'override params private protected public readonly ref return sbyte sealed set ' + - 'short sizeof stackalloc static string struct switch this throw true try ' + - 'typeof uint ulong unchecked unsafe ushort using virtual void while'; - - function fixComments(match, regexInfo) - { - var css = (match[0].indexOf("///") == 0) - ? 'color1' - : 'comments' - ; - - return [new SyntaxHighlighter.Match(match[0], match.index, css)]; - } - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword - { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' - { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; - diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js deleted file mode 100644 index b520544..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.ColdFusion = function() -{ - // Contributed by Jen - // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus - - var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + - 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + - 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + - 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + - 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + - 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + - 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + - 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + - 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + - 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + - 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + - 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + - 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + - 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + - 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + - 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + - 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + - 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + - 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + - 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + - 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + - 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + - 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + - 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + - 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + - 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + - 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + - 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + - 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + - 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + - 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + - 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + - 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + - 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + - 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + - 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + - 'XmlValidate Year YesNoFormat'; - - var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + - 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + - 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + - 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + - 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + - 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + - 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + - 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + - 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + - 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + - 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + - 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + - 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + - 'cfwindow cfxml cfzip cfzipparam'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -} - -SyntaxHighlighter.brushes.ColdFusion.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.ColdFusion.aliases = ['coldfusion','cf']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js deleted file mode 100644 index 4497026..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Cpp = function() -{ - // Copyright 2006 Shin, YoungJin - - var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + - 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + - 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + - 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + - 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + - 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + - 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + - 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + - 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + - 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + - 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + - 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + - 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + - 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + - 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + - 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + - 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + - 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + - 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + - '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + - 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + - 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + - 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + - 'va_list wchar_t wctrans_t wctype_t wint_t signed'; - - var keywords = 'break case catch class const __finally __exception __try ' + - 'const_cast continue private public protected __declspec ' + - 'default delete deprecated dllexport dllimport do dynamic_cast ' + - 'else enum explicit extern if for friend goto inline ' + - 'mutable naked namespace new noinline noreturn nothrow ' + - 'register reinterpret_cast return selectany ' + - 'sizeof static static_cast struct switch template this ' + - 'thread throw true false try typedef typeid typename union ' + - 'using uuid virtual void volatile whcar_t while'; - - var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + - 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + - 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + - 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + - 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + - 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + - 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + - 'fwrite getc getchar gets perror printf putc putchar puts remove ' + - 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + - 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + - 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + - 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + - 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + - 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + - 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + - 'clock ctime difftime gmtime localtime mktime strftime time'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^ *#.*/gm, css: 'preprocessor' }, - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, - { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } - ]; -}; - -SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js deleted file mode 100644 index f69ad77..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.CSS = function() -{ - function getKeywordsCSS(str) - { - return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; - }; - - function getValuesCSS(str) - { - return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; - }; - - var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + - 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + - 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + - 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + - 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + - 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + - 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + - 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + - 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + - 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + - 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + - 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + - 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + - 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; - - var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ - 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ - 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ - 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ - 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ - 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ - 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ - 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ - 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ - 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ - 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ - 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ - 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ - 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; - - var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors - { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes - { regex: /!important/g, css: 'color3' }, // !important - { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values - { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts - ]; - - this.forHtmlScript({ - left: /(<|<)\s*style.*?(>|>)/gi, - right: /(<|<)\/\s*style\s*(>|>)/gi - }); -}; - -SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.CSS.aliases = ['css']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js deleted file mode 100644 index fd194c4..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Delphi = function() -{ - var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + - 'case char class comp const constructor currency destructor div do double ' + - 'downto else end except exports extended false file finalization finally ' + - 'for function goto if implementation in inherited int64 initialization ' + - 'integer interface is label library longint longword mod nil not object ' + - 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + - 'pint64 pointer private procedure program property pshortstring pstring ' + - 'pvariant pwidechar pwidestring protected public published raise real real48 ' + - 'record repeat set shl shortint shortstring shr single smallint string then ' + - 'threadvar to true try type unit until uses val var varirnt while widechar ' + - 'widestring with word write writeln xor'; - - this.regexList = [ - { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) - { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags - { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -}; - -SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js deleted file mode 100644 index 6109f4c..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Diff = function() -{ - this.regexList = [ - { regex: /^\+\+\+.*$/gm, css: 'color2' }, - { regex: /^\-\-\-.*$/gm, css: 'color2' }, - { regex: /^\s.*$/gm, css: 'color1' }, - { regex: /^@@.*@@$/gm, css: 'variable' }, - { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, - { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } - ]; -}; - -SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js deleted file mode 100644 index 7b68bad..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Erlang = function() -{ - // Contributed by Jean-Lou Dupont - // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html - - // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 - var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ - 'case catch cond div end fun if let not of or orelse '+ - 'query receive rem try when xor'+ - // additional - ' module export import define'; - - this.regexList = [ - { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, - { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, - { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, - { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; -}; - -SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js deleted file mode 100644 index db0b8e6..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Groovy = function() -{ - // Contributed by Andres Almiray - // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter - - var keywords = 'as assert break case catch class continue def default do else extends finally ' + - 'if in implements import instanceof interface new package property return switch ' + - 'throw throws try while public protected private static'; - var types = 'void boolean byte char short int long float double'; - var constants = 'null'; - var methods = 'allProperties count get size '+ - 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + - 'findIndexOf grep inject max min reverseEach sort ' + - 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + - 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + - 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + - 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + - 'transformChar transformLine withOutputStream withPrintWriter withStream ' + - 'withStreams withWriter withWriterAppend write writeLine '+ - 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ - 'getText'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /""".*"""/g, css: 'string' }, // GStrings - { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword - { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type - { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -} - -SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Groovy.aliases = ['groovy']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js deleted file mode 100644 index 9b67a4d..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.JScript = function() -{ - var keywords = 'break case catch continue ' + - 'default delete do else false ' + - 'for function if in instanceof ' + - 'new null return super switch ' + - 'this throw true try typeof var while with' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); -}; - -SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js deleted file mode 100644 index 4ae588d..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Java = function() -{ - var keywords = 'abstract assert boolean break byte case catch char class const ' + - 'continue default do double else enum extends ' + - 'false final finally float for goto if implements import ' + - 'instanceof int interface long native new null ' + - 'package private protected public return ' + - 'short static strictfp super switch synchronized this throw throws true ' + - 'transient try void volatile while'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments - { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno - { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword - ]; - - this.forHtmlScript({ - left : /(<|<)%[@!=]?/g, - right : /%(>|>)/g - }); -}; - -SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Java.aliases = ['java']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js deleted file mode 100644 index eeb8f65..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.JavaFX = function() -{ - // Contributed by Patrick Webster - // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html - var datatypes = 'Boolean Byte Character Double Duration ' - + 'Float Integer Long Number Short String Void' - ; - - var keywords = 'abstract after and as assert at before bind bound break catch class ' - + 'continue def delete else exclusive extends false finally first for from ' - + 'function if import in indexof init insert instanceof into inverse last ' - + 'lazy mixin mod nativearray new not null on or override package postinit ' - + 'protected public public-init public-read replace return reverse sizeof ' - + 'step super then this throw true try tween typeof var where while with ' - + 'attribute let private readonly static trigger' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js deleted file mode 100644 index 2b93479..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * Copyright (C) 2010 German Laullon. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.ObjC = function() -{ - var keywords = 'abstract assert boolean break byte case catch char class const ' + - 'continue default do double else enum extends ' + - 'false final finally float for goto if implements import ' + - 'instanceof int interface long native new null ' + - 'package private protected public return ' + - 'short static strictfp super switch synchronized this throw throws true ' + - 'transient try void volatile while id synthesize pragma self IBAction IBOutlet property'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments - { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: /(\w*):/g, css: 'color1' }, // - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword - ]; - - this.forHtmlScript({ - left : /(<|<)%[@!=]?/g, - right : /%(>|>)/g - }); -}; - -SyntaxHighlighter.brushes.ObjC.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.ObjC.aliases = ['objc']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js deleted file mode 100644 index d9f8e13..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Perl = function() -{ - // Contributed by David Simmons-Duffin and Marty Kube - - var funcs = - 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + - 'chroot close closedir connect cos crypt defined delete each endgrent ' + - 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + - 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + - 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + - 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + - 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + - 'getservbyname getservbyport getservent getsockname getsockopt glob ' + - 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + - 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + - 'oct open opendir ord pack pipe pop pos print printf prototype push ' + - 'quotemeta rand read readdir readline readlink readpipe recv rename ' + - 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + - 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + - 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + - 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + - 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + - 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + - 'undef unlink unpack unshift utime values vec wait waitpid warn write'; - - var keywords = - 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + - 'for foreach goto if import last local my next no our package redo ref ' + - 'require return sub tie tied unless untie until use wantarray while'; - - this.regexList = [ - { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, - { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); -} - -SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js deleted file mode 100644 index 4e92a19..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Php = function() -{ - var funcs = 'abs acos acosh addcslashes addslashes ' + - 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ - 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ - 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ - 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ - 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ - 'array_push array_rand array_reduce array_reverse array_search array_shift '+ - 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ - 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ - 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ - 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ - 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ - 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ - 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ - 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ - 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ - 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ - 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ - 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ - 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ - 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ - 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ - 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ - 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ - 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ - 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ - 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ - 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ - 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+ - 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ - 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ - 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ - 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ - 'strtoupper strtr strval substr substr_compare'; - - var keywords = 'and or xor array as break case ' + - 'cfunction class const continue declare default die do else ' + - 'elseif enddeclare endfor endforeach endif endswitch endwhile ' + - 'extends for foreach function include include_once global if ' + - 'new old_function return static switch use require require_once ' + - 'var while abstract interface public implements extends private protected throw'; - - var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\$\w+/g, css: 'variable' }, // variables - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions - { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); -}; - -SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Php.aliases = ['php']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js deleted file mode 100644 index 939f3b3..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Plain = function() -{ -}; - -SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js deleted file mode 100644 index 7c140dd..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.PowerShell = function() -{ - // Contributes by B.v.Zanten, Getronics - // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro - - var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + - 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + - 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + - 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + - 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + - 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + - 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + - 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + - 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + - 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + - 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + - 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + - 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + - 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + - 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + - 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + - 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + - 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + - 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + - 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + - 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; - var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + - 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + - 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + - 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + - 'spps spsv sv tee cat cd cp h history kill lp ls ' + - 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + - 'erase rd ren type % \\?'; - - this.regexList = [ - { regex: /#.*$/gm, css: 'comments' }, // one line comments - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 - { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } - ]; -}; - -SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js deleted file mode 100644 index 4965653..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Python = function() -{ - // Contributed by Gheorghe Milas and Ahmad Sherif - - var keywords = 'and assert break class continue def del elif else ' + - 'except exec finally for from global if import in is ' + - 'lambda not or pass print raise return try yield while'; - - var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + - 'chr classmethod cmp coerce compile complex delattr dict dir ' + - 'divmod enumerate eval execfile file filter float format frozenset ' + - 'getattr globals hasattr hash help hex id input int intern ' + - 'isinstance issubclass iter len list locals long map max min next ' + - 'object oct open ord pow print property range raw_input reduce ' + - 'reload repr reversed round set setattr slice sorted staticmethod ' + - 'str sum super tuple type type unichr unicode vars xrange zip'; - - var special = 'None True False self cls class_'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, - { regex: /^\s*@\w+/gm, css: 'decorator' }, - { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, - { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, - { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, - { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, - { regex: /\b\d+\.?\w*/g, css: 'value' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Python.aliases = ['py', 'python']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js deleted file mode 100644 index 57ecfa4..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Ruby = function() -{ - // Contributed by Erik Peterson. - - var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + - 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + - 'self super then throw true undef unless until when while yield'; - - var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + - 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + - 'ThreadGroup Thread Time TrueClass'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants - { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols - { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js deleted file mode 100644 index 55d7f8a..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Scala = function() -{ - // Contributed by Yegor Jbanov and David Bernard. - - var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + - 'override try lazy for var catch throw type extends class while with new final yield abstract ' + - 'else do if return protected private this package false'; - - var keyops = '[_:=><%#@]+'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword - ]; -} - -SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Scala.aliases = ['scala']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js deleted file mode 100644 index 974df01..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Sql = function() -{ - var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + - 'current_user day isnull left lower month nullif replace right ' + - 'session_user space substring sum system_user upper user year'; - - var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + - 'binary bit by cascade char character check checkpoint close collate ' + - 'column commit committed connect connection constraint contains continue ' + - 'create cube current current_date current_time cursor database date ' + - 'deallocate dec decimal declare default delete desc distinct double drop ' + - 'dynamic else end end-exec escape except exec execute false fetch first ' + - 'float for force foreign forward free from full function global goto grant ' + - 'group grouping having hour ignore index inner insensitive insert instead ' + - 'int integer intersect into is isolation key last level load local max min ' + - 'minute modify move name national nchar next no numeric of off on only ' + - 'open option order out output partial password precision prepare primary ' + - 'prior privileges procedure public read real references relative repeatable ' + - 'restrict return returns revoke rollback rollup rows rule schema scroll ' + - 'second section select sequence serializable set size smallint static ' + - 'statistics table temp temporary then time timestamp to top transaction ' + - 'translation trigger true truncate uncommitted union unique update values ' + - 'varchar varying view when where with work'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -}; - -SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Sql.aliases = ['sql']; - diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js deleted file mode 100644 index d715c58..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Vb = function() -{ - var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + - 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + - 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + - 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + - 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + - 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + - 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + - 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + - 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + - 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + - 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + - 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + - 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + - 'Variant When While With WithEvents WriteOnly Xor'; - - this.regexList = [ - { regex: /'.*$/gm, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js deleted file mode 100644 index 199fa3b..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Xml = function() -{ - function process(match, regexInfo) - { - var constructor = SyntaxHighlighter.Match, - code = match[0], - tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), - result = [] - ; - - if (match.attributes != null) - { - var attributes, - regex = new XRegExp('(? [\\w:\\-\\.]+)' + - '\\s*=\\s*' + - '(? ".*?"|\'.*?\'|\\w+)', - 'xg'); - - while ((attributes = regex.exec(code)) != null) - { - result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); - result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); - } - } - - if (tag != null) - result.push( - new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') - ); - - return result; - } - - this.regexList = [ - { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // - { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } - ]; -}; - -SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js deleted file mode 100644 index 5fed486..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('c(!1q.2X){h 2X=l(){h p={6b:{"1s-R":"","84-2y":1,"83-2y-7W":I,"1I":v,"8d-89":I,"1H-2Q":4,"3g":I,"1w":I,"66":N,"8k-8l":I,"88":N,"5h-1p":I,"1L-1l":N},M:{4T:I,69:v,5l:16,5k:16,8B:N,8f:N,8s:"54",1f:{5q:"53 1g",5d:"9N 1g",5i:"9O 6q 6p",78:"9M C 9L 1V 9I 6p 9J",3t:"3t",6C:"?",1A:"2X\\n\\n",6T:"9K\'t 9P 2O D: ",7x:"9Q 9W\'t 9X D 1L-1l 9V: ",77:"<1L 9t=\\"2s://5x.6x.6B/9s/9x\\"><6z><9y 2s-9E=\\"9F-9D\\" 63=\\"1X/1L; 9C=9z-8\\" /><3i>9A 2X<33 1m=\\"39-9Y:9Z,an,ao,am-al;ai-3f:#aj;3f:#ak;39-2Q:ap;1X-6G:6u;\\">2X6O 2.1.ag (a5 15 6h)2s://6I.3ka3 a0 a1 f 1l, a2 8R 6q 8Q 8O 8W!8V C 8U 8X.8K 8N-6h 8M 8S."},8u:N},1r:{4Z:v,9o:v,3m:v,6f:{}},2d:{},8h:{9g:/\\/\\*[\\s\\S]*?\\*\\//3b,9d:/\\/\\/.*$/3b,9e:/#.*$/3b,9j:/"([^\\\\"\\n]|\\\\.)*"/g,9n:/\'([^\\\\\'\\n]|\\\\.)*\'/g,9m:/"([^\\\\"]|\\\\.)*"/g,8Y:/\'([^\\\\\']|\\\\.)*\'/g,9k:/(&X;|<)!--[\\s\\S]*?--(&Z;|>)/3b,43:/&X;\\w+:\\/\\/[\\w-.\\/?%&=@:;]*&Z;|\\w+:\\/\\/[\\w-.\\/?%&=@:;]*/g,9c:{G:/(&X;|<)\\?=?/g,1d:/\\?(&Z;|>)/g},93:{G:/(&X;|<)%=?/g,1d:/%(&Z;|>)/g},92:{G:/(&X;|<)\\s*1l.*?(&Z;|>)/4e,1d:/(&X;|<)\\/\\s*1l\\s*(&Z;|>)/4e}},1w:{1c:l(3O){h 3T=Q.22("3Y"),5s=p.1w.7d;3T.L="1w";D(h 30 1V 5s){h 6i=5s[30],5t=W 6i(3O),1Y=5t.1c();3O.6g[30]=5t;c(1Y==v){1J}c(7X(1Y)=="91"){1Y=p.1w.6m(1Y,3O.1k,30)}1Y.L+="5v "+30;3T.2p(1Y)}q 3T},6m:l(5L,7j,5K){h a=Q.22("a"),5N=a.1m,5D=p.M,5M=5D.5l,5J=5D.5k;a.27="#"+5K;a.3i=5L;a.5j=7j;a.76=5K;a.1Q=5L;c(40(5M)==N){5N.26=5M+"75"}c(40(5J)==N){5N.2e=5J+"75"}a.9l=l(e){97{p.1w.6M(f,e||1q.6Y,f.5j,f.76)}98(e){p.B.1A(e.6n)}q N};q a},6M:l(7i,7g,7b,7h,7f){h 5G=p.1r.6f[7b],5H;c(5G==v||(5H=5G.6g[7h])==v){q v}q 5H.2z(7i,7g,7f)},7d:{5q:l(5b){f.1c=l(){c(5b.V("66")!=I){q}q p.M.1f.5q};f.2z=l(5c,8T,8P){h A=5b.A;5c.7y.4p(5c);A.L=A.L.E("5O","")}},5d:l(6R){f.1c=l(){q p.M.1f.5d};f.2z=l(b1,bU,bV){h 3J=p.B.3d(6R.5g).E(/"+3J+"");2A.Q.4o()}},5i:l(64){h 3C,c2,6a=64.1k;f.1c=l(){h 2V=p.M;c(2V.69==v){q v}l 1E(56){h 5m="";D(h 5f 1V 56){5m+=""}q 5m};l 2i(5n){h 5p="";D(h 5o 1V 5n){5p+=" "+5o+"=\'"+5n[5o]+"\'"}q 5p};h 67={26:2V.5l,2e:2V.5k,1k:6a+"bY",4r:"bZ/x-71-6V",3i:p.M.1f.5i},5V={bE:"ay",bD:"bC",bA:"5j="+6a,c4:"N"},5U=2V.69,3x;c(/bG/i.1R(6K.7k)){3x="<4h"+2i({bH:"bM:bN-bL-bK-bI-bJ",c3:"2s://ck.cj.3k/cm/71/c9/6V/c8.c7#6O=9,0,0,0"})+2i(67)+">"+1E(5V)+1E({c6:5U})+""}F{3x=""}3C=Q.22("A");3C.1Q=3x;q 3C};f.2z=l(cf,ce,62){h 7c=62.cd;6U(7c){2K"7q":h 61=p.B.2T(p.B.3d(64.5g).E(/&X;/g,"<").E(/&Z;/g,">").E(/&aT;/g,"&"));c(1q.74){1q.74.aU("1X",61)}F{q p.B.2T(61)}2K"aR":p.B.1A(p.M.1f.78);2h;2K"aP":p.B.1A(62.6n);2h}}},aV:l(65){f.1c=l(){q p.M.1f.3t};f.2z=l(aW,bz,b0){h 1Z=Q.22("aZ"),1N=v;c(p.1r.3m!=v){Q.33.4p(p.1r.3m)}p.1r.3m=1Z;1Z.1m.aX="aY:aO;26:6r;2e:6r;G:-6j;4w:-6j;";Q.33.2p(1Z);1N=1Z.5Q.Q;6J(1N,1q.Q);1N.3D(""+65.A.1Q+"");1N.4o();1Z.5Q.4F();1Z.5Q.3t();l 6J(6N,6E){h 2I=6E.4O("4n");D(h i=0;i<2I.u;i++){c(2I[i].6y.6P()=="6A"&&/aE\\.1a$/.1R(2I[i].27)){6N.3D("<4n 4r=\\"1X/1a\\" 6y=\\"6A\\" 27=\\""+2I[i].27+"\\">")}}}}},az:l(aA){f.1c=l(){q p.M.1f.6C};f.2z=l(aF,aG){h 2A=p.B.4z("","4k",aM,aK,"7a=0"),1N=2A.Q;1N.3D(p.M.1f.77);1N.4o();2A.4F()}}}},B:{Y:l(49,73,3y){3y=3e.aH(3y||0,0);D(h i=3y;i<49.u;i++){c(49[i]==73){q i}}q-1},6d:l(72){q 72+3e.aI(3e.b2()*b3).2u()},6c:l(51,4L){h 3h={},1W;D(1W 1V 51){3h[1W]=51[1W]}D(1W 1V 4L){3h[1W]=4L[1W]}q 3h},80:l(4J){6U(4J){2K"I":q I;2K"N":q N}q 4J},4z:l(43,6W,4B,4H,2N){h x=(6X.26-4B)/2,y=(6X.2e-4H)/2;2N+=", G="+x+", 4w="+y+", 26="+4B+", 2e="+4H;2N=2N.E(/^,/,"");h 4E=1q.bk(43,6W,2N);4E.4F();q 4E},7C:l(1G,1T,1U){c(1G.6Z){1G["e"+1T+1U]=1U;1G[1T+1U]=l(){1G["e"+1T+1U](1q.6Y)};1G.6Z("bw"+1T,1G[1T+1U])}F{1G.bv(1T,1U,N)}},1A:l(z){1A(p.M.1f.1A+z)},4u:l(4N,6Q){h 2r=p.1r.4Z,3V=v;c(2r==v){2r={};D(h 2L 1V p.2d){h 42=p.2d[2L].bu;c(42==v){1J}p.2d[2L].R=2L.6P();D(h i=0;i<42.u;i++){2r[42[i]]=2L}}p.1r.4Z=2r}3V=p.2d[2r[4N]];c(3V==v&&6Q!=N){p.B.1A(p.M.1f.6T+4N)}q 3V},46:l(z,6S){h 2E=z.1P("\\n");D(h i=0;i<2E.u;i++){2E[i]=6S(2E[i])}q 2E.5A("\\n")},8C:l(z){q z.E(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},8H:l(z){h 3X,45={},4P=W U("^\\\\[(?<4c>(.*?))\\\\]$"),7e=W U("(?[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<24>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");2j((3X=7e.T(z))!=v){h 2f=3X.24.E(/^[\'"]|[\'"]$/g,"");c(2f!=v&&4P.1R(2f)){h m=4P.T(2f);2f=m.4c.u>0?m.4c.1P(/\\s*,\\s*/):[]}45[3X.R]=2f}q 45},7K:l(z,1a){c(z==v||z.u==0||z=="\\n"){q z}z=z.E(/"+2l+""})}q z},7V:l(6l,6o){h 32=6l.2u();2j(32.u<6o){32="0"+32}q 32},6k:l(){h 3w=Q.22("A"),3B,3o=0,44=Q.33,1k=p.B.6d("6k"),36="",4U="";3w.1Q=36+"6e\\">"+36+"1p\\">"+36+"2y\\">"+36+"63"+"\\"><4G 1s=\\"b5\\"><4G 1k=\\""+1k+"\\">&2B;"+4U+4U+2Y+2Y+2Y+2Y;44.2p(3w);3B=Q.bb(1k);c(/bg/i.1R(6K.7k)){h 6v=1q.be(3B,v);3o=85(6v.bc("26"))}F{3o=3B.bd}44.4p(3w);q 3o},8b:l(79,6s){h 1H="";D(h i=0;i<6s;i++){1H+=" "}q 79.E(/\\t/g,1H)},8a:l(2Z,4f){h bF=2Z.1P("\\n"),1H="\\t",4d="";D(h i=0;i<50;i++){4d+=" "}l 8x(3s,18,8A){q 3s.29(0,18)+4d.29(0,8A)+3s.29(18+1,3s.u)};2Z=p.B.46(2Z,l(20){c(20.Y(1H)==-1){q 20}h 18=0;2j((18=20.Y(1H))!=-1){h 8w=4f-18%4f;20=8x(20,18,8w)}q 20});q 2Z},3d:l(z){h br=/|&X;br\\s*\\/?&Z;/4e;c(p.M.8B==I){z=z.E(br,"\\n")}c(p.M.8f==I){z=z.E(br,"")}q z},2G:l(z){q z.E(/^\\s+|\\s+$/g,"")},2T:l(z){h 21=p.B.3d(z).1P("\\n"),bf=W bh(),8D=/^\\s*/,2a=ba;D(h i=0;i<21.u&&2a>0;i++){h 4x=21[i];c(p.B.2G(4x).u==0){1J}h 4I=8D.T(4x);c(4I==v){q z}2a=3e.2a(4I[0].u,2a)}c(2a>0){D(h i=0;i<21.u;i++){21[i]=21[i].29(2a)}}q 21.5A("\\n")},82:l(35,31){c(35.H<31.H){q-1}F{c(35.H>31.H){q 1}F{c(35.u<31.u){q-1}F{c(35.u>31.u){q 1}}}}q 0},2D:l(8q,34){l 8n(4D,8r){q[W p.4v(4D[0],4D.H,8r.1a)]};h b4=0,4s=v,3L=[],8p=34.4X?34.4X:8n;2j((4s=34.3K.T(8q))!=v){3L=3L.2t(8p(4s,34))}q 3L},8m:l(8o){h X="&X;",Z="&Z;";q 8o.E(p.8h.43,l(m){h 4j="",47="";c(m.Y(X)==0){47=X;m=m.3U(X.u)}c(m.Y(Z)==m.u-Z.u){m=m.3U(0,m.u-Z.u);4j=Z}q 47+""+m+""+4j})},8v:l(){h 3N=Q.4O("1l"),4i=[];D(h i=0;i<3N.u;i++){c(3N[i].4r=="6e"){4i.K(3N[i])}}q 4i},8I:l(4b){h 4q="",1v=p.B.2G(4b),3R=N;c(1v.Y(4q)==0){1v=1v.3U(4q.u);3R=I}c(1v.Y(3S)==1v.u-3S.u){1v=1v.3U(0,1v.u-3S.u);3R=I}q 3R?1v:4b}},1I:l(8E,4R){l 8e(4g){h 4Q=[];D(h i=0;i<4g.u;i++){4Q.K(4g[i])}q 4Q};h 2q=4R?[4R]:8e(Q.4O(p.M.8s)),8J="1Q",2k=v,4S=p.M;c(4S.4T){2q=2q.2t(p.B.8v())}c(2q.u===0){q}D(h i=0;i<2q.u;i++){h 2M=2q[i],28=p.B.8H(2M.L),1D,2W,25;28=p.B.6c(8E,28);1D=28["2O"];c(1D==v){1J}c(28["1L-1l"]=="I"||p.6b["1L-1l"]==I){2k=W p.4a(1D);1D="b9"}F{h 3P=p.B.4u(1D);c(3P){1D=3P.R;2k=W 3P()}F{1J}}2W=2M[8J];c(4S.4T){2W=p.B.8I(2W)}28["2O-R"]=1D;2k.1I(2W,28);25=2k.A;c(p.M.8u){25=Q.22("bj");25.24=2k.A.1Q;25.1m.26="bt";25.1m.2e="bx"}2M.7y.bs(25,2M)}},bq:l(7H){p.B.7C(1q,"bl",l(){p.1I(7H)})}};p.4v=l(4A,7G,1a){f.24=4A;f.H=7G;f.u=4A.u;f.1a=1a;f.5Y=v};p.4v.14.2u=l(){q f.24};p.4a=l(4K){h 3z=p.B.4u(4K),2g,4W=W p.2d.bm(),bn=v;c(3z==v){q}2g=W 3z();f.4m=4W;c(2g.3I==v){p.B.1A(p.M.1f.7x+4K);q}4W.59.K({3K:2g.3I.C,4X:7p});l 3A(4Y,7w){D(h j=0;j<4Y.u;j++){4Y[j].H+=7w}};l 7p(19,bp){h 7n=19.C,1o=[],4M=2g.59,7l=19.H+19.G.u,2U=2g.3I,1n;D(h i=0;i<4M.u;i++){1n=p.B.2D(7n,4M[i]);3A(1n,7l);1o=1o.2t(1n)}c(2U.G!=v&&19.G!=v){1n=p.B.2D(19.G,2U.G);3A(1n,19.H);1o=1o.2t(1n)}c(2U.1d!=v&&19.1d!=v){1n=p.B.2D(19.1d,2U.1d);3A(1n,19.H+19[0].bo(19.1d));1o=1o.2t(1n)}D(h j=0;j<1o.u;j++){1o[j].5Y=3z.R}q 1o}};p.4a.14.1I=l(7t,7s){f.4m.1I(7t,7s);f.A=f.4m.A};p.7I=l(){};p.7I.14={V:l(7J,7Z){h 4l=f.1E[7J];q p.B.80(4l==v?7Z:4l)},1c:l(7Y){q Q.22(7Y)},8i:l(2F,81){h 3u=[];c(2F!=v){D(h i=0;i<2F.u;i++){c(7X(2F[i])=="4h"){3u=3u.2t(p.B.2D(81,2F[i]))}}}q 3u.aB(p.B.82)},86:l(){h 23=f.2C;D(h i=0;i<23.u;i++){c(23[i]===v){1J}h 2x=23[i],4V=2x.H+2x.u;D(h j=i+1;j<23.u&&23[i]!==v;j++){h 1S=23[j];c(1S===v){1J}F{c(1S.H>4V){2h}F{c(1S.H==2x.H&&1S.u>2x.u){f.2C[i]=v}F{c(1S.H>=2x.H&&1S.H<4V){f.2C[j]=v}}}}}}},8t:l(2H){h 3r=2H.1P(/\\n/g),3n=85(f.V("84-2y")),2v=f.V("83-2y-7W"),7N=f.V("1I",[]),7U=f.V("3g");2H="";c(2v==I){2v=(3n+3r.u-1).2u().u}F{c(40(2v)==I){2v=0}}D(h i=0;i<3r.u;i++){h 1x=3r[i],60=/^(&2B;|\\s)+/.T(1x),52="aN"+(i%2==0?1:2),7F=p.B.7V(3n+i,2v),7P=p.B.Y(7N,(3n+i).2u())!=-1,2S=v;c(60!=v){2S=60[0].2u();1x=1x.29(2S.u)}1x=p.B.2G(1x);c(1x.u==0){1x="&2B;"}c(7P){52+=" aQ"}2H+=""+"<7L>"+"<7T>"+(7U?"<3F 1s=\\"aS\\">"+7F+"":"")+"<3F 1s=\\"63\\">"+(2S!=v?""+2S.E(" ","&2B;")+"":"")+1x+""+""+""+""}q 2H},8y:l(5X,5T){h 18=0,3c="",3a=p.B.7K,5S=f.V("2O-R","");l 5W(5Z){h 5R=5Z?(5Z.5Y||5S):5S;q 5R?5R+" ":""};D(h i=0;i<5T.u;i++){h 1y=5T[i],3G;c(1y===v||1y.u===0){1J}3G=5W(1y);3c+=3a(5X.29(18,1y.H-18),3G+"7O")+3a(1y.24,3G+1y.1a);18=1y.H+1y.u}3c+=3a(5X.29(18),5W()+"7O");q 3c},1I:l(C,7E){h cb=p.M,1r=p.1r,A,ci,3Z,ch="cn";f.1E={};f.A=v;f.1p=v;f.C=v;f.1i=v;f.6g={};f.1k=p.B.6d("cl");1r.6f[f.1k]=f;c(C===v){C=""}f.1E=p.B.6c(p.6b,7E||{});c(f.V("88")==I){f.1E.1w=f.1E.3g=N}f.A=A=f.1c("3Y");f.1p=f.1c("3Y");f.1p.L="1p";L="6e";A.1k=f.1k;c(f.V("66")){L+=" 5O"}c(f.V("3g")==N){L+=" bB"}c(f.V("5h-1p")==N){f.1p.L+=" bO-5h"}L+=" "+f.V("1s-R");L+=" "+f.V("2O-R");A.L=L;f.5g=C;f.C=p.B.8C(C).E(/\\r/g," ");3Z=f.V("1H-2Q");f.C=f.V("8d-89")==I?p.B.8a(f.C,3Z):p.B.8b(f.C,3Z);f.C=p.B.2T(f.C);c(f.V("1w")){f.1i=f.1c("3Y");f.1i.L="1i";f.1i.2p(p.1w.1c(f));A.2p(f.1i);h 1i=f.1i;l 58(){1i.L=1i.L.E("53","")};A.c0=l(){58();1i.L+=" 53"};A.bX=l(){58()}}A.2p(f.1p);f.2C=f.8i(f.59,f.C);f.86();C=f.8y(f.C,f.2C);C=f.8t(p.B.2G(C));c(f.V("8k-8l")){C=p.B.8m(C)}f.1p.1Q=C},9f:l(z){z=z.E(/^\\s+|\\s+$/g,"").E(/\\s+/g,"|");q"\\\\b(?:"+z+")\\\\b"},9i:l(2J){f.3I={G:{3K:2J.G,1a:"1l"},1d:{3K:2J.1d,1a:"1l"},C:W U("(?"+2J.G.1g+")"+"(?.*?)"+"(?<1d>"+2J.1d.1g+")","96")}}};q p}()}c(!1q.U){(l(){h 2w={T:10.14.T,87:5I.14.87,E:5I.14.E,1P:5I.14.1P},1F={13:/(?:[^\\\\([#\\s.]+|\\\\(?!k<[\\w$]+>|[7z]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[7z]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,99:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,37:/^(?:\\s+|#.*)+/,5B:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7Q:/&&\\[\\^?/g,7S:/]/g},7o=l(5C,5v,5u){D(h i=5u||0;i<5C.u;i++){c(5C[i]===5v){q i}}q-1},8G=/()??/.T("")[1]!==3j,3q={};U=l(1e,1O){c(1e 68 10){c(1O!==3j){3H 7r("4y\'t 4C 9a 8z 95 7u 10 5u 94")}q 1e.3E()}h 1O=1O||"",7R=1O.Y("s")>-1,7M=1O.Y("x")>-1,5z=N,3v=[],1b=[],13=1F.13,J,cc,38,3M,3p;13.O=0;2j(J=2w.T.2n(13,1e)){c(J[2]){c(!1F.5B.1R(1e.17(13.O))){1b.K("(?:)")}}F{c(J[1]){3v.K(J[3]||v);c(J[3]){5z=I}1b.K("(")}F{c(J[4]){3M=7o(3v,J[4]);1b.K(3M>-1?"\\\\"+(3M+1)+(40(1e.5w(13.O))?"":"(?:)"):J[0])}F{c(J[5]){1b.K(3q.7m?3q.7m.7q(J[5],J[0].5w(1)==="P"):J[0])}F{c(J[6]){c(1e.5w(13.O)==="]"){1b.K(J[6]==="["?"(?!)":"[\\\\S\\\\s]");13.O++}F{cc=U.8g("&&"+1e.17(J.H),1F.7Q,1F.7S,"",{7D:"\\\\"})[0];1b.K(J[6]+cc+"]");13.O+=cc.u+1}}F{c(J[7]){c(7R&&J[7]==="."){1b.K("[\\\\S\\\\s]")}F{c(7M&&1F.37.1R(J[7])){38=2w.T.2n(1F.37,1e.17(13.O-1))[0].u;c(!1F.5B.1R(1e.17(13.O-1+38))){1b.K("(?:)")}13.O+=38-1}F{1b.K(J[7])}}}F{1b.K(J[0])}}}}}}}3p=10(1b.5A(""),2w.E.2n(1O,/[9B]+/g,""));3p.1C={1g:1e,2m:5z?3v:v};q 3p};U.9q=l(R,o){3q[R]=o};10.14.T=l(z){h 1h=2w.T.2n(f,z),R,i,5y;c(1h){c(8G&&1h.u>1){5y=W 10("^"+f.1g+"$(?!\\\\s)",f.5E());2w.E.2n(1h[0],5y,l(){D(i=1;i<8j.u-2;i++){c(8j[i]===3j){1h[i]=3j}}})}c(f.1C&&f.1C.2m){D(i=1;i<1h.u;i++){R=f.1C.2m[i-1];c(R){1h[R]=1h[i]}}}c(f.3l&&f.O>(1h.H+1h[0].u)){f.O--}}q 1h}})()}10.14.5E=l(){q(f.3l?"g":"")+(f.av?"i":"")+(f.8F?"m":"")+(f.37?"x":"")+(f.a4?"y":"")};10.14.3E=l(7A){h 5F=W U(f.1g,(7A||"")+f.5E());c(f.1C){5F.1C={1g:f.1C.1g,2m:f.1C.2m?f.1C.2m.17(0):v}}q 5F};10.14.2n=l(90,z){q f.T(z)};10.14.9b=l(9h,8c){q f.T(8c[0])};U.5P=l(57,5e){h 55="/"+57+"/"+(5e||"");q U.5P[55]||(U.5P[55]=W U(57,5e))};U.41=l(z){q z.E(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};U.8g=l(z,G,11,1j,2R){h 2R=2R||{},2P=2R.7D,12=2R.c5,1j=1j||"",5r=1j.Y("g")>-1,70=1j.Y("i")>-1,7v=1j.Y("m")>-1,5a=1j.Y("y")>-1,1j=1j.E(/y/g,""),G=G 68 10?(G.3l?G:G.3E("g")):W U(G,"g"+1j),11=11 68 10?(11.3l?11:11.3E("g")):W U(11,"g"+1j),1M=[],2o=0,1u=0,1t=0,1z=0,2b,2c,1B,1K,3Q,48;c(2P){c(2P.u>1){3H aC("4y\'t 4C aL aJ 7u 41 7B")}c(7v){3H 7r("4y\'t 4C 41 7B 8z bi b8 8F b7")}3Q=U.41(2P);48=W 10("^(?:"+3Q+"[\\\\S\\\\s]|(?:(?!"+G.1g+"|"+11.1g+")[^"+3Q+"])+)+",70?"i":"")}2j(I){G.O=11.O=1t+(2P?(48.T(z.17(1t))||[""])[0].u:0);1B=G.T(z);1K=11.T(z);c(1B&&1K){c(1B.H<=1K.H){1K=v}F{1B=v}}c(1B||1K){1u=(1B||1K).H;1t=(1B?G:11).O}F{c(!2o){2h}}c(5a&&!2o&&1u>1z){2h}c(1B){c(!2o++){2b=1u;2c=1t}}F{c(1K&&2o){c(!--2o){c(12){c(12[0]&&2b>1z){1M.K([12[0],z.17(1z,2b),1z,2b])}c(12[1]){1M.K([12[1],z.17(2b,2c),2b,2c])}c(12[2]){1M.K([12[2],z.17(2c,1u),2c,1u])}c(12[3]){1M.K([12[3],z.17(1u,1t),1u,1t])}}F{1M.K(z.17(2c,1u))}1z=1t;c(!5r){2h}}}F{G.O=11.O=0;3H bP("8L aq 9r ar 8Z")}}c(1u===1t){1t++}}c(5r&&!5a&&12&&12[0]&&z.u>1z){1M.K([12[0],z.17(1z),1z,z.u])}G.O=11.O=0;q 1M};',62,768,'||||||||||||if|||this||var||||function||||sh|return||||length|null||||str|div|utils|code|for|replace|else|left|index|true|_121|push|className|config|false|lastIndex||document|name||exec|XRegExp|getParam|new|lt|indexOf|gt|RegExp|_139|vN|part|prototype|||slice|pos|_d3|css|_11f|create|right|_119|strings|source|_129|bar|_13a|id|script|style|_da|_d6|lines|window|vars|class|_145|_144|_b5|toolbar|_f4|_103|_146|alert|_149|_x|_c3|params|lib|obj|tab|highlight|continue|_14a|html|_142|doc|_11a|split|innerHTML|test|_ec|_5a|_5b|in|_4f|text|_8|_3c|_91|_98|createElement|_e7|value|_c5|width|href|_c2|substr|min|_147|_148|brushes|height|_6e|_cd|break|attributes|while|_be|_75|captureNames|call|_143|appendChild|_bc|_5f|http|concat|toString|_f0|real|_e9|line|execute|wnd|nbsp|matches|getMatches|_66|_e3|trim|_ed|_40|_10f|case|_61|_c1|_55|brush|_13c|size|_13b|_f9|unindent|_d9|_28|_c4|SyntaxHighlighter|_81|_88|_5|m2|_7a|body|_a2|m1|_80|extended|len|font|_fe|gm|_fd|fixInputString|Math|color|gutter|_4e|title|undefined|com|global|printFrame|_ef|_7d|_125|_118|_ee|_8e|print|_e5|_11e|_7b|_32|_49|_cc|offsetMatches|_7c|_25|write|addFlags|td|_104|throw|htmlScript|_22|regex|_a7|_124|_af|_2|_c6|_14b|_b6|_b4|_3|substring|_60|_76|_6a|DIV|_10b|isNaN|escape|_62|url|_7e|_6b|eachLine|_ae|esc|_47|HtmlScript|_b2|values|_8c|gi|_89|_b9|object|_b0|_ad|_blank|_e1|xmlBrush|link|close|removeChild|_b3|type|_a6|_73|findBrush|Match|top|_9d|can|popup|_c8|_53|supply|_a3|win|focus|span|_54|_9e|_50|_cb|_4d|_d7|_5d|getElementsByTagName|_6c|_ba|_b8|_bf|useScriptTags|_82|_ea|_ce|func|_d0|discoveredBrushes||_4c|_f6|show|pre|key|_29|_133|hide|regexList|_141|_19|_1a|viewSource|_134|_2b|originalCode|wrap|copyToClipboard|highlighterId|toolbarItemHeight|toolbarItemWidth|_2a|_2c|_2e|_2d|expandSource|_13e|_4|_7|from|item|charAt|www|r2|_11d|join|quantifier|_113|_e|getNativeFlags|_12e|_17|_18|String|_10|_b|_9|_f|_d|collapsed|cache|contentWindow|_101|_ff|_fb|swf|_30|getBrushNameCss|_fa|brushName|_100|_f5|_37|_35|content|_24|_38|collapse|_2f|instanceof|clipboardSwf|_27|defaults|merge|guid|syntaxhighlighter|highlighters|toolbarCommands|2009|_6|500px|measureSpace|_78|createButton|message|_79|clipboard|to|0px|_85|decoration|center|_83|margin|w3|rel|head|stylesheet|org|help|xhtml1|_3f|0099FF|align|DTD|alexgorbatchev|copyStyles|navigator|none|executeCommand|_3e|version|toLowerCase|_5e|_1e|_65|noBrush|switch|flash|_52|screen|event|attachEvent|_13f|shockwave|_4b|_48|clipboardData|px|commandName|aboutDialog|copyToClipboardConfirmation|_84|scrollbars|_14|_36|items|_6d|_16|_13|_15|_12|_a|userAgent|_d8|unicode|_d5|_112|process|get|TypeError|_de|_dd|one|_140|_d1|brushNotHtmlScript|parentNode|pP|_12d|character|addEvent|escapeChar|_106|_f7|_c9|_c7|Highlighter|_df|decorate|table|_11c|_f1|plain|_f8|classLeft|_11b|classRight|tr|_f2|padNumber|numbers|typeof|_e2|_e0|toBoolean|_e4|matchesSortCallback|pad|first|parseInt|removeNestedMatches|match|light|tabs|processSmartTabs|processTabs|args|smart|toArray|stripBrs|matchRecursive|regexLib|findMatches|arguments|auto|links|processUrls|defaultAdd|_a9|_a8|_a1|_a4|tagName|createDisplayLines|debug|getSyntaxHighlighterScriptTags|_93|insertSpaces|processMatches|when|_90|bloggerMode|trimFirstAndLastLines|_9a|_b7|multiline|_117|parseParams|stripCData|_bd|Copyright|subject|Alex|2004|development|_1c|keep|donate|Gorbatchev|_1b|syntax|JavaScript|active|highlighter|multiLineSingleQuotedString|delimiters|_12f|string|scriptScriptTags|aspScriptTags|another|constructing|sgi|try|catch|replaceVar|flags|apply|phpScriptTags|singleLineCComments|singleLinePerlComments|getKeywords|multiLineCComments|_131|forHtmlScript|doubleQuotedString|xmlComments|onclick|multiLineDoubleQuotedString|singleQuotedString|spaceWidth|bottom|addPlugin|contains|1999|xmlns|dtd|TR|transitional|xhtml|meta|utf|About|sx|charset|Type|equiv|Content|EN|Transitional|your|now|Can|is|The|view|copy|find|Brush|PUBLIC|W3C|XHTML|DOCTYPE|option|wasn|configured|family|Geneva|you|like|please|If|sticky|October|target|https|paypal|_s|xclick|hosted_button_id|cmd|webscr|cgi|bin|364|4em|background|fff|000|serif|sans|Arial|Helvetica|1em|data|unbalanced|75em|large|xx|ignoreCase|3em|2930402|always|about|_42|sort|SyntaxError|printing|shCore|_43|_44|max|round|than|250|more|500|alt|absolute|error|highlighted|ok|number|amp|setData|printSource|_39|cssText|position|IFRAME|_3b|_1f|random|1000000|_a5|block|CDATA|flag|the|htmlscript|1000|getElementById|getPropertyValue|offsetWidth|getComputedStyle|_99|opera|Array|using|textarea|open|load|Xml|_cf|lastIndexOf|_d4|all||replaceChild|70em|aliases|addEventListener|on|30em|spaces|_3a|flashVars|nogutter|transparent|wmode|allowScriptAccess|_8a|msie|classid|96b8|444553540000|11cf|ae6d|clsid|d27cdb6e|no|Error|location|resizable|400|750|_20|_21|menubar|onmouseout|_clipboard|application|onmouseover|param|_26|codebase|menu|valueNames|movie|cab|swflash|cabs|embed|conf||command|_34|_33|src|_10c|_10a|macromedia|download|highlighter_|pub|important'.split('|'),0,{})) diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js deleted file mode 100644 index fb30751..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 y={d:{}};y.d={F:6(S,l,q,k,m,n){6 J(z,Y){1 V=16 15("^"+Y+"\\\\[(?\\\\w+)\\\\]$","14"),x=2;h(1 i=0;i. - */ -// -// Begin anonymous function. This is used to contain local scope variables without polutting global scope. -// -if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { - -// Shortcut object which will be assigned to the SyntaxHighlighter variable. -// This is a shorthand for local reference in order to avoid long namespace -// references to SyntaxHighlighter.whatever... -var sh = { - defaults : { - /** Additional CSS class names to be added to highlighter elements. */ - 'class-name' : '', - - /** First line number. */ - 'first-line' : 1, - - /** - * Pads line numbers. Possible values are: - * - * false - don't pad line numbers. - * true - automaticaly pad numbers with minimum required number of leading zeroes. - * [int] - length up to which pad line numbers. - */ - 'pad-line-numbers' : true, - - /** Lines to highlight. */ - 'highlight' : null, - - /** Enables or disables smart tabs. */ - 'smart-tabs' : true, - - /** Gets or sets tab size. */ - 'tab-size' : 4, - - /** Enables or disables gutter. */ - 'gutter' : true, - - /** Enables or disables toolbar. */ - 'toolbar' : true, - - /** Forces code view to be collapsed. */ - 'collapse' : false, - - /** Enables or disables automatic links. */ - 'auto-links' : true, - - /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ - 'light' : false, - - /** Enables or disables automatic line wrapping. */ - 'wrap-lines' : true, - - 'html-script' : false - }, - - config : { - /** Enables use of tags. */ - scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } - }, - - toolbar : { - /** - * Creates new toolbar for a highlighter. - * @param {Highlighter} highlighter Target highlighter. - */ - create : function(highlighter) - { - var div = document.createElement('DIV'), - items = sh.toolbar.items - ; - - div.className = 'toolbar'; - - for (var name in items) - { - var constructor = items[name], - command = new constructor(highlighter), - element = command.create() - ; - - highlighter.toolbarCommands[name] = command; - - if (element == null) - continue; - - if (typeof(element) == 'string') - element = sh.toolbar.createButton(element, highlighter.id, name); - - element.className += 'item ' + name; - div.appendChild(element); - } - - return div; - }, - - /** - * Create a standard anchor button for the toolbar. - * @param {String} label Label text to display. - * @param {String} highlighterId Highlighter ID that this button would belong to. - * @param {String} commandName Command name that would be executed. - * @return {Element} Returns an 'A' element. - */ - createButton : function(label, highlighterId, commandName) - { - var a = document.createElement('a'), - style = a.style, - config = sh.config, - width = config.toolbarItemWidth, - height = config.toolbarItemHeight - ; - - a.href = '#' + commandName; - a.title = label; - a.highlighterId = highlighterId; - a.commandName = commandName; - a.innerHTML = label; - - if (isNaN(width) == false) - style.width = width + 'px'; - - if (isNaN(height) == false) - style.height = height + 'px'; - - a.onclick = function(e) - { - try - { - sh.toolbar.executeCommand( - this, - e || window.event, - this.highlighterId, - this.commandName - ); - } - catch(e) - { - sh.utils.alert(e.message); - } - - return false; - }; - - return a; - }, - - /** - * Executes a toolbar command. - * @param {Element} sender Sender element. - * @param {MouseEvent} event Original mouse event object. - * @param {String} highlighterId Highlighter DIV element ID. - * @param {String} commandName Name of the command to execute. - * @return {Object} Passes out return value from command execution. - */ - executeCommand : function(sender, event, highlighterId, commandName, args) - { - var highlighter = sh.vars.highlighters[highlighterId], - command - ; - - if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null) - return null; - - return command.execute(sender, event, args); - }, - - /** Collection of toolbar items. */ - items : { - expandSource : function(highlighter) - { - this.create = function() - { - if (highlighter.getParam('collapse') != true) - return; - - return sh.config.strings.expandSource; - }; - - this.execute = function(sender, event, args) - { - var div = highlighter.div; - - sender.parentNode.removeChild(sender); - div.className = div.className.replace('collapsed', ''); - }; - }, - - /** - * Command to open a new window and display the original unformatted source code inside. - */ - viewSource : function(highlighter) - { - this.create = function() - { - return sh.config.strings.viewSource; - }; - - this.execute = function(sender, event, args) - { - var code = sh.utils.fixInputString(highlighter.originalCode).replace(/' + code + ''); - wnd.document.close(); - }; - }, - - /** - * Command to copy the original source code in to the clipboard. - * Uses Flash method if clipboardSwf is configured. - */ - copyToClipboard : function(highlighter) - { - var flashDiv, flashSwf, - highlighterId = highlighter.id - ; - - this.create = function() - { - var config = sh.config; - - // disable functionality if running locally - if (config.clipboardSwf == null) - return null; - - function params(list) - { - var result = ''; - - for (var name in list) - result += ""; - - return result; - }; - - function attributes(list) - { - var result = ''; - - for (var name in list) - result += " " + name + "='" + list[name] + "'"; - - return result; - }; - - var args1 = { - width : config.toolbarItemWidth, - height : config.toolbarItemHeight, - id : highlighterId + '_clipboard', - type : 'application/x-shockwave-flash', - title : sh.config.strings.copyToClipboard - }, - - // these arguments are used in IE's collection - args2 = { - allowScriptAccess : 'always', - wmode : 'transparent', - flashVars : 'highlighterId=' + highlighterId, - menu : 'false' - }, - swf = config.clipboardSwf, - html - ; - - if (/msie/i.test(navigator.userAgent)) - { - html = '' - + params(args2) - + params({ movie : swf }) - + '
' - ; - } - else - { - html = '' - ; - } - - flashDiv = document.createElement('div'); - flashDiv.innerHTML = html; - - return flashDiv; - }; - - this.execute = function(sender, event, args) - { - var command = args.command; - - switch (command) - { - case 'get': - var code = sh.utils.unindent( - sh.utils.fixInputString(highlighter.originalCode) - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/&/g, '&') - ); - - if(window.clipboardData) - // will fall through to the confirmation because there isn't a break - window.clipboardData.setData('text', code); - else - return sh.utils.unindent(code); - - case 'ok': - sh.utils.alert(sh.config.strings.copyToClipboardConfirmation); - break; - - case 'error': - sh.utils.alert(args.message); - break; - } - }; - }, - - /** Command to print the colored source code. */ - printSource : function(highlighter) - { - this.create = function() - { - return sh.config.strings.print; - }; - - this.execute = function(sender, event, args) - { - var iframe = document.createElement('IFRAME'), - doc = null - ; - - // make sure there is never more than one hidden iframe created by SH - if (sh.vars.printFrame != null) - document.body.removeChild(sh.vars.printFrame); - - sh.vars.printFrame = iframe; - - // this hides the iframe - iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; - - document.body.appendChild(iframe); - doc = iframe.contentWindow.document; - - copyStyles(doc, window.document); - doc.write('
' + highlighter.div.innerHTML + '
'); - doc.close(); - - iframe.contentWindow.focus(); - iframe.contentWindow.print(); - - function copyStyles(destDoc, sourceDoc) - { - var links = sourceDoc.getElementsByTagName('link'); - - for(var i = 0; i < links.length; i++) - if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href)) - destDoc.write(''); - }; - }; - }, - - /** Command to display the about dialog window. */ - about : function(highlighter) - { - this.create = function() - { - return sh.config.strings.help; - }; - - this.execute = function(sender, event) - { - var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'), - doc = wnd.document - ; - - doc.write(sh.config.strings.aboutDialog); - doc.close(); - wnd.focus(); - }; - } - } - }, - - utils : { - /** - * Finds an index of element in the array. - * @ignore - * @param {Object} searchElement - * @param {Number} fromIndex - * @return {Number} Returns index of element if found; -1 otherwise. - */ - indexOf : function(array, searchElement, fromIndex) - { - fromIndex = Math.max(fromIndex || 0, 0); - - for (var i = fromIndex; i < array.length; i++) - if(array[i] == searchElement) - return i; - - return -1; - }, - - /** - * Generates a unique element ID. - */ - guid : function(prefix) - { - return prefix + Math.round(Math.random() * 1000000).toString(); - }, - - /** - * Merges two objects. Values from obj2 override values in obj1. - * Function is NOT recursive and works only for one dimensional objects. - * @param {Object} obj1 First object. - * @param {Object} obj2 Second object. - * @return {Object} Returns combination of both objects. - */ - merge: function(obj1, obj2) - { - var result = {}, name; - - for (name in obj1) - result[name] = obj1[name]; - - for (name in obj2) - result[name] = obj2[name]; - - return result; - }, - - /** - * Attempts to convert string to boolean. - * @param {String} value Input string. - * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise. - */ - toBoolean: function(value) - { - switch (value) - { - case "true": - return true; - - case "false": - return false; - } - - return value; - }, - - /** - * Opens up a centered popup window. - * @param {String} url URL to open in the window. - * @param {String} name Popup name. - * @param {int} width Popup width. - * @param {int} height Popup height. - * @param {String} options window.open() options. - * @return {Window} Returns window instance. - */ - popup: function(url, name, width, height, options) - { - var x = (screen.width - width) / 2, - y = (screen.height - height) / 2 - ; - - options += ', left=' + x + - ', top=' + y + - ', width=' + width + - ', height=' + height - ; - options = options.replace(/^,/, ''); - - var win = window.open(url, name, options); - win.focus(); - return win; - }, - - /** - * Adds event handler to the target object. - * @param {Object} obj Target object. - * @param {String} type Name of the event. - * @param {Function} func Handling function. - */ - addEvent: function(obj, type, func) - { - if (obj.attachEvent) - { - obj['e' + type + func] = func; - obj[type + func] = function() - { - obj['e' + type + func](window.event); - } - obj.attachEvent('on' + type, obj[type + func]); - } - else - { - obj.addEventListener(type, func, false); - } - }, - - /** - * Displays an alert. - * @param {String} str String to display. - */ - alert: function(str) - { - alert(sh.config.strings.alert + str) - }, - - /** - * Finds a brush by its alias. - * - * @param {String} alias Brush alias. - * @param {Boolean} alert Suppresses the alert if false. - * @return {Brush} Returns bursh constructor if found, null otherwise. - */ - findBrush: function(alias, alert) - { - var brushes = sh.vars.discoveredBrushes, - result = null - ; - - if (brushes == null) - { - brushes = {}; - - // Find all brushes - for (var brush in sh.brushes) - { - var aliases = sh.brushes[brush].aliases; - - if (aliases == null) - continue; - - // keep the brush name - sh.brushes[brush].name = brush.toLowerCase(); - - for (var i = 0; i < aliases.length; i++) - brushes[aliases[i]] = brush; - } - - sh.vars.discoveredBrushes = brushes; - } - - result = sh.brushes[brushes[alias]]; - - if (result == null && alert != false) - sh.utils.alert(sh.config.strings.noBrush + alias); - - return result; - }, - - /** - * Executes a callback on each line and replaces each line with result from the callback. - * @param {Object} str Input string. - * @param {Object} callback Callback function taking one string argument and returning a string. - */ - eachLine: function(str, callback) - { - var lines = str.split('\n'); - - for (var i = 0; i < lines.length; i++) - lines[i] = callback(lines[i]); - - return lines.join('\n'); - }, - - /** - * This is a special trim which only removes first and last empty lines - * and doesn't affect valid leading space on the first line. - * - * @param {String} str Input string - * @return {String} Returns string without empty first and last lines. - */ - trimFirstAndLastLines: function(str) - { - return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, ''); - }, - - /** - * Parses key/value pairs into hash object. - * - * Understands the following formats: - * - name: word; - * - name: [word, word]; - * - name: "string"; - * - name: 'string'; - * - * For example: - * name1: value; name2: [value, value]; name3: 'value' - * - * @param {String} str Input string. - * @return {Object} Returns deserialized object. - */ - parseParams: function(str) - { - var match, - result = {}, - arrayRegex = new XRegExp("^\\[(?(.*?))\\]$"), - regex = new XRegExp( - "(?[\\w-]+)" + - "\\s*:\\s*" + - "(?" + - "[\\w-%#]+|" + // word - "\\[.*?\\]|" + // [] array - '".*?"|' + // "" string - "'.*?'" + // '' string - ")\\s*;?", - "g" - ) - ; - - while ((match = regex.exec(str)) != null) - { - var value = match.value - .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings - ; - - // try to parse array value - if (value != null && arrayRegex.test(value)) - { - var m = arrayRegex.exec(value); - value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []; - } - - result[match.name] = value; - } - - return result; - }, - - /** - * Wraps each line of the string into tag with given style applied to it. - * - * @param {String} str Input string. - * @param {String} css Style name to apply to the string. - * @return {String} Returns input string with each line surrounded by tag. - */ - decorate: function(str, css) - { - if (str == null || str.length == 0 || str == '\n') - return str; - - str = str.replace(/... to them so that - // leading spaces aren't included. - if (css != null) - str = sh.utils.eachLine(str, function(line) - { - if (line.length == 0) - return ''; - - var spaces = ''; - - line = line.replace(/^( | )+/, function(s) - { - spaces = s; - return ''; - }); - - if (line.length == 0) - return spaces; - - return spaces + '' + line + ''; - }); - - return str; - }, - - /** - * Pads number with zeros until it's length is the same as given length. - * - * @param {Number} number Number to pad. - * @param {Number} length Max string length with. - * @return {String} Returns a string padded with proper amount of '0'. - */ - padNumber : function(number, length) - { - var result = number.toString(); - - while (result.length < length) - result = '0' + result; - - return result; - }, - - /** - * Measures width of a single space character. - * @return {Number} Returns width of a single space character. - */ - measureSpace : function() - { - var container = document.createElement('div'), - span, - result = 0, - body = document.body, - id = sh.utils.guid('measureSpace'), - - // variable names will be compressed, so it's better than a plain string - divOpen = '
' - + divOpen + 'lines">' - + divOpen + 'line">' - + divOpen + 'content' - + '"> ' + closeSpan + closeSpan - + closeDiv - + closeDiv - + closeDiv - + closeDiv - ; - - body.appendChild(container); - span = document.getElementById(id); - - if (/opera/i.test(navigator.userAgent)) - { - var style = window.getComputedStyle(span, null); - result = parseInt(style.getPropertyValue("width")); - } - else - { - result = span.offsetWidth; - } - - body.removeChild(container); - - return result; - }, - - /** - * Replaces tabs with spaces. - * - * @param {String} code Source code. - * @param {Number} tabSize Size of the tab. - * @return {String} Returns code with all tabs replaces by spaces. - */ - processTabs : function(code, tabSize) - { - var tab = ''; - - for (var i = 0; i < tabSize; i++) - tab += ' '; - - return code.replace(/\t/g, tab); - }, - - /** - * Replaces tabs with smart spaces. - * - * @param {String} code Code to fix the tabs in. - * @param {Number} tabSize Number of spaces in a column. - * @return {String} Returns code with all tabs replaces with roper amount of spaces. - */ - processSmartTabs : function(code, tabSize) - { - var lines = code.split('\n'), - tab = '\t', - spaces = '' - ; - - // Create a string with 1000 spaces to copy spaces from... - // It's assumed that there would be no indentation longer than that. - for (var i = 0; i < 50; i++) - spaces += ' '; // 20 spaces * 50 - - // This function inserts specified amount of spaces in the string - // where a tab is while removing that given tab. - function insertSpaces(line, pos, count) - { - return line.substr(0, pos) - + spaces.substr(0, count) - + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab - ; - }; - - // Go through all the lines and do the 'smart tabs' magic. - code = sh.utils.eachLine(code, function(line) - { - if (line.indexOf(tab) == -1) - return line; - - var pos = 0; - - while ((pos = line.indexOf(tab)) != -1) - { - // This is pretty much all there is to the 'smart tabs' logic. - // Based on the position within the line and size of a tab, - // calculate the amount of spaces we need to insert. - var spaces = tabSize - pos % tabSize; - line = insertSpaces(line, pos, spaces); - } - - return line; - }); - - return code; - }, - - /** - * Performs various string fixes based on configuration. - */ - fixInputString : function(str) - { - var br = /|<br\s*\/?>/gi; - - if (sh.config.bloggerMode == true) - str = str.replace(br, '\n'); - - if (sh.config.stripBrs == true) - str = str.replace(br, ''); - - return str; - }, - - /** - * Removes all white space at the begining and end of a string. - * - * @param {String} str String to trim. - * @return {String} Returns string without leading and following white space characters. - */ - trim: function(str) - { - return str.replace(/^\s+|\s+$/g, ''); - }, - - /** - * Unindents a block of text by the lowest common indent amount. - * @param {String} str Text to unindent. - * @return {String} Returns unindented text block. - */ - unindent: function(str) - { - var lines = sh.utils.fixInputString(str).split('\n'), - indents = new Array(), - regex = /^\s*/, - min = 1000 - ; - - // go through every line and check for common number of indents - for (var i = 0; i < lines.length && min > 0; i++) - { - var line = lines[i]; - - if (sh.utils.trim(line).length == 0) - continue; - - var matches = regex.exec(line); - - // In the event that just one line doesn't have leading white space - // we can't unindent anything, so bail completely. - if (matches == null) - return str; - - min = Math.min(matches[0].length, min); - } - - // trim minimum common number of white space from the begining of every line - if (min > 0) - for (var i = 0; i < lines.length; i++) - lines[i] = lines[i].substr(min); - - return lines.join('\n'); - }, - - /** - * Callback method for Array.sort() which sorts matches by - * index position and then by length. - * - * @param {Match} m1 Left object. - * @param {Match} m2 Right object. - * @return {Number} Returns -1, 0 or -1 as a comparison result. - */ - matchesSortCallback: function(m1, m2) - { - // sort matches by index first - if(m1.index < m2.index) - return -1; - else if(m1.index > m2.index) - return 1; - else - { - // if index is the same, sort by length - if(m1.length < m2.length) - return -1; - else if(m1.length > m2.length) - return 1; - } - - return 0; - }, - - /** - * Executes given regular expression on provided code and returns all - * matches that are found. - * - * @param {String} code Code to execute regular expression on. - * @param {Object} regex Regular expression item info from regexList collection. - * @return {Array} Returns a list of Match objects. - */ - getMatches: function(code, regexInfo) - { - function defaultAdd(match, regexInfo) - { - return [new sh.Match(match[0], match.index, regexInfo.css)]; - }; - - var index = 0, - match = null, - result = [], - func = regexInfo.func ? regexInfo.func : defaultAdd - ; - - while((match = regexInfo.regex.exec(code)) != null) - result = result.concat(func(match, regexInfo)); - - return result; - }, - - processUrls: function(code) - { - var lt = '<', - gt = '>' - ; - - return code.replace(sh.regexLib.url, function(m) - { - var suffix = '', prefix = ''; - - // We include < and > in the URL for the common cases like - // The problem is that they get transformed into <http://google.com> - // Where as > easily looks like part of the URL string. - - if (m.indexOf(lt) == 0) - { - prefix = lt; - m = m.substring(lt.length); - } - - if (m.indexOf(gt) == m.length - gt.length) - { - m = m.substring(0, m.length - gt.length); - suffix = gt; - } - - return prefix + '' + m + '' + suffix; - }); - }, - - /** - * Finds all - - - - - - - - - - - - - - - - - - - - - - - -

SyntaxHihglighter Test

-

This is a test file to insure that everything is working well.

- -
-function test() : String
-{
-	return 10;
-}
-
- diff --git a/html/views/diff/diffWindow.css b/html/views/diff/diffWindow.css index d752659..932dbc1 100644 --- a/html/views/diff/diffWindow.css +++ b/html/views/diff/diffWindow.css @@ -4,6 +4,7 @@ table.diff { width: 100%; border-collapse: collapse; margin-bottom: 10px; + -webkit-box-shadow: 5px 5px 5px #ccc; } table.diff tr td { @@ -57,4 +58,20 @@ table.diff thead tr td { table.diff tbody tr.header { background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, rgba(244, 244, 244,1)), color-stop(1, rgba(215,215,215,1))); -} \ No newline at end of file +} + +table.diff .filemerge { + float: right; + text-align: center; +} + +#diff { + width: 100%; + display: block; + overflow: auto; +} + +#diff table.diff { + width: 98%; + margin: auto auto 20px 1%; +} diff --git a/html/views/diff/diffWindow.js b/html/views/diff/diffWindow.js index 61eeb7c..cb33f92 100644 --- a/html/views/diff/diffWindow.js +++ b/html/views/diff/diffWindow.js @@ -9,3 +9,11 @@ var showFile = function(txt) { $("diff").innerHTML = txt; $("message").style.display = "none"; } + +// TODO: need to be refactoring +var openFileMerge = function(file,sha,sha2) { + alert(file); + alert(sha); + alert(sha2); + Controller.openFileMerge_sha_sha2_(file,sha,sha2); +} diff --git a/html/views/fileview/index.html b/html/views/fileview/index.html index a307f55..4684f22 100644 --- a/html/views/fileview/index.html +++ b/html/views/fileview/index.html @@ -31,6 +31,7 @@