diff --git a/.gitignore b/.gitignore index 3367a4e..94061ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ build build/revision -*.xcodeproj/*.pbxuser -*.xcodeproj/*.perspectivev3 -*.xcodeproj/*.mode1v3 -*.xcodeproj/*.tm_build_errors -*.tmproj +*.xcodeproj/ +!*.xcodeproj/project.pbxproj Nightly.app.zip diff --git a/ApplicationController.h b/ApplicationController.h index 64d1c13..f368344 100644 --- a/ApplicationController.h +++ b/ApplicationController.h @@ -9,10 +9,9 @@ #import #import "PBGitRepository.h" -@class PBCLIProxy; @class PBCloneRepositoryPanel; -@interface ApplicationController : NSObject +@interface ApplicationController : NSObject { IBOutlet NSWindow *window; IBOutlet id firstResponder; @@ -20,22 +19,8 @@ NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; - PBCLIProxy *cliProxy; - NSString * cliArgs; - - // CLI set state - BOOL launchedFromGitx; - NSString * deferredSelectSha; - NSArray * launchedDocuments; - PBCloneRepositoryPanel *cloneRepositoryPanel; } -@property (retain) PBCLIProxy* cliProxy; -@property (copy) NSString *cliArgs; -@property (assign) BOOL launchedFromGitx; -@property (copy) NSString *deferredSelectSha; - -+ (ApplicationController *) sharedApplicationController; - (NSPersistentStoreCoordinator *)persistentStoreCoordinator; - (NSManagedObjectModel *)managedObjectModel; diff --git a/ApplicationController.m b/ApplicationController.m index b24fb9e..c73b524 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -10,82 +10,36 @@ #import "PBGitRevisionCell.h" #import "PBGitWindowController.h" #import "PBRepositoryDocumentController.h" -#import "PBCLIProxy.h" #import "PBServicesController.h" #import "PBGitXProtocol.h" #import "PBPrefsWindowController.h" #import "PBNSURLPathUserDefaultsTransfomer.h" #import "PBGitDefaults.h" -#import "Sparkle/SUUpdater.h" #import "PBCloneRepositoryPanel.h" -#import "BMScript.h" -#import "PBGitSidebarController.h" +#import "Sparkle/SUUpdater.h" @implementation ApplicationController -@synthesize cliProxy; -@synthesize cliArgs; -@synthesize launchedFromGitx; -@synthesize deferredSelectSha; -static ApplicationController * sharedApplicationControllerInstance = nil; - -+ (void) initialize { - if (sharedApplicationControllerInstance == nil) - sharedApplicationControllerInstance = [[self alloc] init]; -} - -+ (ApplicationController *) sharedApplicationController { - //Already set by +initialize. - return sharedApplicationControllerInstance; -} - -+ (id) allocWithZone:(NSZone *) zone { - //Usually already set by +initialize. - if (sharedApplicationControllerInstance) { - //The caller expects to receive a new object, so implicitly retain it - //to balance out the eventual release message. - return [sharedApplicationControllerInstance retain]; - } else { - //When not already set, +initialize is our caller. - //It's creating the shared instance, let this go through. - return [super allocWithZone: zone]; - } -} - -- (id) copyWithZone:(NSZone *) zone { - return self; -} - -- (NSUInteger) retainCount { - return UINT_MAX; // denotes an object that cannot be released -} - -- (ApplicationController *) init +- (ApplicationController*)init { - //If sharedApplicationControllerInstance is nil, +initialize is our caller, so initialize the instance. - //If it is not nil, simply return the instance without re-initializing it. - if (sharedApplicationControllerInstance == nil) { #ifdef DEBUG_BUILD - [NSApp activateIgnoringOtherApps:YES]; + [NSApp activateIgnoringOtherApps:YES]; #endif - if(self = [super init]) { - 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"); - self.cliProxy = [PBCLIProxy new]; - launchedFromGitx = NO; - cliArgs = nil; - deferredSelectSha = nil; - } - /* Value Transformers */ - NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init]; - [NSValueTransformer setValueTransformer:transformer forName:@"PBNSURLPathUserDefaultsTransfomer"]; - // Make sure the PBGitDefaults is initialized, by calling a random method - [PBGitDefaults class]; - return self; - } - return self; + if(!(self = [super init])) + return nil; + + 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"); + + /* Value Transformers */ + NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init]; + [NSValueTransformer setValueTransformer:transformer forName:@"PBNSURLPathUserDefaultsTransfomer"]; + + // Make sure the PBGitDefaults is initialized, by calling a random method + [PBGitDefaults class]; + return self; } - (void)registerServices @@ -109,34 +63,16 @@ static ApplicationController * sharedApplicationControllerInstance = nil; - (void)applicationDidFinishLaunching:(NSNotification*)notification { + [[SUUpdater sharedUpdater] setSendsSystemProfile:YES]; + // Make sure Git's SSH password requests get forwarded to our little UI tool: setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 ); setenv( "DISPLAY", "localhost:0", 1 ); - char * launchedfromgitx = getenv("GITX_LAUNCHED_FROM_CLI"); - char * cliargs = getenv("GITX_CLI_ARGUMENTS"); - - self.launchedFromGitx = (launchedfromgitx ? YES : NO); - - if (cliargs) { - self.cliArgs = [NSString stringWithUTF8String:(cliargs)]; - } - - // NSLog(@"[%@ %s] launchedFromGitx = %@", [self class], _cmd, (launchedFromGitx ? @"YES" : @"NO")); - // NSLog(@"[%@ %s] cliArgs = %@", [self class], _cmd, cliArgs); - [self registerServices]; - if ([cliArgs isEqualToString:@"--all"]) { - [PBGitDefaults setBranchFilter:kGitXAllBranchesFilter]; - [[NSUserDefaults standardUserDefaults] synchronize]; - } else if ([cliArgs isEqualToString:@"--local"]) { - [PBGitDefaults setBranchFilter:kGitXLocalRemoteBranchesFilter]; - [[NSUserDefaults standardUserDefaults] synchronize]; - } - BOOL hasOpenedDocuments = NO; - launchedDocuments = [[[PBRepositoryDocumentController sharedDocumentController] documents] copy]; + NSArray *launchedDocuments = [[[PBRepositoryDocumentController sharedDocumentController] documents] copy]; // Only try to open a default document if there are no documents open already. // For example, the application might have been launched by double-clicking a .git repository, @@ -154,7 +90,7 @@ static ApplicationController * sharedApplicationControllerInstance = nil; } } - // Try to find the current directory, to open that as a repository... + // Try to find the current directory, to open that as a repository if ([PBGitDefaults openCurDirOnLaunch] && !hasOpenedDocuments) { NSString *curPath = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; NSURL *url = nil; @@ -166,47 +102,9 @@ static ApplicationController * sharedApplicationControllerInstance = nil; hasOpenedDocuments = YES; } - launchedDocuments = [[[PBRepositoryDocumentController sharedDocumentController] documents] copy]; - - // ...to bring the launched documents to the front - for (PBGitRepository *document in launchedDocuments) { - - PBGitWindowController * wc = [(PBGitRepository *)document windowController]; - PBGitHistoryController * historyViewController = wc.historyController; - NSArrayController * ccontroller = historyViewController.commitController; - - // determine what to show right after start - stage or standard history view? - if ([cliArgs isEqualToString:@"--commit"] || [cliArgs isEqualToString:@"-c"]) { - [wc showCommitView:self]; - launchedFromGitx = NO; - } else { - [wc showHistoryView:self]; - } - - if ([cliArgs hasPrefix:@"--author"]) { - NSArray * components = [cliArgs componentsSeparatedByString:@"="]; - NSString * author = [components objectAtIndex:1]; - [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"author contains[c] %@", author]]; - [historyViewController.commitList selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; - } else if ([cliArgs hasPrefix:@"--subject"]) { - NSArray * components = [cliArgs componentsSeparatedByString:@"="]; - NSString * subject = [components objectAtIndex:1]; - [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]]; - } else if ([cliArgs hasPrefix:@"--sha"]) { - NSArray * components = [cliArgs componentsSeparatedByString:@"="]; - NSString * sha = [components objectAtIndex:1]; - [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"realSha contains[c] %@", sha]]; - } else if ([cliArgs hasPrefix:@"-S"]) { - NSString * subject = [cliArgs substringFromIndex:2]; - [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]]; - } - + // to bring the launched documents to the front + for (PBGitRepository *document in launchedDocuments) [document showWindows]; - } - - if (launchedFromGitx) { - [self performSelector:@selector(finalizeCLILaunch:) withObject:self afterDelay:0.5]; - } if (![[NSApplication sharedApplication] isActive]) return; @@ -217,42 +115,14 @@ static ApplicationController * sharedApplicationControllerInstance = nil; [[PBRepositoryDocumentController sharedDocumentController] openDocument:self]; } -- (void) finalizeCLILaunch:(id)object { - for (PBGitRepository * document in launchedDocuments) { - BOOL success = [[[(PBGitRepository *)document windowController] historyController] selectCommit:self.deferredSelectSha]; - // NSLog(@"[%@ %s] trying to select commit with sha %@ (success = %@)", [self class], _cmd, self.deferredSelectSha, BMStringFromBOOL(success)); - if (success) { - PBGitWindowController * wc = [(PBGitRepository *)document windowController]; - PBGitHistoryController * histController = wc.historyController; - PBCommitList * clist = histController.commitList; - // updating the selection with the selection seems redundant but it also updates the row select indicator - [clist selectRowIndexes:[clist selectedRowIndexes] byExtendingSelection:NO]; - [histController scrollSelectionToTopOfViewFrom:0]; - [histController updateKeys]; - } - } - // Reset CLI indication status so KVO all over the controllers can go the intended ways again... - self.deferredSelectSha = nil; - self.launchedFromGitx = NO; -} - - -- (void) windowWillClose:(id)sender +- (void) windowWillClose: sender { - if ([[[sender object] windowController] isKindOfClass:[PBPrefsWindowController class]] ) { - for (PBGitRepository * doc in [[PBRepositoryDocumentController sharedDocumentController] documents]) { - [[[doc windowForSheet] contentView] setNeedsDisplay:YES]; - } - } else { - [firstResponder terminate: sender]; - } + [firstResponder terminate: sender]; } - (IBAction)openPreferencesWindow:(id)sender { - DBPrefsWindowController * prefsWindowController = [PBPrefsWindowController sharedPrefsWindowController]; - [[prefsWindowController window] setDelegate:self]; - [prefsWindowController showWindow:nil]; + [[PBPrefsWindowController sharedPrefsWindowController] showWindow:nil]; } - (IBAction)showAboutPanel:(id)sender @@ -376,7 +246,7 @@ static ApplicationController * sharedApplicationControllerInstance = nil; fileManager = [NSFileManager defaultManager]; applicationSupportFolder = [self applicationSupportFolder]; if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) { - [fileManager createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil]; + [fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil]; } url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"GitTest.xml"]]; diff --git a/CWQuickLook.h b/CWQuickLook.h index 2356f77..21d0315 100644 --- a/CWQuickLook.h +++ b/CWQuickLook.h @@ -1,4 +1,3 @@ -#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 @interface QLPreviewPanel : NSPanel + (id)sharedPreviewPanel; @@ -90,5 +89,4 @@ - (void)setShowsAddToiPhoto:(BOOL)fp8; - (void)setShowsiChatTheater:(BOOL)fp8; - (void)setShowsFullscreen:(BOOL)fp8; -@end -#endif \ No newline at end of file +@end \ No newline at end of file diff --git a/DBPrefsWindowController.h b/DBPrefsWindowController.h index b013ac7..5cb711e 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/DBPrefsWindowController.m b/DBPrefsWindowController.m index c5dbc08..8ec45bf 100644 --- a/DBPrefsWindowController.m +++ b/DBPrefsWindowController.m @@ -74,13 +74,13 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil; // Create a new window to display the preference views. // If the developer attached a window to this controller // in Interface Builder, it gets replaced with this one. - NSWindow *window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,1000,1000) + NSPanel *panel = [[[NSPanel alloc] initWithContentRect:NSMakeRect(0,0,1000,1000) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:YES] autorelease]; - [self setWindow:window]; + [self setWindow:panel]; contentSubview = [[[NSView alloc] initWithFrame:[[[self window] contentView] frame]] autorelease]; [contentSubview setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; [[[self window] contentView] addSubview:contentSubview]; diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 59399cb..dd75fb2 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -2,30 +2,24 @@ 1050 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 788 + 1038.29 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 788 YES - YES com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -299,7 +293,6 @@ - YES YES Save s @@ -310,7 +303,6 @@ - YES YES Save As… S @@ -321,7 +313,6 @@ - YES YES Revert to Saved @@ -343,7 +334,6 @@ - YES YES Page Setup… P @@ -354,7 +344,6 @@ - YES YES Print… p @@ -428,6 +417,16 @@ + + + YES + Copy SHA + c + 1572864 + 2147483647 + + + Paste @@ -1104,22 +1103,6 @@ 199 - - - performFindPanelAction: - - - - 200 - - - - performFindPanelAction: - - - - 201 - performFindPanelAction: @@ -1144,6 +1127,14 @@ 206 + + + saveAction: + + + + 211 + performMiniaturize: @@ -1352,13 +1343,39 @@ 963 + + + copySHA: + + + + 966 + + + + selectNext: + + + + 967 + + + + selectPrevious: + + + + 968 + YES 0 - + + YES + @@ -1515,8 +1532,8 @@ - + @@ -1643,6 +1660,7 @@ + @@ -2055,6 +2073,11 @@ + + 964 + + + @@ -2255,6 +2278,8 @@ 951.IBPluginDependency 954.IBPluginDependency 956.IBPluginDependency + 964.IBPluginDependency + 964.ImportedFromIB2 YES @@ -2262,7 +2287,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{778, 1007}, {135, 23}} + {{880, 713}, {135, 23}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2306,7 +2331,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{864, 473}, {238, 103}} + {{762, 747}, {238, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2323,7 +2348,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{522, 787}, {240, 243}} + {{522, 767}, {240, 263}} com.apple.InterfaceBuilder.CocoaPlugin {{455, 493}, {243, 243}} @@ -2373,7 +2398,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{707, 957}, {194, 73}} + {{809, 663}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2390,7 +2415,7 @@ {{297, 739}, {329, 20}} com.apple.InterfaceBuilder.CocoaPlugin - {{657, 857}, {231, 173}} + {{790, 533}, {231, 173}} com.apple.InterfaceBuilder.CocoaPlugin {{499, 623}, {234, 113}} @@ -2400,7 +2425,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{431, 807}, {259, 223}} + {{533, 513}, {259, 223}} com.apple.InterfaceBuilder.CocoaPlugin {{309, 536}, {262, 203}} @@ -2422,7 +2447,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{480, 787}, {196, 243}} + {{582, 493}, {196, 243}} com.apple.InterfaceBuilder.CocoaPlugin {{358, 536}, {199, 203}} @@ -2452,6 +2477,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + @@ -2470,7 +2497,7 @@ - 963 + 968 @@ -2499,6 +2526,45 @@ id + + YES + + YES + installCliTool: + openPreferencesWindow: + saveAction: + showAboutPanel: + showCloneRepository: + showHelp: + + + YES + + installCliTool: + id + + + openPreferencesWindow: + id + + + saveAction: + id + + + showAboutPanel: + id + + + showCloneRepository: + id + + + showHelp: + id + + + YES @@ -2512,6 +2578,25 @@ NSWindow + + YES + + YES + firstResponder + window + + + YES + + firstResponder + id + + + window + NSWindow + + + IBProjectSource ApplicationController.h @@ -2532,6 +2617,7 @@ YES YES + copySHA: setDetailedView: setRawView: setTreeView: @@ -2541,6 +2627,36 @@ id id id + id + + + + YES + + YES + copySHA: + setDetailedView: + setRawView: + setTreeView: + + + YES + + copySHA: + id + + + setDetailedView: + id + + + setRawView: + id + + + setTreeView: + id + @@ -2549,10 +2665,10 @@ - NSObject + NSApplication IBProjectSource - BMScript.h + NSApplication+GitXScripting.h @@ -2578,16 +2694,47 @@ YES controller + searchController webController webView YES PBGitHistoryController + PBHistorySearchController PBWebHistoryController WebView + + YES + + YES + controller + searchController + webController + webView + + + YES + + controller + PBGitHistoryController + + + searchController + PBHistorySearchController + + + webController + PBWebHistoryController + + + webView + WebView + + + IBProjectSource PBCommitList.h @@ -2609,6 +2756,25 @@ id + + YES + + YES + closeCreateBranchSheet: + createBranch: + + + YES + + closeCreateBranchSheet: + id + + + createBranch: + id + + + YES @@ -2624,6 +2790,30 @@ id + + YES + + YES + branchNameField + errorMessageField + startRefish + + + YES + + branchNameField + NSTextField + + + errorMessageField + NSTextField + + + startRefish + id + + + IBProjectSource PBCreateBranchSheet.h @@ -2645,6 +2835,25 @@ id + + YES + + YES + closeCreateTagSheet: + createTag: + + + YES + + closeCreateTagSheet: + id + + + createTag: + id + + + YES @@ -2662,6 +2871,35 @@ id + + YES + + YES + errorMessageField + tagMessageText + tagNameField + targetRefish + + + YES + + errorMessageField + NSTextField + + + tagMessageText + NSTextView + + + tagNameField + NSTextField + + + targetRefish + id + + + IBProjectSource PBCreateTagSheet.h @@ -2685,6 +2923,30 @@ id + + YES + + YES + commit: + refresh: + signOff: + + + YES + + commit: + id + + + refresh: + id + + + signOff: + id + + + YES @@ -2706,6 +2968,45 @@ PBWebChangesController + + YES + + YES + cachedFilesController + commitButton + commitMessageView + indexController + unstagedFilesController + webController + + + YES + + cachedFilesController + NSArrayController + + + commitButton + NSButton + + + commitMessageView + NSTextView + + + indexController + PBGitIndexController + + + unstagedFilesController + NSArrayController + + + webController + PBWebChangesController + + + IBProjectSource PBGitCommitController.h @@ -2729,7 +3030,6 @@ cherryPick: createBranch: createTag: - fetchPullPushAction: merge: openFilesAction: openSelectedFile: @@ -2760,7 +3060,90 @@ id id id - id + + + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openFilesAction: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + showCommitsFromTree: + id + + + showInFinderAction: + id + + + toggleQLPreviewPanel: + id + @@ -2777,12 +3160,13 @@ mergeButton rebaseButton refController - remoteControls scopeBarView + searchController searchField selectedBranchFilterItem treeController upperToolbarView + webHistoryController webView @@ -2797,15 +3181,115 @@ NSButton NSButton PBRefController - NSSegmentedControl PBGitGradientBarView + PBHistorySearchController NSSearchField NSButton NSTreeController PBGitGradientBarView + PBWebHistoryController id + + YES + + YES + allBranchesFilterItem + cherryPickButton + commitController + commitList + fileBrowser + historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView + searchController + searchField + selectedBranchFilterItem + treeController + upperToolbarView + webHistoryController + webView + + + YES + + allBranchesFilterItem + NSButton + + + cherryPickButton + NSButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + fileBrowser + NSOutlineView + + + 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 @@ -2827,6 +3311,25 @@ NSTableView + + YES + + YES + rowClicked: + tableClicked: + + + YES + + rowClicked: + NSCell + + + tableClicked: + NSTableView + + + YES @@ -2846,6 +3349,40 @@ NSTableView + + YES + + YES + commitController + stagedFilesController + stagedTable + unstagedFilesController + unstagedTable + + + YES + + commitController + PBGitCommitController + + + stagedFilesController + NSArrayController + + + stagedTable + NSTableView + + + unstagedFilesController + NSArrayController + + + unstagedTable + NSTableView + + + IBProjectSource PBGitIndexController.h @@ -2875,6 +3412,45 @@ id + + YES + + YES + cloneTo: + openInTerminal: + refresh: + revealInFinder: + showCommitView: + showHistoryView: + + + YES + + cloneTo: + id + + + openInTerminal: + id + + + refresh: + id + + + revealInFinder: + id + + + showCommitView: + id + + + showHistoryView: + id + + + YES @@ -2900,6 +3476,55 @@ NSToolbarItem + + YES + + YES + contentSplitView + finderItem + progressIndicator + sourceListControlsView + sourceSplitView + splitView + statusField + terminalItem + + + YES + + contentSplitView + NSView + + + finderItem + NSToolbarItem + + + progressIndicator + NSProgressIndicator + + + sourceListControlsView + NSView + + + sourceSplitView + NSView + + + splitView + NSSplitView + + + statusField + NSTextField + + + terminalItem + NSToolbarItem + + + IBProjectSource PBGitWindowController.h @@ -2927,6 +3552,40 @@ id + + YES + + YES + openSelectedFile: + setDetailedView: + setRawView: + setTreeView: + toggleQuickView: + + + YES + + openSelectedFile: + id + + + setDetailedView: + id + + + setRawView: + id + + + setTreeView: + id + + + toggleQuickView: + id + + + YES @@ -2944,11 +3603,112 @@ NSTreeController + + YES + + YES + commitController + commitList + fileBrowser + treeController + + + YES + + commitController + NSArrayController + + + commitList + NSTableView + + + fileBrowser + NSOutlineView + + + treeController + NSTreeController + + + IBUserSource + + PBHistorySearchController + NSObject + + stepperPressed: + id + + + stepperPressed: + + stepperPressed: + id + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + NSArrayController + PBGitHistoryController + NSTextField + NSSearchField + NSSegmentedControl + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + + commitController + NSArrayController + + + historyController + PBGitHistoryController + + + numberOfMatchesField + NSTextField + + + searchField + NSSearchField + + + stepper + NSSegmentedControl + + + + + IBProjectSource + PBHistorySearchController.h + + PBNiceSplitView NSSplitView @@ -2999,6 +3759,90 @@ PBRefMenuItem + + YES + + YES + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + diffWithHEAD: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseHeadBranch: + showTagInfoSheet: + + + YES + + checkout: + PBRefMenuItem + + + cherryPick: + PBRefMenuItem + + + copyPatch: + PBRefMenuItem + + + copySHA: + PBRefMenuItem + + + createBranch: + PBRefMenuItem + + + createTag: + PBRefMenuItem + + + diffWithHEAD: + PBRefMenuItem + + + fetchRemote: + PBRefMenuItem + + + merge: + PBRefMenuItem + + + pullRemote: + PBRefMenuItem + + + pushDefaultRemoteForRef: + PBRefMenuItem + + + pushToRemote: + PBRefMenuItem + + + pushUpdatesToRemote: + PBRefMenuItem + + + rebaseHeadBranch: + PBRefMenuItem + + + showTagInfoSheet: + PBRefMenuItem + + + YES @@ -3016,6 +3860,35 @@ PBGitHistoryController + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + + branchPopUp + NSPopUpButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + historyController + PBGitHistoryController + + + IBProjectSource PBRefController.h @@ -3028,6 +3901,13 @@ refish id + + refish + + refish + id + + IBProjectSource PBRefMenuItem.h @@ -3036,34 +3916,6 @@ PBRepositoryDocumentController NSDocumentController - - YES - - YES - cloneURL: - hideClone: - showClone: - - - YES - id - id - id - - - - YES - - YES - cloneURLField - cloneWindow - - - YES - NSTextField - NSWindow - - IBProjectSource PBRepositoryDocumentController.h @@ -3084,6 +3936,13 @@ refresh: id + + refresh: + + refresh: + id + + IBProjectSource PBViewController.h @@ -3109,6 +3968,35 @@ NSArrayController + + YES + + YES + cachedFilesController + controller + indexController + unstagedFilesController + + + YES + + cachedFilesController + NSArrayController + + + controller + PBGitCommitController + + + indexController + PBGitIndexController + + + unstagedFilesController + NSArrayController + + + IBProjectSource PBWebChangesController.h @@ -3130,6 +4018,25 @@ WebView + + YES + + YES + repository + view + + + YES + + repository + id + + + view + WebView + + + IBProjectSource PBWebController.h @@ -3151,6 +4058,25 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + IBProjectSource PBWebHistoryController.h @@ -3173,10 +4099,24 @@ checkForUpdates: id + + checkForUpdates: + + checkForUpdates: + id + + delegate id + + delegate + + delegate + id + + @@ -3297,6 +4237,45 @@ id + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + IBFrameworkSource AppKit.framework/Headers/NSDocument.h @@ -3329,6 +4308,35 @@ id + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + + clearRecentDocuments: + id + + + newDocument: + id + + + openDocument: + id + + + saveAllDocuments: + id + + + IBFrameworkSource AppKit.framework/Headers/NSDocumentController.h @@ -3630,49 +4638,28 @@ NSObject IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h + QuartzCore.framework/Headers/CAAnimation.h NSObject IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h + QuartzCore.framework/Headers/CALayer.h NSObject IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h + QuartzCore.framework/Headers/CIImageProvider.h NSObject IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h + ScriptingBridge.framework/Headers/SBApplication.h @@ -3907,6 +4894,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h @@ -3941,68 +4935,18 @@ showWindow: id + + showWindow: + + showWindow: + id + + IBFrameworkSource AppKit.framework/Headers/NSWindowController.h - - PDFView - NSView - - YES - - YES - goBack: - goForward: - goToFirstPage: - goToLastPage: - goToNextPage: - goToPreviousPage: - selectAll: - takeBackgroundColorFrom: - zoomIn: - zoomOut: - - - YES - id - id - id - id - id - id - id - id - id - id - - - - - - QCView - NSView - - YES - - YES - play: - start: - stop: - - - YES - id - id - id - - - - IBFrameworkSource - QuartzComposer.framework/Headers/QCView.h - - SUUpdater NSObject @@ -4010,10 +4954,24 @@ checkForUpdates: id + + checkForUpdates: + + checkForUpdates: + id + + delegate id + + delegate + + delegate + id + + @@ -4050,6 +5008,70 @@ id + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + IBFrameworkSource WebKit.framework/Headers/WebView.h @@ -4058,6 +5080,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -4073,5 +5096,18 @@ YES ../GitX.xcodeproj 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + diff --git a/English.lproj/PBRemoteProgressSheet.xib b/English.lproj/PBRemoteProgressSheet.xib index ca616cf..bf780a8 100644 --- a/English.lproj/PBRemoteProgressSheet.xib +++ b/English.lproj/PBRemoteProgressSheet.xib @@ -2,13 +2,13 @@ 1050 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 788 + 1038.29 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 788 YES @@ -41,12 +41,12 @@ 1 2 - {{196, 408}, {397, 102}} + {{196, 417}, {397, 93}} 544736256 Window NSWindow - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 274 @@ -56,7 +56,7 @@ 1314 - {{23, 24}, {351, 20}} + {{18, 16}, {361, 20}} 16394 100 @@ -64,7 +64,7 @@ 274 - {{17, 52}, {363, 30}} + {{17, 56}, {363, 17}} YES @@ -83,7 +83,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -98,11 +98,11 @@ - {397, 102} + {397, 93} {{0, 0}, {1680, 1028}} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -220,9 +220,9 @@ YES - {{814, 826}, {397, 102}} + {{814, 835}, {397, 93}} com.apple.InterfaceBuilder.CocoaPlugin - {{814, 826}, {397, 102}} + {{814, 835}, {397, 93}} {196, 240} {{202, 428}, {480, 270}} @@ -271,6 +271,25 @@ NSProgressIndicator + + YES + + YES + progressDescription + progressIndicator + + + YES + + progressDescription + NSTextField + + + progressIndicator + NSProgressIndicator + + + IBProjectSource PBRemoteProgressSheet.h @@ -833,6 +852,13 @@ showWindow: id + + showWindow: + + showWindow: + id + + IBFrameworkSource AppKit.framework/Headers/NSWindowController.h @@ -841,6 +867,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index 9dc0002..e90280b 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -3,19 +3,18 @@ 1050 10C540 - 740 + 759 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 759 YES - + - YES @@ -46,56 +45,24 @@ 268 YES - + 268 - {{294, 160}, {38, 17}} + {{248, 100}, {41, 22}} YES - - 68288064 + + -1804468671 272630784 - chars + LucidaGrande 13 1044 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2ODY1AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{248, 158}, {41, 22}} - - YES - - -1804468671 - 272630784 - - - + YES - + 6 System textBackgroundColor @@ -104,122 +71,21 @@ MQA - + 6 System textColor - + + 3 + MAA + - - - 268 - {{121, 160}, {122, 17}} - - YES - - 68288064 - 71304192 - Truncate to: - - - - - - - - - 268 - {{18, 185}, {273, 18}} - - YES - - -2080244224 - 0 - Truncate large info sheet messages - - - 1211912703 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - - - - 268 - {{18, 210}, {144, 18}} - - YES - - -2080244224 - 0 - Show relative dates - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{18, 235}, {233, 18}} - - YES - - -2080244224 - 0 - Auto refresh on application focus - - - 1211912703 - 2 - - - - - 200 - 25 - - - - - 268 - {{248, 101}, {41, 22}} - - YES - - -1804468671 - 272630784 - - - - YES - - - - 268 - {{121, 103}, {122, 17}} + {{121, 102}, {122, 17}} YES @@ -228,14 +94,27 @@ Display at column: - - + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 268 - {{18, 130}, {273, 18}} + {{18, 125}, {273, 18}} YES @@ -246,8 +125,13 @@ 1211912703 2 - - + + NSImage + NSSwitch + + + NSSwitch + 200 @@ -344,7 +228,7 @@ 268 - {{18, 261}, {203, 18}} + {{18, 150}, {203, 18}} YES @@ -355,7 +239,7 @@ 1211912703 2 - + @@ -366,7 +250,7 @@ 268 - {{18, 286}, {279, 18}} + {{18, 175}, {279, 18}} YES @@ -377,7 +261,7 @@ 1211912703 2 - + @@ -388,7 +272,7 @@ 268 - {{18, 311}, {207, 18}} + {{18, 200}, {207, 18}} YES @@ -399,7 +283,7 @@ 1211912703 2 - + @@ -408,7 +292,7 @@ - {378, 347} + {400, 236} NSView @@ -422,6 +306,7 @@ 268 {{39, 45}, {82, 14}} + YES 68288064 @@ -438,6 +323,7 @@ 268 {{18, 103}, {260, 18}} + YES -2080244224 @@ -447,7 +333,7 @@ 1211912703 2 - + @@ -460,6 +346,7 @@ 268 {{130, 78}, {102, 22}} + YES -2076049856 @@ -547,6 +434,7 @@ 268 {{39, 80}, {89, 17}} + YES 68288064 @@ -563,6 +451,7 @@ 268 {{130, 45}, {251, 14}} + YES 68288064 @@ -587,7 +476,7 @@ - EEEE, d. MMMM yyyy HH:mm:ss + EEEE, MMMM d, yyyy h:mm:ss a NO @@ -600,6 +489,7 @@ 268 {{128, 13}, {96, 28}} + YES 67239424 @@ -616,8 +506,9 @@ - {378, 139} + {400, 139} + NSView @@ -639,7 +530,7 @@ 1211912703 2 - + @@ -656,6 +547,11 @@ SUUpdater + + YES + PBCommitMessageViewHasVerticalLine + PBCommitMessageViewVerticalLineLength + YES @@ -677,7 +573,7 @@ 1211912703 2 - + @@ -699,7 +595,7 @@ 1211912703 2 - + @@ -721,7 +617,7 @@ 1211912703 2 - + @@ -743,7 +639,7 @@ 1211912703 2 - + @@ -752,7 +648,7 @@ - {378, 116} + {400, 116} NSView @@ -1075,6 +971,22 @@ 113 + + + value: values.PBShowWhitespaceDifferences + + + + + + value: values.PBShowWhitespaceDifferences + value + values.PBShowWhitespaceDifferences + 2 + + + 117 + value: values.PBShowOpenPanelOnLaunch @@ -1139,94 +1051,6 @@ 135 - - - value: values.PBShowWhitespaceDifferences - - - - - - value: values.PBShowWhitespaceDifferences - value - values.PBShowWhitespaceDifferences - - NSValidatesImmediately - - - 2 - - - 136 - - - - value: values.PBRefreshAutomatically - - - - - - value: values.PBRefreshAutomatically - value - values.PBRefreshAutomatically - 2 - - - 143 - - - - value: values.PBShowRelativeDates - - - - - - value: values.PBShowRelativeDates - value - values.PBShowRelativeDates - 2 - - - 147 - - - - value: values.PBTruncateInfoText - - - - - - value: values.PBTruncateInfoText - value - values.PBTruncateInfoText - 2 - - - 156 - - - - value: values.PBTruncateInfoTextSize - - - - - - value: values.PBTruncateInfoTextSize - value - values.PBTruncateInfoTextSize - - NSValidatesImmediately - - - 2 - - - 158 - @@ -1261,21 +1085,15 @@ YES + + + + - - - - - - - - - - General @@ -1667,90 +1485,6 @@ - - 137 - - - YES - - - - - - 138 - - - - - 144 - - - YES - - - - - - 145 - - - - - 148 - - - YES - - - - - - 149 - - - YES - - - - - - 150 - - - YES - - - - - - 151 - - - - - 152 - - - - - 153 - - - - - 159 - - - YES - - - - - - 160 - - - @@ -1781,22 +1515,10 @@ 13.IBPluginDependency 130.IBPluginDependency 131.IBPluginDependency - 137.IBPluginDependency - 138.IBPluginDependency 14.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 148.IBPluginDependency - 149.IBPluginDependency 15.IBEditorWindowLastContentRect 15.IBPluginDependency - 150.IBPluginDependency - 151.IBPluginDependency - 152.IBPluginDependency - 153.IBPluginDependency - 159.IBPluginDependency 16.IBPluginDependency - 160.IBPluginDependency 17.IBPluginDependency 18.IBPluginDependency 19.IBPluginDependency @@ -1836,25 +1558,15 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{610, 627}, {378, 347}} + {{845, 648}, {400, 236}} com.apple.InterfaceBuilder.CocoaPlugin YES - 20 + 121 0 - - - 358 - 0 - - - - 26 - 1 - {628, 654} {{217, 442}, {480, 272}} @@ -1877,12 +1589,6 @@ 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 {{443, 712}, {103, 71}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1896,13 +1602,7 @@ 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 - {{610, 741}, {378, 139}} + {{324, 683}, {400, 139}} com.apple.InterfaceBuilder.CocoaPlugin YES @@ -1925,7 +1625,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{610, 763}, {378, 116}} + {{474, 352}, {400, 116}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1952,7 +1652,7 @@ - 160 + 135 @@ -1965,13 +1665,6 @@ DBPrefsWindowController.h - - NSObject - - IBProjectSource - BMScript.h - - PBPrefsWindowController DBPrefsWindowController @@ -2432,55 +2125,6 @@ Foundation.framework/Headers/NSURLDownload.h - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - NSObject @@ -2709,6 +2353,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -2724,5 +2369,9 @@ YES ../GitX.xcodeproj 3 + + NSStopProgressFreestandingTemplate + {83, 83} + diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 969e6dc..fd8c769 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -3,16 +3,16 @@ 1050 10C540 - 740 + 759 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 759 YES - + YES @@ -97,9 +97,11 @@ Clone Repository To - + 268 {{38, 14}, {40, 25}} + + YES -2080244224 @@ -142,9 +144,11 @@ Refresh - + 268 {{8, 14}, {32, 25}} + + YES -2080244224 @@ -304,7 +308,7 @@ YES - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {600, 450} @@ -380,7 +384,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -405,7 +409,7 @@ {{0, 0}, {1440, 878}} {600, 528} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} GitX 31 @@ -763,9 +767,9 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{486, 348}, {890, 514}} + {{210, 655}, {890, 514}} com.apple.InterfaceBuilder.CocoaPlugin - {{486, 348}, {890, 514}} + {{210, 655}, {890, 514}} {{15, 196}, {850, 418}} @@ -816,13 +820,6 @@ YES - - NSObject - - IBProjectSource - BMScript.h - - PBGitWindowController NSWindowController @@ -1231,55 +1228,6 @@ Foundation.framework/Headers/NSURLDownload.h - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - NSObject @@ -1487,6 +1435,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -1502,5 +1451,18 @@ YES ../GitX.xcodeproj 3 + + YES + + YES + CloneRepositoryTemplate + NSRefreshTemplate + + + YES + {26, 15} + {10, 12} + + diff --git a/GLFileView.h b/GLFileView.h new file mode 100644 index 0000000..79b3707 --- /dev/null +++ b/GLFileView.h @@ -0,0 +1,34 @@ +// +// GLFileView.h +// GitX +// +// Created by German Laullon on 14/09/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBWebController.h" +#import "MGScopeBarDelegateProtocol.h" +#import "PBGitCommit.h" +#import "PBGitHistoryController.h" +#import "PBRefContextDelegate.h" + +@class PBGitGradientBarView; + +@interface GLFileView : PBWebController { + IBOutlet PBGitHistoryController* historyController; + IBOutlet MGScopeBar *typeBar; + NSMutableArray *groups; + NSString *logFormat; + IBOutlet NSView *accessoryView; +} + +- (void)showFile; +- (void)didLoad; +- (NSString *)parseBlame:(NSString *)txt; +- (NSString *)parseHTML:(NSString *)txt; + +@property(retain) NSMutableArray *groups; +@property(retain) NSString *logFormat; + +@end diff --git a/GLFileView.m b/GLFileView.m new file mode 100644 index 0000000..90b05ec --- /dev/null +++ b/GLFileView.m @@ -0,0 +1,240 @@ +// +// GLFileView.m +// GitX +// +// Created by German Laullon on 14/09/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import "GLFileView.h" +#import "PBGitGradientBarView.h" + +#define GROUP_LABEL @"Label" // string +#define GROUP_SEPARATOR @"HasSeparator" // BOOL as NSNumber +#define GROUP_SELECTION_MODE @"SelectionMode" // MGScopeBarGroupSelectionMode (int) as NSNumber +#define GROUP_ITEMS @"Items" // array of dictionaries, each containing the following keys: +#define ITEM_IDENTIFIER @"Identifier" // string +#define ITEM_NAME @"Name" // string + +@implementation GLFileView + +- (void) awakeFromNib +{ + NSString *formatFile = [[NSBundle mainBundle] pathForResource:@"format" ofType:@"html" inDirectory:@"html/views/log"]; + if(formatFile!=nil) + logFormat=[NSString stringWithContentsOfURL:[NSURL fileURLWithPath:formatFile] encoding:NSUTF8StringEncoding error:nil]; + + + startFile = @"fileview"; + //repository = historyController.repository; + [super awakeFromNib]; + [historyController.treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeController"]; + + self.groups = [NSMutableArray arrayWithCapacity:0]; + + NSArray *items = [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + startFile, ITEM_IDENTIFIER, + @"Source", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"blame", ITEM_IDENTIFIER, + @"Blame", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"log", ITEM_IDENTIFIER, + @"History", ITEM_NAME, + nil], + nil]; + [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:NO], GROUP_SEPARATOR, + [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. + items, GROUP_ITEMS, + nil]]; + [typeBar reloadData]; +} + +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + //NSLog(@"keyPath=%@ change=%@ context=%@ object=%@ \n %@",keyPath,change,context,object,[historyController.treeController selectedObjects]); + [self showFile]; +} + +- (void) showFile +{ + NSArray *files=[historyController.treeController selectedObjects]; + if ([files count]>0) { + PBGitTree *file=[files objectAtIndex:0]; + + NSString *fileTxt=@""; + if(startFile==@"fileview") + fileTxt=[self parseHTML:[file textContents]]; + else if(startFile==@"blame") + fileTxt=[self parseBlame:[file blame]]; + else if(startFile==@"log") + fileTxt=[file log:logFormat]; + + id script = [view windowScriptObject]; + [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]]; + } + +#ifdef DEBUG + NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML]; + NSString *tmpFile=@"~/tmp/test.html"; + [dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil]; +#endif +} + +#pragma mark JavaScript log.js methods + +- (void) selectCommit:(NSString*)c +{ + [historyController selectCommit:[PBGitSHA shaWithString:c]]; +} + +#pragma mark MGScopeBarDelegate methods + +- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar +{ + return [self.groups count]; +} + + +- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber +{ + return [[self.groups objectAtIndex:groupNumber] valueForKeyPath:[NSString stringWithFormat:@"%@.%@", GROUP_ITEMS, ITEM_IDENTIFIER]]; +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber +{ + return [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_LABEL]; // might be nil, which is fine (nil means no label). +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber +{ + NSArray *items = [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_ITEMS]; + if (items) { + for (NSDictionary *item in items) { + if ([[item objectForKey:ITEM_IDENTIFIER] isEqualToString:identifier]) { + return [item objectForKey:ITEM_NAME]; + break; + } + } + } + return nil; +} + + +- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber +{ + return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SELECTION_MODE] intValue]; +} + +- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber +{ + startFile=identifier; + NSString *path = [NSString stringWithFormat:@"html/views/%@", identifier]; + NSString *html = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; + NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:html]]; + [[view mainFrame] loadRequest:request]; +} + +- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar +{ + return accessoryView; +} + +- (void) didLoad +{ + [self showFile]; +} + +- (NSString *) parseHTML:(NSString *)txt +{ + txt=[txt stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; + txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; + txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@">"]; + + return txt; +} + +- (NSString *) parseBlame:(NSString *)txt +{ + txt=[self 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){ + 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={0,30}; + NSString *truncate_a=author; + if([author length]>30){ + 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",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; +} + +@synthesize groups; +@synthesize logFormat; + +@end diff --git a/GitX.h b/GitX.h new file mode 100644 index 0000000..9f7ff4e --- /dev/null +++ b/GitX.h @@ -0,0 +1,89 @@ +/* + * GitX.h + */ + +#import +#import + + +@class GitXApplication, GitXDocument, GitXWindow; + + + +/* + * Standard Suite + */ + +// The application's top-level scripting object. +@interface GitXApplication : SBApplication + +- (SBElementArray *) documents; +- (SBElementArray *) windows; + +@property (copy, readonly) NSString *name; // The name of the application. +@property (readonly) BOOL frontmost; // Is this the active application? +@property (copy, readonly) NSString *version; // The version number of the application. + +- (void) open:(NSArray *)x; // Open a document. +- (void) quit; // Quit the application. +- (BOOL) exists:(id)x; // Verify that an object exists. +- (void) showDiff:(NSString *)x; // Show the supplied diff output in a GitX window. +- (void) initRepository:(NSURL *)x; // Create a git repository at the given filesystem URL. +- (void) cloneRepository:(NSString *)x to:(NSURL *)to isBare:(BOOL)isBare; // Clone a repository. + +@end + +// A document. +@interface GitXDocument : SBObject + +@property (copy, readonly) NSString *name; // Its name. +@property (copy, readonly) NSURL *file; // Its location on disk, if it has one. + +- (void) close; // Close a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. +- (void) moveTo:(SBObject *)to; // Move an object to a new location. +- (void) searchString:(NSString *)string inMode:(NSInteger)inMode; // Highlight commits that match the given search string. + +@end + +// A window. +@interface GitXWindow : SBObject + +@property (copy, readonly) NSString *name; // The title of the window. +- (NSInteger) id; // The unique identifier of the window. +@property NSInteger index; // The index of the window, ordered front to back. +@property NSRect bounds; // The bounding rectangle of the window. +@property (readonly) BOOL closeable; // Does the window have a close button? +@property (readonly) BOOL miniaturizable; // Does the window have a minimize button? +@property BOOL miniaturized; // Is the window minimized right now? +@property (readonly) BOOL resizable; // Can the window be resized? +@property BOOL visible; // Is the window visible right now? +@property (readonly) BOOL zoomable; // Does the window have a zoom button? +@property BOOL zoomed; // Is the window zoomed right now? +@property (copy, readonly) GitXDocument *document; // The document whose contents are displayed in the window. + +- (void) close; // Close a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. +- (void) moveTo:(SBObject *)to; // Move an object to a new location. +- (void) searchString:(NSString *)string inMode:(NSInteger)inMode; // Highlight commits that match the given search string. + +@end + + + +/* + * GitX Suite + */ + +// The GitX application. +@interface GitXApplication (GitXSuite) + +@end + +// A document. +@interface GitXDocument (GitXSuite) + +@end + diff --git a/GitX.sdef b/GitX.sdef new file mode 100644 index 0000000..445b9f0 --- /dev/null +++ b/GitX.sdef @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index db203f4..65ea4fa 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -21,132 +21,40 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */; }; + 02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */; }; 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; }; - 315CB97B11C3305F003B8DBE /* FileViewerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 315CB97A11C3305F003B8DBE /* FileViewerController.m */; }; - 315CB9B011C339DA003B8DBE /* FileViewer.xib in Resources */ = {isa = PBXBuildFile; fileRef = 315CB9AF11C339DA003B8DBE /* FileViewer.xib */; }; - 31A520AC11C6983900F604D0 /* test.html in Resources */ = {isa = PBXBuildFile; fileRef = 31A520AB11C6983900F604D0 /* test.html */; }; - 31D70AFB11C4006C00F4B199 /* MGRecessedPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31D70AF111C4006C00F4B199 /* MGRecessedPopUpButtonCell.m */; }; - 31D70AFC11C4006C00F4B199 /* MGScopeBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 31D70AF311C4006C00F4B199 /* MGScopeBar.m */; }; - 31D70AFD11C4006C00F4B199 /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31D70AF911C4006C00F4B199 /* ReadMe.txt */; }; - 31D70AFE11C4006C00F4B199 /* Source Code License.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 31D70AFA11C4006C00F4B199 /* Source Code License.rtf */; }; - 31DA63D811C6D7CD00BCBCAD /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 31DA63D711C6D7CD00BCBCAD /* index.html */; }; - 31DA63DA11C6D7F700BCBCAD /* log.js in Sources */ = {isa = PBXBuildFile; fileRef = 31DA63D911C6D7F700BCBCAD /* log.js */; }; - 31DA63DF11C6DA5800BCBCAD /* format.html in Resources */ = {isa = PBXBuildFile; fileRef = 31DA63DE11C6DA5800BCBCAD /* format.html */; }; + 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 310DC1D71240599E0017A0F7 /* GLFileView.m */; }; + 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */; }; + 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA9124185BA00B90AED /* MGScopeBar.m */; }; + 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31460CAF124185BA00B90AED /* ReadMe.txt */; }; + 31460CD5124185BA00B90AED /* Source Code License.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB0124185BA00B90AED /* Source Code License.rtf */; }; + 31460CD6124185BA00B90AED /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB1124185BA00B90AED /* TODO */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; 47DBDB580E94EDE700671A1E /* DBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDB570E94EDE700671A1E /* DBPrefsWindowController.m */; }; 47DBDB670E94EE8B00671A1E /* PBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDB660E94EE8B00671A1E /* PBPrefsWindowController.m */; }; + 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDB680E94EF6500671A1E /* Preferences.xib */; }; 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDBB00E94F6CA00671A1E /* Updates.png */; }; 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 */; }; - 6501ABC1115C064A00171062 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 6501ABC0115C064A00171062 /* Release.xcconfig */; }; - 650A6BAA115F5DBE00F2E2B9 /* BMScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 650A6BA9115F5DBE00F2E2B9 /* BMScript.m */; }; - 65241C96116984F800D49143 /* PBCommitList.m in Sources */ = {isa = PBXBuildFile; fileRef = 65241C95116984F800D49143 /* PBCommitList.m */; }; - 653D930A109BEAFE00B26705 /* PBGitXErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 653D9309109BEAFE00B26705 /* PBGitXErrors.m */; }; - 654D16E8108C6CA6008D960C /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; - 654FEFA0115A2684004C8721 /* NSString_Truncate.m in Sources */ = {isa = PBXBuildFile; fileRef = 654FEF9F115A2684004C8721 /* NSString_Truncate.m */; }; - 6552BA27109C4CA8003B4892 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDB690E94EF6500671A1E /* Preferences.xib */; }; - 65604690115BF80F0021E246 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 6560468F115BF80F0021E246 /* Debug.xcconfig */; }; - 656F3B0B115C042D00CA816E /* Common.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 656F3B0A115C042D00CA816E /* Common.xcconfig */; }; - 659E57A2115C80D300786570 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; }; - 659E57D3115C819B00786570 /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; - 65C77FA0108BF560003BD3B5 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65C77F9F108BF560003BD3B5 /* Quartz.framework */; }; - 65F3544011599F3100235D5B /* AddRemoteBranchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 65A102F110A7D9FE0033C593 /* AddRemoteBranchTemplate.png */; }; - 65F3555B1159A95700235D5B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F3555A1159A95700235D5B /* MainMenu.xib */; }; - 65F3555D1159A96600235D5B /* RepositoryWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F3555C1159A96600235D5B /* RepositoryWindow.xib */; }; 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 */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 911111E20E58BD5A00BF76B4 /* RepositoryWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 911111E00E58BD5A00BF76B4 /* RepositoryWindow.xib */; }; 911111F80E594F3F00BF76B4 /* PBRepositoryDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = 911111F70E594F3F00BF76B4 /* PBRepositoryDocumentController.m */; }; 911112370E5A097800BF76B4 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 911112360E5A097800BF76B4 /* Security.framework */; }; 913D5E4D0E55644E00CECEA2 /* gitx.m in Sources */ = {isa = PBXBuildFile; fileRef = 913D5E440E55640C00CECEA2 /* gitx.m */; }; 913D5E500E55645900CECEA2 /* gitx in Resources */ = {isa = PBXBuildFile; fileRef = 913D5E490E55644600CECEA2 /* gitx */; }; - 913D5E5F0E556A9300CECEA2 /* PBCLIProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */; }; 91B103CC0E898EC300C84364 /* PBIconAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 91B103CB0E898EC300C84364 /* PBIconAndTextCell.m */; }; 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; - C3138BE611C2F48400BE6CBE /* blame.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138B8D11C2F48400BE6CBE /* blame.css */; }; - C3138BE711C2F48400BE6CBE /* blame.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138B8E11C2F48400BE6CBE /* blame.js */; }; - C3138BE811C2F48400BE6CBE /* index copy.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B8F11C2F48400BE6CBE /* index copy.html */; }; - C3138BE911C2F48400BE6CBE /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9011C2F48400BE6CBE /* index.html */; }; - C3138BEA11C2F48400BE6CBE /* commit.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9211C2F48400BE6CBE /* commit.css */; }; - C3138BEB11C2F48400BE6CBE /* commit.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138B9311C2F48400BE6CBE /* commit.js */; }; - C3138BEC11C2F48400BE6CBE /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9411C2F48400BE6CBE /* index.html */; }; - C3138BED11C2F48400BE6CBE /* multipleSelection.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138B9511C2F48400BE6CBE /* multipleSelection.js */; }; - C3138BEE11C2F48400BE6CBE /* diffWindow.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9711C2F48400BE6CBE /* diffWindow.css */; }; - C3138BEF11C2F48400BE6CBE /* diffWindow.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138B9811C2F48400BE6CBE /* diffWindow.js */; }; - C3138BF011C2F48400BE6CBE /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9911C2F48400BE6CBE /* index.html */; }; - C3138BF111C2F48400BE6CBE /* history.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9B11C2F48400BE6CBE /* history.css */; }; - C3138BF211C2F48400BE6CBE /* history.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138B9C11C2F48400BE6CBE /* history.js */; }; - C3138BF311C2F48400BE6CBE /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9D11C2F48400BE6CBE /* index.html */; }; - C3138BF411C2F48400BE6CBE /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138B9F11C2F48400BE6CBE /* index.html */; }; - C3138BF511C2F48400BE6CBE /* source.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BA011C2F48400BE6CBE /* source.css */; }; - C3138BF611C2F48400BE6CBE /* source.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BA111C2F48400BE6CBE /* source.js */; }; - C3138BF711C2F48400BE6CBE /* diffHighlighter.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BA311C2F48400BE6CBE /* diffHighlighter.js */; }; - C3138BF811C2F48400BE6CBE /* GitX.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BA411C2F48400BE6CBE /* GitX.js */; }; - C3138BF911C2F48400BE6CBE /* keyboardNavigation.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BA511C2F48400BE6CBE /* keyboardNavigation.js */; }; - C3138BFA11C2F48400BE6CBE /* md5.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BA611C2F48400BE6CBE /* md5.js */; }; - C3138BFB11C2F48400BE6CBE /* LGPLv3.txt in Resources */ = {isa = PBXBuildFile; fileRef = C3138BA811C2F48400BE6CBE /* LGPLv3.txt */; }; - C3138BFC11C2F48400BE6CBE /* clipboard.swf in Resources */ = {isa = PBXBuildFile; fileRef = C3138BAA11C2F48400BE6CBE /* clipboard.swf */; }; - C3138BFD11C2F48400BE6CBE /* shBrushAS3.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BAB11C2F48400BE6CBE /* shBrushAS3.js */; }; - C3138BFE11C2F48400BE6CBE /* shBrushBash.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BAC11C2F48400BE6CBE /* shBrushBash.js */; }; - C3138BFF11C2F48400BE6CBE /* shBrushColdFusion.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BAD11C2F48400BE6CBE /* shBrushColdFusion.js */; }; - C3138C0011C2F48400BE6CBE /* shBrushCpp.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BAE11C2F48400BE6CBE /* shBrushCpp.js */; }; - C3138C0111C2F48400BE6CBE /* shBrushCSharp.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BAF11C2F48400BE6CBE /* shBrushCSharp.js */; }; - C3138C0211C2F48400BE6CBE /* shBrushCss.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB011C2F48400BE6CBE /* shBrushCss.js */; }; - C3138C0311C2F48400BE6CBE /* shBrushDelphi.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB111C2F48400BE6CBE /* shBrushDelphi.js */; }; - C3138C0411C2F48400BE6CBE /* shBrushDiff.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB211C2F48400BE6CBE /* shBrushDiff.js */; }; - C3138C0511C2F48400BE6CBE /* shBrushErlang.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB311C2F48400BE6CBE /* shBrushErlang.js */; }; - C3138C0611C2F48400BE6CBE /* shBrushGroovy.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB411C2F48400BE6CBE /* shBrushGroovy.js */; }; - C3138C0711C2F48400BE6CBE /* shBrushJava.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB511C2F48400BE6CBE /* shBrushJava.js */; }; - C3138C0811C2F48400BE6CBE /* shBrushJavaFX.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB611C2F48400BE6CBE /* shBrushJavaFX.js */; }; - C3138C0911C2F48400BE6CBE /* shBrushJScript.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB711C2F48400BE6CBE /* shBrushJScript.js */; }; - C3138C0A11C2F48400BE6CBE /* shBrushObjC.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB811C2F48400BE6CBE /* shBrushObjC.js */; }; - C3138C0B11C2F48400BE6CBE /* shBrushPerl.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BB911C2F48400BE6CBE /* shBrushPerl.js */; }; - C3138C0C11C2F48400BE6CBE /* shBrushPhp.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBA11C2F48400BE6CBE /* shBrushPhp.js */; }; - C3138C0D11C2F48400BE6CBE /* shBrushPlain.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBB11C2F48400BE6CBE /* shBrushPlain.js */; }; - C3138C0E11C2F48400BE6CBE /* shBrushPowerShell.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBC11C2F48400BE6CBE /* shBrushPowerShell.js */; }; - C3138C0F11C2F48400BE6CBE /* shBrushPython.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBD11C2F48400BE6CBE /* shBrushPython.js */; }; - C3138C1011C2F48400BE6CBE /* shBrushRuby.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBE11C2F48400BE6CBE /* shBrushRuby.js */; }; - C3138C1111C2F48400BE6CBE /* shBrushScala.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BBF11C2F48400BE6CBE /* shBrushScala.js */; }; - C3138C1211C2F48400BE6CBE /* shBrushSql.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC011C2F48400BE6CBE /* shBrushSql.js */; }; - C3138C1311C2F48400BE6CBE /* shBrushVb.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC111C2F48400BE6CBE /* shBrushVb.js */; }; - C3138C1411C2F48400BE6CBE /* shBrushXml.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC211C2F48400BE6CBE /* shBrushXml.js */; }; - C3138C1511C2F48400BE6CBE /* shCore.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC311C2F48400BE6CBE /* shCore.js */; }; - C3138C1611C2F48400BE6CBE /* shLegacy.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC411C2F48400BE6CBE /* shLegacy.js */; }; - C3138C1711C2F48400BE6CBE /* shCore.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC611C2F48400BE6CBE /* shCore.js */; }; - C3138C1811C2F48400BE6CBE /* shLegacy.js in Sources */ = {isa = PBXBuildFile; fileRef = C3138BC711C2F48400BE6CBE /* shLegacy.js */; }; - C3138C1911C2F48400BE6CBE /* help.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BC911C2F48400BE6CBE /* help.png */; }; - C3138C1A11C2F48400BE6CBE /* magnifier.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCA11C2F48400BE6CBE /* magnifier.png */; }; - C3138C1B11C2F48400BE6CBE /* page_white_code.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCB11C2F48400BE6CBE /* page_white_code.png */; }; - C3138C1C11C2F48400BE6CBE /* page_white_copy.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCC11C2F48400BE6CBE /* page_white_copy.png */; }; - C3138C1D11C2F48400BE6CBE /* printer.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCD11C2F48400BE6CBE /* printer.png */; }; - C3138C1E11C2F48400BE6CBE /* shCore.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCE11C2F48400BE6CBE /* shCore.css */; }; - C3138C1F11C2F48400BE6CBE /* shThemeDefault.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BCF11C2F48400BE6CBE /* shThemeDefault.css */; }; - C3138C2011C2F48400BE6CBE /* shThemeDjango.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD011C2F48400BE6CBE /* shThemeDjango.css */; }; - C3138C2111C2F48400BE6CBE /* shThemeEclipse.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD111C2F48400BE6CBE /* shThemeEclipse.css */; }; - C3138C2211C2F48400BE6CBE /* shThemeEmacs.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD211C2F48400BE6CBE /* shThemeEmacs.css */; }; - C3138C2311C2F48400BE6CBE /* shThemeFadeToGrey.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD311C2F48400BE6CBE /* shThemeFadeToGrey.css */; }; - C3138C2411C2F48400BE6CBE /* shThemeMidnight.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD411C2F48400BE6CBE /* shThemeMidnight.css */; }; - C3138C2511C2F48400BE6CBE /* shThemeRDark.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD511C2F48400BE6CBE /* shThemeRDark.css */; }; - C3138C2611C2F48400BE6CBE /* test.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD611C2F48400BE6CBE /* test.html */; }; - C3138C2711C2F48400BE6CBE /* added.acorn in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD811C2F48400BE6CBE /* added.acorn */; }; - C3138C2811C2F48400BE6CBE /* added.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BD911C2F48400BE6CBE /* added.png */; }; - C3138C2911C2F48400BE6CBE /* modified.acorn in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDA11C2F48400BE6CBE /* modified.acorn */; }; - C3138C2A11C2F48400BE6CBE /* modified.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDB11C2F48400BE6CBE /* modified.png */; }; - C3138C2B11C2F48400BE6CBE /* removed.acorn in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDC11C2F48400BE6CBE /* removed.acorn */; }; - C3138C2C11C2F48400BE6CBE /* removed.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDD11C2F48400BE6CBE /* removed.png */; }; - C3138C2D11C2F48400BE6CBE /* renamed.acorn in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDE11C2F48400BE6CBE /* renamed.acorn */; }; - C3138C2E11C2F48400BE6CBE /* renamed.png in Resources */ = {isa = PBXBuildFile; fileRef = C3138BDF11C2F48400BE6CBE /* renamed.png */; }; - C3138C2F11C2F48400BE6CBE /* spinner.gif in Resources */ = {isa = PBXBuildFile; fileRef = C3138BE011C2F48400BE6CBE /* spinner.gif */; }; - C3138C3011C2F48400BE6CBE /* dragtest.html in Resources */ = {isa = PBXBuildFile; fileRef = C3138BE111C2F48400BE6CBE /* dragtest.html */; }; - C3138C3111C2F48400BE6CBE /* diff.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BE311C2F48400BE6CBE /* diff.css */; }; - C3138C3211C2F48400BE6CBE /* GitX.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BE411C2F48400BE6CBE /* GitX.css */; }; - C3138C3311C2F48400BE6CBE /* notification.css in Resources */ = {isa = PBXBuildFile; fileRef = C3138BE511C2F48400BE6CBE /* notification.css */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; + D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */; }; + D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */; }; D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */; }; D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083C43111F106800337480 /* PBAddRemoteSheet.m */; }; D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083C45111F136400337480 /* PBAddRemoteSheet.xib */; }; @@ -168,14 +76,23 @@ D858108411274D28007F254B /* RemoteBranch.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108111274D28007F254B /* RemoteBranch.png */; }; D858108511274D28007F254B /* Tag.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108211274D28007F254B /* Tag.png */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; + D87127011229A21C00012334 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D87127001229A21C00012334 /* QuartzCore.framework */; }; + D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D87129FF122B14EC00012334 /* GitXTextFieldCell.m */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; + D89E9B141218BA260097A90B /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */; }; D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */; }; D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */; }; D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD051134AD2900E92D51 /* MergeTemplate.png */; }; D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */; }; + D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */ = {isa = PBXBuildFile; fileRef = D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */; }; D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E105461157C18200FC28A4 /* PBQLTextView.m */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; + D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */; }; + D8F01C4B12182F19007F729F /* GitX.sdef in Resources */ = {isa = PBXBuildFile; fileRef = D8F01C4A12182F19007F729F /* GitX.sdef */; }; + D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */; }; + D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */ = {isa = PBXBuildFile; fileRef = D8F4AB7812298CE200D6D53C /* rewindImage.pdf */; }; + D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FBCF18115FA20C0098676A /* PBGitSHA.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; D8FDDA6B114335E8005647F6 /* PBGitSVFolderItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5F114335E8005647F6 /* PBGitSVFolderItem.m */; }; @@ -190,11 +107,14 @@ 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 */; }; F523CEB60ED3399200DDD714 /* PBGitIndexController.m in Sources */ = {isa = PBXBuildFile; fileRef = F523CEB50ED3399200DDD714 /* PBGitIndexController.m */; }; F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */; }; F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F52BCE060E84211300AA3741 /* PBGitHistoryController.m */; }; F53C4DF70E97FC630022AD59 /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; + F53C4DF80E97FCA70022AD59 /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; + F53C4DF90E97FCAD0022AD59 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; }; F53FF2050E7ABB5300389171 /* PBGitRevSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */; }; F56174570E058893001DCD79 /* PBGitTree.m in Sources */ = {isa = PBXBuildFile; fileRef = F56174560E058893001DCD79 /* PBGitTree.m */; }; F56244090E9684B0002B6C44 /* PBUnsortableTableHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = F56244080E9684B0002B6C44 /* PBUnsortableTableHeader.m */; }; @@ -249,6 +169,8 @@ F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; }; F5945E170E02B0C200706420 /* PBGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = F5945E160E02B0C200706420 /* PBGitRepository.m */; }; F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = F59F1DD4105C4FF300115F88 /* PBGitIndex.m */; }; + F5AD56790E79B78100EDAAFE /* PBCommitList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AD56780E79B78100EDAAFE /* PBCommitList.m */; }; + F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5B721C20E05CF7E00AF29DC /* MainMenu.xib */; }; F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C007740E731B48007B84B2 /* PBGitRef.m */; }; F5C580E50EDA250900995434 /* libgit2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C580E40EDA250900995434 /* libgit2.a */; }; F5C580F50EDA251100995434 /* libgit2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C580E40EDA250900995434 /* libgit2.a */; }; @@ -271,7 +193,6 @@ F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A1A0E88550E00056E75 /* empty_file.png */; }; F5E92A230E88569500056E75 /* new_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F5E92A220E88569500056E75 /* new_file.png */; }; F5EF8C8E0E9D4A5D0050906B /* PBWebController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5EF8C8D0E9D4A5D0050906B /* PBWebController.m */; }; - F5F7D0651062E7940072C81C /* UpdateKey.pem in Resources */ = {isa = PBXBuildFile; fileRef = F5F7D0641062E7940072C81C /* UpdateKey.pem */; }; F5FC41F40EBCBD4300191D80 /* PBGitXProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */; }; F5FC43FE0EBD08EE00191D80 /* PBRefMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FC43FD0EBD08EE00191D80 /* PBRefMenuItem.m */; }; F5FE6C030EB13BC900F30D12 /* PBServicesController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FE6C020EB13BC900F30D12 /* PBServicesController.m */; }; @@ -294,6 +215,13 @@ remoteGlobalIDString = 913D5E480E55644600CECEA2; remoteInfo = "cli tool"; }; + D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = D8022B1411DFCE7F003C21F6; + remoteInfo = libgit2; + }; F5643A010F792B4900A579C2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -317,27 +245,26 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitHookFailedSheet.h; sourceTree = ""; }; + 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitHookFailedSheet.m; sourceTree = ""; }; + 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBCommitHookFailedSheet.xib; sourceTree = ""; }; 056438B60ED0C40B00985397 /* DetailViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DetailViewTemplate.png; path = Images/DetailViewTemplate.png; sourceTree = ""; }; 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 315CB97911C3305F003B8DBE /* FileViewerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileViewerController.h; path = FileViewer/FileViewerController.h; sourceTree = ""; }; - 315CB97A11C3305F003B8DBE /* FileViewerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FileViewerController.m; path = FileViewer/FileViewerController.m; sourceTree = ""; }; - 315CB9AF11C339DA003B8DBE /* FileViewer.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = FileViewer.xib; path = FileViewer/FileViewer.xib; sourceTree = ""; }; - 31A520AB11C6983900F604D0 /* test.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = test.html; sourceTree = ""; }; - 31D70AF011C4006C00F4B199 /* MGRecessedPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGRecessedPopUpButtonCell.h; sourceTree = ""; }; - 31D70AF111C4006C00F4B199 /* MGRecessedPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGRecessedPopUpButtonCell.m; sourceTree = ""; }; - 31D70AF211C4006C00F4B199 /* MGScopeBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar.h; sourceTree = ""; }; - 31D70AF311C4006C00F4B199 /* MGScopeBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGScopeBar.m; sourceTree = ""; }; - 31D70AF711C4006C00F4B199 /* MGScopeBar_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar_Prefix.pch; sourceTree = ""; }; - 31D70AF811C4006C00F4B199 /* MGScopeBarDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBarDelegateProtocol.h; sourceTree = ""; }; - 31D70AF911C4006C00F4B199 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; - 31D70AFA11C4006C00F4B199 /* Source Code License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Source Code License.rtf"; sourceTree = ""; }; - 31DA63D711C6D7CD00BCBCAD /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = index.html; path = log/index.html; sourceTree = ""; }; - 31DA63D911C6D7F700BCBCAD /* log.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = log.js; path = log/log.js; sourceTree = ""; }; - 31DA63DE11C6DA5800BCBCAD /* format.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = format.html; path = log/format.html; sourceTree = ""; }; + 310DC1D61240599E0017A0F7 /* GLFileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLFileView.h; sourceTree = ""; }; + 310DC1D71240599E0017A0F7 /* GLFileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLFileView.m; sourceTree = ""; }; + 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGRecessedPopUpButtonCell.h; sourceTree = ""; }; + 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGRecessedPopUpButtonCell.m; sourceTree = ""; }; + 31460CA8124185BA00B90AED /* MGScopeBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar.h; sourceTree = ""; }; + 31460CA9124185BA00B90AED /* MGScopeBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGScopeBar.m; sourceTree = ""; }; + 31460CAD124185BA00B90AED /* MGScopeBar_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar_Prefix.pch; sourceTree = ""; }; + 31460CAE124185BA00B90AED /* MGScopeBarDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBarDelegateProtocol.h; sourceTree = ""; }; + 31460CAF124185BA00B90AED /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; + 31460CB0124185BA00B90AED /* Source Code License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Source Code License.rtf"; sourceTree = ""; }; + 31460CB1124185BA00B90AED /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; 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 = ""; }; 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CommitViewTemplate.png; path = Images/CommitViewTemplate.png; sourceTree = ""; }; @@ -345,30 +272,12 @@ 47DBDB570E94EDE700671A1E /* DBPrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBPrefsWindowController.m; sourceTree = ""; }; 47DBDB650E94EE8B00671A1E /* PBPrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBPrefsWindowController.h; sourceTree = ""; }; 47DBDB660E94EE8B00671A1E /* PBPrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBPrefsWindowController.m; sourceTree = ""; }; - 47DBDB690E94EF6500671A1E /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Preferences.xib; path = English.lproj/Preferences.xib; sourceTree = ""; }; + 47DBDB690E94EF6500671A1E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = ""; }; 47DBDBB00E94F6CA00671A1E /* Updates.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Updates.png; path = Images/Preferences/Updates.png; sourceTree = ""; }; 47DBDBC80E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBNSURLPathUserDefaultsTransfomer.h; sourceTree = ""; }; 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 = ""; }; - 6501ABC0115C064A00171062 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 650A6BA7115F5DBE00F2E2B9 /* BMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMDefines.h; sourceTree = ""; }; - 650A6BA8115F5DBE00F2E2B9 /* BMScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMScript.h; sourceTree = ""; }; - 650A6BA9115F5DBE00F2E2B9 /* BMScript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BMScript.m; sourceTree = ""; }; - 650FBBC7115CE6AA00CE5638 /* CWQuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWQuickLook.h; sourceTree = ""; }; - 65241C94116984F800D49143 /* PBCommitList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitList.h; sourceTree = ""; }; - 65241C95116984F800D49143 /* PBCommitList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitList.m; sourceTree = ""; }; - 653D9308109BEAFE00B26705 /* PBGitXErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitXErrors.h; sourceTree = ""; }; - 653D9309109BEAFE00B26705 /* PBGitXErrors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitXErrors.m; sourceTree = ""; }; - 654D17E7108C90E8008D960C /* html */ = {isa = PBXFileReference; lastKnownFileType = folder; path = html; sourceTree = ""; }; - 654D18EF108C9597008D960C /* Install.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Install.xcconfig; sourceTree = ""; }; - 654D18F6108C96CB008D960C /* install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = ""; }; - 654FEF9F115A2684004C8721 /* NSString_Truncate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSString_Truncate.m; sourceTree = ""; }; - 654FEFAF115A2747004C8721 /* NSString_Truncate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_Truncate.h; sourceTree = ""; }; - 6560468F115BF80F0021E246 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - 656F3B0A115C042D00CA816E /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; - 65A102F110A7D9FE0033C593 /* AddRemoteBranchTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemoteBranchTemplate.png; path = Images/AddRemoteBranchTemplate.png; sourceTree = ""; }; - 65C77F9F108BF560003BD3B5 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; 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 = ""; }; @@ -381,8 +290,6 @@ 911112360E5A097800BF76B4 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 913D5E440E55640C00CECEA2 /* gitx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gitx.m; sourceTree = ""; }; 913D5E490E55644600CECEA2 /* gitx */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gitx; sourceTree = BUILT_PRODUCTS_DIR; }; - 913D5E5D0E556A9300CECEA2 /* PBCLIProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCLIProxy.h; sourceTree = ""; }; - 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCLIProxy.m; sourceTree = ""; }; 91B103CA0E898EC300C84364 /* PBIconAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBIconAndTextCell.h; sourceTree = ""; }; 91B103CB0E898EC300C84364 /* PBIconAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBIconAndTextCell.m; sourceTree = ""; }; 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitDefaults.h; sourceTree = ""; }; @@ -390,85 +297,11 @@ 93F7857D0EA3ABF100C1F443 /* PBCommitMessageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitMessageView.h; sourceTree = ""; }; 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; - C3138B8D11C2F48400BE6CBE /* blame.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = blame.css; sourceTree = ""; }; - C3138B8E11C2F48400BE6CBE /* blame.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = blame.js; sourceTree = ""; }; - C3138B8F11C2F48400BE6CBE /* index copy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "index copy.html"; sourceTree = ""; }; - C3138B9011C2F48400BE6CBE /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - C3138B9211C2F48400BE6CBE /* commit.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = commit.css; sourceTree = ""; }; - C3138B9311C2F48400BE6CBE /* commit.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = commit.js; sourceTree = ""; }; - C3138B9411C2F48400BE6CBE /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - C3138B9511C2F48400BE6CBE /* multipleSelection.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = multipleSelection.js; sourceTree = ""; }; - C3138B9711C2F48400BE6CBE /* diffWindow.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = diffWindow.css; sourceTree = ""; }; - C3138B9811C2F48400BE6CBE /* diffWindow.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = diffWindow.js; sourceTree = ""; }; - C3138B9911C2F48400BE6CBE /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - C3138B9B11C2F48400BE6CBE /* history.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = history.css; sourceTree = ""; }; - C3138B9C11C2F48400BE6CBE /* history.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = history.js; sourceTree = ""; }; - C3138B9D11C2F48400BE6CBE /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - C3138B9F11C2F48400BE6CBE /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; - C3138BA011C2F48400BE6CBE /* source.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = source.css; sourceTree = ""; }; - C3138BA111C2F48400BE6CBE /* source.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = source.js; sourceTree = ""; }; - C3138BA311C2F48400BE6CBE /* diffHighlighter.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = diffHighlighter.js; sourceTree = ""; }; - C3138BA411C2F48400BE6CBE /* GitX.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = GitX.js; sourceTree = ""; }; - C3138BA511C2F48400BE6CBE /* keyboardNavigation.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = keyboardNavigation.js; sourceTree = ""; }; - C3138BA611C2F48400BE6CBE /* md5.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = md5.js; sourceTree = ""; }; - C3138BA811C2F48400BE6CBE /* LGPLv3.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LGPLv3.txt; sourceTree = ""; }; - C3138BAA11C2F48400BE6CBE /* clipboard.swf */ = {isa = PBXFileReference; lastKnownFileType = file; path = clipboard.swf; sourceTree = ""; }; - C3138BAB11C2F48400BE6CBE /* shBrushAS3.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushAS3.js; sourceTree = ""; }; - C3138BAC11C2F48400BE6CBE /* shBrushBash.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushBash.js; sourceTree = ""; }; - C3138BAD11C2F48400BE6CBE /* shBrushColdFusion.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushColdFusion.js; sourceTree = ""; }; - C3138BAE11C2F48400BE6CBE /* shBrushCpp.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushCpp.js; sourceTree = ""; }; - C3138BAF11C2F48400BE6CBE /* shBrushCSharp.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushCSharp.js; sourceTree = ""; }; - C3138BB011C2F48400BE6CBE /* shBrushCss.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushCss.js; sourceTree = ""; }; - C3138BB111C2F48400BE6CBE /* shBrushDelphi.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushDelphi.js; sourceTree = ""; }; - C3138BB211C2F48400BE6CBE /* shBrushDiff.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushDiff.js; sourceTree = ""; }; - C3138BB311C2F48400BE6CBE /* shBrushErlang.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushErlang.js; sourceTree = ""; }; - C3138BB411C2F48400BE6CBE /* shBrushGroovy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushGroovy.js; sourceTree = ""; }; - C3138BB511C2F48400BE6CBE /* shBrushJava.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushJava.js; sourceTree = ""; }; - C3138BB611C2F48400BE6CBE /* shBrushJavaFX.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushJavaFX.js; sourceTree = ""; }; - C3138BB711C2F48400BE6CBE /* shBrushJScript.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushJScript.js; sourceTree = ""; }; - C3138BB811C2F48400BE6CBE /* shBrushObjC.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushObjC.js; sourceTree = ""; }; - C3138BB911C2F48400BE6CBE /* shBrushPerl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushPerl.js; sourceTree = ""; }; - C3138BBA11C2F48400BE6CBE /* shBrushPhp.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushPhp.js; sourceTree = ""; }; - C3138BBB11C2F48400BE6CBE /* shBrushPlain.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushPlain.js; sourceTree = ""; }; - C3138BBC11C2F48400BE6CBE /* shBrushPowerShell.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushPowerShell.js; sourceTree = ""; }; - C3138BBD11C2F48400BE6CBE /* shBrushPython.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushPython.js; sourceTree = ""; }; - C3138BBE11C2F48400BE6CBE /* shBrushRuby.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushRuby.js; sourceTree = ""; }; - C3138BBF11C2F48400BE6CBE /* shBrushScala.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushScala.js; sourceTree = ""; }; - C3138BC011C2F48400BE6CBE /* shBrushSql.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushSql.js; sourceTree = ""; }; - C3138BC111C2F48400BE6CBE /* shBrushVb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushVb.js; sourceTree = ""; }; - C3138BC211C2F48400BE6CBE /* shBrushXml.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shBrushXml.js; sourceTree = ""; }; - C3138BC311C2F48400BE6CBE /* shCore.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shCore.js; sourceTree = ""; }; - C3138BC411C2F48400BE6CBE /* shLegacy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shLegacy.js; sourceTree = ""; }; - C3138BC611C2F48400BE6CBE /* shCore.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shCore.js; sourceTree = ""; }; - C3138BC711C2F48400BE6CBE /* shLegacy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = shLegacy.js; sourceTree = ""; }; - C3138BC911C2F48400BE6CBE /* help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = help.png; sourceTree = ""; }; - C3138BCA11C2F48400BE6CBE /* magnifier.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = magnifier.png; sourceTree = ""; }; - C3138BCB11C2F48400BE6CBE /* page_white_code.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = page_white_code.png; sourceTree = ""; }; - C3138BCC11C2F48400BE6CBE /* page_white_copy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = page_white_copy.png; sourceTree = ""; }; - C3138BCD11C2F48400BE6CBE /* printer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = printer.png; sourceTree = ""; }; - C3138BCE11C2F48400BE6CBE /* shCore.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shCore.css; sourceTree = ""; }; - C3138BCF11C2F48400BE6CBE /* shThemeDefault.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeDefault.css; sourceTree = ""; }; - C3138BD011C2F48400BE6CBE /* shThemeDjango.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeDjango.css; sourceTree = ""; }; - C3138BD111C2F48400BE6CBE /* shThemeEclipse.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeEclipse.css; sourceTree = ""; }; - C3138BD211C2F48400BE6CBE /* shThemeEmacs.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeEmacs.css; sourceTree = ""; }; - C3138BD311C2F48400BE6CBE /* shThemeFadeToGrey.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeFadeToGrey.css; sourceTree = ""; }; - C3138BD411C2F48400BE6CBE /* shThemeMidnight.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeMidnight.css; sourceTree = ""; }; - C3138BD511C2F48400BE6CBE /* shThemeRDark.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = shThemeRDark.css; sourceTree = ""; }; - C3138BD611C2F48400BE6CBE /* test.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = test.html; sourceTree = ""; }; - C3138BD811C2F48400BE6CBE /* added.acorn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = added.acorn; sourceTree = ""; }; - C3138BD911C2F48400BE6CBE /* added.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added.png; sourceTree = ""; }; - C3138BDA11C2F48400BE6CBE /* modified.acorn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = modified.acorn; sourceTree = ""; }; - C3138BDB11C2F48400BE6CBE /* modified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modified.png; sourceTree = ""; }; - C3138BDC11C2F48400BE6CBE /* removed.acorn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = removed.acorn; sourceTree = ""; }; - C3138BDD11C2F48400BE6CBE /* removed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = removed.png; sourceTree = ""; }; - C3138BDE11C2F48400BE6CBE /* renamed.acorn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = renamed.acorn; sourceTree = ""; }; - C3138BDF11C2F48400BE6CBE /* renamed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = renamed.png; sourceTree = ""; }; - C3138BE011C2F48400BE6CBE /* spinner.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = spinner.gif; sourceTree = ""; }; - C3138BE111C2F48400BE6CBE /* dragtest.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = dragtest.html; path = html/dragtest.html; sourceTree = ""; }; - C3138BE311C2F48400BE6CBE /* diff.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = diff.css; sourceTree = ""; }; - C3138BE411C2F48400BE6CBE /* GitX.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = GitX.css; sourceTree = ""; }; - C3138BE511C2F48400BE6CBE /* notification.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = notification.css; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_libgit2.sh; sourceTree = ""; }; + D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitXMessageSheet.xib; sourceTree = ""; }; + D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitXMessageSheet.h; sourceTree = ""; }; + D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitXMessageSheet.m; sourceTree = ""; }; D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = ""; }; D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = ""; }; @@ -500,11 +333,18 @@ D858108111274D28007F254B /* RemoteBranch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RemoteBranch.png; path = Images/RemoteBranch.png; sourceTree = ""; }; D858108211274D28007F254B /* Tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Tag.png; path = Images/Tag.png; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D87127001229A21C00012334 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + D87129FE122B14EC00012334 /* GitXTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXTextFieldCell.h; sourceTree = ""; }; + D87129FF122B14EC00012334 /* GitXTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXTextFieldCell.m; sourceTree = ""; }; + D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = System/Library/Frameworks/ScriptingBridge.framework; sourceTree = SDKROOT; }; + D89E9B4F1218C2750097A90B /* GitXScriptingConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXScriptingConstants.h; sourceTree = ""; }; D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitGradientBarView.h; sourceTree = ""; }; D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitGradientBarView.m; sourceTree = ""; }; D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CherryPickTemplate.png; path = Images/CherryPickTemplate.png; sourceTree = ""; }; D8A4BD051134AD2900E92D51 /* MergeTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = MergeTemplate.png; path = Images/MergeTemplate.png; sourceTree = ""; }; D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RebaseTemplate.png; path = Images/RebaseTemplate.png; sourceTree = ""; }; + D8B4DC551220D1E4004166D6 /* PBHistorySearchController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBHistorySearchController.h; sourceTree = ""; }; + D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBHistorySearchController.m; sourceTree = ""; }; D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E105451157C18200FC28A4 /* PBQLTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLTextView.h; sourceTree = ""; }; D8E105461157C18200FC28A4 /* PBQLTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBQLTextView.m; sourceTree = ""; }; @@ -512,6 +352,15 @@ D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; + D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXRelativeDateFormatter.h; sourceTree = ""; }; + D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXRelativeDateFormatter.m; sourceTree = ""; }; + D8F01C4A12182F19007F729F /* GitX.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = GitX.sdef; sourceTree = ""; }; + D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+GitXScripting.h"; sourceTree = ""; }; + D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+GitXScripting.m"; sourceTree = ""; }; + D8F01D841218A406007F729F /* GitX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX.h; sourceTree = ""; }; + D8F4AB7812298CE200D6D53C /* rewindImage.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = rewindImage.pdf; path = Images/rewindImage.pdf; sourceTree = ""; }; + D8FBCF17115FA20C0098676A /* PBGitSHA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSHA.h; sourceTree = ""; }; + D8FBCF18115FA20C0098676A /* PBGitSHA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSHA.m; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; D8FDDA5C114335E8005647F6 /* PBGitSVBranchItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVBranchItem.h; sourceTree = ""; }; D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVBranchItem.m; sourceTree = ""; }; @@ -548,10 +397,11 @@ F52BCE060E84211300AA3741 /* PBGitHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryController.m; sourceTree = ""; }; F53C4DF50E97FC630022AD59 /* PBGitBinary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitBinary.h; sourceTree = ""; }; F53C4DF60E97FC630022AD59 /* PBGitBinary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitBinary.m; sourceTree = ""; }; + F53EE3590E06BBA00022B925 /* CWQuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWQuickLook.h; sourceTree = ""; }; F53FF2030E7ABB5300389171 /* PBGitRevSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevSpecifier.h; sourceTree = ""; }; F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevSpecifier.m; sourceTree = ""; }; F56174550E058893001DCD79 /* PBGitTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitTree.h; sourceTree = ""; }; - F56174560E058893001DCD79 /* PBGitTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitTree.m; sourceTree = ""; wrapsLines = 1; }; + F56174560E058893001DCD79 /* PBGitTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitTree.m; sourceTree = ""; }; F56244070E9684B0002B6C44 /* PBUnsortableTableHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBUnsortableTableHeader.h; sourceTree = ""; }; F56244080E9684B0002B6C44 /* PBUnsortableTableHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBUnsortableTableHeader.m; sourceTree = ""; }; F562C8850FE1766C000EC528 /* NSString_RegEx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSString_RegEx.h; sourceTree = ""; }; @@ -575,11 +425,11 @@ F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGraphCellInfo.m; sourceTree = ""; }; F57240BA0E9678EA00D8EE66 /* deleted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = deleted_file.png; path = Images/deleted_file.png; sourceTree = ""; }; F574A2830EAE2EAC003F2CB1 /* PBRefController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRefController.h; sourceTree = ""; }; - F574A2840EAE2EAC003F2CB1 /* PBRefController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = PBRefController.m; sourceTree = ""; tabWidth = 4; usesTabs = 0; }; + F574A2840EAE2EAC003F2CB1 /* PBRefController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRefController.m; sourceTree = ""; }; F57CC38F0E05DDF2000472E2 /* PBEasyPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBEasyPipe.h; sourceTree = ""; }; F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBEasyPipe.m; sourceTree = ""; }; F57CC43F0E05E496000472E2 /* PBGitWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitWindowController.h; sourceTree = ""; }; - F57CC4400E05E496000472E2 /* PBGitWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitWindowController.m; sourceTree = ""; wrapsLines = 1; }; + F57CC4400E05E496000472E2 /* PBGitWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitWindowController.m; sourceTree = ""; }; F580E6AD0E733276009E2D3F /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; F5886A0A0ED5D27A0066E74C /* speedtest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = speedtest.m; sourceTree = ""; }; F5886A100ED5D33D0066E74C /* SpeedTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpeedTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -595,9 +445,11 @@ F593DF760E9E636C003A8559 /* PBFileChangesTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBFileChangesTableView.h; sourceTree = ""; }; F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBFileChangesTableView.m; sourceTree = ""; }; F5945E150E02B0C200706420 /* PBGitRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRepository.h; sourceTree = ""; }; - F5945E160E02B0C200706420 /* PBGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRepository.m; sourceTree = ""; wrapsLines = 1; }; + F5945E160E02B0C200706420 /* PBGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRepository.m; sourceTree = ""; }; F59F1DD3105C4FF300115F88 /* PBGitIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitIndex.h; sourceTree = ""; }; F59F1DD4105C4FF300115F88 /* PBGitIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitIndex.m; sourceTree = ""; }; + F5AD56770E79B78100EDAAFE /* PBCommitList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitList.h; sourceTree = ""; }; + F5AD56780E79B78100EDAAFE /* PBCommitList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitList.m; sourceTree = ""; }; F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; F5C007730E731B48007B84B2 /* PBGitRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRef.h; sourceTree = ""; }; F5C007740E731B48007B84B2 /* PBGitRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRef.m; sourceTree = ""; }; @@ -605,6 +457,7 @@ F5C6F68B0E65FF9300478D97 /* PBGitLane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitLane.h; sourceTree = ""; }; F5C6F68C0E65FF9300478D97 /* PBGitLane.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PBGitLane.mm; sourceTree = ""; }; F5D2DC850EA401A80034AD24 /* PBGitConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitConfig.h; sourceTree = ""; }; + F5D619ED0EAE62EA00341D73 /* html */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = folder; path = html; sourceTree = ""; }; F5DFFA6A0E075D8800617813 /* PBEasyFS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBEasyFS.h; sourceTree = ""; }; F5DFFA6B0E075D8800617813 /* PBEasyFS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBEasyFS.m; sourceTree = ""; }; F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBDiffWindow.xib; sourceTree = ""; }; @@ -655,8 +508,8 @@ F580E6AE0E733276009E2D3F /* Sparkle.framework in Frameworks */, F5E4DBFB0EAB58D90013FAFC /* SystemConfiguration.framework in Frameworks */, F5C580E50EDA250900995434 /* libgit2.a in Frameworks */, - 65C77FA0108BF560003BD3B5 /* Quartz.framework in Frameworks */, D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */, + D87127011229A21C00012334 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -664,6 +517,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D89E9B141218BA260097A90B /* ScriptingBridge.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -687,11 +541,16 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + ); + name = Classes; + sourceTree = ""; + }; 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( - F5C580E40EDA250900995434 /* libgit2.a */, - 65C77F9F108BF560003BD3B5 /* Quartz.framework */, F5E4DBFA0EAB58D90013FAFC /* SystemConfiguration.framework */, F580E6AD0E733276009E2D3F /* Sparkle.framework */, F56526230E03D85900F03B52 /* WebKit.framework */, @@ -708,6 +567,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */, + D87127001229A21C00012334 /* QuartzCore.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -727,24 +587,23 @@ 29B97314FDCFA39411CA2CEA /* GitTest */ = { isa = PBXGroup; children = ( - 31D70AEF11C4006C00F4B199 /* MGScopeBar */, - 315CB97811C32FC2003B8DBE /* FileViewer */, - C3138B6211C2F39900BE6CBE /* html */, - 654D18EE108C9589008D960C /* Config */, - 654D18F5108C96BC008D960C /* Scripts */, F5886A080ED5D26B0066E74C /* SpeedTest */, - 654FEF1C115A1611004C8721 /* CLI */, + 913D5E420E5563FD00CECEA2 /* cli */, + D89E9B4C1218C22A0097A90B /* GitXScripting */, F57CC43E0E05E472000472E2 /* Aux */, F57CC3850E05DDC1000472E2 /* Controllers */, F56174540E05887E001DCD79 /* Git */, - 654D17E7108C90E8008D960C /* html */, + F5D619ED0EAE62EA00341D73 /* html */, 7756732906782D8800D1FEB8 /* Models */, + 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, + 551BF118112F373E00265053 /* gitx_asskpasswd */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, F5886A120ED5D33D0066E74C /* SpeedTest-Info.plist */, F567CC3A106E6B910059BB9D /* GitXTesting-Info.plist */, + D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */, ); name = GitTest; sourceTree = ""; @@ -752,8 +611,30 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + D858108011274D28007F254B /* Branch.png */, + D858108111274D28007F254B /* RemoteBranch.png */, + D858108211274D28007F254B /* Tag.png */, + D8F4AB7812298CE200D6D53C /* rewindImage.pdf */, + D85810541127476E007F254B /* StageView.png */, + D8FDDBF31143F318005647F6 /* AddRemote.png */, + D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, + D828A5F01128AE7200F09D11 /* PullTemplate.png */, + D828A5F11128AE7200F09D11 /* PushTemplate.png */, + D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */, + 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, + D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */, + D8A4BD051134AD2900E92D51 /* MergeTemplate.png */, + D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */, + 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, + F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, + F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */, + 056438B60ED0C40B00985397 /* DetailViewTemplate.png */, + F57240BA0E9678EA00D8EE66 /* deleted_file.png */, + F5E92A1A0E88550E00056E75 /* empty_file.png */, 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, + F5E92A220E88569500056E75 /* new_file.png */, + D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */, ); name = "Other Sources"; sourceTree = ""; @@ -761,15 +642,16 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */, F5F7D0641062E7940072C81C /* UpdateKey.pem */, - 65F3543F11599F2400235D5B /* Images */, F50A41130EBB872D00208746 /* Widgets */, 47DBDB920E94F47200671A1E /* Preference Icons */, D26DC6440E782C9000C777B2 /* gitx.icns */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 65F3555A1159A95700235D5B /* MainMenu.xib */, - 65F3555C1159A96600235D5B /* RepositoryWindow.xib */, + D8F01C4A12182F19007F729F /* GitX.sdef */, + F5B721C20E05CF7E00AF29DC /* MainMenu.xib */, + 911111E00E58BD5A00BF76B4 /* RepositoryWindow.xib */, F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, @@ -782,6 +664,7 @@ 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */, + D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */, ); name = Resources; sourceTree = ""; @@ -789,47 +672,38 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + F5C580E40EDA250900995434 /* libgit2.a */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; - 315CB97811C32FC2003B8DBE /* FileViewer */ = { + 310DC1D5124059820017A0F7 /* FileView */ = { isa = PBXGroup; children = ( - 315CB97911C3305F003B8DBE /* FileViewerController.h */, - 315CB97A11C3305F003B8DBE /* FileViewerController.m */, - 315CB9AF11C339DA003B8DBE /* FileViewer.xib */, + 310DC1D61240599E0017A0F7 /* GLFileView.h */, + 310DC1D71240599E0017A0F7 /* GLFileView.m */, ); - name = FileViewer; + name = FileView; sourceTree = ""; }; - 31D70AEF11C4006C00F4B199 /* MGScopeBar */ = { + 31460C79124185B900B90AED /* MGScopeBar */ = { isa = PBXGroup; children = ( - 31D70AF011C4006C00F4B199 /* MGRecessedPopUpButtonCell.h */, - 31D70AF111C4006C00F4B199 /* MGRecessedPopUpButtonCell.m */, - 31D70AF211C4006C00F4B199 /* MGScopeBar.h */, - 31D70AF311C4006C00F4B199 /* MGScopeBar.m */, - 31D70AF711C4006C00F4B199 /* MGScopeBar_Prefix.pch */, - 31D70AF811C4006C00F4B199 /* MGScopeBarDelegateProtocol.h */, - 31D70AF911C4006C00F4B199 /* ReadMe.txt */, - 31D70AFA11C4006C00F4B199 /* Source Code License.rtf */, + 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */, + 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */, + 31460CA8124185BA00B90AED /* MGScopeBar.h */, + 31460CA9124185BA00B90AED /* MGScopeBar.m */, + 31460CAD124185BA00B90AED /* MGScopeBar_Prefix.pch */, + 31460CAE124185BA00B90AED /* MGScopeBarDelegateProtocol.h */, + 31460CAF124185BA00B90AED /* ReadMe.txt */, + 31460CB0124185BA00B90AED /* Source Code License.rtf */, + 31460CB1124185BA00B90AED /* TODO */, ); path = MGScopeBar; sourceTree = ""; }; - 31DA63D511C6D7A600BCBCAD /* log */ = { - isa = PBXGroup; - children = ( - 31DA63D711C6D7CD00BCBCAD /* index.html */, - 31DA63D911C6D7F700BCBCAD /* log.js */, - 31DA63DE11C6DA5800BCBCAD /* format.html */, - ); - name = log; - sourceTree = ""; - }; 47DBDB920E94F47200671A1E /* Preference Icons */ = { isa = PBXGroup; children = ( @@ -846,63 +720,6 @@ name = gitx_asskpasswd; sourceTree = ""; }; - 654D18EE108C9589008D960C /* Config */ = { - isa = PBXGroup; - children = ( - 656F3B0A115C042D00CA816E /* Common.xcconfig */, - 6560468F115BF80F0021E246 /* Debug.xcconfig */, - 6501ABC0115C064A00171062 /* Release.xcconfig */, - 654D18EF108C9597008D960C /* Install.xcconfig */, - ); - name = Config; - sourceTree = ""; - }; - 654D18F5108C96BC008D960C /* Scripts */ = { - isa = PBXGroup; - children = ( - 654D18F6108C96CB008D960C /* install.sh */, - ); - name = Scripts; - path = scripts; - sourceTree = ""; - }; - 654FEF1C115A1611004C8721 /* CLI */ = { - isa = PBXGroup; - children = ( - 913D5E420E5563FD00CECEA2 /* gitx */, - 551BF118112F373E00265053 /* gitx_asskpasswd */, - ); - name = CLI; - sourceTree = ""; - }; - 65F3543F11599F2400235D5B /* Images */ = { - isa = PBXGroup; - children = ( - D858108011274D28007F254B /* Branch.png */, - D858108111274D28007F254B /* RemoteBranch.png */, - D858108211274D28007F254B /* Tag.png */, - D85810541127476E007F254B /* StageView.png */, - D8FDDBF31143F318005647F6 /* AddRemote.png */, - D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, - D828A5F01128AE7200F09D11 /* PullTemplate.png */, - D828A5F11128AE7200F09D11 /* PushTemplate.png */, - D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */, - 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, - D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */, - D8A4BD051134AD2900E92D51 /* MergeTemplate.png */, - D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */, - 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, - F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, - 65A102F110A7D9FE0033C593 /* AddRemoteBranchTemplate.png */, - F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */, - 056438B60ED0C40B00985397 /* DetailViewTemplate.png */, - F57240BA0E9678EA00D8EE66 /* deleted_file.png */, - F5E92A1A0E88550E00056E75 /* empty_file.png */, - F5E92A220E88569500056E75 /* new_file.png */, - ); - name = Images; - sourceTree = ""; - }; 7756732906782D8800D1FEB8 /* Models */ = { isa = PBXGroup; children = ( @@ -911,214 +728,19 @@ name = Models; sourceTree = ""; }; - 913D5E420E5563FD00CECEA2 /* gitx */ = { + 913D5E420E5563FD00CECEA2 /* cli */ = { isa = PBXGroup; children = ( - 913D5E5D0E556A9300CECEA2 /* PBCLIProxy.h */, - 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */, 913D5E440E55640C00CECEA2 /* gitx.m */, ); - name = gitx; - sourceTree = ""; - }; - C3138B6211C2F39900BE6CBE /* html */ = { - isa = PBXGroup; - children = ( - C3138B8B11C2F48400BE6CBE /* views */, - C3138BA211C2F48400BE6CBE /* lib */, - C3138BD711C2F48400BE6CBE /* images */, - C3138BE111C2F48400BE6CBE /* dragtest.html */, - C3138BE211C2F48400BE6CBE /* css */, - ); - name = html; - sourceTree = ""; - }; - C3138B8B11C2F48400BE6CBE /* views */ = { - isa = PBXGroup; - children = ( - 31DA63D511C6D7A600BCBCAD /* log */, - C3138B8C11C2F48400BE6CBE /* blame */, - C3138B9111C2F48400BE6CBE /* commit */, - C3138B9611C2F48400BE6CBE /* diff */, - C3138B9A11C2F48400BE6CBE /* history */, - C3138B9E11C2F48400BE6CBE /* source */, - ); - name = views; - path = html/views; - sourceTree = ""; - }; - C3138B8C11C2F48400BE6CBE /* blame */ = { - isa = PBXGroup; - children = ( - C3138B8D11C2F48400BE6CBE /* blame.css */, - C3138B8E11C2F48400BE6CBE /* blame.js */, - C3138B8F11C2F48400BE6CBE /* index copy.html */, - C3138B9011C2F48400BE6CBE /* index.html */, - ); - path = blame; - sourceTree = ""; - }; - C3138B9111C2F48400BE6CBE /* commit */ = { - isa = PBXGroup; - children = ( - C3138B9211C2F48400BE6CBE /* commit.css */, - C3138B9311C2F48400BE6CBE /* commit.js */, - C3138B9411C2F48400BE6CBE /* index.html */, - C3138B9511C2F48400BE6CBE /* multipleSelection.js */, - 31A520AB11C6983900F604D0 /* test.html */, - ); - path = commit; - sourceTree = ""; - }; - C3138B9611C2F48400BE6CBE /* diff */ = { - isa = PBXGroup; - children = ( - C3138B9711C2F48400BE6CBE /* diffWindow.css */, - C3138B9811C2F48400BE6CBE /* diffWindow.js */, - C3138B9911C2F48400BE6CBE /* index.html */, - ); - path = diff; - sourceTree = ""; - }; - C3138B9A11C2F48400BE6CBE /* history */ = { - isa = PBXGroup; - children = ( - C3138B9B11C2F48400BE6CBE /* history.css */, - C3138B9C11C2F48400BE6CBE /* history.js */, - C3138B9D11C2F48400BE6CBE /* index.html */, - ); - path = history; - sourceTree = ""; - }; - C3138B9E11C2F48400BE6CBE /* source */ = { - isa = PBXGroup; - children = ( - C3138B9F11C2F48400BE6CBE /* index.html */, - C3138BA011C2F48400BE6CBE /* source.css */, - C3138BA111C2F48400BE6CBE /* source.js */, - ); - path = source; - sourceTree = ""; - }; - C3138BA211C2F48400BE6CBE /* lib */ = { - isa = PBXGroup; - children = ( - C3138BA311C2F48400BE6CBE /* diffHighlighter.js */, - C3138BA411C2F48400BE6CBE /* GitX.js */, - C3138BA511C2F48400BE6CBE /* keyboardNavigation.js */, - C3138BA611C2F48400BE6CBE /* md5.js */, - C3138BA711C2F48400BE6CBE /* syntaxhighlighter_2.1.364 */, - ); - name = lib; - path = html/lib; - sourceTree = ""; - }; - C3138BA711C2F48400BE6CBE /* syntaxhighlighter_2.1.364 */ = { - isa = PBXGroup; - children = ( - C3138BA811C2F48400BE6CBE /* LGPLv3.txt */, - C3138BA911C2F48400BE6CBE /* scripts */, - C3138BC511C2F48400BE6CBE /* src */, - C3138BC811C2F48400BE6CBE /* styles */, - C3138BD611C2F48400BE6CBE /* test.html */, - ); - path = syntaxhighlighter_2.1.364; - sourceTree = ""; - }; - C3138BA911C2F48400BE6CBE /* scripts */ = { - isa = PBXGroup; - children = ( - C3138BAA11C2F48400BE6CBE /* clipboard.swf */, - C3138BAB11C2F48400BE6CBE /* shBrushAS3.js */, - C3138BAC11C2F48400BE6CBE /* shBrushBash.js */, - C3138BAD11C2F48400BE6CBE /* shBrushColdFusion.js */, - C3138BAE11C2F48400BE6CBE /* shBrushCpp.js */, - C3138BAF11C2F48400BE6CBE /* shBrushCSharp.js */, - C3138BB011C2F48400BE6CBE /* shBrushCss.js */, - C3138BB111C2F48400BE6CBE /* shBrushDelphi.js */, - C3138BB211C2F48400BE6CBE /* shBrushDiff.js */, - C3138BB311C2F48400BE6CBE /* shBrushErlang.js */, - C3138BB411C2F48400BE6CBE /* shBrushGroovy.js */, - C3138BB511C2F48400BE6CBE /* shBrushJava.js */, - C3138BB611C2F48400BE6CBE /* shBrushJavaFX.js */, - C3138BB711C2F48400BE6CBE /* shBrushJScript.js */, - C3138BB811C2F48400BE6CBE /* shBrushObjC.js */, - C3138BB911C2F48400BE6CBE /* shBrushPerl.js */, - C3138BBA11C2F48400BE6CBE /* shBrushPhp.js */, - C3138BBB11C2F48400BE6CBE /* shBrushPlain.js */, - C3138BBC11C2F48400BE6CBE /* shBrushPowerShell.js */, - C3138BBD11C2F48400BE6CBE /* shBrushPython.js */, - C3138BBE11C2F48400BE6CBE /* shBrushRuby.js */, - C3138BBF11C2F48400BE6CBE /* shBrushScala.js */, - C3138BC011C2F48400BE6CBE /* shBrushSql.js */, - C3138BC111C2F48400BE6CBE /* shBrushVb.js */, - C3138BC211C2F48400BE6CBE /* shBrushXml.js */, - C3138BC311C2F48400BE6CBE /* shCore.js */, - C3138BC411C2F48400BE6CBE /* shLegacy.js */, - ); - path = scripts; - sourceTree = ""; - }; - C3138BC511C2F48400BE6CBE /* src */ = { - isa = PBXGroup; - children = ( - C3138BC611C2F48400BE6CBE /* shCore.js */, - C3138BC711C2F48400BE6CBE /* shLegacy.js */, - ); - path = src; - sourceTree = ""; - }; - C3138BC811C2F48400BE6CBE /* styles */ = { - isa = PBXGroup; - children = ( - C3138BC911C2F48400BE6CBE /* help.png */, - C3138BCA11C2F48400BE6CBE /* magnifier.png */, - C3138BCB11C2F48400BE6CBE /* page_white_code.png */, - C3138BCC11C2F48400BE6CBE /* page_white_copy.png */, - C3138BCD11C2F48400BE6CBE /* printer.png */, - C3138BCE11C2F48400BE6CBE /* shCore.css */, - C3138BCF11C2F48400BE6CBE /* shThemeDefault.css */, - C3138BD011C2F48400BE6CBE /* shThemeDjango.css */, - C3138BD111C2F48400BE6CBE /* shThemeEclipse.css */, - C3138BD211C2F48400BE6CBE /* shThemeEmacs.css */, - C3138BD311C2F48400BE6CBE /* shThemeFadeToGrey.css */, - C3138BD411C2F48400BE6CBE /* shThemeMidnight.css */, - C3138BD511C2F48400BE6CBE /* shThemeRDark.css */, - ); - path = styles; - sourceTree = ""; - }; - C3138BD711C2F48400BE6CBE /* images */ = { - isa = PBXGroup; - children = ( - C3138BD811C2F48400BE6CBE /* added.acorn */, - C3138BD911C2F48400BE6CBE /* added.png */, - C3138BDA11C2F48400BE6CBE /* modified.acorn */, - C3138BDB11C2F48400BE6CBE /* modified.png */, - C3138BDC11C2F48400BE6CBE /* removed.acorn */, - C3138BDD11C2F48400BE6CBE /* removed.png */, - C3138BDE11C2F48400BE6CBE /* renamed.acorn */, - C3138BDF11C2F48400BE6CBE /* renamed.png */, - C3138BE011C2F48400BE6CBE /* spinner.gif */, - ); - name = images; - path = html/images; - sourceTree = ""; - }; - C3138BE211C2F48400BE6CBE /* css */ = { - isa = PBXGroup; - children = ( - C3138BE311C2F48400BE6CBE /* diff.css */, - C3138BE411C2F48400BE6CBE /* GitX.css */, - C3138BE511C2F48400BE6CBE /* notification.css */, - ); - name = css; - path = html/css; + name = cli; sourceTree = ""; }; D82F435F111B9C6D00A25A39 /* Sheets */ = { isa = PBXGroup; children = ( + 02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */, + 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */, D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */, @@ -1131,14 +753,29 @@ D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */, D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */, D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */, + D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */, + D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */, ); name = Sheets; sourceTree = ""; }; + D89E9B4C1218C22A0097A90B /* GitXScripting */ = { + isa = PBXGroup; + children = ( + D8F01D841218A406007F729F /* GitX.h */, + D89E9B4F1218C2750097A90B /* GitXScriptingConstants.h */, + D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */, + D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */, + ); + name = GitXScripting; + sourceTree = ""; + }; D8FDDA58114335B0005647F6 /* Source View Items */ = { isa = PBXGroup; children = ( D8FDDA7311433634005647F6 /* PBSourceViewItems.h */, + F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, + F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, D8FDDA66114335E8005647F6 /* PBGitSVStageItem.h */, D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */, D8FDDA5C114335E8005647F6 /* PBGitSVBranchItem.h */, @@ -1185,6 +822,7 @@ F57CC3850E05DDC1000472E2 /* Controllers */ = { isa = PBXGroup; children = ( + 310DC1D5124059820017A0F7 /* FileView */, F58DB55610566D1F00CFDF4A /* Sidebar */, F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, @@ -1215,22 +853,20 @@ F57CC43E0E05E472000472E2 /* Aux */ = { isa = PBXGroup; children = ( - 650A6BA7115F5DBE00F2E2B9 /* BMDefines.h */, - 650A6BA8115F5DBE00F2E2B9 /* BMScript.h */, - 650A6BA9115F5DBE00F2E2B9 /* BMScript.m */, - 650FBBC7115CE6AA00CE5638 /* CWQuickLook.h */, + 31460C79124185B900B90AED /* MGScopeBar */, 47DBDBC80E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.h */, 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */, + F5AD56770E79B78100EDAAFE /* PBCommitList.h */, + F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F56524B90E02D22D00F03B52 /* NSFileHandleExt.m */, F56524BA0E02D22D00F03B52 /* NSFileHandleExt.h */, F562C8850FE1766C000EC528 /* NSString_RegEx.h */, F562C8860FE1766C000EC528 /* NSString_RegEx.m */, - 654FEFAF115A2747004C8721 /* NSString_Truncate.h */, - 654FEF9F115A2684004C8721 /* NSString_Truncate.m */, F57CC38F0E05DDF2000472E2 /* PBEasyPipe.h */, F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */, F5DFFA6A0E075D8800617813 /* PBEasyFS.h */, F5DFFA6B0E075D8800617813 /* PBEasyFS.m */, + F53EE3590E06BBA00022B925 /* CWQuickLook.h */, F51308590E0740F2000C8BCD /* PBQLOutlineView.h */, F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */, D8E105451157C18200FC28A4 /* PBQLTextView.h */, @@ -1247,13 +883,15 @@ EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, - 653D9308109BEAFE00B26705 /* PBGitXErrors.h */, - 653D9309109BEAFE00B26705 /* PBGitXErrors.m */, D823487410CB382C00944BDE /* Terminal.h */, F567B88B1057FA9F000DB976 /* NSOutlineViewExt.h */, F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */, D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */, D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */, + D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */, + D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */, + D87129FE122B14EC00012334 /* GitXTextFieldCell.h */, + D87129FF122B14EC00012334 /* GitXTextFieldCell.m */, ); name = Aux; sourceTree = ""; @@ -1275,8 +913,6 @@ D828A40C1127B18700F09D11 /* PBSourceViewCell.m */, D828A40F1127B1C400F09D11 /* PBSourceViewBadge.h */, D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */, - F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, - F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, D8FDDA58114335B0005647F6 /* Source View Items */, ); name = Sidebar; @@ -1323,14 +959,16 @@ F5E927E10E883D2E00056E75 /* History */ = { isa = PBXGroup; children = ( + F5AD56770E79B78100EDAAFE /* PBCommitList.h */, + F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F5C6F6750E65FE2B00478D97 /* Graphing */, D85B93F610E51279007F3C28 /* PBGitRefish.h */, F56524EE0E02D45200F03B52 /* PBGitCommit.h */, F56524EF0E02D45200F03B52 /* PBGitCommit.m */, - 65241C94116984F800D49143 /* PBCommitList.h */, - 65241C95116984F800D49143 /* PBCommitList.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, F5C007740E731B48007B84B2 /* PBGitRef.m */, + D8FBCF17115FA20C0098676A /* PBGitSHA.h */, + D8FBCF18115FA20C0098676A /* PBGitSHA.m */, D8295D281130A1DC00C838E8 /* PBGitHistoryList.h */, D8295D291130A1DC00C838E8 /* PBGitHistoryList.m */, F5FF4E160E0829C20006317A /* PBGitRevList.h */, @@ -1381,6 +1019,8 @@ F52BCE060E84211300AA3741 /* PBGitHistoryController.m */, F574A2830EAE2EAC003F2CB1 /* PBRefController.h */, F574A2840EAE2EAC003F2CB1 /* PBRefController.m */, + D8B4DC551220D1E4004166D6 /* PBHistorySearchController.h */, + D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */, ); name = History; sourceTree = ""; @@ -1403,6 +1043,22 @@ }; /* End PBXHeadersBuildPhase section */ +/* Begin PBXLegacyTarget section */ + D8022B1411DFCE7F003C21F6 /* libgit2 */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "\"${PROJECT_DIR}/build_libgit2.sh\""; + buildConfigurationList = D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */; + buildPhases = ( + ); + buildToolPath = /bin/sh; + dependencies = ( + ); + name = libgit2; + passBuildSettingsInEnvironment = 1; + productName = libgit2; + }; +/* End PBXLegacyTarget section */ + /* Begin PBXNativeTarget section */ 551BF110112F371800265053 /* gitx_askpasswd */ = { isa = PBXNativeTarget; @@ -1424,13 +1080,12 @@ isa = PBXNativeTarget; buildConfigurationList = 26FC0A840875C7B200E6366F /* Build configuration list for PBXNativeTarget "GitX" */; buildPhases = ( - F5792DFB0EDB570C001B0C31 /* Compile libgit2 */, 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, F580E6BD0E73329C009E2D3F /* CopyFiles */, F5CF04A20EAE696C00D75C81 /* Copy HTML files */, - 654D18DF108C950E008D960C /* Run Install Script */, + D81E15ED121CE83D00269E61 /* Scripting Bridge Header Script */, ); buildRules = ( ); @@ -1438,6 +1093,7 @@ 551BF175112F3F3500265053 /* PBXTargetDependency */, 913D5E5A0E5564F400CECEA2 /* PBXTargetDependency */, F5643A020F792B4900A579C2 /* PBXTargetDependency */, + D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */, ); name = GitX; productInstallPath = "$(HOME)/Applications"; @@ -1449,9 +1105,8 @@ isa = PBXNativeTarget; buildConfigurationList = 913D5E570E55646100CECEA2 /* Build configuration list for PBXNativeTarget "cli tool" */; buildPhases = ( - 913D5E470E55644600CECEA2 /* Frameworks */, 913D5E460E55644600CECEA2 /* Sources */, - 65957407116211EC00CEA800 /* Run Install Script */, + 913D5E470E55644600CECEA2 /* Frameworks */, ); buildRules = ( ); @@ -1484,7 +1139,6 @@ isa = PBXNativeTarget; buildConfigurationList = F5886A150ED5D33E0066E74C /* Build configuration list for PBXNativeTarget "SpeedTest" */; buildPhases = ( - F5886A0C0ED5D33D0066E74C /* Resources */, F5886A0D0ED5D33D0066E74C /* Sources */, F5886A0E0ED5D33D0066E74C /* Frameworks */, ); @@ -1514,6 +1168,7 @@ F5886A0F0ED5D33D0066E74C /* SpeedTest */, F56439F70F792B2100A579C2 /* Generate PList Prefix */, F567CC38106E6B910059BB9D /* GitXTesting */, + D8022B1411DFCE7F003C21F6 /* libgit2 */, 551BF110112F371800265053 /* gitx_askpasswd */, ); }; @@ -1524,42 +1179,28 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - D858108311274D28007F254B /* Branch.png in Resources */, - D858108411274D28007F254B /* RemoteBranch.png in Resources */, - D858108511274D28007F254B /* Tag.png in Resources */, - D85810551127476E007F254B /* StageView.png in Resources */, - D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */, - D828A5F21128AE7200F09D11 /* FetchTemplate.png in Resources */, - D828A5F31128AE7200F09D11 /* PullTemplate.png in Resources */, - D828A5F41128AE7200F09D11 /* PushTemplate.png in Resources */, - D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, - 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */, - D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */, - D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, - D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, - 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */, - F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */, - 65F3544011599F3100235D5B /* AddRemoteBranchTemplate.png in Resources */, - F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */, - 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */, - F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */, F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */, - F5E92A230E88569500056E75 /* new_file.png in Resources */, 913D5E500E55645900CECEA2 /* gitx in Resources */, 551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */, 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 65F3555B1159A95700235D5B /* MainMenu.xib in Resources */, - 65F3555D1159A96600235D5B /* RepositoryWindow.xib in Resources */, + F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */, + 911111E20E58BD5A00BF76B4 /* RepositoryWindow.xib in Resources */, D26DC6450E782C9000C777B2 /* gitx.icns in Resources */, F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */, F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */, + F5E92A230E88569500056E75 /* new_file.png in Resources */, + F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */, F5E424110EA3E4D60046E362 /* PBDiffWindow.xib in Resources */, F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */, F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */, - 6552BA27109C4CA8003B4892 /* Preferences.xib in Resources */, + 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */, + F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */, + F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */, + 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */, + 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */, + 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */, 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, - F5F7D0651062E7940072C81C /* UpdateKey.pem in Resources */, F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, @@ -1580,55 +1221,13 @@ D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, - C3138BE611C2F48400BE6CBE /* blame.css in Resources */, - C3138BE811C2F48400BE6CBE /* index copy.html in Resources */, - C3138BE911C2F48400BE6CBE /* index.html in Resources */, - C3138BEA11C2F48400BE6CBE /* commit.css in Resources */, - C3138BEC11C2F48400BE6CBE /* index.html in Resources */, - C3138BEE11C2F48400BE6CBE /* diffWindow.css in Resources */, - C3138BF011C2F48400BE6CBE /* index.html in Resources */, - C3138BF111C2F48400BE6CBE /* history.css in Resources */, - C3138BF311C2F48400BE6CBE /* index.html in Resources */, - C3138BF411C2F48400BE6CBE /* index.html in Resources */, - C3138BF511C2F48400BE6CBE /* source.css in Resources */, - C3138BFB11C2F48400BE6CBE /* LGPLv3.txt in Resources */, - C3138BFC11C2F48400BE6CBE /* clipboard.swf in Resources */, - C3138C1911C2F48400BE6CBE /* help.png in Resources */, - C3138C1A11C2F48400BE6CBE /* magnifier.png in Resources */, - C3138C1B11C2F48400BE6CBE /* page_white_code.png in Resources */, - C3138C1C11C2F48400BE6CBE /* page_white_copy.png in Resources */, - C3138C1D11C2F48400BE6CBE /* printer.png in Resources */, - C3138C1E11C2F48400BE6CBE /* shCore.css in Resources */, - C3138C1F11C2F48400BE6CBE /* shThemeDefault.css in Resources */, - C3138C2011C2F48400BE6CBE /* shThemeDjango.css in Resources */, - C3138C2111C2F48400BE6CBE /* shThemeEclipse.css in Resources */, - C3138C2211C2F48400BE6CBE /* shThemeEmacs.css in Resources */, - C3138C2311C2F48400BE6CBE /* shThemeFadeToGrey.css in Resources */, - C3138C2411C2F48400BE6CBE /* shThemeMidnight.css in Resources */, - C3138C2511C2F48400BE6CBE /* shThemeRDark.css in Resources */, - C3138C2611C2F48400BE6CBE /* test.html in Resources */, - C3138C2711C2F48400BE6CBE /* added.acorn in Resources */, - C3138C2811C2F48400BE6CBE /* added.png in Resources */, - C3138C2911C2F48400BE6CBE /* modified.acorn in Resources */, - C3138C2A11C2F48400BE6CBE /* modified.png in Resources */, - C3138C2B11C2F48400BE6CBE /* removed.acorn in Resources */, - C3138C2C11C2F48400BE6CBE /* removed.png in Resources */, - C3138C2D11C2F48400BE6CBE /* renamed.acorn in Resources */, - C3138C2E11C2F48400BE6CBE /* renamed.png in Resources */, - C3138C2F11C2F48400BE6CBE /* spinner.gif in Resources */, - C3138C3011C2F48400BE6CBE /* dragtest.html in Resources */, - C3138C3111C2F48400BE6CBE /* diff.css in Resources */, - C3138C3211C2F48400BE6CBE /* GitX.css in Resources */, - C3138C3311C2F48400BE6CBE /* notification.css in Resources */, - 315CB9B011C339DA003B8DBE /* FileViewer.xib in Resources */, - 31D70AFD11C4006C00F4B199 /* ReadMe.txt in Resources */, - 31D70AFE11C4006C00F4B199 /* Source Code License.rtf in Resources */, - 31A520AC11C6983900F604D0 /* test.html in Resources */, - 31DA63D811C6D7CD00BCBCAD /* index.html in Resources */, - 31DA63DF11C6DA5800BCBCAD /* format.html in Resources */, - 65604690115BF80F0021E246 /* Debug.xcconfig in Resources */, - 656F3B0B115C042D00CA816E /* Common.xcconfig in Resources */, - 6501ABC1115C064A00171062 /* Release.xcconfig in Resources */, + D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, + D8F01C4B12182F19007F729F /* GitX.sdef in Resources */, + D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */, + 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */, + 31460CD5124185BA00B90AED /* Source Code License.rtf in Resources */, + 31460CD6124185BA00B90AED /* TODO in Resources */, + 02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1639,43 +1238,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - F5886A0C0ED5D33D0066E74C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 654D18DF108C950E008D960C /* Run Install Script */ = { + D81E15ED121CE83D00269E61 /* Scripting Bridge Header Script */ = { isa = PBXShellScriptBuildPhase; - buildActionMask = 12; + buildActionMask = 2147483647; files = ( ); inputPaths = ( + "$(SRCROOT)/GitX.sdef", ); - name = "Run Install Script"; + name = "Scripting Bridge Header Script "; outputPaths = ( + "$(SRCROOT)/GitX.h", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"Running install script...\"\nchmod u+x \"${PROJECT_DIR}/scripts/install.sh\"\n\"${PROJECT_DIR}/scripts/install.sh\"\n"; - }; - 65957407116211EC00CEA800 /* Run Install Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 12; - files = ( - ); - inputPaths = ( - ); - name = "Run Install Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Running install script...\"\nchmod u+x \"${PROJECT_DIR}/scripts/install.sh\"\n\"${PROJECT_DIR}/scripts/install.sh\"\n"; + shellScript = "# Build the scripting bridge header GitX.h if the GitX.sdef file changes\nsdef $TARGET_BUILD_DIR/GitX.app | sdp -fh --basename GitX"; }; F56439F60F792B2100A579C2 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1688,21 +1268,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define GIT_VERSION $VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist"; - }; - F5792DFB0EDB570C001B0C31 /* Compile libgit2 */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Compile libgit2"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc -arch x86_64\"\nranlib libgit2.a"; + shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define GIT_VERSION $VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist"; }; F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = { isa = PBXShellScriptBuildPhase; @@ -1734,48 +1300,64 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 77C8280E06725ACE000B614F /* ApplicationController.m in Sources */, - 650A6BAA115F5DBE00F2E2B9 /* BMScript.m in Sources */, - 47DBDB580E94EDE700671A1E /* DBPrefsWindowController.m in Sources */, - 770B37ED0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel in Sources */, + F5EF8C8E0E9D4A5D0050906B /* PBWebController.m in Sources */, 8D11072D0486CEB800E47090 /* main.m in Sources */, - F56524BB0E02D22D00F03B52 /* NSFileHandleExt.m in Sources */, - F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */, - F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, - 654FEFA0115A2684004C8721 /* NSString_Truncate.m in Sources */, - D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, - F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */, - 913D5E5F0E556A9300CECEA2 /* PBCLIProxy.m in Sources */, - D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */, - D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */, - EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, - 65241C96116984F800D49143 /* PBCommitList.m in Sources */, - 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */, - D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, - D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, - F5E424150EA3E4E10046E362 /* PBDiffWindowController.m in Sources */, - F5DFFA6C0E075D8800617813 /* PBEasyFS.m in Sources */, - F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */, - F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */, - F53C4DF70E97FC630022AD59 /* PBGitBinary.m in Sources */, - F56524F00E02D45200F03B52 /* PBGitCommit.m in Sources */, - F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */, F574A2910EAE2FF4003F2CB1 /* PBGitConfig.m in Sources */, - 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */, - D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */, - F5FF4E7A0E082E440006317A /* PBGitGrapher.mm in Sources */, - F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */, - D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */, - D8295D2A1130A1DC00C838E8 /* PBGitHistoryList.m in Sources */, - F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, - F523CEB60ED3399200DDD714 /* PBGitIndexController.m in Sources */, - F5C6F68D0E65FF9300478D97 /* PBGitLane.mm in Sources */, - F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */, + 77C8280E06725ACE000B614F /* ApplicationController.m in Sources */, + 770B37ED0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel in Sources */, F5945E170E02B0C200706420 /* PBGitRepository.m in Sources */, + F56524BB0E02D22D00F03B52 /* NSFileHandleExt.m in Sources */, + F56524F00E02D45200F03B52 /* PBGitCommit.m in Sources */, + F565262B0E03D89B00F03B52 /* PBWebHistoryController.m in Sources */, + F56174570E058893001DCD79 /* PBGitTree.m in Sources */, + F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */, + F57CC4410E05E496000472E2 /* PBGitWindowController.m in Sources */, + F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */, + F5DFFA6C0E075D8800617813 /* PBEasyFS.m in Sources */, F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */, F5FF4E180E0829C20006317A /* PBGitRevList.mm in Sources */, + F5FF4E7A0E082E440006317A /* PBGitGrapher.mm in Sources */, + 911111F80E594F3F00BF76B4 /* PBRepositoryDocumentController.m in Sources */, + F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */, + F5C6F68D0E65FF9300478D97 /* PBGitLane.mm in Sources */, + F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */, + F5AD56790E79B78100EDAAFE /* PBCommitList.m in Sources */, F53FF2050E7ABB5300389171 /* PBGitRevSpecifier.m in Sources */, + F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */, + F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */, + F5E926060E8827D300056E75 /* PBViewController.m in Sources */, + F5E927F80E883E7200056E75 /* PBChangedFile.m in Sources */, + F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */, + 91B103CC0E898EC300C84364 /* PBIconAndTextCell.m in Sources */, + F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */, + F56244090E9684B0002B6C44 /* PBUnsortableTableHeader.m in Sources */, + F53C4DF70E97FC630022AD59 /* PBGitBinary.m in Sources */, + F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */, + 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */, + 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */, + 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 */, + F523CEB60ED3399200DDD714 /* PBGitIndexController.m in Sources */, + 47DBDB580E94EDE700671A1E /* DBPrefsWindowController.m in Sources */, + 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 */, + D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, + D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, + D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */, + D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */, F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, + F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, + F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */, D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */, D8FDDA6B114335E8005647F6 /* PBGitSVFolderItem.m in Sources */, D8FDDA6C114335E8005647F6 /* PBGitSVOtherRevItem.m in Sources */, @@ -1783,74 +1365,22 @@ D8FDDA6E114335E8005647F6 /* PBGitSVRemoteItem.m in Sources */, D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */, D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */, - F56174570E058893001DCD79 /* PBGitTree.m in Sources */, - F57CC4410E05E496000472E2 /* PBGitWindowController.m in Sources */, - 653D930A109BEAFE00B26705 /* PBGitXErrors.m in Sources */, - F5FC41F40EBCBD4300191D80 /* PBGitXProtocol.m in Sources */, - F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */, - 91B103CC0E898EC300C84364 /* PBIconAndTextCell.m in Sources */, - F50A41230EBB875D00208746 /* PBNiceSplitView.m in Sources */, - 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */, - 47DBDB670E94EE8B00671A1E /* PBPrefsWindowController.m in Sources */, - 654D16E8108C6CA6008D960C /* PBQLOutlineView.m in Sources */, - D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, - C3138BE711C2F48400BE6CBE /* blame.js in Sources */, - C3138BEB11C2F48400BE6CBE /* commit.js in Sources */, - C3138BED11C2F48400BE6CBE /* multipleSelection.js in Sources */, - C3138BEF11C2F48400BE6CBE /* diffWindow.js in Sources */, - C3138BF211C2F48400BE6CBE /* history.js in Sources */, - C3138BF611C2F48400BE6CBE /* source.js in Sources */, - C3138BF711C2F48400BE6CBE /* diffHighlighter.js in Sources */, - C3138BF811C2F48400BE6CBE /* GitX.js in Sources */, - C3138BF911C2F48400BE6CBE /* keyboardNavigation.js in Sources */, - C3138BFA11C2F48400BE6CBE /* md5.js in Sources */, - C3138BFD11C2F48400BE6CBE /* shBrushAS3.js in Sources */, - C3138BFE11C2F48400BE6CBE /* shBrushBash.js in Sources */, - C3138BFF11C2F48400BE6CBE /* shBrushColdFusion.js in Sources */, - C3138C0011C2F48400BE6CBE /* shBrushCpp.js in Sources */, - C3138C0111C2F48400BE6CBE /* shBrushCSharp.js in Sources */, - C3138C0211C2F48400BE6CBE /* shBrushCss.js in Sources */, - C3138C0311C2F48400BE6CBE /* shBrushDelphi.js in Sources */, - C3138C0411C2F48400BE6CBE /* shBrushDiff.js in Sources */, - C3138C0511C2F48400BE6CBE /* shBrushErlang.js in Sources */, - C3138C0611C2F48400BE6CBE /* shBrushGroovy.js in Sources */, - C3138C0711C2F48400BE6CBE /* shBrushJava.js in Sources */, - C3138C0811C2F48400BE6CBE /* shBrushJavaFX.js in Sources */, - C3138C0911C2F48400BE6CBE /* shBrushJScript.js in Sources */, - C3138C0A11C2F48400BE6CBE /* shBrushObjC.js in Sources */, - C3138C0B11C2F48400BE6CBE /* shBrushPerl.js in Sources */, - C3138C0C11C2F48400BE6CBE /* shBrushPhp.js in Sources */, - C3138C0D11C2F48400BE6CBE /* shBrushPlain.js in Sources */, - C3138C0E11C2F48400BE6CBE /* shBrushPowerShell.js in Sources */, - C3138C0F11C2F48400BE6CBE /* shBrushPython.js in Sources */, - C3138C1011C2F48400BE6CBE /* shBrushRuby.js in Sources */, - C3138C1111C2F48400BE6CBE /* shBrushScala.js in Sources */, - C3138C1211C2F48400BE6CBE /* shBrushSql.js in Sources */, - C3138C1311C2F48400BE6CBE /* shBrushVb.js in Sources */, - C3138C1411C2F48400BE6CBE /* shBrushXml.js in Sources */, - C3138C1511C2F48400BE6CBE /* shCore.js in Sources */, - C3138C1611C2F48400BE6CBE /* shLegacy.js in Sources */, - C3138C1711C2F48400BE6CBE /* shCore.js in Sources */, - C3138C1811C2F48400BE6CBE /* shLegacy.js in Sources */, - 315CB97B11C3305F003B8DBE /* FileViewerController.m in Sources */, - 31D70AFB11C4006C00F4B199 /* MGRecessedPopUpButtonCell.m in Sources */, - 31D70AFC11C4006C00F4B199 /* MGScopeBar.m in Sources */, - 31DA63DA11C6D7F700BCBCAD /* log.js in Sources */, - F574A2850EAE2EAC003F2CB1 /* PBRefController.m in Sources */, - F5FC43FE0EBD08EE00191D80 /* PBRefMenuItem.m in Sources */, - D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, - 911111F80E594F3F00BF76B4 /* PBRepositoryDocumentController.m in Sources */, - F5FE6C030EB13BC900F30D12 /* PBServicesController.m in Sources */, - D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */, + D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */, D828A40D1127B18700F09D11 /* PBSourceViewCell.m in Sources */, - F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, - F56244090E9684B0002B6C44 /* PBUnsortableTableHeader.m in Sources */, - F5E926060E8827D300056E75 /* PBViewController.m in Sources */, - F5E927FC0E883F0700056E75 /* PBWebChangesController.m in Sources */, - F5EF8C8E0E9D4A5D0050906B /* PBWebController.m in Sources */, - F5E424180EA3E4EB0046E362 /* PBWebDiffController.m in Sources */, - F565262B0E03D89B00F03B52 /* PBWebHistoryController.m in Sources */, - F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */, + D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */, + D8295D2A1130A1DC00C838E8 /* PBGitHistoryList.m in Sources */, + D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */, + D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, + D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */, + D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */, + D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */, + D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */, + D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, + D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, + 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */, + 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */, + 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */, + 02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1858,8 +1388,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 659E57D3115C819B00786570 /* PBGitBinary.m in Sources */, - 659E57A2115C80D300786570 /* PBEasyPipe.m in Sources */, + F53C4DF90E97FCAD0022AD59 /* PBEasyPipe.m in Sources */, + F53C4DF80E97FCA70022AD59 /* PBGitBinary.m in Sources */, 913D5E4D0E55644E00CECEA2 /* gitx.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1916,6 +1446,11 @@ target = 913D5E480E55644600CECEA2 /* cli tool */; targetProxy = 913D5E590E5564F400CECEA2 /* PBXContainerItemProxy */; }; + D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D8022B1411DFCE7F003C21F6 /* libgit2 */; + targetProxy = D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */; + }; F5643A020F792B4900A579C2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F56439F70F792B2100A579C2 /* Generate PList Prefix */; @@ -1935,20 +1470,12 @@ 47DBDB680E94EF6500671A1E /* Preferences.xib */ = { isa = PBXVariantGroup; children = ( - 47DBDB690E94EF6500671A1E /* Preferences.xib */, + 47DBDB690E94EF6500671A1E /* English */, ); name = Preferences.xib; sourceTree = ""; }; - 65F3555A1159A95700235D5B /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - F5B721C30E05CF7E00AF29DC /* English */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; - 65F3555C1159A96600235D5B /* RepositoryWindow.xib */ = { + 911111E00E58BD5A00BF76B4 /* RepositoryWindow.xib */ = { isa = PBXVariantGroup; children = ( 911111E10E58BD5A00BF76B4 /* English */, @@ -2004,32 +1531,65 @@ name = PBCloneRepositoryPanel.xib; sourceTree = ""; }; + F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + F5B721C30E05CF7E00AF29DC /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 26FC0A850875C7B200E6366F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6560468F115BF80F0021E246 /* Debug.xcconfig */; buildSettings = { COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = GitX_Prefix.pch; + HEADER_SEARCH_PATHS = libgit2/src; + INFOPLIST_FILE = Info.plist; + INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; + INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; + INFOPLIST_PREPROCESS = YES; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = libgit2; PRODUCT_NAME = GitX; WRAPPER_EXTENSION = app; + ZERO_LINK = YES; }; name = Debug; }; 26FC0A860875C7B200E6366F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6501ABC0115C064A00171062 /* Release.xcconfig */; buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); + GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = GitX_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; + HEADER_SEARCH_PATHS = libgit2/src; + INFOPLIST_FILE = Info.plist; + INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; + INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; + INFOPLIST_PREPROCESS = YES; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = libgit2; PRODUCT_NAME = GitX; WRAPPER_EXTENSION = app; }; @@ -2037,28 +1597,34 @@ }; 26FC0A890875C7B200E6366F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.6; - VALID_ARCHS = "i386 x86_64"; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + GCC_ENABLE_OBJC_GC = required; + GCC_PREPROCESSOR_DEFINITIONS = DEBUG; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_PREPROCESS = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; }; name = Debug; }; 26FC0A8A0875C7B200E6366F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = c99; + ARCHS = ( + ppc, + i386, + x86_64, + ); GCC_ENABLE_OBJC_GC = required; - GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.6; - VALID_ARCHS = "i386 x86_64"; + INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; + INFOPLIST_PREPROCESS = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; }; name = Release; }; @@ -2091,16 +1657,10 @@ ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_GC = required; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision; - INFOPLIST_PREPROCESS = YES; INSTALL_PATH = /usr/local/bin; OTHER_LDFLAGS = ( "-framework", @@ -2134,124 +1694,8 @@ }; name = Install; }; - 654D1896108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 656F3B0A115C042D00CA816E /* Common.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.6; - VALID_ARCHS = "i386 x86_64"; - }; - name = Install; - }; - 654D1897108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 654D18EF108C9597008D960C /* Install.xcconfig */; - buildSettings = { - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - PRODUCT_NAME = GitX; - WRAPPER_EXTENSION = app; - }; - name = Install; - }; - 654D1898108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 654D18EF108C9597008D960C /* Install.xcconfig */; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = /usr/local/bin; - LIBRARY_SEARCH_PATHS = libgit2; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; - PRODUCT_NAME = gitx; - ZERO_LINK = NO; - }; - name = Install; - }; - 654D1899108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h"; - INFOPLIST_FILE = "SpeedTest-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = libgit2; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - UIKit, - ); - PREBINDING = NO; - PRODUCT_NAME = SpeedTest; - SDKROOT = iphoneos2.0; - ZERO_LINK = NO; - }; - name = Install; - }; - 654D189A108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - INFOPLIST_PREPROCESS = YES; - PRODUCT_NAME = "Generate PList Prefix"; - ZERO_LINK = NO; - }; - name = Install; - }; - 654D189B108C9293008D960C /* Install */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INFOPLIST_FILE = "GitXTesting-Info.plist"; - INSTALL_PATH = "$(HOME)/Library/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/libgit2\"", - ); - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; - PRODUCT_NAME = GitXTesting; - ZERO_LINK = NO; - }; - name = Install; - }; 913D5E4B0E55644600CECEA2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6560468F115BF80F0021E246 /* Debug.xcconfig */; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -2276,7 +1720,6 @@ }; 913D5E4C0E55644600CECEA2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6501ABC0115C064A00171062 /* Release.xcconfig */; buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -2298,6 +1741,27 @@ }; name = Release; }; + D8022B1511DFCE7F003C21F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = libgit2; + }; + name = Debug; + }; + D8022B1611DFCE7F003C21F6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PRODUCT_NAME = libgit2; + ZERO_LINK = NO; + }; + name = Release; + }; F56439F80F792B2100A579C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2449,7 +1913,6 @@ buildConfigurations = ( 26FC0A850875C7B200E6366F /* Debug */, 26FC0A860875C7B200E6366F /* Release */, - 654D1897108C9293008D960C /* Install */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2459,7 +1922,6 @@ buildConfigurations = ( 26FC0A890875C7B200E6366F /* Debug */, 26FC0A8A0875C7B200E6366F /* Release */, - 654D1896108C9293008D960C /* Install */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2479,7 +1941,15 @@ buildConfigurations = ( 913D5E4B0E55644600CECEA2 /* Debug */, 913D5E4C0E55644600CECEA2 /* Release */, - 654D1898108C9293008D960C /* Install */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D8022B1511DFCE7F003C21F6 /* Debug */, + D8022B1611DFCE7F003C21F6 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2489,7 +1959,6 @@ buildConfigurations = ( F56439F80F792B2100A579C2 /* Debug */, F56439F90F792B2100A579C2 /* Release */, - 654D189A108C9293008D960C /* Install */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2499,7 +1968,6 @@ buildConfigurations = ( F567CC3B106E6B920059BB9D /* Debug */, F567CC3C106E6B920059BB9D /* Release */, - 654D189B108C9293008D960C /* Install */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -2509,7 +1977,6 @@ buildConfigurations = ( F5886A130ED5D33E0066E74C /* Debug */, F5886A140ED5D33E0066E74C /* Release */, - 654D1899108C9293008D960C /* Install */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/GitXRelativeDateFormatter.h b/GitXRelativeDateFormatter.h new file mode 100644 index 0000000..b5f1244 --- /dev/null +++ b/GitXRelativeDateFormatter.h @@ -0,0 +1,16 @@ +// +// GitXRelativeDateFormatter.h +// GitX +// +// Created by Nathan Kinsinger on 9/1/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface GitXRelativeDateFormatter : NSFormatter { + +} + +@end diff --git a/GitXRelativeDateFormatter.m b/GitXRelativeDateFormatter.m new file mode 100644 index 0000000..7107548 --- /dev/null +++ b/GitXRelativeDateFormatter.m @@ -0,0 +1,93 @@ +// +// GitXRelativeDateFormatter.m +// GitX +// +// Created by Nathan Kinsinger on 9/1/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "GitXRelativeDateFormatter.h" + + +#define MINUTE 60 +#define HOUR (60 * MINUTE) + +#define WEEK 7 + + +@implementation GitXRelativeDateFormatter + +- (NSString *)stringForObjectValue:(id)date +{ + if (![date isKindOfClass:[NSDate class]]) + return nil; + + NSDate *now = [NSDate date]; + + NSInteger secondsAgo = lround([now timeIntervalSinceDate:date]); + + if (secondsAgo < 0) + return @"In the future!"; + + if (secondsAgo < MINUTE) + return @"seconds ago"; + + if (secondsAgo < (2 * MINUTE)) + return @"1 minute ago"; + + if (secondsAgo < HOUR) + return [NSString stringWithFormat:@"%d minutes ago", (secondsAgo / MINUTE)]; + + if (secondsAgo < (2 * HOUR)) + return @"1 hour ago"; + + // figure out # of days ago based on calender days (so yesterday is the day before today not 24 hours ago) + NSDateFormatter *midnightFormmatter = [[NSDateFormatter alloc] init]; + [midnightFormmatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *midnightOnTargetDate = [midnightFormmatter dateFromString:[midnightFormmatter stringFromDate:date]]; + NSDate *midnightToday = [midnightFormmatter dateFromString:[midnightFormmatter stringFromDate:now]]; + + // use NSCalendar so it will handle things like leap years correctly + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:midnightOnTargetDate + toDate:midnightToday + options:0]; + NSInteger yearsAgo = [components year]; + NSInteger monthsAgo = [components month]; + NSInteger daysAgo = [components day]; + + if (yearsAgo == 0) { + if (monthsAgo == 0) { + // return "hours ago" if it's still today, but "Yesterday" only if more than 6 hours ago + // gives people a little time to get used to the idea that yesterday is over :) + if ((daysAgo == 0) || (secondsAgo < (6 * HOUR))) + return [NSString stringWithFormat:@"%d hours ago", (secondsAgo / HOUR)]; + if (daysAgo == 1) + return @"Yesterday"; + + if (daysAgo >= (2 * WEEK)) + return [NSString stringWithFormat:@"%d weeks ago", (daysAgo / WEEK)]; + + return [NSString stringWithFormat:@"%d days ago", daysAgo]; + } + + if (monthsAgo == 1) + return @"1 month ago"; + + return [NSString stringWithFormat:@"%d months ago", monthsAgo]; + } + + if (yearsAgo == 1) { + if (monthsAgo == 0) + return @"1 year ago"; + + if (monthsAgo == 1) + return @"1 year 1 month ago"; + + return [NSString stringWithFormat:@"1 year %d months ago", monthsAgo]; + } + + return [NSString stringWithFormat:@"%d years ago", yearsAgo]; +} + +@end diff --git a/GitXScriptingConstants.h b/GitXScriptingConstants.h new file mode 100644 index 0000000..4f04f5b --- /dev/null +++ b/GitXScriptingConstants.h @@ -0,0 +1,18 @@ +// +// GitXScriptingConstants.h +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#define kGitXBundleIdentifier @"nl.frim.GitX" + + +#define kGitXAEKeyArgumentsList 'ARGS' + +#define kGitXCloneDestinationURLKey @"destinationURL" +#define kGitXCloneIsBareKey @"isBare" + +#define kGitXFindSearchStringKey @"searchString" +#define kGitXFindInModeKey @"inMode" diff --git a/GitXTextFieldCell.h b/GitXTextFieldCell.h new file mode 100644 index 0000000..1161dca --- /dev/null +++ b/GitXTextFieldCell.h @@ -0,0 +1,17 @@ +// +// GitXTextFieldCell.h +// GitX +// +// Created by Nathan Kinsinger on 8/27/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBRefContextDelegate.h" + + +@interface GitXTextFieldCell : NSTextFieldCell { + IBOutlet id contextMenuDelegate; +} + +@end diff --git a/GitXTextFieldCell.m b/GitXTextFieldCell.m new file mode 100644 index 0000000..9e90193 --- /dev/null +++ b/GitXTextFieldCell.m @@ -0,0 +1,37 @@ +// +// GitXTextFieldCell.m +// GitX +// +// Created by Nathan Kinsinger on 8/27/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "GitXTextFieldCell.h" +#import "PBGitCommit.h" +#import "PBRefController.h" + + +@implementation GitXTextFieldCell + +- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + // disables the cell's selection highlight + return nil; +} + +- (NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSTableView *)commitList +{ + NSInteger rowIndex = [commitList rowAtPoint:(cellFrame.origin)]; + NSArray *items = [contextMenuDelegate menuItemsForRow:rowIndex]; + if (!items) + return nil; + + NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; + for (NSMenuItem *item in items) + [menu addItem:item]; + + return menu; +} + +@end diff --git a/Images/Branch.acorn b/Images/Branch.acorn deleted file mode 100644 index 6e6498d..0000000 Binary files a/Images/Branch.acorn and /dev/null differ diff --git a/Images/Branch.png b/Images/Branch.png index ad2c242..a4230fc 100644 Binary files a/Images/Branch.png and b/Images/Branch.png differ diff --git a/Images/RemoteBranch.acorn b/Images/RemoteBranch.acorn deleted file mode 100644 index 8921318..0000000 Binary files a/Images/RemoteBranch.acorn and /dev/null differ diff --git a/Images/RemoteBranch.png b/Images/RemoteBranch.png index a0c7a06..c1dbf28 100644 Binary files a/Images/RemoteBranch.png and b/Images/RemoteBranch.png differ diff --git a/Images/Tag.acorn b/Images/Tag.acorn deleted file mode 100644 index 1364597..0000000 Binary files a/Images/Tag.acorn and /dev/null differ diff --git a/Images/Tag.png b/Images/Tag.png index 4d72ca6..6c51407 100644 Binary files a/Images/Tag.png and b/Images/Tag.png differ diff --git a/Images/rewindImage.pdf b/Images/rewindImage.pdf new file mode 100644 index 0000000..40066ca Binary files /dev/null and b/Images/rewindImage.pdf differ diff --git a/Info.plist b/Info.plist index b7a8de4..d7e5e5b 100644 --- a/Info.plist +++ b/Info.plist @@ -89,5 +89,9 @@ + NSAppleScriptEnabled + + OSAScriptingDefinition + GitX.sdef diff --git a/MGScopeBar/English.lproj/InfoPlist.strings b/MGScopeBar/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..5e45963 Binary files /dev/null and b/MGScopeBar/English.lproj/InfoPlist.strings differ diff --git a/MGScopeBar/English.lproj/MainMenu.xib b/MGScopeBar/English.lproj/MainMenu.xib new file mode 100644 index 0000000..9c12f0b --- /dev/null +++ b/MGScopeBar/English.lproj/MainMenu.xib @@ -0,0 +1,3278 @@ + + + + 1050 + 9F33 + 672 + 949.34 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + NewApplication + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + NewApplication + + YES + + + About NewApplication + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + UHJlZmVyZW5jZXPigKY + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide NewApplication + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit NewApplication + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + T3BlbuKApg + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + U2F2ZSBBc+KApg + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + UHJpbnTigKY + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + RmluZOKApg + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + U2hvdyBTcGVsbGluZ+KApg + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Q3VzdG9taXplIFRvb2xiYXLigKY + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + NewApplication Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + 15 + 2 + {{153, 619}, {805, 122}} + 1946157056 + MGScopeBar Demo + NSWindow + + {1000, 122} + {250, 122} + + + 256 + + YES + + + 266 + {{0, 97}, {805, 25}} + + MGScopeBar + + + + 266 + {{17, 48}, {771, 17}} + + YES + + 68288064 + 138413056 + + + LucidaGrande + 1.300000e+01 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {805, 122} + + + {{0, 0}, {1440, 878}} + {250, 144} + {1000, 144} + + + NSFontManager + + + AppController + + + + 265 + + YES + + + 265 + {{1, 0}, {52, 19}} + + YES + + -2080244224 + 134217728 + Save + + LucidaGrande + 1.200000e+01 + 16 + + + -2038152961 + 164 + + + 400 + 75 + + + + {54, 20} + NSView + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + alignLeft: + + + + 442 + + + + alignJustified: + + + + 443 + + + + copyRuler: + + + + 444 + + + + alignCenter: + + + + 445 + + + + toggleRuler: + + + + 446 + + + + alignRight: + + + + 447 + + + + pasteRuler: + + + + 448 + + + + terminate: + + + + 449 + + + + labelField + + + + 454 + + + + scopeBar + + + + 455 + + + + delegate + + + + 456 + + + + nextKeyView + + + + 458 + + + + initialFirstResponder + + + + 459 + + + + accessoryView + + + + 461 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 103 + + + YES + + + + 1 + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + 3 + + + 80 + + + 8 + + + 78 + + + 6 + + + 72 + + + + + 82 + + + 9 + + + 124 + + + YES + + + + + + 77 + + + 5 + + + 73 + + + 1 + + + 79 + + + 7 + + + 112 + + + 10 + + + 74 + + + 2 + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 106 + + + YES + + + + 2 + + + 111 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + 1111 + + + 144 + + + + + 129 + + + 121 + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + 377 + + + YES + + + + + + 378 + + + YES + + + + + + 379 + + + YES + + + + + + + + + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + 387 + + + + + 388 + + + YES + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + YES + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + YES + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + YES + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + YES + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + 450 + + + + + 451 + + + + + 452 + + + YES + + + + + + 453 + + + + + 460 + + + YES + + + + + + 462 + + + YES + + + + + + 463 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 103.IBPluginDependency + 103.ImportedFromIB2 + 106.IBPluginDependency + 106.ImportedFromIB2 + 106.editorWindowContentRectSynchronizationRect + 111.IBPluginDependency + 111.ImportedFromIB2 + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 371.windowTemplate.hasMaxSize + 371.windowTemplate.hasMinSize + 371.windowTemplate.maxSize + 371.windowTemplate.minSize + 372.IBPluginDependency + 375.IBPluginDependency + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 377.IBPluginDependency + 378.IBPluginDependency + 379.IBPluginDependency + 380.IBPluginDependency + 381.IBPluginDependency + 382.IBPluginDependency + 383.IBPluginDependency + 384.IBPluginDependency + 385.IBPluginDependency + 386.IBPluginDependency + 387.IBPluginDependency + 388.IBEditorWindowLastContentRect + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency + 450.IBPluginDependency + 451.IBPluginDependency + 452.IBPluginDependency + 453.IBPluginDependency + 460.IBEditorWindowLastContentRect + 460.IBPluginDependency + 462.IBPluginDependency + 463.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{596, 852}, {216, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + 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 + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{187, 434}, {243, 243}} + 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 + + {{608, 612}, {167, 43}} + 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 + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{207, 285}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{153, 619}, {805, 122}} + com.apple.InterfaceBuilder.CocoaPlugin + {{153, 619}, {805, 122}} + + {{33, 99}, {480, 360}} + + + {1000, 122} + {250, 122} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{437, 242}, {86, 43}} + 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 + {{523, 2}, {178, 283}} + 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 + 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 + {{76, 814}, {54, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{219, 102}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + 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 + + {{145, 474}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 463 + + + + YES + + AppController + NSObject + + YES + + YES + accessoryView + labelField + scopeBar + + + YES + NSView + NSTextField + MGScopeBar + + + + IBProjectSource + AppController.h + + + + MGScopeBar + NSView + + delegate + id + + + IBProjectSource + MGScopeBar.h + + + + + 0 + ../MGScopeBar.xcodeproj + 3 + + diff --git a/MGScopeBar/Info.plist b/MGScopeBar/Info.plist new file mode 100644 index 0000000..612b7da --- /dev/null +++ b/MGScopeBar/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/MGScopeBar/MGScopeBar.m b/MGScopeBar/MGScopeBar.m index c614649..28454e3 100644 --- a/MGScopeBar/MGScopeBar.m +++ b/MGScopeBar/MGScopeBar.m @@ -150,7 +150,8 @@ NSRect ctrlRect = NSZeroRect; BOOL providesImages = [delegate respondsToSelector:@selector(scopeBar:imageForItem:inGroup:)]; - for (int groupNum = 0; groupNum < numGroups; groupNum++) { + int groupNum; + for (groupNum = 0; groupNum < numGroups; groupNum++) { // Add separator if appropriate. BOOL addSeparator = (groupNum > 0); // default behavior. if ([delegate respondsToSelector:@selector(scopeBar:showSeparatorBeforeGroup:)]) { @@ -494,7 +495,8 @@ //NSLog(@"Got %@ - modifying groups %@", ((narrower) ? @"narrower" : @"wider"), NSStringFromRange(changedRange)); NSInteger nextXCoord = NSNotFound; if (adjusting) { - for (int i = changedRange.location; i < NSMaxRange(changedRange); i++) { + int i; + for (i = changedRange.location; i < NSMaxRange(changedRange); i++) { NSMutableDictionary *groupInfo = [_groups objectAtIndex:i]; if (nextXCoord == NSNotFound) { @@ -547,7 +549,8 @@ float buttonX = nextXCoord; NSMutableArray *menuItems = [groupInfo objectForKey:GROUP_BUTTONS]; NSArray *selectedItems = [_selectedItems objectAtIndex:i]; - for (int i = 0; i < [menuItems count]; i++) { + int i; + for (i = 0; i < [menuItems count]; i++) { NSMenuItem *menuItem = [menuItems objectAtIndex:i]; NSString *itemIdentifier = [menuItem representedObject]; NSButton *button = [self buttonForItem:itemIdentifier @@ -579,7 +582,8 @@ if (shouldAdjustPopups) { perGroupDelta = ((_totalGroupsWidthForPopups - availableWidth) / [_groups count]); } - for (int i = startIndex; i < [_groups count]; i++) { + int i; + for (i = startIndex; i < [_groups count]; i++) { NSDictionary *groupInfo = [_groups objectAtIndex:i]; BOOL menuMode = [[groupInfo objectForKey:GROUP_MENU_MODE] boolValue]; @@ -760,7 +764,8 @@ // Add appropriate items. [popup removeAllItems]; NSMutableArray *buttons = [group objectForKey:GROUP_BUTTONS]; - for (int i = 0; i < [buttons count]; i++) { + int i; + for (i = 0; i < [buttons count]; i++) { NSButton *button = (NSButton *)[buttons objectAtIndex:i]; NSMenuItem *menuItem = [self menuItemForItem:[[button cell] representedObject] inGroup:[button tag] @@ -798,7 +803,8 @@ int count = [identArray count]; if (groupNumber >= count) { // Pad identArray with nulls if appropriate, so this control lies at index groupNumber. - for (int i = count; i < groupNumber; i++) { + int i; + for (i = count; i < groupNumber; i++) { [identArray addObject:[NSNull null]]; } [identArray addObject:control]; diff --git a/MGScopeBar/TODO b/MGScopeBar/TODO new file mode 100644 index 0000000..30747a1 --- /dev/null +++ b/MGScopeBar/TODO @@ -0,0 +1,9 @@ +MGScopeBar TODO + + +- Maybe properly support a blue gradient appearance (like Mail in Tiger)? + - Easy to change background gradient, but buttons/popups still highlight gray. + +- Accessibility support + - The control needs to indicate which groups it contains, what selection-mode those groups support, etc. + - Otherwise it's just an opaque group of buttons to VoiceOver. diff --git a/NSApplication+GitXScripting.h b/NSApplication+GitXScripting.h new file mode 100644 index 0000000..fafab7e --- /dev/null +++ b/NSApplication+GitXScripting.h @@ -0,0 +1,18 @@ +// +// NSApplication+GitXScripting.h +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface NSApplication (GitXScripting) + +- (void)showDiffScriptCommand:(NSScriptCommand *)command; +- (void)initRepositoryScriptCommand:(NSScriptCommand *)command; +- (void)cloneRepositoryScriptCommand:(NSScriptCommand *)command; + +@end diff --git a/NSApplication+GitXScripting.m b/NSApplication+GitXScripting.m new file mode 100644 index 0000000..f3bef65 --- /dev/null +++ b/NSApplication+GitXScripting.m @@ -0,0 +1,49 @@ +// +// NSApplication+GitXScripting.m +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "NSApplication+GitXScripting.h" +#import "GitXScriptingConstants.h" +#import "PBDiffWindowController.h" +#import "PBRepositoryDocumentController.h" +#import "PBCloneRepositoryPanel.h" + + +@implementation NSApplication (GitXScripting) + +- (void)showDiffScriptCommand:(NSScriptCommand *)command +{ + NSString *diffText = [command directParameter]; + if (diffText) { + PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diffText]; + [diffController showWindow:nil]; + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; + } +} + +- (void)initRepositoryScriptCommand:(NSScriptCommand *)command +{ + NSURL *repositoryURL = [command directParameter]; + if (repositoryURL) + [[PBRepositoryDocumentController sharedDocumentController] initNewRepositoryAtURL:repositoryURL]; +} + +- (void)cloneRepositoryScriptCommand:(NSScriptCommand *)command +{ + NSString *repository = [command directParameter]; + if (repository) { + NSDictionary *arguments = [command arguments]; + NSURL *destinationURL = [arguments objectForKey:kGitXCloneDestinationURLKey]; + if (destinationURL) { + BOOL isBare = [[arguments objectForKey:kGitXCloneIsBareKey] boolValue]; + + [PBCloneRepositoryPanel beginCloneRepository:repository toURL:destinationURL isBare:isBare]; + } + } +} + +@end diff --git a/NSFileHandleExt.m b/NSFileHandleExt.m index 0af2861..54b9098 100644 --- a/NSFileHandleExt.m +++ b/NSFileHandleExt.m @@ -13,12 +13,9 @@ #define CONN_TIMEOUT 5 #define BUFFER_SIZE 256 -#import /* for objc_collect */ - @implementation NSFileHandle(NSFileHandleExt) -(NSString*)readLine { - // If the socket is closed, return an empty string if ([self fileDescriptor] <= 0) return @""; @@ -30,28 +27,26 @@ char *buffer = (char*)malloc(bufferSize + 1); if (buffer == NULL) [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; - buffer[0] = '\0'; + buffer[0] = '\0'; - int bytesReceived = 0, n = 1; + int bytesReceived = 0, n = 0; - while (n > 0) { + while (1) { n = read(fd, buffer + bytesReceived, 1); if (n == 0) - break; - - if (n < 0) { - if (errno == EINTR) { - n = 1; - continue; - } else { - free(buffer); - NSString *reason = [NSString stringWithFormat:@"%s:%d: read() error: %s", __PRETTY_FUNCTION__, __LINE__, strerror(errno)]; - [[NSException exceptionWithName:@"Socket error" reason:reason userInfo:nil] raise]; - } - } - - bytesReceived++; + break; + + if (n < 0) { + if (errno == EINTR) + continue; + + free(buffer); + NSString *reason = [NSString stringWithFormat:@"%s:%d: read() error: %s", __PRETTY_FUNCTION__, __LINE__, strerror(errno)]; + [[NSException exceptionWithName:@"Socket error" reason:reason userInfo:nil] raise]; + } + + bytesReceived++; if (bytesReceived >= bufferSize) { // Make buffer bigger @@ -61,17 +56,14 @@ [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; } - switch (*(buffer + bytesReceived - 1)) { - case '\n': - buffer[bytesReceived-1] = '\0'; - NSString* s = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding]; - if ([s length] == 0) - s = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; - free(buffer); - return s; - case '\r': - bytesReceived--; + char receivedByte = buffer[bytesReceived-1]; + if (receivedByte == '\n') { + bytesReceived--; + break; } + + if (receivedByte == '\r') + bytesReceived--; } buffer[bytesReceived] = '\0'; @@ -80,8 +72,6 @@ retVal = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; free(buffer); - - [[NSGarbageCollector defaultCollector] collectExhaustively]; return retVal; } diff --git a/NSString_RegEx.m b/NSString_RegEx.m index 0b593a6..38d3848 100644 --- a/NSString_RegEx.m +++ b/NSString_RegEx.m @@ -85,7 +85,6 @@ catch_exit: if (pmatch) free(pmatch); regfree(&preg); - [[NSGarbageCollector defaultCollector] collectIfNeeded]; return outMatches; } diff --git a/PBCLIProxy.h b/PBCLIProxy.h index f8293e0..eb4d735 100644 --- a/PBCLIProxy.h +++ b/PBCLIProxy.h @@ -7,7 +7,7 @@ // #import -#import "PBGitXErrors.h" + @interface PBCLIProxy : NSObject { @@ -16,12 +16,10 @@ @property (retain) NSConnection* connection; @end -#define PBDOConnectionName @"GitXDOConnection" +#define ConnectionName @"GitX DO Connection" #define PBCLIProxyErrorDomain @"PBCLIProxyErrorDomain" @protocol GitXCliToolProtocol - -- (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycopy NSArray *) args error:(byref NSError**)error; -- (oneway void) openDiffWindowWithDiff:(in bycopy NSString *)diff; - +- (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(NSError**)error; +- (void)openDiffWindowWithDiff:(NSString *)diff; @end \ No newline at end of file diff --git a/PBCLIProxy.m b/PBCLIProxy.m index 08a87fe..416c917 100644 --- a/PBCLIProxy.m +++ b/PBCLIProxy.m @@ -20,82 +20,52 @@ - (id)init { if (self = [super init]) { - connection = [NSConnection new]; - [connection setRootObject:self]; + self.connection = [NSConnection new]; + [self.connection setRootObject:self]; - if ([connection registerName:PBDOConnectionName] == NO) + if ([self.connection registerName:ConnectionName] == NO) NSBeep(); + } return self; } -- (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycopy NSArray *)args error:(byref NSError **)error +- (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(NSError**)error; { - // NSLog(@"============================== PBCLIProxy START =============================="); - - if (!repositoryPath || !args) { - return NO; - } - // FIXME I found that creating this redundant NSURL reference was necessary to // work around an apparent bug with GC and Distributed Objects // I am not familiar with GC though, so perhaps I was doing something wrong. - // - // !!! Andre Berg 20100326: This is because NSURL objects are passed as proxies - // See also http://jens.mooseyard.com/2009/07/the-subtle-dangers-of-distributed-objects/#comment-3069 - // We should be able to adjust this by using bycopy modifiers. - // - NSURL* url = [NSURL fileURLWithPath:repositoryPath isDirectory:YES]; - NSString * fullargs = [args componentsJoinedByString:@" "]; - PBGitRepository *document = [[PBRepositoryDocumentController sharedDocumentController] documentForLocation:url]; + NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]]; + NSArray* arguments = [NSArray arrayWithArray:args]; - if (!document) { + PBGitRepository *document = [[PBRepositoryDocumentController sharedDocumentController] documentForLocation:url]; + if (!document) { if (error) { - NSString *suggestion = nil; - NSInteger errCode = -1; - - if ([PBGitBinary path]) { - suggestion = @"this isn't a git repository"; - errCode = PBNotAGitRepositoryErrorCode; - } else { - suggestion = @"GitX can't find your git binary"; - errCode = PBGitBinaryNotFoundErrorCode; - } + NSString *suggestion = [PBGitBinary path] ? @"this isn't a git repository" : @"GitX can't find your git binary"; + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Could not create document. Perhaps %@", suggestion] forKey:NSLocalizedFailureReasonErrorKey]; - *error = [NSError errorWithDomain:PBCLIProxyErrorDomain code:errCode userInfo:userInfo]; + *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:2 userInfo:userInfo]; } - // NSLog(@"============================== PBCLIProxy Abort =============================="); return NO; - } else if (![document checkRefFormat:fullargs] && - ![document checkRefFormatForBranch:fullargs]) { + } - NSString * suggestion = @"the arguments passed do not constitute a valid ref format"; - NSString * recoveryInfo = @"(see git help check-ref-format)"; - NSInteger errCode = PBNotAValidRefFormatErrorCode; - - NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [NSString stringWithFormat: @"Ignoring parameters passed to gitx. It appears %@.", - suggestion], NSLocalizedFailureReasonErrorKey, - recoveryInfo, NSLocalizedRecoverySuggestionErrorKey, nil]; - - if (error) - { - *error = [NSError errorWithDomain:PBCLIProxyErrorDomain code:errCode userInfo:userInfo]; - fprintf(stderr, "\t%s\n", [[*error localizedFailureReason] UTF8String]); - } - } - - // NSLog(@"document = %@ at path = %@", document, repositoryPath); - + if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--commit"] || + [[arguments objectAtIndex:0] isEqualToString:@"-c"])) + [document.windowController showCommitView:self]; + else { + PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; + rev.workingDirectory = url; + document.currentBranch = [document addBranch: rev]; + [document.windowController showHistoryView:self]; + } [NSApp activateIgnoringOtherApps:YES]; - // NSLog(@"============================== PBCLIProxy END =============================="); return YES; } -- (oneway void) openDiffWindowWithDiff:(in bycopy NSString *)diff +- (void)openDiffWindowWithDiff:(NSString *)diff { PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]]; [diffController showWindow:nil]; diff --git a/PBCloneRepositoryPanel.h b/PBCloneRepositoryPanel.h index 7c7d102..8b29551 100644 --- a/PBCloneRepositoryPanel.h +++ b/PBCloneRepositoryPanel.h @@ -23,6 +23,7 @@ } + (id) panel; ++ (void)beginCloneRepository:(NSString *)repository toURL:(NSURL *)targetURL isBare:(BOOL)bare; - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; @@ -38,4 +39,6 @@ @property (assign) IBOutlet NSTextField *errorMessage; @property (assign) IBOutlet NSView *repositoryAccessoryView; +@property (assign) BOOL isBare; + @end diff --git a/PBCloneRepositoryPanel.m b/PBCloneRepositoryPanel.m index 20baaa2..a2aaa51 100644 --- a/PBCloneRepositoryPanel.m +++ b/PBCloneRepositoryPanel.m @@ -21,6 +21,8 @@ @synthesize errorMessage; @synthesize repositoryAccessoryView; +@synthesize isBare; + #pragma mark - @@ -31,6 +33,21 @@ return [[self alloc] initWithWindowNibName:@"PBCloneRepositoryPanel"]; } ++ (void)beginCloneRepository:(NSString *)repository toURL:(NSURL *)targetURL isBare:(BOOL)bare +{ + if (!repository || [repository isEqualToString:@""] || !targetURL || [[targetURL path] isEqualToString:@""]) + return; + + PBCloneRepositoryPanel *clonePanel = [PBCloneRepositoryPanel panel]; + [clonePanel showWindow:self]; + + [clonePanel.repositoryURL setStringValue:repository]; + [clonePanel.destinationPath setStringValue:[targetURL path]]; + clonePanel.isBare = bare; + + [clonePanel clone:self]; +} + - (void) awakeFromNib { diff --git a/PBCommitHookFailedSheet.h b/PBCommitHookFailedSheet.h new file mode 100644 index 0000000..869d196 --- /dev/null +++ b/PBCommitHookFailedSheet.h @@ -0,0 +1,25 @@ +// +// PBCommitHookFailedSheet.h +// GitX +// +// Created by Sebastian Staudt on 9/12/10. +// Copyright 2010 Sebastian Staudt. All rights reserved. +// + +#import + +#import "PBGitCommitController.h" +#import "PBGitXMessageSheet.h" + + +@interface PBCommitHookFailedSheet : PBGitXMessageSheet +{ + PBGitCommitController *commitController; +} + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller; + +- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller; +- (IBAction)forceCommit:(id)sender; + +@end \ No newline at end of file diff --git a/PBCommitHookFailedSheet.m b/PBCommitHookFailedSheet.m new file mode 100644 index 0000000..907d85a --- /dev/null +++ b/PBCommitHookFailedSheet.m @@ -0,0 +1,38 @@ +// +// PBCommitHookFailedSheet.m +// GitX +// +// Created by Sebastian Staudt on 9/12/10. +// Copyright 2010 Sebastian Staudt. All rights reserved. +// + +#import "PBCommitHookFailedSheet.h" +#import "PBGitWindowController.h" + + +@implementation PBCommitHookFailedSheet + +#pragma mark - +#pragma mark PBCommitHookFailedSheet + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller +{ + PBCommitHookFailedSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCommitHookFailedSheet" andController:controller]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:message infoText:info]; +} + +- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller; +{ + self = [self initWithWindowNibName:windowNibName]; + commitController = controller; + + return self; +} + +- (IBAction)forceCommit:(id)sender +{ + [self closeMessageSheet:self]; + [commitController forceCommit:sender]; +} + +@end diff --git a/PBCommitHookFailedSheet.xib b/PBCommitHookFailedSheet.xib new file mode 100644 index 0000000..60e58b1 --- /dev/null +++ b/PBCommitHookFailedSheet.xib @@ -0,0 +1,1288 @@ + + + + 1050 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCommitHookFailedSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 331}, {540, 179}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 289 + {{430, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{17, 98}, {64, 64}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 0 + 0 + NO + + YES + + + + 266 + {{99, 142}, {424, 17}} + + YES + + 67239424 + 272629760 + <message> + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {423, 14} + + + + + + PGluZm8+A + + + YES + + YES + NSFont + NSParagraphStyle + + + YES + + Helvetica + 12 + 16 + + + 4 + + + + + + + + YES + + + 134 + + + + 423 + 1 + + + 2049 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {423, 1e+07} + {223, 0} + + + + {422, 72} + + + + + + {4, -5} + 1 + + 2 + + + + -2147483392 + {{386, 1}, {15, 163}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + YES + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{98, 60}, {422, 72}} + + + 656 + + + + + + + 289 + {{289, 12}, {129, 32}} + + YES + + 67239424 + 134217728 + Force Commit + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + {540, 179} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + iconView + + + + 15 + + + + infoView + + + + 16 + + + + messageField + + + + 17 + + + + window + + + + 18 + + + + closeMessageSheet: + + + + 19 + + + + scrollView + + + + 20 + + + + forceCommit: + + + + 24 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + YES + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 21 + + + YES + + + + + + 22 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 2.IBPluginDependency + 2.IBUserGuides + 21.IBPluginDependency + 22.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{279, 244}, {540, 179}} + com.apple.InterfaceBuilder.CocoaPlugin + {{279, 244}, {540, 179}} + + {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 + + YES + + + 103 + 0 + + + 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 + + + + YES + + + YES + + + + + YES + + + YES + + + + 24 + + + + YES + + PBCommitHookFailedSheet + PBGitXMessageSheet + + forceCommit: + id + + + forceCommit: + + forceCommit: + id + + + + IBProjectSource + PBCommitHookFailedSheet.h + + + + PBGitXMessageSheet + NSWindowController + + closeMessageSheet: + id + + + closeMessageSheet: + + closeMessageSheet: + id + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + NSImageView + NSTextView + NSTextField + NSScrollView + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + + iconView + NSImageView + + + infoView + NSTextView + + + messageField + NSTextField + + + scrollView + NSScrollView + + + + + IBProjectSource + PBGitXMessageSheet.h + + + + + 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 + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.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 + 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 + + + + 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 + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + 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 + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + GitX.xcodeproj + 3 + + NSApplicationIcon + {128, 128} + + + diff --git a/PBCommitList.h b/PBCommitList.h index d83dd80..3829a41 100644 --- a/PBCommitList.h +++ b/PBCommitList.h @@ -16,6 +16,8 @@ IBOutlet WebView* webView; IBOutlet PBWebHistoryController *webController; IBOutlet PBGitHistoryController *controller; + IBOutlet PBHistorySearchController *searchController; + BOOL useAdjustScroll; NSPoint mouseDownPoint; } diff --git a/PBCommitList.m b/PBCommitList.m index c3f0998..dbf33b4 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -9,6 +9,7 @@ #import "PBCommitList.h" #import "PBGitRevisionCell.h" #import "PBWebHistoryController.h" +#import "PBHistorySearchController.h" @implementation PBCommitList @@ -23,13 +24,13 @@ - (void)keyDown:(NSEvent *)event { NSString* character = [event charactersIgnoringModifiers]; - + // Pass on command-shift up/down to the responder. We want the splitview to capture this. if ([event modifierFlags] & NSShiftKeyMask && [event modifierFlags] & NSCommandKeyMask && ([event keyCode] == 0x7E || [event keyCode] == 0x7D)) { [self.nextResponder keyDown:event]; return; } - + if ([character isEqualToString:@" "]) { if (controller.selectedCommitDetailsIndex == 0) { if ([event modifierFlags] & NSShiftKeyMask) @@ -51,6 +52,11 @@ [controller copyCommitInfo]; } +- (void) copySHA:(id)sender +{ + [controller copyCommitSHA]; +} + // !!! Andre Berg 20100330: Used from -scrollSelectionToTopOfViewFrom: of PBGitHistoryController // so that when the history controller udpates the branch filter the origin of the superview gets // shifted into multiples of the row height. Otherwise the top selected row will always be off by @@ -117,4 +123,66 @@ return newImage; } + + +#pragma mark Row highlighting + +- (NSColor *)searchResultHighlightColorForRow:(NSInteger)rowIndex +{ + // if the row is selected use default colors + if ([self isRowSelected:rowIndex]) { + if ([[self window] isKeyWindow]) { + if ([[self window] firstResponder] == self) { + return [NSColor alternateSelectedControlColor]; + } + return [NSColor selectedControlColor]; + } + return [NSColor secondarySelectedControlColor]; + } + + // light blue color highlighting search results + return [NSColor colorWithCalibratedRed:0.751f green:0.831f blue:0.943f alpha:0.800f]; +} + +- (NSColor *)searchResultHighlightStrokeColorForRow:(NSInteger)rowIndex +{ + if ([self isRowSelected:rowIndex]) + return [NSColor colorWithCalibratedWhite:0.0f alpha:0.30f]; + + return [NSColor colorWithCalibratedWhite:0.0f alpha:0.05f]; +} + +- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)tableViewClipRect +{ + NSRect rowRect = [self rectOfRow:rowIndex]; + BOOL isRowVisible = NSIntersectsRect(rowRect, tableViewClipRect); + + // draw special highlighting if the row is part of search results + if (isRowVisible && [searchController isRowInSearchResults:rowIndex]) { + NSRect highlightRect = NSInsetRect(rowRect, 1.0f, 1.0f); + float radius = highlightRect.size.height / 2.0f; + + NSBezierPath *highlightPath = [NSBezierPath bezierPathWithRoundedRect:highlightRect xRadius:radius yRadius:radius]; + + [[self searchResultHighlightColorForRow:rowIndex] set]; + [highlightPath fill]; + + [[self searchResultHighlightStrokeColorForRow:rowIndex] set]; + [highlightPath stroke]; + } + + // draws the content inside the row + [super drawRow:rowIndex clipRect:tableViewClipRect]; +} + +- (void)highlightSelectionInClipRect:(NSRect)tableViewClipRect +{ + // disable highlighting if the selected row is part of search results + // instead do the highlighting in drawRow:clipRect: above + if ([searchController isRowInSearchResults:[self selectedRow]]) + return; + + [super highlightSelectionInClipRect:tableViewClipRect]; +} + @end diff --git a/PBCreateBranchSheet.m b/PBCreateBranchSheet.m index ebd2643..0eb8d2a 100644 --- a/PBCreateBranchSheet.m +++ b/PBCreateBranchSheet.m @@ -51,6 +51,16 @@ [self.errorMessageField setStringValue:@""]; self.shouldCheckoutBranch = [PBGitDefaults shouldCheckoutBranch]; + // when creating a local branch tracking a remote branch preset the branch name to the name of the remote branch + if ([self.startRefish refishType] == kGitXRemoteBranchType) { + NSMutableArray *components = [[[self.startRefish shortName] componentsSeparatedByString:@"/"] mutableCopy]; + if ([components count] > 1) { + [components removeObjectAtIndex:0]; + NSString *branchName = [components componentsJoinedByString:@"/"]; + [self.branchNameField setStringValue:branchName]; + } + } + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; } diff --git a/PBDiffWindowController.m b/PBDiffWindowController.m index 496c850..06403d5 100644 --- a/PBDiffWindowController.m +++ b/PBDiffWindowController.m @@ -9,6 +9,7 @@ #import "PBDiffWindowController.h" #import "PBGitRepository.h" #import "PBGitCommit.h" +#import "PBGitDefaults.h" @implementation PBDiffWindowController @@ -34,6 +35,10 @@ NSString *commitSelector = [NSString stringWithFormat:@"%@..%@", [startCommit realSha], [diffCommit realSha]]; NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", commitSelector, nil]; + + if (![PBGitDefaults showWhitespaceDifferences]) + [arguments insertObject:@"-w" atIndex:1]; + if (filePaths) { [arguments addObject:@"--"]; [arguments addObjectsFromArray:filePaths]; diff --git a/PBEasyPipe.h b/PBEasyPipe.h index 151483a..84793ee 100644 --- a/PBEasyPipe.h +++ b/PBEasyPipe.h @@ -14,14 +14,26 @@ } + (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir; -+ (NSFileHandle *) handleForCommand:(NSString *)cmd withArgs:(NSArray *)args; -+ (NSFileHandle *) handleForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir; ++ (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args; ++ (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir retValue:(int *)ret; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir inputString:(NSString *)input retValue:(int *)ret; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir byExtendingEnvironment:(NSDictionary *)dict inputString:(NSString *)input retValue:(int *)ret; ++ (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args; ++ (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir; ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + retValue:(int *) ret; ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + inputString:(NSString *)input + retValue:(int *) ret; ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + byExtendingEnvironment:(NSDictionary *)dict + inputString:(NSString *)input + retValue:(int *) ret; @end diff --git a/PBEasyPipe.m b/PBEasyPipe.m index 10a563f..8506daf 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -16,6 +16,26 @@ return [self handleForCommand:cmd withArgs:args inDir:nil]; } ++ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir +{ + NSTask* task = [[NSTask alloc] init]; + [task setLaunchPath:cmd]; + [task setArguments:args]; + if (dir) + [task setCurrentDirectoryPath:dir]; + + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Show Debug Messages"]) + NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); +#ifdef CLI + NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); +#endif + + NSPipe* pipe = [NSPipe pipe]; + [task setStandardOutput:pipe]; + [task setStandardError:pipe]; + return task; +} + + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir { NSTask *task = [self taskForCommand:cmd withArgs:args inDir:dir]; @@ -25,76 +45,64 @@ return handle; } -+ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir + + ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + retValue:(int *) ret { - NSTask* task = [[NSTask alloc] init]; - [task setLaunchPath:cmd]; - [task setArguments:args]; - if (dir) { - // check if the dir exists and is really a folder - BOOL isDir = NO; - if ([[NSFileManager defaultManager] fileExistsAtPath:dir isDirectory:&isDir] && isDir) { - [task setCurrentDirectoryPath:dir]; - } - } - - /* use getenv too so we can easily use Xcodes executable environment */ - if (([[NSUserDefaults standardUserDefaults] boolForKey:@"Show Debug Messages"]) || (getenv("PBDebugEnabled"))) - { - NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); - } - -#ifdef CLI - NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); -#endif - - NSPipe* pipe = [[NSPipe alloc] init]; - [task setStandardOutput:pipe]; - [task setStandardError:pipe]; - return task; + return [self outputForCommand:cmd withArgs:args inDir:dir byExtendingEnvironment:nil inputString:nil retValue:ret]; +} + ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + inputString:(NSString *) input + retValue:(int *) ret +{ + return [self outputForCommand:cmd withArgs:args inDir:dir byExtendingEnvironment:nil inputString:input retValue:ret]; } -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir retValue:(int *)ret { - return [self outputForCommand:cmd withArgs:args inDir:dir byExtendingEnvironment:nil inputString:nil retValue:ret]; -} ++ (NSString*) outputForCommand:(NSString *) cmd + withArgs:(NSArray *) args + inDir:(NSString *) dir + byExtendingEnvironment:(NSDictionary *)dict + inputString:(NSString *) input + retValue:(int *) ret +{ + NSTask *task = [self taskForCommand:cmd withArgs:args inDir:dir]; -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir inputString:(NSString *)input retValue:(int *)ret { - return [self outputForCommand:cmd withArgs:args inDir:dir byExtendingEnvironment:nil inputString:input retValue:ret]; -} + if (dict) { + NSMutableDictionary *env = [[[NSProcessInfo processInfo] environment] mutableCopy]; + [env addEntriesFromDictionary:dict]; + [task setEnvironment:env]; + } -+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir byExtendingEnvironment:(NSDictionary *)dict inputString:(NSString *)input retValue:(int *)ret { - NSTask * task = [self taskForCommand:cmd withArgs:args inDir:dir]; + NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; - if (dict) { - NSMutableDictionary * env = [[[NSProcessInfo processInfo] environment] mutableCopy]; - [env addEntriesFromDictionary:dict]; - [task setEnvironment:env]; - } - - NSFileHandle * handle = [[task standardOutput] fileHandleForReading]; - - if (input) { - [task setStandardInput:[[NSPipe alloc] init]]; - NSFileHandle * inHandle = [[task standardInput] fileHandleForWriting]; - [inHandle writeData:[input dataUsingEncoding:NSUTF8StringEncoding]]; - [inHandle closeFile]; - } - - [task launch]; - - NSData * data = [handle readDataToEndOfFile]; - NSString * string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - if (!string) - string = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding]; - - // Strip trailing newline - if ([string hasSuffix:@"\n"]) - string = [string substringToIndex:[string length] - 1]; - - [task waitUntilExit]; - if (ret) - *ret = [task terminationStatus]; - return string; + if (input) { + [task setStandardInput:[NSPipe pipe]]; + NSFileHandle *inHandle = [[task standardInput] fileHandleForWriting]; + [inHandle writeData:[input dataUsingEncoding:NSUTF8StringEncoding]]; + [inHandle closeFile]; + } + + [task launch]; + + NSData* data = [handle readDataToEndOfFile]; + NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + if (!string) + string = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding]; + + // Strip trailing newline + if ([string hasSuffix:@"\n"]) + string = [string substringToIndex:[string length]-1]; + + [task waitUntilExit]; + if (ret) + *ret = [task terminationStatus]; + return string; } // We don't use the above function because then we'd have to wait until the program was finished @@ -102,18 +110,17 @@ + (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir { - NSLog(@"cmd=%@ args=%@ dir=%@",cmd,args,dir); - NSTask *task = [self taskForCommand:cmd withArgs:args inDir:dir]; NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; [task launch]; + // This can cause a "Bad file descriptor"... when? NSData *data; @try { data = [handle readDataToEndOfFile]; } @catch (NSException * e) { - NSLog(@"Got a bad file descriptor in %s!", _cmd); + NSLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd)); if ([NSThread currentThread] != [NSThread mainThread]) [task waitUntilExit]; @@ -130,7 +137,6 @@ if ([NSThread currentThread] != [NSThread mainThread]) [task waitUntilExit]; - //NSLog(@"%@",string); return string; } diff --git a/PBGitCommit.h b/PBGitCommit.h index 02ceb03..e77ee32 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -10,22 +10,21 @@ #import "PBGitRepository.h" #import "PBGitTree.h" #import "PBGitRefish.h" -#include "git/oid.h" +#import "PBGitSHA.h" extern NSString * const kGitXCommitType; @interface PBGitCommit : NSObject { - git_oid sha; - git_oid *parentShas; - int nParents; + PBGitSHA *sha; NSString* subject; NSString* author; + NSString *committer; NSString* details; NSString *_patch; - NSArray* parents; + NSArray *parents; NSString *realSHA; int timestamp; @@ -34,8 +33,8 @@ extern NSString * const kGitXCommitType; PBGitRepository* repository; } -+ (id) commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha; -- (id) initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; ++ (PBGitCommit *)commitWithRepository:(PBGitRepository*)repo andSha:(PBGitSHA *)newSha; +- (id)initWithRepository:(PBGitRepository *)repo andSha:(PBGitSHA *)newSha; - (void) addRef:(PBGitRef *)ref; - (void) removeRef:(id)ref; @@ -50,13 +49,13 @@ extern NSString * const kGitXCommitType; - (NSString *) shortName; - (NSString *) refishType; -@property (readonly) git_oid *sha; +@property (readonly) PBGitSHA *sha; @property (copy) NSString* subject; @property (copy) NSString* author; -@property (readonly) NSArray* parents; // TODO: remove this and its uses +@property (copy) NSString *committer; +@property (retain) NSArray *parents; -@property (assign) git_oid *parentShas; -@property (assign) int nParents, timestamp; +@property (assign) int timestamp; @property (retain) NSMutableArray* refs; @property (readonly) NSDate *date; diff --git a/PBGitCommit.m b/PBGitCommit.m index e5db9ed..067d6f4 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -7,6 +7,7 @@ // #import "PBGitCommit.h" +#import "PBGitSHA.h" #import "PBGitDefaults.h" @@ -15,95 +16,21 @@ NSString * const kGitXCommitType = @"commit"; @implementation PBGitCommit -@synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo; +@synthesize repository, subject, timestamp, author, sign, lineInfo; +@synthesize sha; +@synthesize parents; +@synthesize committer; -- (NSArray *) parents -{ - if (nParents == 0) - return NULL; - - int i; - NSMutableArray *p = [NSMutableArray arrayWithCapacity:nParents]; - for (i = 0; i < nParents; ++i) - { - char buff[GIT_OID_HEXSZ+1]; - char * s = git_oid_to_string(buff, GIT_OID_HEXSZ+1, parentShas + i); - [p addObject:[NSString stringWithUTF8String:s]]; - } - return p; -} - -- (NSString *) description { - return [NSString stringWithFormat:@"%@, realSha = %@, %d parent(s), repository = %@", - [super description], [self realSha], nParents, repository]; -} - (NSDate *)date { return [NSDate dateWithTimeIntervalSince1970:timestamp]; } --(NSString *)dateString { - if ([PBGitDefaults showRelativeDates]) { - // Code modified from Gilean ( http://stackoverflow.com/users/6305/gilean ). - // Copied from stackoverflow's accepted answer for Objective C relative dates. - // http://stackoverflow.com/questions/902950/iphone-convert-date-string-to-a-relative-time-stamp - // Modified the seconds constants with compile time math to aid in ease of adjustment of "Majic" numbers. - // - NSDate *todayDate = [NSDate date]; - double ti = [self.date timeIntervalSinceDate:todayDate]; - ti = ti * -1; - if(ti < 1) { - return @"In the future!"; - } else if ( ti < 60 ) { - return @"less than a minute ago"; - } else if ( ti < (60 * 60) ) { - int diff = round(ti / 60); - if ( diff < 2 ) { - return @"1 minute ago"; - } else { - return [NSString stringWithFormat:@"%d minutes ago", diff]; - } - } else if ( ti < ( 60 * 60 * 24 ) ) { - int diff = round(ti / 60 / 60); - if ( diff < 2 ) { - return @"1 hour ago"; - } else { - return[NSString stringWithFormat:@"%d hours ago", diff]; - } - } else if ( ti < ( 60 * 60 * 24 * 7 ) ) { - int diff = round(ti / 60 / 60 / 24); - if ( diff < 2 ) { - return @"1 day ago"; - } else { - return[NSString stringWithFormat:@"%d days ago", diff]; - } - } else if ( ti < ( 60 * 60 * 24 * 31.5 ) ) { - int diff = round(ti / 60 / 60 / 24 / 7); - if ( diff < 2 ) { - return @"1 week ago"; - } else { - return[NSString stringWithFormat:@"%d weeks ago", diff]; - } - } else if ( ti < ( 60 * 60 * 24 * 365 ) ) { - int diff = round(ti / 60 / 60 / 24 / 30); - if ( diff < 2 ) { - return @"1 month ago"; - } else { - return[NSString stringWithFormat:@"%d months ago", diff]; - } - } else { - float diff = round(ti / 60 / 60 / 24 / 365 * 4) / 4.0; - if ( diff < 1.25 ) { - return @"1 year ago"; - } else { - return[NSString stringWithFormat:@"%g years ago", diff]; - } - } - } else { - NSDateFormatter* formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:NO]; - return [formatter stringFromDate: self.date]; - } +- (NSString *) dateString +{ + NSDateFormatter* formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:NO]; + return [formatter stringFromDate: self.date]; } - (NSArray*) treeContents @@ -111,17 +38,12 @@ NSString * const kGitXCommitType = @"commit"; return self.tree.children; } -- (git_oid *)sha ++ (PBGitCommit *)commitWithRepository:(PBGitRepository*)repo andSha:(PBGitSHA *)newSha { - return &sha; + return [[self alloc] initWithRepository:repo andSha:newSha]; } -+ commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha -{ - return [[[self alloc] initWithRepository:repo andSha:newSha] autorelease]; -} - -- initWithRepository:(PBGitRepository*) repo andSha:(git_oid)newSha +- (id)initWithRepository:(PBGitRepository*) repo andSha:(PBGitSHA *)newSha { details = nil; repository = repo; @@ -131,27 +53,18 @@ NSString * const kGitXCommitType = @"commit"; - (NSString *)realSha { - if (!realSHA) { - char buff[GIT_OID_HEXSZ+1]; - char * hex = git_oid_to_string(buff, GIT_OID_HEXSZ+1, &sha); - realSHA = [NSString stringWithUTF8String:hex]; - } - - return realSHA; + return sha.string; } -- (BOOL) isOnSameBranchAs:(PBGitCommit *)other +- (BOOL) isOnSameBranchAs:(PBGitCommit *)otherCommit { - if (!other) + if (!otherCommit) return NO; - NSString *mySHA = [self realSha]; - NSString *otherSHA = [other realSha]; - - if ([otherSHA isEqualToString:mySHA]) + if ([self isEqual:otherCommit]) return YES; - return [repository isOnSameBranch:otherSHA asSHA:mySHA]; + return [repository isOnSameBranch:otherCommit.sha asSHA:self.sha]; } - (BOOL) isOnHeadBranch @@ -159,6 +72,22 @@ NSString * const kGitXCommitType = @"commit"; return [self isOnSameBranchAs:[repository headCommit]]; } +- (BOOL)isEqual:(id)otherCommit +{ + if (self == otherCommit) + return YES; + + if (![otherCommit isMemberOfClass:[PBGitCommit class]]) + return NO; + + return [self.sha isEqual:[(PBGitCommit *)otherCommit sha]]; +} + +- (NSUInteger)hash +{ + return [self.sha hash]; +} + // FIXME: Remove this method once it's unused. - (NSString*) details { @@ -211,17 +140,16 @@ NSString * const kGitXCommitType = @"commit"; - (NSMutableArray *)refs { - return [[repository refs] objectForKey:[self realSha]]; + return [[repository refs] objectForKey:[self sha]]; } - (void) setRefs:(NSMutableArray *)refs { - [[repository refs] setObject:refs forKey:[self realSha]]; + [[repository refs] setObject:refs forKey:[self sha]]; } - (void)finalize { - free(parentShas); [super finalize]; } diff --git a/PBGitCommitController.h b/PBGitCommitController.h index ae26950..ac852a3 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -8,7 +8,6 @@ #import #import "PBViewController.h" -#import "FileViewerController.h" @class PBGitIndexController, PBIconAndTextCell, PBWebChangesController, PBGitIndex; @@ -22,9 +21,6 @@ IBOutlet NSArrayController *cachedFilesController; IBOutlet NSButton *commitButton; - IBOutlet NSView *fileViewer; - FileViewerController *fileViewerController; - IBOutlet PBGitIndexController *indexController; IBOutlet PBWebChangesController *webController; } @@ -33,5 +29,6 @@ - (IBAction) refresh:(id) sender; - (IBAction) commit:(id) sender; +- (IBAction) forceCommit:(id) sender; - (IBAction)signOff:(id)sender; @end diff --git a/PBGitCommitController.m b/PBGitCommitController.m index ade187d..9f0eca1 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -14,9 +14,11 @@ @interface PBGitCommitController () - (void)refreshFinished:(NSNotification *)notification; +- (void)commitWithVerification:(BOOL) doVerify; - (void)commitStatusUpdated:(NSNotification *)notification; - (void)commitFinished:(NSNotification *)notification; - (void)commitFailed:(NSNotification *)notification; +- (void)commitHookFailed:(NSNotification *)notification; - (void)amendCommit:(NSNotification *)notification; - (void)indexChanged:(NSNotification *)notification; - (void)indexOperationFailed:(NSNotification *)notification; @@ -38,6 +40,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitStatusUpdated:) name:PBGitIndexCommitStatus object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitFinished:) name:PBGitIndexFinishedCommit object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitFailed:) name:PBGitIndexCommitFailed object:index]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitHookFailed:) name:PBGitIndexCommitHookFailed object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(amendCommit:) name:PBGitIndexAmendMessageAvailable object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexChanged:) name:PBGitIndexIndexUpdated object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexOperationFailed:) name:PBGitIndexOperationFailed object:index]; @@ -62,25 +65,11 @@ [cachedFilesController setAutomaticallyRearrangesObjects:NO]; [unstagedFilesController setAutomaticallyRearrangesObjects:NO]; - - fileViewerController=[[FileViewerController alloc] retain]; - [fileViewerController setCommit:true]; - [fileViewerController initWithRepository:repository andController:webController]; - [fileViewerController loadView]; - - // XXXX :( ? - NSMutableArray *sv=[NSMutableArray arrayWithArray:[[fileViewer superview] subviews]]; - [sv removeObjectAtIndex:0]; - [sv insertObject:[fileViewerController view] atIndex:0]; - [[fileViewer superview] setSubviews:sv]; - webController.fileViewerController=fileViewerController; - } -- (void) removeView +- (void)closeView { [webController closeView]; - [super finalize]; } - (NSResponder *)firstResponder; @@ -121,7 +110,17 @@ - (IBAction) commit:(id) sender { - if ([[NSFileManager defaultManager] fileExistsAtPath:[[[repository fileURL] path] stringByAppendingPathComponent:@"MERGE_HEAD"]]) { + [self commitWithVerification:YES]; +} + +- (IBAction) forceCommit:(id) sender +{ + [self commitWithVerification:NO]; +} + +- (void) commitWithVerification:(BOOL) doVerify +{ + if ([[NSFileManager defaultManager] fileExistsAtPath:[repository.fileURL.path stringByAppendingPathComponent:@"MERGE_HEAD"]]) { [[repository windowController] showMessageSheet:@"Cannot commit merges" infoText:@"GitX cannot commit merges yet. Please commit your changes from the command line."]; return; } @@ -143,7 +142,7 @@ self.isBusy = YES; [commitMessageView setEditable:NO]; - [index commitWithMessage:commitMessage]; + [index commitWithMessage:commitMessage andVerify:doVerify]; } @@ -163,7 +162,7 @@ { [commitMessageView setEditable:YES]; [commitMessageView setString:@""]; - [webController setStateMessage:[NSString stringWithString:[[notification userInfo] objectForKey:@"description"]]]; + [webController setStateMessage:[NSString stringWithFormat:[[notification userInfo] objectForKey:@"description"]]]; } - (void)commitFailed:(NSNotification *)notification @@ -175,6 +174,15 @@ [[repository windowController] showMessageSheet:@"Commit failed" infoText:reason]; } +- (void)commitHookFailed:(NSNotification *)notification +{ + self.isBusy = NO; + NSString *reason = [[notification userInfo] objectForKey:@"description"]; + self.status = [@"Commit hook failed: " stringByAppendingString:reason]; + [commitMessageView setEditable:YES]; + [[repository windowController] showCommitHookFailedSheet:@"Commit hook failed" infoText:reason commitController:self]; +} + - (void)amendCommit:(NSNotification *)notification { // Replace commit message with the old one if it's less than 3 characters long. diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index de74b2b..96cec64 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -2,13 +2,22 @@ 1050 - 10D573 + 10C540 762 - 1038.29 - 460.00 + 1038.25 + 458.00 - com.apple.InterfaceBuilder.CocoaPlugin - 762 + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 762 + 762 + YES @@ -17,6 +26,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES @@ -48,13 +58,55 @@ 274 YES - + - 4370 - {1351, 234} + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {852, 181} - YES - NSView + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES @@ -84,7 +136,7 @@ 4352 - {302, 310} + {189, 221} YES @@ -95,7 +147,7 @@ YES - 299 + 186 10 3.4028229999999999e+38 @@ -176,7 +228,7 @@ 0 - {{1, 1}, {302, 310}} + {{1, 1}, {189, 221}} @@ -203,7 +255,7 @@ 0.99470899999999995 - {{-1, -1}, {304, 312}} + {{-1, -1}, {191, 223}} 562 @@ -213,11 +265,11 @@ QSAAAEEgAABBiAAAQYgAAA - {303, 316} + {190, 227} - {303, 331} + {190, 242} {0, 0} @@ -255,7 +307,7 @@ 289 - {{596, 0}, {96, 32}} + {{339, 0}, {96, 32}} YES @@ -299,6 +351,7 @@ Apple PNG pasteboard type Apple URL pasteboard type CorePasteboardFlavorType 0x6D6F6F76 + CorePasteboardFlavorType 0x75726C20 NSColor pasteboard type NSFilenamesPboardType NSStringPboardType @@ -312,7 +365,7 @@ public.url - {684, 15} + {427, 41} @@ -330,7 +383,7 @@ - 684 + 427 1 @@ -382,11 +435,11 @@ 6 {1161, 1e+07} - {216, 0} + {223, 0} - {{1, 1}, {684, 273}} + {{1, 1}, {427, 184}} @@ -418,7 +471,7 @@ 0.94565220000000005
- {{0, 33}, {686, 275}} + {{0, 36}, {429, 186}} 530 @@ -456,7 +509,7 @@ 289 - {{500, 0}, {96, 32}} + {{243, 0}, {96, 32}} YES @@ -474,11 +527,11 @@
- {686, 316} + {429, 227}
- {{312, 0}, {686, 331}} + {{199, 0}, {429, 242}} {0, 0} @@ -521,7 +574,7 @@ 4352 - {343, 310} + {214, 221} 1 YES @@ -533,7 +586,7 @@ YES - 340 + 211 10 3.4028229999999999e+38 @@ -574,7 +627,7 @@ 0 - {{1, 1}, {343, 310}} + {{1, 1}, {214, 221}} @@ -601,7 +654,7 @@ 0.90033220000000003 - {{0, -1}, {345, 312}} + {{0, -1}, {216, 223}} 562 @@ -611,11 +664,11 @@ QSAAAEEgAABBiAAAQYgAAA
- {344, 316} + {215, 227}
- {{1007, 0}, {344, 331}} + {{637, 0}, {215, 242}} {0, 0} @@ -636,17 +689,17 @@ NO - {{0, 243}, {1351, 331}} + {{0, 190}, {852, 242}} YES - {1351, 574} + {852, 432} CommitViewSplitView - {1351, 574} + {852, 432} NSView @@ -738,6 +791,22 @@ 122 + + + view + + + + 136 + + + + frameLoadDelegate + + + + 137 + value: arrangedObjects.path @@ -962,14 +1031,6 @@ 307 - - - fileViewer - - - - 361 - @@ -1035,11 +1096,16 @@ YES + - + + 125 + + + 209 @@ -1065,10 +1131,10 @@ YES + - @@ -1242,15 +1308,6 @@ - - 360 - - - YES - - - File viewer - @@ -1268,6 +1325,7 @@ 113.IBPluginDependency 114.CustomClassName 114.IBPluginDependency + 125.IBPluginDependency 130.IBPluginDependency 131.IBPluginDependency 132.IBPluginDependency @@ -1285,7 +1343,6 @@ 248.IBPluginDependency 278.IBPluginDependency 279.IBPluginDependency - 360.IBPluginDependency 45.IBPluginDependency 46.IBPluginDependency 47.IBPluginDependency @@ -1303,7 +1360,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{54, 9}, {1351, 574}} + {{1091, 655}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1313,6 +1370,7 @@ com.apple.InterfaceBuilder.CocoaPlugin PBIconAndTextCell com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1333,7 +1391,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBFileChangesTableView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1362,7 +1419,7 @@ - 363 + 311 @@ -1408,7 +1465,6 @@ cachedFilesController commitButton commitMessageView - fileViewer indexController unstagedFilesController webController @@ -1418,7 +1474,6 @@ NSArrayController NSButton NSTextView - NSView PBGitIndexController NSArrayController PBWebChangesController @@ -1429,14 +1484,6 @@ PBGitCommitController.h - - PBGitGradientBarView - NSView - - IBProjectSource - PBGitGradientBarView.h - - PBGitIndexController NSObject @@ -1462,7 +1509,6 @@ stagedTable unstagedFilesController unstagedTable - upperToolbarView YES @@ -1471,7 +1517,6 @@ NSTableView NSArrayController NSTableView - PBGitGradientBarView @@ -1510,17 +1555,12 @@ PBWebChangesController PBWebController - - displayControlChanged: - id - YES YES cachedFilesController controller - displayControl indexController unstagedFilesController @@ -1528,7 +1568,6 @@ YES NSArrayController PBGitCommitController - NSSegmentedCell PBGitIndexController NSArrayController @@ -2060,14 +2099,6 @@ AppKit.framework/Headers/NSScroller.h - - NSSegmentedCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSSegmentedCell.h - - NSSplitView NSView diff --git a/PBGitConfig.h b/PBGitConfig.h index 24b1197..1645819 100644 --- a/PBGitConfig.h +++ b/PBGitConfig.h @@ -13,7 +13,7 @@ @interface PBGitConfig : NSObject { NSString *repositoryPath; } -@property (copy) NSString *repositoryPath; -- (id) init; -- (id) initWithRepositoryPath:(NSString *)path; + +- init; +- initWithRepositoryPath:(NSString *)path; @end diff --git a/PBGitConfig.m b/PBGitConfig.m index 41ead58..caf883c 100644 --- a/PBGitConfig.m +++ b/PBGitConfig.m @@ -10,15 +10,14 @@ @implementation PBGitConfig -@synthesize repositoryPath; -- (id) init +- init { repositoryPath = nil; return self; } -- (id) initWithRepositoryPath:(NSString *)path +- initWithRepositoryPath:(NSString *)path { repositoryPath = path; return self; diff --git a/PBGitDefaults.h b/PBGitDefaults.h index 013eb15..46b28b5 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -12,16 +12,12 @@ } + (int) commitMessageViewVerticalLineLength; -+ (NSInteger) truncateInfoTextSize; -+ (BOOL) truncateInfoText; + (BOOL) commitMessageViewHasVerticalLine; + (BOOL) isGistEnabled; + (BOOL) isGravatarEnabled; + (BOOL) confirmPublicGists; + (BOOL) isGistPublic; -+ (BOOL) showWhitespaceDifferences; -+ (BOOL) showRelativeDates; -+ (BOOL) refreshAutomatically; ++ (BOOL)showWhitespaceDifferences; + (BOOL)openCurDirOnLaunch; + (BOOL)showOpenPanelOnLaunch; + (BOOL) shouldCheckoutBranch; @@ -38,5 +34,7 @@ + (void) removePreviousDocumentPaths; + (NSInteger) branchFilter; + (void) setBranchFilter:(NSInteger)state; ++ (NSInteger)historySearchMode; ++ (void)setHistorySearchMode:(NSInteger)mode; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index f4f9fb3..ccc2162 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -7,65 +7,57 @@ // #import "PBGitDefaults.h" +#import "PBHistorySearchController.h" -#define kDefaultVerticalLineLength 50 +#define kDefaultVerticalLineLength 50 #define kCommitMessageViewVerticalLineLength @"PBCommitMessageViewVerticalLineLength" -#define kCommitMessageViewHasVerticalLine @"PBCommitMessageViewHasVerticalLine" -#define kEnableGist @"PBEnableGist" -#define kEnableGravatar @"PBEnableGravatar" -#define kConfirmPublicGists @"PBConfirmPublicGists" -#define kPublicGist @"PBGistPublic" -#define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences" -#define kRefreshAutomatically @"PBRefreshAutomatically" -#define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch" -#define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" -#define kShouldCheckoutBranch @"PBShouldCheckoutBranch" -#define kRecentCloneDestination @"PBRecentCloneDestination" -#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" -#define kShowStageView @"PBShowStageView" -#define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch" -#define kPreviousDocumentPaths @"PBPreviousDocumentPaths" -#define kBranchFilterState @"PBBranchFilter" -#define kShowRelativeDates @"PBShowRelativeDates" -#define kTruncateInfoText @"PBTruncateInfoText" -#define kTruncateInfoTextSize @"PBTruncateInfoTextSize" +#define kCommitMessageViewHasVerticalLine @"PBCommitMessageViewHasVerticalLine" +#define kEnableGist @"PBEnableGist" +#define kEnableGravatar @"PBEnableGravatar" +#define kConfirmPublicGists @"PBConfirmPublicGists" +#define kPublicGist @"PBGistPublic" +#define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences" +#define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch" +#define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" +#define kShouldCheckoutBranch @"PBShouldCheckoutBranch" +#define kRecentCloneDestination @"PBRecentCloneDestination" +#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" +#define kShowStageView @"PBShowStageView" +#define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch" +#define kPreviousDocumentPaths @"PBPreviousDocumentPaths" +#define kBranchFilterState @"PBBranchFilter" +#define kHistorySearchMode @"PBHistorySearchMode" @implementation PBGitDefaults -+ (void) initialize { - NSMutableDictionary * defaultValues = [NSMutableDictionary dictionary]; - - [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength] ++ (void)initialize +{ + NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; + [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength] forKey:kCommitMessageViewVerticalLineLength]; [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:kCommitMessageViewHasVerticalLine]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kEnableGist]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kEnableGravatar]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kConfirmPublicGists]; - [defaultValues setObject:[NSNumber numberWithBool:NO] - forKey:kPublicGist]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kShowWhitespaceDifferences]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kOpenCurDirOnLaunch]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kShowOpenPanelOnLaunch]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kRefreshAutomatically]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kShouldCheckoutBranch]; - [defaultValues setObject:[NSNumber numberWithBool:NO] + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kEnableGist]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kEnableGravatar]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kConfirmPublicGists]; + [defaultValues setObject:[NSNumber numberWithBool:NO] + forKey:kPublicGist]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kShowWhitespaceDifferences]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kOpenCurDirOnLaunch]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kShowOpenPanelOnLaunch]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kShouldCheckoutBranch]; + [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:kOpenPreviousDocumentsOnLaunch]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kShowRelativeDates]; - [defaultValues setObject:[NSNumber numberWithBool:YES] - forKey:kTruncateInfoText]; - [defaultValues setObject:[NSNumber numberWithInteger:1000] - forKey:kTruncateInfoTextSize]; - [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; + [defaultValues setObject:[NSNumber numberWithInteger:kGitXBasicSeachMode] + forKey:kHistorySearchMode]; + [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; } + (int) commitMessageViewVerticalLineLength @@ -73,16 +65,6 @@ return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength]; } -+ (BOOL) truncateInfoText -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:kTruncateInfoText]; -} - -+ (NSInteger) truncateInfoTextSize -{ - return [[NSUserDefaults standardUserDefaults] integerForKey:kTruncateInfoTextSize]; -} - + (BOOL) commitMessageViewHasVerticalLine { return [[NSUserDefaults standardUserDefaults] boolForKey:kCommitMessageViewHasVerticalLine]; @@ -108,21 +90,11 @@ return [[NSUserDefaults standardUserDefaults] boolForKey:kPublicGist]; } -+ (BOOL) refreshAutomatically -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:kRefreshAutomatically]; -} - + (BOOL)showWhitespaceDifferences { return [[NSUserDefaults standardUserDefaults] boolForKey:kShowWhitespaceDifferences]; } -+ (BOOL)showRelativeDates -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:kShowRelativeDates]; -} - + (BOOL)openCurDirOnLaunch { return [[NSUserDefaults standardUserDefaults] boolForKey:kOpenCurDirOnLaunch]; @@ -202,26 +174,14 @@ [[NSUserDefaults standardUserDefaults] setInteger:state forKey:kBranchFilterState]; } -- (BOOL) isFeatureEnabled:(NSString *)feature ++ (NSInteger)historySearchMode { - if([feature isEqualToString:@"gravatar"]) - return [PBGitDefaults isGravatarEnabled]; - else if([feature isEqualToString:@"gist"]) - return [PBGitDefaults isGistEnabled]; - else if([feature isEqualToString:@"confirmGist"]) - return [PBGitDefaults confirmPublicGists]; - else if([feature isEqualToString:@"publicGist"]) - return [PBGitDefaults isGistPublic]; - else if ([feature isEqualToString:@"showWhitespaceDifferences"]) - return [PBGitDefaults showWhitespaceDifferences]; - else - return YES; + return [[NSUserDefaults standardUserDefaults] integerForKey:kHistorySearchMode]; } -+ (BOOL)isSelectorExcludedFromWebScript:(SEL)sel ++ (void)setHistorySearchMode:(NSInteger)mode { - NSLog(@"[%@ %s]: self = %@ (%i)", [self class], _cmd, self,[self respondsToSelector:sel]); - return NO; + [[NSUserDefaults standardUserDefaults] setInteger:mode forKey:kHistorySearchMode]; } diff --git a/PBGitGrapher.h b/PBGitGrapher.h index f8945d0..d17f3bd 100644 --- a/PBGitGrapher.h +++ b/PBGitGrapher.h @@ -14,7 +14,7 @@ @interface PBGitGrapher : NSObject { PBGraphCellInfo *previous; void *pl; - void *endLane; + int curLane; } - (id) initWithRepository:(PBGitRepository *)repo; diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index b71b60d..41401d6 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -39,13 +39,16 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in int i = 0, newPos = -1; std::list *currentLanes = new std::list; std::list *previousLanes = (std::list *)pl; + NSArray *parents = [commit parents]; + int nParents = [parents count]; - int maxLines = (previousLanes->size() + commit.nParents + 2) * 2; + int maxLines = (previousLanes->size() + nParents + 2) * 2; struct PBGitGraphLine *lines = (struct PBGitGraphLine *)malloc(sizeof(struct PBGitGraphLine) * maxLines); int currentLine = 0; PBGitLane *currentLane = NULL; BOOL didFirst = NO; + git_oid commit_oid = [[commit sha] oid]; // First, iterate over earlier columns and pass through any that don't want this commit if (previous != nil) { @@ -53,21 +56,16 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in std::list::iterator it = previousLanes->begin(); for (; it != previousLanes->end(); ++it) { i++; - if(*it == (PBGitLane *)endLane) { - delete *it; - endLane = NULL; - continue; - } // This is our commit! We should do a "merge": move the line from // our upperMapping to their lowerMapping - if ((*it)->isCommit([commit sha])) { + if ((*it)->isCommit(commit_oid)) { if (!didFirst) { didFirst = YES; currentLanes->push_back(*it); currentLane = currentLanes->back(); newPos = currentLanes->size(); add_line(lines, ¤tLine, 1, i, newPos,(*it)->index()); - if (commit.nParents) + if (nParents) add_line(lines, ¤tLine, 0, newPos, newPos,(*it)->index()); } else { @@ -89,8 +87,9 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in //Add your own parents // If we already did the first parent, don't do so again - if (!didFirst && currentLanes->size() < MAX_LANES && commit.nParents) { - PBGitLane *newLane = new PBGitLane(commit.parentShas); + if (!didFirst && currentLanes->size() < MAX_LANES && nParents) { + git_oid parentOID = [[parents objectAtIndex:0] oid]; + PBGitLane *newLane = new PBGitLane(&parentOID); currentLanes->push_back(newLane); newPos = currentLanes->size(); add_line(lines, ¤tLine, 0, newPos, newPos, newLane->index()); @@ -102,15 +101,15 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in // This boolean will tell us if that happened BOOL addedParent = NO; - int parentIndex; - for (parentIndex = 1; parentIndex < commit.nParents; ++parentIndex) { - git_oid *parent = commit.parentShas + parentIndex; + int parentIndex = 0; + for (parentIndex = 1; parentIndex < nParents; ++parentIndex) { + git_oid parentOID = [[parents objectAtIndex:parentIndex] oid]; int i = 0; BOOL was_displayed = NO; std::list::iterator it = currentLanes->begin(); for (; it != currentLanes->end(); ++it) { i++; - if ((*it)->isCommit(parent)) { + if ((*it)->isCommit(parentOID)) { add_line(lines, ¤tLine, 0, i, newPos,(*it)->index()); was_displayed = YES; break; @@ -124,12 +123,19 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in // Really add this parent addedParent = YES; - PBGitLane *newLane = new PBGitLane(parent); + PBGitLane *newLane = new PBGitLane(&parentOID); currentLanes->push_back(newLane); add_line(lines, ¤tLine, 0, currentLanes->size(), newPos, newLane->index()); } - previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines]; + if (commit.lineInfo) { + previous = commit.lineInfo; + previous.position = newPos; + previous.lines = lines; + } + else + previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines]; + if (currentLine > maxLines) NSLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines); @@ -143,11 +149,10 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in previous.numColumns = currentLanes->size(); // Update the current lane to point to the new parent - if (currentLane && commit.nParents > 0) - currentLane->setSha(commit.parentShas[0]); + if (currentLane && nParents > 0) + currentLane->setSha([[parents objectAtIndex:0] oid]); else - endLane = currentLane; - // currentLanes->remove(currentLane); // must be leaked without this changes + currentLanes->remove(currentLane); delete previousLanes; diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index c59aabd..9eb81e9 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -7,92 +7,72 @@ // #import -#import #import "PBGitCommit.h" #import "PBGitTree.h" #import "PBViewController.h" #import "PBCollapsibleSplitView.h" -#import "FileViewerController.h" -@class PBQLOutlineView; @class PBGitSidebarController; +@class PBWebHistoryController; @class PBGitGradientBarView; @class PBRefController; @class QLPreviewPanel; @class PBCommitList; -@class PBSourceViewItem; +@class PBGitSHA; -@interface PBGitHistoryController : PBViewController { +@class PBHistorySearchController; + +@interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; - IBOutlet PBCommitList* commitList; - IBOutlet PBCollapsibleSplitView *historySplitView; - IBOutlet PBGitGradientBarView *upperToolbarView; - IBOutlet PBGitGradientBarView *scopeBarView; - IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; IBOutlet NSTreeController* treeController; IBOutlet NSOutlineView* fileBrowser; + NSArray *currentFileBrowserSelectionPath; + IBOutlet PBCommitList* commitList; + IBOutlet PBCollapsibleSplitView *historySplitView; + IBOutlet PBWebHistoryController *webHistoryController; + QLPreviewPanel* previewPanel; + IBOutlet PBHistorySearchController *searchController; + + IBOutlet PBGitGradientBarView *upperToolbarView; IBOutlet NSButton *mergeButton; IBOutlet NSButton *cherryPickButton; IBOutlet NSButton *rebaseButton; + + IBOutlet PBGitGradientBarView *scopeBarView; IBOutlet NSButton *allBranchesFilterItem; IBOutlet NSButton *localRemoteBranchesFilterItem; IBOutlet NSButton *selectedBranchFilterItem; - - IBOutlet NSView *fileViewer; - FileViewerController *fileViewerController; - + IBOutlet id webView; - - // moved from PBGitSidebarController - IBOutlet NSSegmentedControl * remoteControls; - - __weak QLPreviewPanel* previewPanel; - int selectedCommitDetailsIndex; BOOL forceSelectionUpdate; - NSArray *currentFileBrowserSelectionPath; - - IBOutlet MGScopeBar *treeStyle; - NSArray *treeOpts; + PBGitTree *gitTree; PBGitCommit *webCommit; PBGitCommit *selectedCommit; - - PBSourceViewItem * sidebarRemotes; - NSOutlineView * sidebarSourceView; } +@property (readonly) NSTreeController* treeController; @property (assign) int selectedCommitDetailsIndex; @property (retain) PBGitCommit *webCommit; @property (retain) PBGitTree* gitTree; @property (readonly) NSArrayController *commitController; -@property (readonly) PBCommitList *commitList; @property (readonly) PBRefController *refController; -@property (assign) NSOutlineView * sidebarSourceView; -@property (assign) PBSourceViewItem * sidebarRemotes; -@property (readonly) NSSearchField *searchField; -@property (retain) IBOutlet id webView; +@property (readonly) PBHistorySearchController *searchController; +@property (readonly) PBCommitList *commitList; - (IBAction) setDetailedView:(id)sender; - (IBAction) setTreeView:(id)sender; - (IBAction) setBranchFilter:(id)sender; + +- (void)selectCommit:(PBGitSHA *)commit; - (IBAction) refresh:(id)sender; - (IBAction) toggleQLPreviewPanel:(id)sender; - (IBAction) openSelectedFile:(id)sender; - -- (BOOL) selectCommit: (NSString*) commit; -- (void) updateKeys; - - (void) updateQuicklookForce: (BOOL) force; -- (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex; - -// Moved over Sidebar methods -- (IBAction) fetchPullPushAction:(id)sender; -- (void) updateRemoteControls:(PBGitRef *)forRef; - // Context menu methods - (NSMenu *)contextMenuForTreeView; - (NSArray *)menuItemsForPaths:(NSArray *)paths; @@ -108,7 +88,12 @@ - (IBAction) cherryPick:(id)sender; - (IBAction) rebase:(id)sender; +// Find/Search methods +- (IBAction)selectNext:(id)sender; +- (IBAction)selectPrevious:(id)sender; + - (void) copyCommitInfo; +- (void) copyCommitSHA; - (BOOL) hasNonlinearPath; @@ -119,5 +104,4 @@ - (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset; - (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset; -- (IBAction)updateFileViwer:(id)sender; @end diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 9652d50..dd024d9 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -7,12 +7,11 @@ // #import "PBGitHistoryController.h" +#import "PBWebHistoryController.h" #import "CWQuickLook.h" #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" -#import "ApplicationController.h" -#import "PBQLOutlineView.h" #import "PBCreateBranchSheet.h" #import "PBCreateTagSheet.h" #import "PBAddRemoteSheet.h" @@ -21,11 +20,11 @@ #import "PBDiffWindowController.h" #import "PBGitDefaults.h" #import "PBGitRevList.h" -#import "PBCommitList.h" -#import "PBSourceViewItem.h" -#import "PBRefController.h" - +#import "PBHistorySearchController.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") +#import "PBQLTextView.h" + + #define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex" #define kHistoryDetailViewIndex 0 #define kHistoryTreeViewIndex 1 @@ -40,34 +39,10 @@ @implementation PBGitHistoryController -@synthesize selectedCommitDetailsIndex, webCommit, gitTree; -@synthesize commitController, refController; -@synthesize sidebarSourceView, sidebarRemotes; -@synthesize searchField; +@synthesize selectedCommitDetailsIndex, webCommit, gitTree, commitController, refController; +@synthesize searchController; @synthesize commitList; -@synthesize webView; - -#pragma mark NSToolbarItemValidation Methods - -- (BOOL) validateToolbarItem:(NSToolbarItem *)theItem { - - NSString * curBranchDesc = [[repository currentBranch] description]; - NSArray * candidates = [NSArray arrayWithObjects:@"Push", @"Pull", @"Rebase", nil]; - BOOL res; - - if (([candidates containsObject:[theItem label]]) && - (([curBranchDesc isEqualToString:@"All branches"]) || - ([curBranchDesc isEqualToString:@"Local branches"]))) - { - res = NO; - } else { - res = YES; - } - - return res; -} - -#pragma mark PBGitHistoryController +@synthesize treeController; - (void)awakeFromNib { @@ -78,15 +53,9 @@ [treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeChange"]; [repository.revisionList addObserver:self forKeyPath:@"isUpdating" options:0 context:@"revisionListUpdating"]; - [repository.revisionList addObserver:self forKeyPath:@"updatedGraph" options:0 context:@"revisionListUpdatedGraph"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"]; [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; - - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:self - selector:@selector(preferencesChangedWithNotification:) - name:NSUserDefaultsDidChangeNotification - object:nil]; + [repository addObserver:self forKeyPath:@"currentBranchFilter" options:0 context:@"branchFilterChange"]; forceSelectionUpdate = YES; NSSize cellSpacing = [commitList intercellSpacing]; @@ -94,17 +63,17 @@ [commitList setIntercellSpacing:cellSpacing]; [fileBrowser setTarget:self]; [fileBrowser setDoubleAction:@selector(openSelectedFile:)]; - + if (!repository.currentBranch) { [repository reloadRefs]; [repository readCurrentBranch]; } else [repository lazyReload]; - + // Set a sort descriptor for the subject column in the history list, as // It can't be sorted by default (because it's bound to a PBGitCommit) - [[commitList tableColumnWithIdentifier:@"subject"] setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]]; + [[commitList tableColumnWithIdentifier:@"SubjectColumn"] setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]]; // 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]; @@ -116,48 +85,37 @@ //[scopeBarView setTopShade:207/255.0 bottomShade:180/255.0]; [self updateBranchFilterMatrix]; -// [webViewFileViwer setFrameLoadDelegate:self]; - - fileViewerController=[[FileViewerController alloc] retain]; - [fileViewerController initWithRepository:repository andController:self]; - [fileViewerController loadView]; - - //[fileViewer setAutoresizesSubviews:YES]; - //[fileViewer addSubview:[fileViewerController view]]; - - // XXXX :( ? - NSMutableArray *sv=[NSMutableArray arrayWithArray:[[fileViewer superview] subviews]]; - [sv removeObjectAtIndex:1]; - [sv insertObject:[fileViewerController view] atIndex:1]; - [[fileViewer superview] setSubviews:sv]; - [super awakeFromNib]; } -- (void) updateKeys +- (void)updateKeys { - PBGitCommit * lastObject = [[commitController selectedObjects] lastObject]; - if (lastObject) { - selectedCommit = lastObject; - } + PBGitCommit *lastObject = [[commitController selectedObjects] lastObject]; + if (lastObject) { + if (![selectedCommit isEqual:lastObject]) { + selectedCommit = lastObject; + + BOOL isOnHeadBranch = [selectedCommit isOnHeadBranch]; + [mergeButton setEnabled:!isOnHeadBranch]; + [cherryPickButton setEnabled:!isOnHeadBranch]; + [rebaseButton setEnabled:!isOnHeadBranch]; + } + } + else { + [mergeButton setEnabled:NO]; + [cherryPickButton setEnabled:NO]; + [rebaseButton setEnabled:NO]; + } if (self.selectedCommitDetailsIndex == kHistoryTreeViewIndex) { - PBGitTree *pt = selectedCommit.tree; - - NSString *show=[[[treeStyle selectedItems] objectAtIndex:0] objectAtIndex:0]; - pt.onlyCommit=[show isEqualToString:@"Only Commit"]; - - self.gitTree=pt; - + self.gitTree = selectedCommit.tree; [self restoreFileBrowserSelection]; } - else // kHistoryDetailViewIndex + else { + // kHistoryDetailViewIndex + if (![self.webCommit isEqual:selectedCommit]) self.webCommit = selectedCommit; - - BOOL isOnHeadBranch = [selectedCommit isOnHeadBranch]; - [mergeButton setEnabled:!isOnHeadBranch]; - [cherryPickButton setEnabled:!isOnHeadBranch]; - [rebaseButton setEnabled:!isOnHeadBranch]; + } } - (void) updateBranchFilterMatrix @@ -196,6 +154,11 @@ return nil; } +- (BOOL)isCommitSelected +{ + return [selectedCommit isEqual:[[commitController selectedObjects] lastObject]]; +} + - (void) setSelectedCommitDetailsIndex:(int)detailsIndex { if (selectedCommitDetailsIndex == detailsIndex) @@ -213,10 +176,6 @@ self.status = [NSString stringWithFormat:@"%d commits loaded", [[commitController arrangedObjects] count]]; } -- (void) preferencesChangedWithNotification:(NSNotification *)notification { - [[[repository windowForSheet] contentView] setNeedsDisplay:YES]; -} - - (void) restoreFileBrowserSelection { if (self.selectedCommitDetailsIndex != kHistoryTreeViewIndex) @@ -262,10 +221,6 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([ApplicationController sharedApplicationController].launchedFromGitx) { - return; - } - if ([(NSString *)context isEqualToString: @"commitChange"]) { [self updateKeys]; [self restoreFileBrowserSelection]; @@ -275,15 +230,6 @@ if ([(NSString *)context isEqualToString: @"treeChange"]) { [self updateQuicklookForce: NO]; [self saveFileBrowserSelection]; - NSLog(@"---> %@",object); - NSArray *objects = [(NSTreeController *)object selectedObjects]; - if([objects count]){ - PBGitTree *tree=(PBGitTree *)[objects objectAtIndex:0]; - NSLog(@"---> %@",tree.fullPath); - [fileViewerController showFile:tree.fullPath sha:tree.sha]; - } - - //[self updateFileViwer:nil]; return; } @@ -300,16 +246,19 @@ return; } - if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { - [self updateStatus]; + if ([(NSString *)context isEqualToString:@"branchFilterChange"]) { + [PBGitDefaults setBranchFilter:repository.currentBranchFilter]; + [self updateBranchFilterMatrix]; return; } - if([(NSString *)context isEqualToString:@"revisionListUpdatedGraph"]) { + if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { + [self updateStatus]; + if ([repository.currentBranch isSimpleRef]) [self selectCommit:[repository shaForRef:[repository.currentBranch ref]]]; else - [self selectCommit:[[self firstCommit] realSha]]; + [self selectCommit:[[self firstCommit] sha]]; return; } @@ -323,7 +272,7 @@ return; PBGitTree* tree = [selectedFiles objectAtIndex:0]; NSString* name = [tree tmpFileNameForContents]; - [[NSWorkspace sharedWorkspace] openFile:name]; + [[NSWorkspace sharedWorkspace] openTempFile:name]; } - (IBAction) setDetailedView:(id)sender @@ -348,17 +297,34 @@ - (void)keyDown:(NSEvent*)event { - if ([[event charactersIgnoringModifiers] isEqualToString: @"f"] - && [event modifierFlags] & NSAlternateKeyMask - && [event modifierFlags] & NSCommandKeyMask) - { - // command+alt+f - [[superController window] makeFirstResponder: searchField]; - } - else - { - [super keyDown: event]; - } + if ([[event charactersIgnoringModifiers] isEqualToString: @"f"] && [event modifierFlags] & NSAlternateKeyMask && [event modifierFlags] & NSCommandKeyMask) + [superController.window makeFirstResponder: searchField]; + else + [super keyDown: event]; +} + +// NSSearchField (actually textfields in general) prevent the normal Find operations from working. Setup custom actions for the +// next and previous menuitems (in MainMenu.nib) so they will work when the search field is active. When searching for text in +// a file make sure to call the Find panel's action method instead. +- (IBAction)selectNext:(id)sender +{ + NSResponder *firstResponder = [[[self view] window] firstResponder]; + if ([firstResponder isKindOfClass:[PBQLTextView class]]) { + [(PBQLTextView *)firstResponder performFindPanelAction:sender]; + return; + } + + [searchController selectNextResult]; +} +- (IBAction)selectPrevious:(id)sender +{ + NSResponder *firstResponder = [[[self view] window] firstResponder]; + if ([firstResponder isKindOfClass:[PBQLTextView class]]) { + [(PBQLTextView *)firstResponder performFindPanelAction:sender]; + return; + } + + [searchController selectPreviousResult]; } - (void) copyCommitInfo @@ -367,13 +333,26 @@ if (!commit) return; NSString *info = [NSString stringWithFormat:@"%@ (%@)", [[commit realSha] substringToIndex:10], [commit subject]]; - + NSPasteboard *a =[NSPasteboard generalPasteboard]; [a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; [a setString:info forType: NSStringPboardType]; } +- (void) copyCommitSHA +{ + PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0]; + if (!commit) + return; + NSString *info = [[commit realSha] substringWithRange:NSMakeRange(0, 7)]; + + NSPasteboard *a =[NSPasteboard generalPasteboard]; + [a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [a setString:info forType: NSStringPboardType]; + +} + - (IBAction) toggleQLPreviewPanel:(id)sender { if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { @@ -398,7 +377,7 @@ { if (!force && ![[QLPreviewPanel sharedPreviewPanel] isOpen]) return; - + if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { // Public QL API [previewPanel reloadData]; @@ -406,14 +385,14 @@ else { // Private QL API (10.5 only) NSArray *selectedFiles = [treeController selectedObjects]; - + NSMutableArray *fileNames = [NSMutableArray array]; for (PBGitTree *tree in selectedFiles) { NSString *filePath = [tree tmpFileNameForContents]; if (filePath) [fileNames addObject:[NSURL fileURLWithPath:filePath]]; } - + if ([fileNames count]) [[QLPreviewPanel sharedPreviewPanel] setURLs:fileNames currentIndex:0 preservingDisplayState:YES]; } @@ -461,15 +440,13 @@ commitList.useAdjustScroll = YES; } - // NSLog(@"[%@ %s] newIndex = %d, oldIndex = %d", [self class], _cmd, newIndex, oldIndex); - [commitList scrollRowToVisible:newIndex]; commitList.useAdjustScroll = NO; } -- (NSArray *) selectedObjectsForSHA:(NSString *)commitSHA +- (NSArray *) selectedObjectsForSHA:(PBGitSHA *)commitSHA { - NSPredicate *selection = [NSPredicate predicateWithFormat:@"realSha == %@", commitSHA]; + NSPredicate *selection = [NSPredicate predicateWithFormat:@"sha == %@", commitSHA]; NSArray *selectedCommits = [[commitController content] filteredArrayUsingPredicate:selection]; if (([selectedCommits count] == 0) && [self firstCommit]) @@ -478,32 +455,19 @@ return selectedCommits; } -- (BOOL) selectCommit:(NSString *)commitSHA +- (void)selectCommit:(PBGitSHA *)commitSHA { - ApplicationController * appController = [ApplicationController sharedApplicationController]; - if (appController.launchedFromGitx && [appController.cliArgs isEqualToString:@"--commit"]) { - return NO; - } - NSLog(@"[%@ %s]: SHA = %@", [self class], _cmd, commitSHA); - if (!forceSelectionUpdate && [[selectedCommit realSha] isEqualToString:commitSHA]) - return NO; + if (!forceSelectionUpdate && [[[[commitController selectedObjects] lastObject] sha] isEqual:commitSHA]) + return; NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; - if (oldIndex == NSNotFound) { - oldIndex = [[commitController content] indexOfObject:selectedCommit]; - } NSArray *selectedCommits = [self selectedObjectsForSHA:commitSHA]; - selectedCommit = [selectedCommits objectAtIndex:0]; - [commitController setSelectedObjects:selectedCommits]; - if (repository.currentBranchFilter != kGitXSelectedBranchFilter) { - NSLog(@"[%@ %s] currentBranchFilter = %@", [self class], _cmd, PBStringFromBranchFilterType(repository.currentBranchFilter)); - [self scrollSelectionToTopOfViewFrom:oldIndex]; - } + [self scrollSelectionToTopOfViewFrom:oldIndex]; - return YES; + forceSelectionUpdate = NO; } - (BOOL) hasNonlinearPath @@ -511,17 +475,26 @@ return [commitController filterPredicate] || [[commitController sortDescriptors] count] > 0; } -- (void) removeView +- (void)closeView { float position = [[[historySplitView subviews] objectAtIndex:0] frame].size.height; [[NSUserDefaults standardUserDefaults] setFloat:position forKey:@"PBGitSplitViewPosition"]; [[NSUserDefaults standardUserDefaults] synchronize]; - [webView close]; - [commitController removeObserver:self forKeyPath:@"selection"]; - [treeController removeObserver:self forKeyPath:@"selection"]; - [repository removeObserver:self forKeyPath:@"currentBranch"]; - - [super removeView]; + + if (commitController) { + [commitController removeObserver:self forKeyPath:@"selection"]; + [commitController removeObserver:self forKeyPath:@"arrangedObjects.@count"]; + [treeController removeObserver:self forKeyPath:@"selection"]; + + [repository.revisionList removeObserver:self forKeyPath:@"isUpdating"]; + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"refs"]; + [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; + } + + [webHistoryController closeView]; + + [super closeView]; } #pragma mark Table Column Methods @@ -544,14 +517,8 @@ - (void)showCommitsFromTree:(id)sender { - // TODO: Enable this from webview as well! - - NSMutableArray *filePaths = [NSMutableArray arrayWithObjects:@"HEAD", @"--", NULL]; - [filePaths addObjectsFromArray:[sender representedObject]]; - - PBGitRevSpecifier *revSpec = [[PBGitRevSpecifier alloc] initWithParameters:filePaths]; - - repository.currentBranch = [repository addBranch:revSpec]; + NSString *searchString = [(NSArray *)[sender representedObject] componentsJoinedByString:@" "]; + [searchController setHistorySearch:searchString mode:kGitXPathSearchMode]; } - (void)showInFinderAction:(id)sender @@ -559,12 +526,12 @@ NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"]; NSString *path; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; - + for (NSString *filePath in [sender representedObject]) { path = [workingDirectory stringByAppendingPathComponent:filePath]; [ws selectFile: path inFileViewerRootedAtPath:path]; } - + } - (void)openFilesAction:(id)sender @@ -572,7 +539,7 @@ NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"]; NSString *path; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; - + for (NSString *filePath in [sender representedObject]) { path = [workingDirectory stringByAppendingPathComponent:filePath]; [ws openFile:path]; @@ -596,7 +563,7 @@ - (NSMenu *)contextMenuForTreeView { NSArray *filePaths = [[treeController selectedObjects] valueForKey:@"fullPath"]; - + NSMenu *menu = [[NSMenu alloc] init]; for (NSMenuItem *item in [self menuItemsForPaths:filePaths]) [menu addItem:item]; @@ -617,7 +584,7 @@ PBGitRef *headRef = [[repository headRef] ref]; NSString *headRefName = [headRef shortName]; NSString *diffTitle = [NSString stringWithFormat:@"Diff %@ with %@", multiple ? @"files" : @"file", headRefName]; - BOOL isHead = [[selectedCommit realSha] isEqualToString:[repository headSHA]]; + BOOL isHead = [[selectedCommit sha] isEqual:[repository headSHA]]; NSMenuItem *diffItem = [[NSMenuItem alloc] initWithTitle:diffTitle action:isHead ? nil : @selector(diffFilesAction:) keyEquivalent:@""]; @@ -637,7 +604,7 @@ [item setTarget:self]; [item setRepresentedObject:filePaths]; } - + return menuItems; } @@ -705,71 +672,8 @@ - (IBAction) rebase:(id)sender { - if (selectedCommit) { - PBGitRef *headRef = [[repository headRef] ref]; - [repository rebaseBranch:headRef onRefish:selectedCommit]; - } -} - -#pragma mark Remote controls - -// !!! Andre Berg 20100330: moved these over from the PBGitSidebarController -// since I grew tired of having to go all the way down with the mouse just -// to do some basic actions I need to frequently (YMMV) =) - -enum { - kAddRemoteSegment = 0, - kFetchSegment, - kPullSegment, - kPushSegment -}; - -- (void) updateRemoteControls:(PBGitRef *)forRef -{ - BOOL hasRemote = NO; - - PBGitRef *ref = forRef; - if ([ref isRemote] || ([ref isBranch] && [[repository remoteRefForBranch:ref error:NULL] remoteName])) - hasRemote = YES; - - [remoteControls setEnabled:hasRemote forSegment:kFetchSegment]; - [remoteControls setEnabled:hasRemote forSegment:kPullSegment]; - [remoteControls setEnabled:hasRemote forSegment:kPushSegment]; -} - -- (IBAction) fetchPullPushAction:(id)sender -{ - NSInteger selectedSegment = [sender selectedSegment]; - - if (selectedSegment == kAddRemoteSegment) { - [PBAddRemoteSheet beginAddRemoteSheetForRepository:repository]; - return; - } - NSOutlineView * sourceView = sidebarSourceView; - NSInteger index = [sourceView selectedRow]; - PBSourceViewItem *item = [sourceView itemAtRow:index]; - PBGitRef *ref = [[item revSpecifier] ref]; - - if (!ref && (item.parent == sidebarRemotes)) - ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[item title]]]; - - if (![ref isRemote] && ![ref isBranch]) - return; - - PBGitRef *remoteRef = [repository remoteRefForBranch:ref error:NULL]; - if (!remoteRef) - return; - - if (selectedSegment == kFetchSegment) - [repository beginFetchFromRemoteForRef:ref]; - else if (selectedSegment == kPullSegment) - [repository beginPullFromRemote:remoteRef forRef:ref]; - else if (selectedSegment == kPushSegment) { - if ([ref isRemote]) - [refController showConfirmPushRefSheet:nil remote:remoteRef]; - else if ([ref isBranch]) - [refController showConfirmPushRefSheet:ref remote:remoteRef]; - } + if (selectedCommit) + [repository rebaseBranch:nil onRefish:selectedCommit]; } #pragma mark - @@ -852,46 +756,4 @@ enum { return iconRect; } -+ (BOOL)isSelectorExcludedFromWebScript:(SEL)sel -{ - NSLog(@"[%@ %s]: self = %@ (%i)", [self class], _cmd, self,[self respondsToSelector:sel]); - //return NO; //![controller respondsToSelector:sel]; - if (sel == @selector(selectCommit:)) return NO; - return YES; -} - -#pragma mark - -- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar -{ - return 1; -} - -- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber -{ - return [NSArray arrayWithObjects:@"Only Commit",@"All Files",nil]; -} - -- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber -{ - return nil; -} - -- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber -{ - return MGRadioSelectionMode; -} - -- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber -{ - return identifier; -} - -- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber -{ - [self updateKeys]; -} - - @end - diff --git a/PBGitHistoryGrapher.h b/PBGitHistoryGrapher.h index adb0ee2..0e02e6a 100644 --- a/PBGitHistoryGrapher.h +++ b/PBGitHistoryGrapher.h @@ -9,18 +9,23 @@ #import +#define kCurrentQueueKey @"kCurrentQueueKey" +#define kNewCommitsKey @"kNewCommitsKey" + + @class PBGitGrapher; @interface PBGitHistoryGrapher : NSObject { id delegate; + NSOperationQueue *currentQueue; NSMutableSet *searchSHAs; PBGitGrapher *grapher; BOOL viewAllBranches; } -- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate; +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll queue:(NSOperationQueue *)queue delegate:(id)theDelegate; - (void) graphCommits:(NSArray *)revList; @end diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index 76bbd70..ab9760d 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -8,14 +8,16 @@ #import "PBGitHistoryGrapher.h" #import "PBGitGrapher.h" +#import "PBGitSHA.h" @implementation PBGitHistoryGrapher -- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll queue:(NSOperationQueue *)queue delegate:(id)theDelegate { delegate = theDelegate; + currentQueue = queue; searchSHAs = [NSMutableSet setWithSet:commits]; grapher = [[PBGitGrapher alloc] initWithRepository:nil]; viewAllBranches = viewAll; @@ -24,31 +26,48 @@ } +- (void)sendCommits:(NSArray *)commits +{ + NSDictionary *commitData = [NSDictionary dictionaryWithObjectsAndKeys:currentQueue, kCurrentQueueKey, commits, kNewCommitsKey, nil]; + [delegate performSelectorOnMainThread:@selector(updateCommitsFromGrapher:) withObject:commitData waitUntilDone:NO]; +} + + - (void) graphCommits:(NSArray *)revList { if (!revList || [revList count] == 0) return; + //NSDate *start = [NSDate date]; + NSThread *currentThread = [NSThread currentThread]; + NSDate *lastUpdate = [NSDate date]; NSMutableArray *commits = [NSMutableArray array]; NSInteger counter = 0; for (PBGitCommit *commit in revList) { - NSString *commitSHA = [commit realSha]; + if ([currentThread isCancelled]) + return; + PBGitSHA *commitSHA = [commit sha]; if (viewAllBranches || [searchSHAs containsObject:commitSHA]) { [grapher decorateCommit:commit]; [commits addObject:commit]; if (!viewAllBranches) { [searchSHAs removeObject:commitSHA]; - [searchSHAs addObjectsFromArray:commit.parents]; + [searchSHAs addObjectsFromArray:[commit parents]]; } } - if (++counter % 2000 == 0) { - [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:[commits copy] waitUntilDone:NO]; - commits = [NSMutableArray array]; + if (++counter % 100 == 0) { + if ([[NSDate date] timeIntervalSinceDate:lastUpdate] > 0.1) { + [self sendCommits:commits]; + commits = [NSMutableArray array]; + lastUpdate = [NSDate date]; + } } } + //NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; + //NSLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration); - [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:commits waitUntilDone:YES]; + [self sendCommits:commits]; [delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO]; } diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index c3e3a0b..75e1c6c 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -14,6 +14,7 @@ @class PBGitRef; @class PBGitRevList; @class PBGitHistoryGrapher; +@class PBGitSHA; @interface PBGitHistoryList : NSObject { PBGitRepository *repository; @@ -21,17 +22,15 @@ PBGitRevList *projectRevList; PBGitRevList *currentRevList; - NSString *lastSHA; + PBGitSHA *lastSHA; NSSet *lastRefSHAs; NSInteger lastBranchFilter; PBGitRef *lastRemoteRef; BOOL resetCommits; BOOL shouldReloadProjectHistory; - NSDate *updatedGraph; PBGitHistoryGrapher *grapher; NSOperationQueue *graphQueue; - NSInvocationOperation *lastOperation; NSMutableArray *commits; BOOL isUpdating; @@ -40,14 +39,14 @@ - (id) initWithRepository:(PBGitRepository *)repo; - (void) forceUpdate; - (void) updateHistory; +- (void)cleanup; -- (void) addCommitsFromArray:(NSArray *)array; +- (void) updateCommitsFromGrapher:(NSDictionary *)commitData; @property (retain) PBGitRevList *projectRevList; @property (retain) NSMutableArray *commits; @property (readonly) NSArray *projectCommits; @property (assign) BOOL isUpdating; -@property (retain) NSDate *updatedGraph; @end diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 89142a9..0a4433f 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -11,6 +11,7 @@ #import "PBGitRevList.h" #import "PBGitGrapher.h" #import "PBGitHistoryGrapher.h" +#import "PBGitSHA.h" @@ -35,7 +36,6 @@ @synthesize projectRevList; @synthesize commits; @synthesize isUpdating; -@synthesize updatedGraph; @dynamic projectCommits; @@ -81,6 +81,20 @@ } +- (void)cleanup +{ + if (currentRevList) { + [currentRevList removeObserver:self forKeyPath:@"commits"]; + [currentRevList cancel]; + } + [graphQueue cancelAllOperations]; + + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; + [repository removeObserver:self forKeyPath:@"hasChanged"]; +} + + - (NSArray *) projectCommits { return [projectRevList.commits copy]; @@ -95,6 +109,7 @@ { if (!array || [array count] == 0) return; + if (resetCommits) { self.commits = [NSMutableArray array]; resetCommits = NO; @@ -109,11 +124,18 @@ } +- (void) updateCommitsFromGrapher:(NSDictionary *)commitData +{ + if ([commitData objectForKey:kCurrentQueueKey] != graphQueue) + return; + + [self addCommitsFromArray:[commitData objectForKey:kNewCommitsKey]]; +} + - (void) finishedGraphing { if (!currentRevList.isParsing && ([[graphQueue operations] count] == 0)) { self.isUpdating = NO; - [self performSelector:@selector(setUpdatedGraph:) withObject:[NSDate date] afterDelay:0]; } } @@ -127,12 +149,9 @@ resetCommits = YES; self.isUpdating = YES; - [graphQueue setSuspended:YES]; - if (graphQueue) - [graphQueue removeObserver:self forKeyPath:@"operations"]; + [graphQueue cancelAllOperations]; graphQueue = [[NSOperationQueue alloc] init]; - [graphQueue addObserver:self forKeyPath:@"operations" options:0 context:@"operations"]; - lastOperation = nil; + [graphQueue setMaxConcurrentOperationCount:1]; grapher = [self grapher]; } @@ -140,12 +159,7 @@ - (NSInvocationOperation *) operationForCommits:(NSArray *)newCommits { - NSInvocationOperation *graphOperation = [[NSInvocationOperation alloc] initWithTarget:grapher selector:@selector(graphCommits:) object:newCommits]; - if (lastOperation) - [graphOperation addDependency:lastOperation]; - lastOperation = graphOperation; - - return graphOperation; + return [[NSInvocationOperation alloc] initWithTarget:grapher selector:@selector(graphCommits:) object:newCommits]; } @@ -154,11 +168,14 @@ NSMutableSet *baseCommitSHAs = [NSMutableSet set]; NSDictionary *refs = repository.refs; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *ref in [refs objectForKey:sha]) if ([ref isBranch] || [ref isTag]) [baseCommitSHAs addObject:sha]; + if (![[PBGitRef refFromString:[[repository headRef] simpleRef]] type]) + [baseCommitSHAs addObject:[repository headSHA]]; + return baseCommitSHAs; } @@ -170,7 +187,7 @@ PBGitRef *remoteRef = [[repository.currentBranch ref] remoteRef]; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *ref in [refs objectForKey:sha]) if ([remoteRef isEqualToRef:[ref remoteRef]]) [baseCommitSHAs addObject:sha]; @@ -186,7 +203,7 @@ return [NSMutableSet setWithObject:lastSHA]; else if ([repository.currentBranch isSimpleRef]) { PBGitRef *currentRef = [repository.currentBranch ref]; - NSString *sha = [repository shaForRef:currentRef]; + PBGitSHA *sha = [repository shaForRef:currentRef]; if (sha) return [NSMutableSet setWithObject:sha]; } @@ -206,7 +223,7 @@ { BOOL viewAllBranches = (repository.currentBranchFilter == kGitXAllBranchesFilter); - return [[PBGitHistoryGrapher alloc] initWithBaseCommits:[self baseCommits] viewAllBranches:viewAllBranches delegate:self]; + return [[PBGitHistoryGrapher alloc] initWithBaseCommits:[self baseCommits] viewAllBranches:viewAllBranches queue:graphQueue delegate:self]; } @@ -215,15 +232,12 @@ if (currentRevList == parser) return; - if (currentRevList) { + if (currentRevList) [currentRevList removeObserver:self forKeyPath:@"commits"]; - [currentRevList removeObserver:self forKeyPath:@"isParsing"]; - } currentRevList = parser; [currentRevList addObserver:self forKeyPath:@"commits" options:NSKeyValueObservingOptionNew context:@"commitsUpdated"]; - [currentRevList addObserver:self forKeyPath:@"isParsing" options:0 context:@"revListParsing"]; } @@ -256,12 +270,11 @@ lastRemoteRef = [[rev ref] remoteRef]; lastSHA = nil; self.isUpdating = NO; - self.updatedGraph = [NSDate date]; return NO; } - NSString *revSHA = [repository shaForRef:[rev ref]]; - if ([revSHA isEqualToString:lastSHA] && (lastBranchFilter == repository.currentBranchFilter)) + PBGitSHA *revSHA = [repository shaForRef:[rev ref]]; + if ([revSHA isEqual:lastSHA] && (lastBranchFilter == repository.currentBranchFilter)) return NO; lastBranchFilter = repository.currentBranchFilter; @@ -303,6 +316,7 @@ lastBranchFilter = -1; lastRemoteRef = nil; lastSHA = nil; + self.commits = [NSMutableArray array]; [projectRevList loadRevisons]; return; } @@ -320,6 +334,7 @@ lastBranchFilter = -1; lastRemoteRef = nil; lastSHA = nil; + self.commits = [NSMutableArray array]; [otherRevListParser loadRevisons]; } @@ -329,21 +344,6 @@ #pragma mark - #pragma mark Key Value Observing -- (void) removeObservers -{ - [repository removeObserver:self forKeyPath:@"currentBranch"]; - [repository removeObserver:self forKeyPath:@"hasChanged"]; - - if (currentRevList) { - [currentRevList removeObserver:self forKeyPath:@"commits"]; - [currentRevList removeObserver:self forKeyPath:@"isParsing"]; - } - - if (graphQueue) - [graphQueue removeObserver:self forKeyPath:@"operations"]; -} - - - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([@"currentBranch" isEqualToString:context]) { @@ -368,11 +368,6 @@ return; } - if ([@"revListParsing" isEqualToString:context] || [@"operations" isEqualToString:context]) { - [self finishedGraphing]; - return; - } - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index c25731b..350a02f 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -3,7 +3,7 @@ 1050 10F569 - 762 + 788 1038.29 461.00 @@ -15,13 +15,13 @@ YES - 762 - 762 + 788 + 788 YES - + YES @@ -88,17 +88,21 @@ dateString arran realSha + relativeDateString + shortName PBGitCommit - YES - YES + YES YES - YES + YES PBWebHistoryController + + GLFileView + 4370 @@ -109,98 +113,6 @@ 266 YES - - - 268 - {{362, 3}, {141, 25}} - - YES - - 67239424 - 0 - - LucidaGrande - 13 - 16 - - - - YES - - 33 - - NSImage - AddRemote - - - Add remote - 0 - - - 33 - - NSImage - FetchTemplate - - - Fetch from default remote - 1 - 0 - - - 33 - - NSImage - PullTemplate - - Pull from default remote - 2 - 0 - - - 33 - - NSImage - PushTemplate - - Push to default remote - 3 - 0 - - - 2 - 2 - 2 - - - - - 289 - {{805, 3}, {37, 25}} - - YES - - -2080244224 - 134217728 - QuickLook - - LucidaGrande - 13 - 1044 - - - -2033958657 - 163 - - NSImage - NSQuickLookTemplate - - - IA - 400 - 75 - - 292 @@ -210,7 +122,11 @@ -2080244224 0 - + + LucidaGrande + 13 + 1044 + YES @@ -362,7 +278,7 @@ 10 - {{0, -2}, {852, 5}} + {{0, -2}, {955, 5}} {0, 0} @@ -390,7 +306,7 @@ NO - {{0, 402}, {852, 30}} + {{0, 404}, {955, 30}} PBGitGradientBarView @@ -407,7 +323,7 @@ 10 - {{0, 143}, {852, 5}} + {{0, 144}, {955, 5}} {0, 0} @@ -439,13 +355,13 @@ 4352 - {852, 129} + {955, 130} YES 256 - {852, 17} + {955, 17} @@ -459,7 +375,7 @@ YES SubjectColumn - 549 + 652 40 1000 @@ -545,7 +461,7 @@ DateColumn 165 10 - 3.4028230607370965e+38 + 1000 75628096 2048 @@ -561,9 +477,59 @@ 337772096 - 2048 + -2147481600 Text Cell + + + YES + + YES + dateStyle + formatterBehavior + timeStyle + + + YES + + + + + + d 'de' MMMM 'de' yyyy HH:mm + NO + + + + + + 3 + YES + + + date + YES + compare: + + + + RelativeDateColumn + 30 + 10 + 1000 + + 75628096 + 2048 + Relative Date + + + + + + 338820672 + 1024 + + @@ -571,12 +537,18 @@ 3 YES + + date + YES + compare: + + YES SHAColumn 30 10 - 3.4028230607370965e+38 + 1000 75628096 2048 @@ -599,6 +571,33 @@ YES + + ShortSHAColumn + 30 + 10 + 1000 + + 75628096 + 2048 + Short SHA + + + + + + 338820672 + 1024 + + + + + + + 3 + YES + + YES + 3 2 @@ -624,7 +623,7 @@ 0 - {{0, 17}, {852, 129}} + {{0, 17}, {955, 130}} @@ -648,6 +647,7 @@ 1 _doScroller: + 0.19685863874345549 0.99882769584655762 @@ -657,7 +657,7 @@ YES - {852, 17} + {955, 17} @@ -666,7 +666,7 @@ - {852, 146} + {955, 147} 560 @@ -682,42 +682,25 @@ 266 YES - + - 268 - {{49, 2}, {57, 17}} + -2147482359 + + {{740, 3}, {16, 16}} - 1 - YES - - 67239424 - 134348800 - Remote - - LucidaGrande-Bold - 11 - 16 - - - -1232846593 - 173 - - - 400 - 75 - + 20746 + 100 265 - {{662, 2}, {180, 19}} + {{765, 2}, {180, 19}} YES 343014976 268567552 - Subject YES 1 @@ -765,8 +748,90 @@ 400 75 + Recent History Searches 255 - CAAAAA + + + + + 265 + {{714, 3}, {43, 18}} + + YES + + 67239424 + 131072 + + LucidaGrande + 9 + 16 + + + + YES + + 18 + + Previous search result + 0 + + + 18 + + Next search result + 1 + 0 + + + 1 + 2 + 3 + + + + + 265 + {{630, 5}, {80, 14}} + + YES + + 68288064 + 71435264 + # of matches + + + + 6 + System + controlColor + + + + + + + + 268 + {{49, 2}, {57, 17}} + + 1 + YES + + 67239424 + 134348800 + Remote + + LucidaGrande-Bold + 11 + 16 + + + -1232846593 + 173 + + + 400 + 75 @@ -811,12 +876,12 @@ - {{0, 146}, {852, 24}} + {{0, 147}, {955, 24}} PBGitGradientBarView - {852, 170} + {955, 171} NSView @@ -828,7 +893,7 @@ 18 - {852, 232} + {955, 233} YES @@ -863,12 +928,12 @@ public.url-name - {{1, 0}, {851, 233}} + {{1, 0}, {954, 234}} - + YES @@ -890,15 +955,10 @@ YES - {852, 232} + {955, 233} Details - - 6 - System - controlColor - - + @@ -913,142 +973,209 @@ 4370 YES - + - 274 + 4372 YES - - - 266 - {{0, 209}, {172, 25}} - - MGScopeBar - - - - 4370 + + + 2304 YES - - - 2304 - + + + 4368 + {216, 233} + + YES + + + 256 + {{223, 0}, {16, 17}} + + YES - - - 4368 - {155, 207} - - YES - - - 256 - {{223, 0}, {16, 17}} - - - YES - - 152 - 16 - 1000 - - 75628096 - 2048 - - - - 3 - MC4zMzMzMzI5ODU2AA - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - + + 213 + 16 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5ODU2AA + - 3 - 2 - - - 17 - -624951296 - - - 4 - 15 - 0 - YES - 0 + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + - {{1, 1}, {155, 207}} - - - - - 4 - - - - 256 - {{156, 1}, {15, 207}} - - - _doScroller: - 0.99481862783432007 - - - - -2147483392 - {{-100, -100}, {502, 15}} - - 1 - - _doScroller: - 0.0045045050792396069 - 0.99801188707351685 + 3 + 2 + + + 17 + -624951296 + + + 4 + 15 + 0 + YES + 0 - {172, 209} - - - 18 - - - - QSAAAEEgAABBmAAAQZgAAA + {{1, 1}, {216, 233}} + + + + + 4 + + + + 256 + {{217, 1}, {15, 233}} + + + _doScroller: + 0.99481862783432007 + + + + -2147483392 + {{-100, -100}, {502, 15}} + + 1 + + _doScroller: + 0.0045045050792396069 + 0.99801188707351685 - {172, 234} + {233, 235} - NSView + + 18 + + + + QSAAAEEgAABBmAAAQZgAAA - + 268 - {{173, 0}, {681, 234}} + + YES + + + 266 + + YES + + + 268 + + YES + + + 289 + {{41, 1.5}, {29, 19}} + + YES + + -2080244224 + 134217728 + QuickLook + + LucidaGrande-Bold + 12 + 16 + + + 147079423 + 173 + + NSImage + NSQuickLookTemplate + + + IA + 400 + 75 + + + + {{639, 0}, {84, 24}} + + NSView + + + {{0, 211}, {723, 24}} + + MGScopeBar + + + + 274 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + + {723, 210} + + + + + + YES + YES + + + {{234, 0}, {723, 235}} NSView - {{-1, -1}, {854, 234}} + {{-1, -1}, {957, 235}} YES 2 - {852, 232} + {955, 233} Tree @@ -1067,24 +1194,30 @@ - {{0, 171}, {852, 232}} + {{0, 172}, {955, 233}} NSView - {852, 403} + {955, 405} 2 HistoryViewSplitView - {852, 432} + {955, 434} NSView PBRefController + + GitXRelativeDateFormatter + + + PBHistorySearchController + @@ -1309,34 +1442,6 @@ 95 - - - delegate - - - - 96 - - - - value: arrangedObjects.dateString - - - - - - value: arrangedObjects.dateString - value - arrangedObjects.dateString - - NSConditionallySetsEditable - - - 2 - - - 98 - delegate @@ -1409,14 +1514,6 @@ 234 - - - dataSource - - - - 235 - contextMenuDelegate @@ -1457,95 +1554,6 @@ 290 - - - predicate: filterPredicate - - - - - - predicate: filterPredicate - predicate - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Subject - subject contains[c] $value - - - 2 - - - 301 - - - - predicate2: filterPredicate - - - - - - predicate2: filterPredicate - predicate2 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Author - author contains[c] $value - - - - 2 - - - 304 - - - - predicate3: filterPredicate - - - - - - predicate3: filterPredicate - predicate3 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - SHA - realSha contains[c] $value - - - - 2 - - - 308 - searchField @@ -1716,52 +1724,264 @@ - remoteControls + webHistoryController - + - 407 + 402 - - fetchPullPushAction: - - + + value: arrangedObjects.date + + + + + + value: arrangedObjects.date + value + arrangedObjects.date + + NSConditionallySetsEditable + + + 2 + - 408 + 404 - fileViewer - - - - 411 - - - - treeStyle - - - - 414 - - - - delegate - - + formatter + + 416 - - pair - - + + value: arrangedObjects.date + + + + + + value: arrangedObjects.date + value + arrangedObjects.date + + NSConditionallySetsEditable + + + 2 + 417 + + + value: arrangedObjects.shortName + + + + + + value: arrangedObjects.shortName + value + arrangedObjects.shortName + + NSConditionallySetsEditable + + + 2 + + + 422 + + + + commitController + + + + 424 + + + + historyController + + + + 425 + + + + searchField + + + + 426 + + + + stepper + + + + 429 + + + + numberOfMatchesField + + + + 432 + + + + delegate + + + + 433 + + + + updateSearch: + + + + 434 + + + + stepperPressed: + + + + 435 + + + + searchController + + + + 436 + + + + contextMenuDelegate + + + + 438 + + + + contextMenuDelegate + + + + 439 + + + + contextMenuDelegate + + + + 440 + + + + contextMenuDelegate + + + + 441 + + + + contextMenuDelegate + + + + 442 + + + + delegate + + + + 444 + + + + dataSource + + + + 445 + + + + searchController + + + + 446 + + + + progressIndicator + + + + 448 + + + + view + + + + 453 + + + + historyController + + + + 454 + + + + typeBar + + + + 484 + + + + delegate + + + + 485 + + + + accessoryView + + + + 487 + @@ -1838,9 +2058,9 @@ YES - + Commits Split View @@ -1888,10 +2108,12 @@ YES - + + + Commit List @@ -1945,6 +2167,10 @@ 34 + + YES + + @@ -2011,20 +2237,68 @@ YES - - + + + + 10 + + + YES + + + + + + File List Scroll View + + + 17 + + + + + 16 + + + + + 15 + + + YES + + + + + + 18 + + + YES + + + + + + 19 + + + 311 YES - - + + + + + Commits Scope Bar @@ -2043,11 +2317,60 @@ + + 316 + + + YES + + + + + + + + + + History Upper Toolbar + + + 317 + + + 327 + + 330 + + + YES + + + + + + 331 + + + + + 332 + + + YES + + + + + + 333 + + + 355 @@ -2090,66 +2413,6 @@ - - 316 - - - YES - - - - - - - - - - - - History Upper Toolbar - - - 399 - - - YES - - - - - - 400 - - - - - 48 - - - YES - - - - - - 51 - - - - - 49 - - - YES - - - - - - 50 - - - 337 @@ -2193,102 +2456,149 @@ - 332 - + 48 + YES - + - 333 - - + 51 + + - 330 - + 407 + + + + + 409 + YES - + - - - - 331 - - - - - 317 - - + 410 - - + + - 412 - + 414 + + + + + 418 + YES - - + + + + + + 419 + + + + + 423 + + + + + 427 + + + YES + + + + + + 428 + + + + + 430 + + + YES + + + + + + 431 + + + + + 447 + + + + + 449 + + + YES + + + Viewer - 10 - + 450 + + + FileViewer + + + 452 + + + + + 475 + YES - - - + - - File List Scroll View + + TypeBar - 15 - + 486 + YES - + - + - 16 - - - - - 17 - - - - - 18 - + 49 + YES - + - + - 19 - - - - - 413 - - + 50 + + @@ -2321,6 +2631,7 @@ 28.IBPluginDependency 28.IBShouldRemoveOnLegacySave 287.IBPluginDependency + 288.CustomClassName 288.IBPluginDependency 29.IBPluginDependency 29.IBShouldRemoveOnLegacySave @@ -2351,6 +2662,7 @@ 337.IBAttributePlaceholdersKey 337.IBPluginDependency 338.IBPluginDependency + 34.CustomClassName 34.IBPluginDependency 340.IBAttributePlaceholdersKey 340.IBPluginDependency @@ -2366,6 +2678,7 @@ 356.IBPluginDependency 359.IBAttributePlaceholdersKey 359.IBPluginDependency + 36.CustomClassName 36.IBPluginDependency 36.ImportedFromIB2 360.IBPluginDependency @@ -2375,17 +2688,29 @@ 388.IBPluginDependency 39.IBPluginDependency 39.ImportedFromIB2 - 399.IBPluginDependency 4.IBAttributePlaceholdersKey 4.IBPluginDependency - 400.IBPluginDependency - 400.IBSegmentedControlInspectorSelectedSegmentMetadataKey + 409.IBPluginDependency + 410.CustomClassName 410.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency + 414.IBDateFormatterBehaviorMetadataKey + 414.IBPluginDependency + 418.IBPluginDependency + 419.CustomClassName + 419.IBPluginDependency + 427.IBPluginDependency + 428.IBPluginDependency + 428.IBSegmentedControlInspectorSelectedSegmentMetadataKey + 430.IBPluginDependency + 431.IBPluginDependency + 447.IBPluginDependency + 449.IBPluginDependency + 450.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency + 475.IBPluginDependency 48.IBPluginDependency + 486.IBPluginDependency 49.IBAttributePlaceholdersKey 49.IBPluginDependency 50.IBPluginDependency @@ -2428,6 +2753,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2479,6 +2805,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2522,6 +2849,7 @@ com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2538,7 +2866,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin YES @@ -2548,11 +2875,24 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + GitXTextFieldCell + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{68, 19}, {852, 432}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + {{2069, 399}, {955, 434}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2588,11 +2928,85 @@ - 417 + 487 YES + + GLFileView + PBWebController + + YES + + YES + accessoryView + historyController + typeBar + + + YES + NSView + PBGitHistoryController + MGScopeBar + + + + YES + + YES + accessoryView + historyController + typeBar + + + YES + + accessoryView + NSView + + + historyController + PBGitHistoryController + + + typeBar + MGScopeBar + + + + + IBProjectSource + GLFileView.h + + + + GitXRelativeDateFormatter + NSFormatter + + IBProjectSource + GitXRelativeDateFormatter.h + + + + GitXTextFieldCell + NSTextFieldCell + + contextMenuDelegate + id + + + contextMenuDelegate + + contextMenuDelegate + id + + + + IBProjectSource + GitXTextFieldCell.h + + MGScopeBar NSView @@ -2600,16 +3014,23 @@ delegate id + + delegate + + delegate + id + + IBProjectSource MGScopeBar/MGScopeBar.h - NSObject + NSApplication IBProjectSource - BMScript.h + NSApplication+GitXScripting.h @@ -2635,16 +3056,47 @@ YES controller + searchController webController webView YES PBGitHistoryController + PBHistorySearchController PBWebHistoryController WebView + + YES + + YES + controller + searchController + webController + webView + + + YES + + controller + PBGitHistoryController + + + searchController + PBHistorySearchController + + + webController + PBWebHistoryController + + + webView + WebView + + + IBProjectSource PBCommitList.h @@ -2676,12 +3128,13 @@ cherryPick: createBranch: createTag: - fetchPullPushAction: merge: openFilesAction: openSelectedFile: rebase: refresh: + selectNext: + selectPrevious: setBranchFilter: setDetailedView: setTreeView: @@ -2689,7 +3142,6 @@ showCommitsFromTree: showInFinderAction: toggleQLPreviewPanel: - updateFileViwer: YES @@ -2712,6 +3164,100 @@ id + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + selectNext: + selectPrevious: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openFilesAction: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + selectNext: + id + + + selectPrevious: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + showCommitsFromTree: + id + + + showInFinderAction: + id + + + toggleQLPreviewPanel: + id + + + YES @@ -2721,19 +3267,18 @@ commitController commitList fileBrowser - fileViewer historySplitView localRemoteBranchesFilterItem mergeButton rebaseButton refController - remoteControls scopeBarView + searchController searchField selectedBranchFilterItem treeController - treeStyle upperToolbarView + webHistoryController webView @@ -2743,22 +3288,120 @@ NSArrayController PBCommitList NSOutlineView - NSView PBCollapsibleSplitView NSButton NSButton NSButton PBRefController - NSSegmentedControl PBGitGradientBarView + PBHistorySearchController NSSearchField NSButton NSTreeController - MGScopeBar PBGitGradientBarView + PBWebHistoryController id + + YES + + YES + allBranchesFilterItem + cherryPickButton + commitController + commitList + fileBrowser + historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView + searchController + searchField + selectedBranchFilterItem + treeController + upperToolbarView + webHistoryController + webView + + + YES + + allBranchesFilterItem + NSButton + + + cherryPickButton + NSButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + fileBrowser + NSOutlineView + + + 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 @@ -2788,11 +3431,137 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + controller + + + YES + + contextMenuDelegate + id + + + controller + PBGitHistoryController + + + IBProjectSource PBGitRevisionCell.h + + PBHistorySearchController + NSObject + + YES + + YES + selectSearchMode: + stepperPressed: + updateSearch: + + + YES + id + id + id + + + + YES + + YES + selectSearchMode: + stepperPressed: + updateSearch: + + + YES + + selectSearchMode: + id + + + stepperPressed: + id + + + updateSearch: + id + + + + + YES + + YES + commitController + historyController + numberOfMatchesField + progressIndicator + searchField + stepper + + + YES + NSArrayController + PBGitHistoryController + NSTextField + NSProgressIndicator + NSSearchField + 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 + + PBNiceSplitView NSSplitView @@ -2808,6 +3577,13 @@ controller PBGitHistoryController + + controller + + controller + PBGitHistoryController + + IBProjectSource PBQLOutlineView.h @@ -2855,6 +3631,90 @@ PBRefMenuItem + + YES + + YES + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + diffWithHEAD: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseHeadBranch: + showTagInfoSheet: + + + YES + + checkout: + PBRefMenuItem + + + cherryPick: + PBRefMenuItem + + + copyPatch: + PBRefMenuItem + + + copySHA: + PBRefMenuItem + + + createBranch: + PBRefMenuItem + + + createTag: + PBRefMenuItem + + + diffWithHEAD: + PBRefMenuItem + + + fetchRemote: + PBRefMenuItem + + + merge: + PBRefMenuItem + + + pullRemote: + PBRefMenuItem + + + pushDefaultRemoteForRef: + PBRefMenuItem + + + pushToRemote: + PBRefMenuItem + + + pushUpdatesToRemote: + PBRefMenuItem + + + rebaseHeadBranch: + PBRefMenuItem + + + showTagInfoSheet: + PBRefMenuItem + + + YES @@ -2872,6 +3732,35 @@ PBGitHistoryController + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + + branchPopUp + NSPopUpButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + historyController + PBGitHistoryController + + + IBProjectSource PBRefController.h @@ -2884,6 +3773,13 @@ refish id + + refish + + refish + id + + IBProjectSource PBRefMenuItem.h @@ -2896,6 +3792,13 @@ controller NSArrayController + + controller + + controller + NSArrayController + + IBProjectSource PBUnsortableTableHeader.h @@ -2908,6 +3811,13 @@ refresh: id + + refresh: + + refresh: + id + + IBProjectSource PBViewController.h @@ -2929,6 +3839,25 @@ WebView + + YES + + YES + repository + view + + + YES + + repository + id + + + view + WebView + + + IBProjectSource PBWebController.h @@ -2950,6 +3879,25 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + IBProjectSource PBWebHistoryController.h @@ -2962,6 +3910,13 @@ view WebView + + view + + view + WebView + + IBUserSource @@ -3077,6 +4032,14 @@ AppKit.framework/Headers/NSController.h + + NSDateFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSDateFormatter.h + + NSFormatter NSObject @@ -3357,63 +4320,21 @@ NSObject IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h + QuartzCore.framework/Headers/CAAnimation.h NSObject IBFrameworkSource - ImageKit.framework/Headers/IKSaveOptions.h + QuartzCore.framework/Headers/CALayer.h NSObject IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - - - NSObject - - IBFrameworkSource - QuickLookUI.framework/Headers/QLPreviewPanel.h + QuartzCore.framework/Headers/CIImageProvider.h @@ -3521,6 +4442,14 @@ AppKit.framework/Headers/NSPopUpButton.h + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + NSResponder @@ -3683,6 +4612,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h @@ -3722,6 +4658,70 @@ id + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + IBFrameworkSource WebKit.framework/Headers/WebView.h @@ -3752,30 +4752,22 @@ YES AddBranchTemplate AddLabelTemplate - AddRemote CherryPickTemplate DetailViewTemplate - FetchTemplate MergeTemplate NSPathTemplate NSQuickLookTemplate - PullTemplate - PushTemplate RebaseTemplate YES {20, 12} {23, 12} - {23, 12} {18.5143, 12.3429} {17, 17} {16.4571, 12.3429} - {16.4571, 12.3429} {16, 9} {19, 11} - {16.4571, 12.3429} - {16.4571, 12.3429} {16.4571, 13.3714} diff --git a/PBGitIndex.h b/PBGitIndex.h index acf5ec0..dee0651 100644 --- a/PBGitIndex.h +++ b/PBGitIndex.h @@ -26,6 +26,7 @@ extern NSString *PBGitIndexIndexUpdated; // Committing files extern NSString *PBGitIndexCommitStatus; extern NSString *PBGitIndexCommitFailed; +extern NSString *PBGitIndexCommitHookFailed; extern NSString *PBGitIndexFinishedCommit; // Changing to amend @@ -66,7 +67,7 @@ extern NSString *PBGitIndexOperationFailed; // Refresh the index - (void)refresh; -- (void)commitWithMessage:(NSString *)commitMessage; +- (void)commitWithMessage:(NSString *)commitMessage andVerify:(BOOL) doVerify; // Inter-file changes: - (BOOL)stageFiles:(NSArray *)stageFiles; @@ -75,7 +76,6 @@ extern NSString *PBGitIndexOperationFailed; // Intra-file changes - (BOOL)applyPatch:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse; -- (NSString *)blameFile:(PBChangedFile *)file; - (NSString *)diffForFile:(PBChangedFile *)file staged:(BOOL)staged contextLines:(NSUInteger)context; @end diff --git a/PBGitIndex.m b/PBGitIndex.m index 2f4550a..e41e5e5 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -21,6 +21,7 @@ NSString *PBGitIndexIndexUpdated = @"GBGitIndexIndexUpdated"; NSString *PBGitIndexCommitStatus = @"PBGitIndexCommitStatus"; NSString *PBGitIndexCommitFailed = @"PBGitIndexCommitFailed"; +NSString *PBGitIndexCommitHookFailed = @"PBGitIndexCommitHookFailed"; NSString *PBGitIndexFinishedCommit = @"PBGitIndexFinishedCommit"; NSString *PBGitIndexAmendMessageAvailable = @"PBGitIndexAmendMessageAvailable"; @@ -48,6 +49,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (NSString *) parentTree; - (void)postCommitUpdate:(NSString *)update; - (void)postCommitFailure:(NSString *)reason; +- (void)postCommitHookFailure:(NSString *)reason; - (void)postIndexChange; - (void)postOperationFailed:(NSString *)description; @end @@ -145,7 +147,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; } // TODO: make Asynchronous -- (void)commitWithMessage:(NSString *)commitMessage +- (void)commitWithMessage:(NSString *)commitMessage andVerify:(BOOL) doVerify { NSMutableString *commitSubject = [@"commit: " mutableCopy]; NSRange newLine = [commitMessage rangeOfString:@"\n"]; @@ -155,7 +157,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; [commitSubject appendString:[commitMessage substringToIndex:newLine.location]]; NSString *commitMessageFile; - commitMessageFile = [[[repository fileURL] path] stringByAppendingPathComponent:@"COMMIT_EDITMSG"]; + commitMessageFile = [repository.fileURL.path stringByAppendingPathComponent:@"COMMIT_EDITMSG"]; [commitMessage writeToFile:commitMessageFile atomically:YES encoding:NSUTF8StringEncoding error:nil]; @@ -175,6 +177,30 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; [self postCommitUpdate:@"Creating commit"]; int ret = 1; + + if (doVerify) { + [self postCommitUpdate:@"Running hooks"]; + NSString *hookFailureMessage = nil; + NSString *hookOutput = nil; + if (![repository executeHook:@"pre-commit" output:&hookOutput]) { + hookFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; + } + + if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) { + hookFailureMessage = [NSString stringWithFormat:@"Commit-msg hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; + } + + if (hookFailureMessage != nil) { + return [self postCommitHookFailure:hookFailureMessage]; + } + } + + commitMessage = [NSString stringWithContentsOfFile:commitMessageFile encoding:NSUTF8StringEncoding error:nil]; + NSString *commit = [repository outputForArguments:arguments inputString:commitMessage byExtendingEnvironment:amendEnvironment @@ -183,13 +209,6 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; if (ret || [commit length] != 40) return [self postCommitFailure:@"Could not create a commit object"]; - [self postCommitUpdate:@"Running hooks"]; - if (![repository executeHook:@"pre-commit" output:nil]) - return [self postCommitFailure:@"Pre-commit hook failed"]; - - if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) - return [self postCommitFailure:@"Commit-msg hook failed"]; - [self postCommitUpdate:@"Updating HEAD"]; [repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-m", commitSubject, @"HEAD", commit, nil] retValue: &ret]; @@ -239,6 +258,13 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; userInfo:[NSDictionary dictionaryWithObject:reason forKey:@"description"]]; } +- (void)postCommitHookFailure:(NSString *)reason +{ + [[NSNotificationCenter defaultCenter] postNotificationName:PBGitIndexCommitHookFailed + object:self + userInfo:[NSDictionary dictionaryWithObject:reason forKey:@"description"]]; +} + - (void)postOperationFailed:(NSString *)description { [[NSNotificationCenter defaultCenter] postNotificationName:PBGitIndexOperationFailed @@ -248,30 +274,57 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (BOOL)stageFiles:(NSArray *)stageFiles { - // Input string for update-index - // This will be a list of filenames that - // should be updated. It's similar to - // "git add -- - NSMutableString *input = [NSMutableString string]; - - for (PBChangedFile *file in stageFiles) { - [input appendFormat:@"%@\0", file.path]; - } + // Do staging files by chunks of 1000 files each, to prevent program freeze (because NSPipe has limited capacity) - int ret = 1; - [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"--add", @"--remove", @"-z", @"--stdin", nil] - inputString:input - retValue:&ret]; + int filesCount = [stageFiles count]; + + // Prepare first iteration + int loopFrom = 0; + int loopTo = 1000; + if (loopTo > filesCount) + loopTo = filesCount; + int loopCount = 0; + int i = 0; + + // Staging + while (loopCount < filesCount) { + // Input string for update-index + // This will be a list of filenames that + // should be updated. It's similar to + // "git add -- + NSMutableString *input = [NSMutableString string]; - if (ret) { - [self postOperationFailed:[NSString stringWithFormat:@"Error in staging files. Return value: %i", ret]]; - return NO; - } + for (i = loopFrom; i < loopTo; i++) { + loopCount++; + + PBChangedFile *file = [stageFiles objectAtIndex:i]; + + [input appendFormat:@"%@\0", file.path]; + } + + + int ret = 1; + [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"--add", @"--remove", @"-z", @"--stdin", nil] + inputString:input + retValue:&ret]; - for (PBChangedFile *file in stageFiles) - { - file.hasUnstagedChanges = NO; - file.hasStagedChanges = YES; + if (ret) { + [self postOperationFailed:[NSString stringWithFormat:@"Error in staging files. Return value: %i", ret]]; + return NO; + } + + for (i = loopFrom; i < loopTo; i++) { + PBChangedFile *file = [stageFiles objectAtIndex:i]; + + file.hasUnstagedChanges = NO; + file.hasStagedChanges = YES; + } + + // Prepare next iteration + loopFrom = loopCount; + loopTo = loopFrom + 1000; + if (loopTo > filesCount) + loopTo = filesCount; } [self postIndexChange]; @@ -281,27 +334,53 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; // TODO: Refactor with above. What's a better name for this? - (BOOL)unstageFiles:(NSArray *)unstageFiles { - NSMutableString *input = [NSMutableString string]; - - for (PBChangedFile *file in unstageFiles) { - [input appendString:[file indexInfo]]; - } - - int ret = 1; - [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"-z", @"--index-info", nil] - inputString:input - retValue:&ret]; - - if (ret) - { - [self postOperationFailed:[NSString stringWithFormat:@"Error in unstaging files. Return value: %i", ret]]; - return NO; - } - - for (PBChangedFile *file in unstageFiles) - { - file.hasUnstagedChanges = YES; - file.hasStagedChanges = NO; + // Do unstaging files by chunks of 1000 files each, to prevent program freeze (because NSPipe has limited capacity) + + int filesCount = [unstageFiles count]; + + // Prepare first iteration + int loopFrom = 0; + int loopTo = 1000; + if (loopTo > filesCount) + loopTo = filesCount; + int loopCount = 0; + int i = 0; + + // Unstaging + while (loopCount < filesCount) { + NSMutableString *input = [NSMutableString string]; + + for (i = loopFrom; i < loopTo; i++) { + loopCount++; + + PBChangedFile *file = [unstageFiles objectAtIndex:i]; + + [input appendString:[file indexInfo]]; + } + + int ret = 1; + [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"-z", @"--index-info", nil] + inputString:input + retValue:&ret]; + + if (ret) + { + [self postOperationFailed:[NSString stringWithFormat:@"Error in unstaging files. Return value: %i", ret]]; + return NO; + } + + for (i = loopFrom; i < loopTo; i++) { + PBChangedFile *file = [unstageFiles objectAtIndex:i]; + + file.hasUnstagedChanges = YES; + file.hasStagedChanges = NO; + } + + // Prepare next iteration + loopFrom = loopCount; + loopTo = loopFrom + 1000; + if (loopTo > filesCount) + loopTo = filesCount; } [self postIndexChange]; @@ -324,14 +403,15 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; } for (PBChangedFile *file in discardFiles) - file.hasUnstagedChanges = NO; + if (file.status != NEW) + file.hasUnstagedChanges = NO; [self postIndexChange]; } - (BOOL)applyPatch:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse; { - NSMutableArray *array = [NSMutableArray arrayWithObjects:@"apply", nil]; + NSMutableArray *array = [NSMutableArray arrayWithObjects:@"apply", @"--unidiff-zero", nil]; if (stage) [array addObject:@"--cached"]; if (reverse) @@ -353,11 +433,6 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; } -- (NSString *)blameFile:(PBChangedFile *)file -{ - return [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", file.path, nil]]; -} - - (NSString *)diffForFile:(PBChangedFile *)file staged:(BOOL)staged contextLines:(NSUInteger)context { NSString *parameter = [NSString stringWithFormat:@"-U%u", context]; diff --git a/PBGitIndexController.h b/PBGitIndexController.h index 947b3dc..1a455e6 100644 --- a/PBGitIndexController.h +++ b/PBGitIndexController.h @@ -9,7 +9,6 @@ #import #import "PBGitCommitController.h" #import "PBChangedFile.h" -#import "PBGitGradientBarView.h" @interface PBGitIndexController : NSObject { IBOutlet NSArrayController *stagedFilesController, *unstagedFilesController; @@ -17,7 +16,6 @@ IBOutlet NSTableView *unstagedTable; IBOutlet NSTableView *stagedTable; - IBOutlet PBGitGradientBarView *upperToolbarView; } - (IBAction) rowClicked:(NSCell *) sender; diff --git a/PBGitIndexController.m b/PBGitIndexController.m index 9a4c42a..d72e8bc 100644 --- a/PBGitIndexController.m +++ b/PBGitIndexController.m @@ -29,9 +29,6 @@ [unstagedTable registerForDraggedTypes: [NSArray arrayWithObject:FileChangesTableViewType]]; [stagedTable registerForDraggedTypes: [NSArray arrayWithObject:FileChangesTableViewType]]; - - [upperToolbarView setTopShade:237/255.0 bottomShade:216/255.0]; - } // FIXME: Find a proper place for this method -- this is not it. diff --git a/PBGitLane.h b/PBGitLane.h index 57d59c8..94b59a2 100644 --- a/PBGitLane.h +++ b/PBGitLane.h @@ -33,9 +33,9 @@ public: d_index = s_colorIndex++; } - bool isCommit(git_oid *sha) const + bool isCommit(git_oid sha) const { - return !git_oid_cmp(&d_sha, sha); + return !git_oid_cmp(&d_sha, &sha); } void setSha(git_oid sha); diff --git a/PBGitRef.h b/PBGitRef.h index 67b7b20..80bae6e 100644 --- a/PBGitRef.h +++ b/PBGitRef.h @@ -42,9 +42,6 @@ extern NSString * const kGitXRemoteRefPrefix; - (PBGitRef *) remoteRef; -- (NSString *)description; -- (NSString *)debugDescription; - - (BOOL) isEqualToRef:(PBGitRef *)otherRef; + (PBGitRef*) refFromString: (NSString*) s; diff --git a/PBGitRef.m b/PBGitRef.m index 4f7dd77..c9ab938 100644 --- a/PBGitRef.m +++ b/PBGitRef.m @@ -66,15 +66,6 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; return nil; } -- (NSString *) description { - return [NSString stringWithFormat:@" ref = %@", self, self.ref]; -} - - -- (NSString *)debugDescription { - return [NSString stringWithFormat:@", ref = %@, type = %@", self, ref, [self type]]; -} - - (BOOL) isBranch { return [ref hasPrefix:kGitXBranchRefPrefix]; diff --git a/PBGitRepository.h b/PBGitRepository.h index 9b9ff17..7599c6c 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -10,9 +10,9 @@ #import "PBGitHistoryList.h" #import "PBGitRevSpecifier.h" #import "PBGitConfig.h" -#import "PBGitXErrors.h" #import "PBGitRefish.h" +extern NSString* PBGitRepositoryErrorDomain; typedef enum branchFilterTypes { kGitXAllBranchesFilter = 0, kGitXLocalRemoteBranchesFilter, @@ -38,6 +38,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { @class PBGitWindowController; @class PBGitCommit; +@class PBGitSHA; @interface PBGitRepository : NSDocument { PBGitHistoryList* revisionList; @@ -50,6 +51,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { NSMutableDictionary *refs; PBGitRevSpecifier *_headRef; // Caching + PBGitSHA* _headSha; } - (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare; @@ -80,8 +82,6 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { - (NSString*) outputForArguments:(NSArray*) args retValue:(int *)ret; - (NSString *)outputInWorkdirForArguments:(NSArray*) arguments; - (NSString *)outputInWorkdirForArguments:(NSArray*) arguments retValue:(int *)ret; -- (NSString *) outputForShellScriptTemplate:(NSString *)scriptTemplate keywordDict:(NSDictionary *)keywordDict retValue:(NSInteger *)retValue; -- (NSString *) outputForShellScript:(NSString *)script retValue:(NSInteger *)retValue; - (BOOL)executeHook:(NSString *)name output:(NSString **)output; - (BOOL)executeHook:(NSString *)name withArgs:(NSArray*) arguments output:(NSString **)output; @@ -93,21 +93,18 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { - (void) reloadRefs; - (void) addRef:(PBGitRef *)ref fromParameters:(NSArray *)params; - (void) lazyReload; -- (PBGitRevSpecifier*) headRef; -- (NSString *) headSHA; -- (PBGitCommit *) headCommit; -- (NSString *) shaForRef:(PBGitRef *)ref; -- (PBGitCommit *) commitForRef:(PBGitRef *)ref; -- (PBGitCommit *) commitForSHA:(NSString *)sha; -- (BOOL) isOnSameBranch:(NSString *)baseSHA asSHA:(NSString *)testSHA; -- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA; -- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef; -- (BOOL) checkRefFormat:(NSString *)refName; -- (BOOL) checkRefFormatForBranch:(NSString *)shaOrRefName; -- (PBGitRef *) completeRefForString:(NSString *)partialRefString; -- (BOOL) refExists:(PBGitRef *)ref; -// checks to see if the ref or sha exists - returns nil if not found and the complete sha if found -- (NSString *) shaExists:(NSString *)sha; +- (PBGitRevSpecifier*)headRef; +- (PBGitSHA *)headSHA; +- (PBGitCommit *)headCommit; +- (PBGitSHA *)shaForRef:(PBGitRef *)ref; +- (PBGitCommit *)commitForRef:(PBGitRef *)ref; +- (PBGitCommit *)commitForSHA:(PBGitSHA *)sha; +- (BOOL)isOnSameBranch:(PBGitSHA *)baseSHA asSHA:(PBGitSHA *)testSHA; +- (BOOL)isSHAOnHeadBranch:(PBGitSHA *)testSHA; +- (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef; +- (BOOL)checkRefFormat:(NSString *)refName; +- (BOOL)refExists:(PBGitRef *)ref; +- (PBGitRef *)refForName:(NSString *)name; - (NSArray *) remotes; - (BOOL) hasRemotes; @@ -123,12 +120,15 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { + (NSURL*)gitDirForURL:(NSURL*)repositoryURL; + (NSURL*)baseDirForURL:(NSURL*)repositoryURL; -+ (NSString *) basePath; - (id) initWithURL: (NSURL*) path; - (void) setup; - (void) forceUpdateRevisions; +// for the scripting bridge +- (void)findInModeScriptCommand:(NSScriptCommand *)command; + + @property (assign) BOOL hasChanged; @property (readonly) PBGitWindowController *windowController; @property (readonly) PBGitConfig *config; @@ -137,5 +137,4 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { @property (assign) PBGitRevSpecifier *currentBranch; @property (assign) NSInteger currentBranchFilter; @property (retain) NSMutableDictionary* refs; - @end diff --git a/PBGitRepository.m b/PBGitRepository.m index 13e48c8..3d4489b 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -10,6 +10,7 @@ #import "PBGitCommit.h" #import "PBGitWindowController.h" #import "PBGitBinary.h" + #import "NSFileHandleExt.h" #import "PBEasyPipe.h" #import "PBGitRef.h" @@ -17,25 +18,21 @@ #import "PBRemoteProgressSheet.h" #import "PBGitRevList.h" #import "PBGitDefaults.h" -#import "BMScript.h" +#import "GitXScriptingConstants.h" +#import "PBHistorySearchController.h" -static NSString * repositoryBasePath = nil; +NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; @implementation PBGitRepository -@synthesize revisionList; -@synthesize branches; -@synthesize currentBranch; -@synthesize refs; -@synthesize hasChanged; -@synthesize config; +@synthesize revisionList, branches, currentBranch, refs, hasChanged, config; @synthesize currentBranchFilter; - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { if (outError) { - *outError = [NSError errorWithDomain:PBGitXErrorDomain - code:PBFileReadingUnsupportedErrorCode + *outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain + code:0 userInfo:[NSDictionary dictionaryWithObject:@"Reading files is not supported." forKey:NSLocalizedFailureReasonErrorKey]]; } return NO; @@ -46,36 +43,28 @@ static NSString * repositoryBasePath = nil; return [[PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--is-bare-repository", nil] inDir:path] isEqualToString:@"true"]; } -// can be used to return the basePath of a repo when [self fileURL] is unavailable yet -+ (NSString *) basePath { - if (repositoryBasePath) { - return repositoryBasePath; - } - return nil; -} - - -+ (NSURL*)gitDirForURL:(NSURL*)repositoryURL; ++ (NSURL *)gitDirForURL:(NSURL *)repositoryURL; { if (![PBGitBinary path]) return nil; NSString* repositoryPath = [repositoryURL path]; - // save base path - repositoryBasePath = [repositoryPath stringByDeletingLastPathComponent]; - if ([self isBareRepository:repositoryPath]) return repositoryURL; // Use rev-parse to find the .git dir for the repository being opened - NSString* newPath = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--git-dir", nil] inDir:repositoryPath]; - - if ([newPath rangeOfString:@"fatal:"].length != 0) - return nil; - - if ([newPath isEqualToString:@".git"]) + int retValue = 1; + NSString *newPath = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--git-dir", nil] inDir:repositoryPath retValue:&retValue]; + if (retValue) { + // The current directory does not contain a git repository + return nil; + } + + if ([newPath isEqualToString:@".git"]) return [NSURL fileURLWithPath:[repositoryPath stringByAppendingPathComponent:@".git"]]; + if ([newPath isEqualToString:@"."]) + return [NSURL fileURLWithPath:repositoryPath]; if ([newPath length] > 0) return [NSURL fileURLWithPath:newPath]; @@ -107,7 +96,7 @@ static NSString * repositoryBasePath = nil; if (outError) { NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[PBGitBinary notFoundError] forKey:NSLocalizedRecoverySuggestionErrorKey]; - *outError = [NSError errorWithDomain:PBGitXErrorDomain code:PBGitBinaryNotFoundErrorCode userInfo:userInfo]; + *outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo]; } return NO; } @@ -118,7 +107,7 @@ static NSString * repositoryBasePath = nil; if (outError) { NSDictionary* userInfo = [NSDictionary dictionaryWithObject:@"Reading files is not supported." forKey:NSLocalizedRecoverySuggestionErrorKey]; - *outError = [NSError errorWithDomain:PBGitXErrorDomain code:PBFileReadingUnsupportedErrorCode userInfo:userInfo]; + *outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo]; } return NO; } @@ -127,9 +116,9 @@ static NSString * repositoryBasePath = nil; 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 fileURL] path]] + NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileName]] forKey:NSLocalizedRecoverySuggestionErrorKey]; - *outError = [NSError errorWithDomain:PBGitXErrorDomain code:PBNotAGitRepositoryErrorCode userInfo:userInfo]; + *outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo]; } return NO; } @@ -148,6 +137,13 @@ static NSString * repositoryBasePath = nil; revisionList = [[PBGitHistoryList alloc] initWithRepository:self]; } +- (void)close +{ + [revisionList cleanup]; + + [super close]; +} + - (id) initWithURL: (NSURL*) path { if (![PBGitBinary path]) @@ -157,20 +153,20 @@ static NSString * repositoryBasePath = nil; if (!gitDirURL) return nil; - if (self = [super init]) { - [self setFileURL: gitDirURL]; - - [self setup]; - - // We don't want the window controller to display anything yet.. - // We'll leave that to the caller of this method. - #ifndef CLI - [self addWindowController:[[PBGitWindowController alloc] initWithRepository:self displayDefault:NO]]; - #endif - - [self showWindows]; - } - return self; + self = [self init]; + [self setFileURL: gitDirURL]; + + [self setup]; + + // We don't want the window controller to display anything yet.. + // We'll leave that to the caller of this method. +#ifndef CLI + [self addWindowController:[[PBGitWindowController alloc] initWithRepository:self displayDefault:NO]]; +#endif + + [self showWindows]; + + return self; } - (void) forceUpdateRevisions @@ -185,7 +181,6 @@ static NSString * repositoryBasePath = nil; // The fileURL the document keeps is to the .git dir, but that’s pretty // useless for display in the window title bar, so we show the directory above - - (NSString *) displayName { if (![[PBGitRef refFromString:[[self headRef] simpleRef]] type]) @@ -239,14 +234,14 @@ static NSString * repositoryBasePath = nil; { NSString* type = [components objectAtIndex:1]; - NSString* sha; + PBGitSHA *sha; if ([type isEqualToString:@"tag"] && [components count] == 4) - sha = [components objectAtIndex:3]; + sha = [PBGitSHA shaWithString:[components objectAtIndex:3]]; else - sha = [components objectAtIndex:2]; + sha = [PBGitSHA shaWithString:[components objectAtIndex:2]]; NSMutableArray* curRefs; - if (curRefs = [refs objectForKey:sha]) + if ( (curRefs = [refs objectForKey:sha]) != nil ) [curRefs addObject:ref]; else [refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha]; @@ -254,7 +249,9 @@ static NSString * repositoryBasePath = nil; - (void) reloadRefs { - _headRef = nil; + _headRef = nil; + _headSha = nil; + refs = [NSMutableDictionary dictionary]; NSMutableArray *oldBranches = [branches mutableCopy]; @@ -307,32 +304,30 @@ static NSString * repositoryBasePath = nil; else _headRef = [[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:@"HEAD"]]; + _headSha = [self shaForRef:[_headRef ref]]; + return _headRef; } -- (NSString *) headSHA +- (PBGitSHA *)headSHA { - return [self shaForRef:[[self headRef] ref]]; + if (! _headSha) + [self headRef]; + + return _headSha; } -- (NSString *) headRefForSHA:(NSString *)sha -{ - // TODO: move code over - // from PBGitSidebarController populateList - // that deals with getting the head refs path -} - -- (PBGitCommit *) headCommit +- (PBGitCommit *)headCommit { return [self commitForSHA:[self headSHA]]; } -- (NSString *) shaForRef:(PBGitRef *)ref +- (PBGitSHA *)shaForRef:(PBGitRef *)ref { if (!ref) return nil; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *existingRef in [refs objectForKey:sha]) if ([existingRef isEqualToRef:ref]) return sha; @@ -343,10 +338,10 @@ static NSString * repositoryBasePath = nil; if (retValue || [shaForRef isEqualToString:@""]) return nil; - return shaForRef; + return [PBGitSHA shaWithString:shaForRef]; } -- (PBGitCommit *) commitForRef:(PBGitRef *)ref +- (PBGitCommit *)commitForRef:(PBGitRef *)ref { if (!ref) return nil; @@ -354,7 +349,7 @@ static NSString * repositoryBasePath = nil; return [self commitForSHA:[self shaForRef:ref]]; } -- (PBGitCommit *) commitForSHA:(NSString *)sha +- (PBGitCommit *)commitForSHA:(PBGitSHA *)sha { if (!sha) return nil; @@ -365,18 +360,18 @@ static NSString * repositoryBasePath = nil; revList = revisionList.projectCommits; } for (PBGitCommit *commit in revList) - if ([[commit realSha] isEqualToString:sha]) + if ([[commit sha] isEqual:sha]) return commit; return nil; } -- (BOOL) isOnSameBranch:(NSString *)branchSHA asSHA:(NSString *)testSHA +- (BOOL)isOnSameBranch:(PBGitSHA *)branchSHA asSHA:(PBGitSHA *)testSHA { if (!branchSHA || !testSHA) return NO; - if ([testSHA isEqualToString:branchSHA]) + if ([testSHA isEqual:branchSHA]) return YES; NSArray *revList = revisionList.projectCommits; @@ -384,34 +379,34 @@ static NSString * repositoryBasePath = nil; NSMutableSet *searchSHAs = [NSMutableSet setWithObject:branchSHA]; for (PBGitCommit *commit in revList) { - NSString *commitSHA = [commit realSha]; + PBGitSHA *commitSHA = [commit sha]; if ([searchSHAs containsObject:commitSHA]) { - if ([testSHA isEqualToString:commitSHA]) + if ([testSHA isEqual:commitSHA]) return YES; [searchSHAs removeObject:commitSHA]; [searchSHAs addObjectsFromArray:commit.parents]; } - else if ([testSHA isEqualToString:commitSHA]) + else if ([testSHA isEqual:commitSHA]) return NO; } return NO; } -- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA +- (BOOL)isSHAOnHeadBranch:(PBGitSHA *)testSHA { if (!testSHA) return NO; - NSString *headSHA = [self headSHA]; + PBGitSHA *headSHA = [self headSHA]; - if ([testSHA isEqualToString:headSHA]) + if ([testSHA isEqual:headSHA]) return YES; return [self isOnSameBranch:headSHA asSHA:testSHA]; } -- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef +- (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef { if (!testRef) return NO; @@ -428,32 +423,6 @@ static NSString * repositoryBasePath = nil; return YES; } -- (BOOL) checkRefFormatForBranch:(NSString *)shaOrRefName -{ - int retValue = 1; - [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"check-ref-format", @"--branch", shaOrRefName, nil] retValue:&retValue]; - if (retValue) - return NO; - return YES; -} - -- (PBGitRef *) completeRefForString:(NSString *)partialRefString { - if (![self checkRefFormat:partialRefString] && - ![self checkRefFormatForBranch:partialRefString]) { - return nil; - } - NSArray * prefixes = [NSArray arrayWithObjects:kGitXBranchRefPrefix, kGitXRemoteRefPrefix, kGitXTagRefPrefix, nil]; - PBGitRef * completeRef = nil; - for (NSString * prefix in prefixes) { - PBGitRef * tryref = [PBGitRef refFromString:[NSString stringWithFormat:@"%@%@", prefix, partialRefString]]; - if ([self refExists:tryref]) { - completeRef = tryref; - break; - } - } - return completeRef; -} - - (BOOL) refExists:(PBGitRef *)ref { int retValue = 1; @@ -463,13 +432,29 @@ static NSString * repositoryBasePath = nil; return YES; } -- (NSString *) shaExists:(NSString *)sha +// useful for getting the full ref for a user entered name +// EX: name: master +// ref: refs/heads/master +- (PBGitRef *)refForName:(NSString *)name { + if (!name) + return nil; + int retValue = 1; - NSString *output = [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"rev-parse", sha, nil] retValue:&retValue]; - if (retValue || [output isEqualToString:@""]) - return nil; - return output; + NSString *output = [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"show-ref", name, nil] retValue:&retValue]; + if (retValue) + return nil; + + // the output is in the format: + // with potentially multiple lines if there are multiple matching refs (ex: refs/remotes/origin/master) + // here we only care about the first match + NSArray *refList = [output componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([refList count] > 1) { + NSString *refName = [refList objectAtIndex:1]; + return [PBGitRef refFromString:refName]; + } + + return nil; } // Returns either this object, or an existing, equal object @@ -515,9 +500,8 @@ static NSString * repositoryBasePath = nil; - (NSString *) workingDirectory { - NSString * dotGitSuffix = @"/.git"; - if ([[[self fileURL] path] hasSuffix:dotGitSuffix]) - return [[[self fileURL] path] substringToIndex:[[[self fileURL] path] length] - [dotGitSuffix length]]; + if ([self.fileURL.path hasSuffix:@"/.git"]) + return [self.fileURL.path substringToIndex:[self.fileURL.path length] - 5]; else if ([[self outputForCommand:@"rev-parse --is-inside-work-tree"] isEqualToString:@"true"]) return [PBGitBinary path]; @@ -641,24 +625,7 @@ static NSString * repositoryBasePath = nil; NSString *remoteName = [remoteRef remoteName]; [arguments addObject:remoteName]; - NSString *branchName = nil; - NSString *refSpec = nil; - if ([ref isRemoteBranch]) { - branchName = [ref shortName]; - refSpec = [ref remoteBranchName]; - } - else if ([ref isRemote] || !ref) { - branchName = @"all tracking branches"; - } - else { - branchName = [ref shortName]; - refSpec = [NSString stringWithFormat:@"%@:%@", branchName, branchName]; - } - if (refSpec) - [arguments addObject:refSpec]; - - NSString *headRefName = [[[self headRef] ref] shortName]; - NSString *description = [NSString stringWithFormat:@"Pulling %@ from %@ and updating %@", branchName, remoteName, headRefName]; + NSString *description = [NSString stringWithFormat:@"Pulling all tracking branches from %@", remoteName]; NSString *title = @"Pulling from remote"; [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; } @@ -919,6 +886,131 @@ static NSString * repositoryBasePath = nil; } +#pragma mark GitX Scripting + +- (void)handleRevListArguments:(NSArray *)arguments inWorkingDirectory:(NSURL *)workingDirectory +{ + if (![arguments count]) + return; + + PBGitRevSpecifier *revListSpecifier = nil; + + // the argument may be a branch or tag name but will probably not be the full reference + if ([arguments count] == 1) { + PBGitRef *refArgument = [self refForName:[arguments lastObject]]; + if (refArgument) { + revListSpecifier = [[PBGitRevSpecifier alloc] initWithRef:refArgument]; + revListSpecifier.workingDirectory = workingDirectory; + } + } + + if (!revListSpecifier) { + revListSpecifier = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; + revListSpecifier.workingDirectory = workingDirectory; + } + + self.currentBranch = [self addBranch:revListSpecifier]; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; +} + +- (void)handleBranchFilterEventForFilter:(PBGitXBranchFilterType)filter additionalArguments:(NSMutableArray *)arguments inWorkingDirectory:(NSURL *)workingDirectory +{ + self.currentBranchFilter = filter; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; + + // treat any additional arguments as a rev-list specifier + if ([arguments count] > 1) { + [arguments removeObjectAtIndex:0]; + [self handleRevListArguments:arguments inWorkingDirectory:workingDirectory]; + } +} + +- (void)handleGitXScriptingArguments:(NSAppleEventDescriptor *)argumentsList inWorkingDirectory:(NSURL *)workingDirectory +{ + NSMutableArray *arguments = [NSMutableArray array]; + uint argumentsIndex = 1; // AppleEvent list descriptor's are one based + while(1) { + NSAppleEventDescriptor *arg = [argumentsList descriptorAtIndex:argumentsIndex++]; + if (arg) + [arguments addObject:[arg stringValue]]; + else + break; + } + + if (![arguments count]) + return; + + NSString *firstArgument = [arguments objectAtIndex:0]; + + if ([firstArgument isEqualToString:@"-c"] || [firstArgument isEqualToString:@"--commit"]) { + [PBGitDefaults setShowStageView:YES]; + [self.windowController showCommitView:self]; + return; + } + + if ([firstArgument isEqualToString:@"--all"]) { + [self handleBranchFilterEventForFilter:kGitXAllBranchesFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; + return; + } + + if ([firstArgument isEqualToString:@"--local"]) { + [self handleBranchFilterEventForFilter:kGitXLocalRemoteBranchesFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; + return; + } + + if ([firstArgument isEqualToString:@"--branch"]) { + [self handleBranchFilterEventForFilter:kGitXSelectedBranchFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; + return; + } + + // if the argument is not a known command then treat it as a rev-list specifier + [self handleRevListArguments:arguments inWorkingDirectory:workingDirectory]; +} + +// see if the current appleEvent has the command line arguments from the gitx cli +// this could be from an openApplication or an openDocument apple event +// when opening a repository this is called before the sidebar controller gets it's awakeFromNib: message +// if the repository is already open then this is also a good place to catch the event as the window is about to be brought forward +- (void)showWindows +{ + NSAppleEventDescriptor *currentAppleEvent = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent]; + + if (currentAppleEvent) { + NSAppleEventDescriptor *eventRecord = [currentAppleEvent paramDescriptorForKeyword:keyAEPropData]; + + // on app launch there may be many repositories opening, so double check that this is the right repo + NSString *path = [[eventRecord paramDescriptorForKeyword:typeFileURL] stringValue]; + if (path) { + NSURL *workingDirectory = [NSURL URLWithString:path]; + if ([[PBGitRepository gitDirForURL:workingDirectory] isEqual:[self fileURL]]) { + NSAppleEventDescriptor *argumentsList = [eventRecord paramDescriptorForKeyword:kGitXAEKeyArgumentsList]; + [self handleGitXScriptingArguments:argumentsList inWorkingDirectory:workingDirectory]; + + // showWindows may be called more than once during app launch so remove the CLI data after we handle the event + [currentAppleEvent removeDescriptorWithKeyword:keyAEPropData]; + } + } + } + + [super showWindows]; +} + +// for the scripting bridge +- (void)findInModeScriptCommand:(NSScriptCommand *)command +{ + NSDictionary *arguments = [command arguments]; + NSString *searchString = [arguments objectForKey:kGitXFindSearchStringKey]; + if (searchString) { + NSInteger mode = [[arguments objectForKey:kGitXFindInModeKey] integerValue]; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; + [self.windowController setHistorySearch:searchString mode:mode]; + } +} + + #pragma mark low level - (int) returnValueForCommand:(NSString *)cmd @@ -930,7 +1022,7 @@ static NSString * repositoryBasePath = nil; - (NSFileHandle*) handleForArguments:(NSArray *)args { - NSString* gitDirArg = [@"--git-dir=" stringByAppendingString:[[self fileURL] path]]; + NSString* gitDirArg = [@"--git-dir=" stringByAppendingString:self.fileURL.path]; NSMutableArray* arguments = [NSMutableArray arrayWithObject: gitDirArg]; [arguments addObjectsFromArray: args]; return [PBEasyPipe handleForCommand:[PBGitBinary path] withArgs:arguments]; @@ -938,7 +1030,7 @@ static NSString * repositoryBasePath = nil; - (NSFileHandle*) handleInWorkDirForArguments:(NSArray *)args { - NSString* gitDirArg = [@"--git-dir=" stringByAppendingString:[[self fileURL] path]]; + NSString* gitDirArg = [@"--git-dir=" stringByAppendingString:self.fileURL.path]; NSMutableArray* arguments = [NSMutableArray arrayWithObject: gitDirArg]; [arguments addObjectsFromArray: args]; return [PBEasyPipe handleForCommand:[PBGitBinary path] withArgs:arguments inDir:[self workingDirectory]]; @@ -962,32 +1054,9 @@ static NSString * repositoryBasePath = nil; return [self outputForArguments: arguments retValue: ret]; } -- (NSString *) outputForShellScriptTemplate:(NSString *)scriptTemplate keywordDict:(NSDictionary *)keywordDict retValue:(NSInteger *)retValue { - BMScript * script = [[BMScript alloc] initWithTemplateSource:scriptTemplate - options:BMSynthesizeOptions(@"/bin/sh", @"-c")]; - [script saturateTemplateWithDictionary:keywordDict]; - - if (*retValue) { - *retValue = [script execute]; - } else { - [script execute]; - } - return [script lastResult]; -} - -- (NSString *) outputForShellScript:(NSString *)script retValue:(NSInteger *)retValue { - BMScript * shellScript = [BMScript shellScriptWithSource:script]; - if (*retValue) { - *retValue = [shellScript execute]; - } else { - [shellScript execute]; - } - return [shellScript lastResult]; -} - - (NSString*) outputForArguments:(NSArray*) arguments { - return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir: [[self fileURL] path]]; + return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir: self.fileURL.path]; } - (NSString*) outputInWorkdirForArguments:(NSArray*) arguments @@ -1002,7 +1071,7 @@ static NSString * repositoryBasePath = nil; - (NSString*) outputForArguments:(NSArray *)arguments retValue:(int *)ret { - return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir: [[self fileURL] path] retValue: ret]; + return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir: self.fileURL.path retValue: ret]; } - (NSString*) outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret diff --git a/PBGitRevList.h b/PBGitRevList.h index 7370711..0fe216d 100644 --- a/PBGitRevList.h +++ b/PBGitRevList.h @@ -25,6 +25,7 @@ - (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph; - (void) loadRevisons; +- (void)cancel; @property (retain) NSMutableArray *commits; @property (readonly) BOOL isParsing; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 87a43ec..8ab64e1 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -12,7 +12,6 @@ #import "PBGitGrapher.h" #import "PBGitRevSpecifier.h" -#include "git/oid.h" #include #include #include @@ -59,6 +58,12 @@ using namespace std; } +- (void)cancel +{ + [parseThread cancel]; +} + + - (void) finishedParsing { self.isParsing = NO; @@ -91,28 +96,29 @@ using namespace std; - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev { NSDate *start = [NSDate date]; + NSDate *lastUpdate = [NSDate date]; NSMutableArray *revisions = [NSMutableArray array]; PBGitGrapher *g = [[PBGitGrapher alloc] initWithRepository:repository]; std::map encodingMap; NSThread *currentThread = [NSThread currentThread]; - NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at"; + NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%s\01%P\01%at"; BOOL showSign = [rev hasLeftRight]; if (showSign) formatString = [formatString stringByAppendingString:@"\01%m"]; - NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--children", formatString, nil]; + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--topo-order", @"--children", formatString, nil]; if (!rev) [arguments addObject:@"HEAD"]; else [arguments addObjectsFromArray:[rev parameters]]; - NSString *directory = rev.workingDirectory ? [rev.workingDirectory path] : [[repository fileURL] path]; + NSString *directory = rev.workingDirectory ? rev.workingDirectory.path : repository.fileURL.path; NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:directory]; [task launch]; - NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; + NSFileHandle *handle = [task.standardOutput fileHandleForReading]; int fd = [handle fileDescriptor]; __gnu_cxx::stdio_filebuf buf(fd, std::ios::in); @@ -120,34 +126,13 @@ using namespace std; int num = 0; while (true) { + if ([currentThread isCancelled]) + break; + string sha; if (!getline(stream, sha, '\1')) break; - // We reached the end of some temporary output. Show what we have - // until now, and then start again. The sha of the next thing is still - // in this buffer. So, we use a substring of current input. - if (sha[1] == 'i') // Matches 'Final output' - { - num = 0; - if ([currentThread isCancelled]) - break; - - NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; - [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; - revisions = [NSMutableArray array]; - - if (isGraphing) - g = [[PBGitGrapher alloc] initWithRepository:repository]; - revisions = [NSMutableArray array]; - - // If the length is < 40, then there are no commits.. quit now - if (sha.length() < 40) - break; - - sha = sha.substr(sha.length() - 40, 40); - } - // From now on, 1.2 seconds string encoding_str; getline(stream, encoding_str, '\1'); @@ -164,11 +149,14 @@ using namespace std; git_oid oid; git_oid_mkstr(&oid, sha.c_str()); - PBGitCommit* newCommit = [[PBGitCommit alloc] initWithRepository:repository andSha:oid]; + PBGitCommit *newCommit = [PBGitCommit commitWithRepository:repository andSha:[PBGitSHA shaWithOID:oid]]; string author; getline(stream, author, '\1'); + string committer; + getline(stream, committer, '\1'); + string subject; getline(stream, subject, '\1'); @@ -177,17 +165,16 @@ using namespace std; if (parentString.size() != 0) { if (((parentString.size() + 1) % 41) != 0) { - NSLog(@"invalid parents: %i", parentString.size()); + NSLog(@"invalid parents: %zu", parentString.size()); continue; } int nParents = (parentString.size() + 1) / 41; - git_oid *parents = (git_oid *)malloc(sizeof(git_oid) * nParents); + NSMutableArray *parents = [NSMutableArray arrayWithCapacity:nParents]; int parentIndex; for (parentIndex = 0; parentIndex < nParents; ++parentIndex) - git_oid_mkstr(parents + parentIndex, parentString.substr(parentIndex * 41, 40).c_str()); - - newCommit.parentShas = parents; - newCommit.nParents = nParents; + [parents addObject:[PBGitSHA shaWithCString:parentString.substr(parentIndex * 41, 40).c_str()]]; + + [newCommit setParents:parents]; } int time; @@ -195,6 +182,7 @@ using namespace std; [newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]]; [newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]]; + [newCommit setCommitter:[NSString stringWithCString:committer.c_str() encoding:encoding]]; [newCommit setTimestamp:time]; if (showSign) @@ -216,18 +204,19 @@ using namespace std; if (isGraphing) [g decorateCommit:newCommit]; - if (++num % 1000 == 0) { - if ([currentThread isCancelled]) - break; - NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; - [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; - revisions = [NSMutableArray array]; + if (++num % 100 == 0) { + if ([[NSDate date] timeIntervalSinceDate:lastUpdate] > 0.1) { + NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; + [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; + revisions = [NSMutableArray array]; + lastUpdate = [NSDate date]; + } } } if (![currentThread isCancelled]) { NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; - NSLog(@"Loaded %i commits in %f seconds", num, duration); + NSLog(@"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]; @@ -236,9 +225,10 @@ using namespace std; [self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO]; } else { - NSLog(@"[%@ %s] thread has been canceled", [self class], _cmd); + NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd)); } + [task terminate]; [task waitUntilExit]; } diff --git a/PBGitRevSpecifier.m b/PBGitRevSpecifier.m index 73491c4..9e2b785 100644 --- a/PBGitRevSpecifier.m +++ b/PBGitRevSpecifier.m @@ -21,23 +21,18 @@ parameters = params; description = descrip; - if (([parameters count] > 1) || ([parameters count] == 0)) { - isSimpleRef = NO; - } else { - NSString *param = [parameters objectAtIndex:0]; + if (([parameters count] > 1) || ([parameters count] == 0)) + isSimpleRef = NO; + else { + NSString *param = [parameters objectAtIndex:0]; if ([param hasPrefix:@"-"] || [param rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"^@{}~:"]].location != NSNotFound || - [param rangeOfString:@".."].location != NSNotFound) { - isSimpleRef = NO; - } else { - if ([param hasPrefix:@"refs/"]) { - isSimpleRef = YES; - } else { - isSimpleRef = NO; - } - } + [param rangeOfString:@".."].location != NSNotFound) + isSimpleRef = NO; + else + isSimpleRef = YES; } - // NSLog(@"paramters = %@, isSimpleRef = %@", parameters, (isSimpleRef ? @"YES" : @"NO")); + return self; } @@ -49,7 +44,7 @@ - (id) initWithRef:(PBGitRef *)ref { - [self initWithParameters:[NSArray arrayWithObject:ref.ref] description:[ref shortName]]; + [self initWithParameters:[NSArray arrayWithObject:ref.ref] description:ref.shortName]; return self; } @@ -92,11 +87,6 @@ return description; } -- (NSString *) debugDescription { - return [NSString stringWithFormat:@"<%@: %p> description = %@, parameters = %@", - NSStringFromClass([self class]), self, description, parameters]; -} - - (NSString *) title { NSString *title = nil; @@ -105,6 +95,8 @@ title = @"detached HEAD"; else if ([self isSimpleRef]) title = [[self ref] shortName]; + else if ([self.description hasPrefix:@"-S"]) + title = [self.description substringFromIndex:[@"-S" length]]; else if ([self.description hasPrefix:@"HEAD -- "]) title = [self.description substringFromIndex:[@"HEAD -- " length]]; else if ([self.description hasPrefix:@"-- "]) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 79a26e7..65889a6 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -9,6 +9,7 @@ #import "PBGitRevisionCell.h" #import "PBGitRef.h" #import "RoundedRectangle.h" +#import "GitXTextFieldCell.h" @implementation PBGitRevisionCell @@ -16,20 +17,24 @@ - (id) initWithCoder: (id) coder { self = [super initWithCoder:coder]; - textCell = [[NSTextFieldCell alloc] initWithCoder:coder]; + textCell = [[GitXTextFieldCell alloc] initWithCoder:coder]; return self; } -- (NSArray*) colors ++ (NSArray *)laneColors { - return [NSArray arrayWithObjects: - [NSColor colorWithCalibratedRed: 0X4e/256.0 green:0X9A/256.0 blue: 0X06/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0X20/256.0 green:0X4A/256.0 blue: 0X87/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XC4/256.0 green:0XA0/256.0 blue: 0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0X5C/256.0 green:0X35/256.0 blue: 0X66/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XA4/256.0 green:0X00/256.0 blue: 0X00/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XCE/256.0 green:0X5C/256.0 blue: 0 alpha: 1.0], - nil]; + static NSArray *laneColors = nil; + if (!laneColors) + laneColors = [NSArray arrayWithObjects: + [NSColor colorWithCalibratedRed: 0X4e/256.0 green:0X9A/256.0 blue: 0X06/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0X20/256.0 green:0X4A/256.0 blue: 0X87/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XC4/256.0 green:0XA0/256.0 blue: 0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0X5C/256.0 green:0X35/256.0 blue: 0X66/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XA4/256.0 green:0X00/256.0 blue: 0X00/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XCE/256.0 green:0X5C/256.0 blue: 0 alpha: 1.0], + nil]; + + return laneColors; } - (void) drawLineFromColumn: (int) from toColumn: (int) to inRect: (NSRect) r offset: (int) offset color: (int) c @@ -41,8 +46,7 @@ NSPoint source = NSMakePoint(origin.x + columnWidth* from, origin.y + offset); NSPoint center = NSMakePoint( origin.x + columnWidth * to, origin.y + r.size.height * 0.5 + 0.5); - // Just use red for now. - NSArray* colors = [self colors]; + NSArray* colors = [PBGitRevisionCell laneColors]; [[colors objectAtIndex: c % [colors count]] set]; NSBezierPath * path = [NSBezierPath bezierPath]; @@ -54,6 +58,16 @@ } +- (BOOL) isCurrentCommit +{ + PBGitSHA *thisSha = [self.objectValue sha]; + + PBGitRepository* repository = [self.objectValue repository]; + PBGitSHA *currentSha = [repository headSHA]; + + return [currentSha isEqual:thisSha]; +} + - (void) drawCircleInRect: (NSRect) r { @@ -71,7 +85,13 @@ [path fill]; NSRect smallOval = { columnOrigin.x - 3, columnOrigin.y + r.size.height * 0.5 - 3, 6, 6}; - [[NSColor whiteColor] set]; + + if ( [self isCurrentCommit ] ) { + [[NSColor colorWithCalibratedRed: 0Xfc/256.0 green:0Xa6/256.0 blue: 0X4f/256.0 alpha: 1.0] set]; + } else { + [[NSColor whiteColor] set]; + } + path = [NSBezierPath bezierPathWithOvalInRect:smallOval]; [path fill]; } diff --git a/PBGitSHA.h b/PBGitSHA.h new file mode 100644 index 0000000..f222911 --- /dev/null +++ b/PBGitSHA.h @@ -0,0 +1,28 @@ +// +// PBGitSHA.h +// GitX +// +// Created by BrotherBard on 3/28/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import +#include "git/oid.h" + + +@interface PBGitSHA : NSObject { + git_oid oid; + NSString *string; +} + + ++ (PBGitSHA *)shaWithOID:(git_oid)oid; ++ (PBGitSHA *)shaWithString:(NSString *)shaString; ++ (PBGitSHA *)shaWithCString:(const char *)shaCString; + +- (BOOL)isEqualToOID:(git_oid)other_oid; + +@property (readonly) git_oid oid; +@property (readonly) NSString *string; + +@end diff --git a/PBGitSHA.m b/PBGitSHA.m new file mode 100644 index 0000000..6aff86f --- /dev/null +++ b/PBGitSHA.m @@ -0,0 +1,139 @@ +// +// PBGitSHA.m +// GitX +// +// Created by BrotherBard on 3/28/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import "PBGitSHA.h" + + +@interface PBGitSHA () + +- (id)initWithOID:(git_oid)g_oid; + +@end + + +@implementation PBGitSHA + + +@synthesize oid; +@synthesize string; + + ++ (PBGitSHA *)shaWithOID:(git_oid)oid +{ + return [[PBGitSHA alloc] initWithOID:oid]; +} + + ++ (PBGitSHA *)shaWithString:(NSString *)shaString +{ + git_oid oid; + int err = git_oid_mkstr(&oid, [shaString UTF8String]); + if (err == GIT_ENOTOID) + return nil; + + return [self shaWithOID:oid]; +} + + ++ (PBGitSHA *)shaWithCString:(const char *)shaCString +{ + git_oid oid; + int err = git_oid_mkstr(&oid, shaCString); + if (err == GIT_ENOTOID) + return nil; + + return [self shaWithOID:oid]; +} + + ++ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector +{ + return NO; +} + + ++ (BOOL)isKeyExcludedFromWebScript:(const char *)name +{ + return NO; +} + + + +#pragma mark - +#pragma mark PBGitSHA + +- (id)initWithOID:(git_oid)g_oid +{ + self = [super init]; + if (!self) + return nil; + + oid = g_oid; + + return self; +} + + +- (NSString *)string +{ + if (!string) { + char *hex = git_oid_mkhex(&oid); + if (hex == NULL) + return nil; + string = [NSString stringWithUTF8String:hex]; + free(hex); + } + + return string; +} + + +- (BOOL)isEqual:(id)otherSHA +{ + if (self == otherSHA) + return YES; + + git_oid other_oid = [(PBGitSHA *)otherSHA oid]; + return git_oid_cmp(&oid, &other_oid) == 0; +} + + +- (BOOL)isEqualToOID:(git_oid)other_oid +{ + return git_oid_cmp(&oid, &other_oid) == 0; +} + + +- (NSUInteger)hash +{ + NSUInteger hash; + memcpy(&hash, &(oid.id), sizeof(NSUInteger)); + + return hash; +} + + +- (NSString *)description +{ + return [self string]; +} + + + +#pragma mark + +- (id)copyWithZone:(NSZone *)zone +{ + git_oid oidCopy; + git_oid_cpy(&oidCopy, &oid); + PBGitSHA *copy = [[[self class] allocWithZone:zone] initWithOID:oidCopy]; + + return copy; +} + +@end diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 1ae59c0..e2f712f 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -12,13 +12,13 @@ @class PBSourceViewItem; @class PBGitHistoryController; @class PBGitCommitController; -@class ApplicationController; -@interface PBGitSidebarController : PBViewController { +@interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; IBOutlet NSOutlineView *sourceView; IBOutlet NSView *sourceListControlsView; IBOutlet NSPopUpButton *actionButton; + IBOutlet NSSegmentedControl *remoteControls; NSMutableArray *items; @@ -26,23 +26,20 @@ PBSourceViewItem *stage; PBSourceViewItem *branches, *remotes, *tags, *others; - PBSourceViewItem * deferredSelectObject; PBGitHistoryController *historyViewController; PBGitCommitController *commitViewController; } - (void) selectStage; -- (void) selectBranch:(PBSourceViewItem *)branchItem; - (void) selectCurrentBranch; -- (PBSourceViewItem *) selectedItem; - - (NSMenu *) menuForRow:(NSInteger)row; +- (IBAction) fetchPullPushAction:(id)sender; + +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + @property(readonly) NSMutableArray *items; @property(readonly) NSView *sourceListControlsView; -@property(readonly) PBSourceViewItem * remotes; -@property(readonly) NSOutlineView * sourceView; -@property(assign) PBSourceViewItem * deferredSelectObject; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 8bab4e4..efcf6f1 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -15,8 +15,7 @@ #import "NSOutlineViewExt.h" #import "PBAddRemoteSheet.h" #import "PBGitDefaults.h" -#import "BMScript.h" -#import "ApplicationController.h" +#import "PBHistorySearchController.h" @interface PBGitSidebarController () @@ -25,38 +24,32 @@ - (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev; - (void) removeRevSpec:(PBGitRevSpecifier *)rev; - (void) updateActionMenu; - +- (void) updateRemoteControls; @end @implementation PBGitSidebarController @synthesize items; -@synthesize sourceListControlsView, sourceView, remotes; -@synthesize deferredSelectObject; +@synthesize sourceListControlsView; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { self = [super initWithRepository:theRepository superController:controller]; [sourceView setDelegate:self]; items = [NSMutableArray array]; - deferredSelectObject = nil; + return self; } - (void)awakeFromNib { [super awakeFromNib]; - window.contentView = [self view]; + window.contentView = self.view; [self populateList]; historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:superController]; commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController]; - superController.historyController = historyViewController; - - historyViewController.sidebarSourceView = self.sourceView; - historyViewController.sidebarRemotes = self.remotes; - - [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; + [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; [repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"]; [self menuNeedsUpdate:[actionButton menu]]; @@ -64,123 +57,22 @@ if ([PBGitDefaults showStageView]) [self selectStage]; else - [self selectCurrentBranch]; + [self selectCurrentBranch]; } -- (void)populateList +- (void)closeView { - // NSLog(@"[%@ %s]", [self class], _cmd); + [historyViewController closeView]; + [commitViewController closeView]; - PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]]; - project.isUncollapsible = YES; + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"branches"]; - stage = [PBGitSVStageItem stageItem]; - [project addChild:stage]; - - branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; - remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; - tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; - others = [PBSourceViewItem groupItemWithTitle:@"Other"]; - - for (PBGitRevSpecifier *branchRev in repository.branches) - [self addRevSpec:branchRev]; - - [items addObject:project]; - [items addObject:branches]; - [items addObject:remotes]; - [items addObject:tags]; - [items addObject:others]; - - [sourceView reloadData]; - [sourceView expandItem:project]; - [sourceView expandItem:branches expandChildren:YES]; - [sourceView expandItem:remotes]; - - [sourceView reloadItem:nil reloadChildren:YES]; - - // figure out if args passed to gitx are meaningful enough to describe a source view branch - // and a selectable commit on the history view controller... - - ApplicationController * appController = [ApplicationController sharedApplicationController]; - PBGitRevSpecifier * resolvedRev = nil; - -// if (YES) { -// //appController.cliArgs = @"rdi/master"; -// //appController.cliArgs = @"d12b92349bb89bc83b8eab45a4bed88d50547aeb"; -// appController.cliArgs = @"--commit"; -// appController.launchedFromGitx = YES; -// } - - NSString * cliargs = appController.cliArgs; - - // if the cliArgs have a "-" prefix it might be one of the "--all", "--local", "--commit", "-S..." etc. - // parameters (see ApplicationController.m and gitx.m) then don't set the deferredSelectObject and continue - // as normal - if (appController.launchedFromGitx && cliargs && !([cliargs hasPrefix:@"-"])) { - - repository.currentBranchFilter = [PBGitDefaults branchFilter]; - - // is it a partial ref ? (like xyz/master) - try to complete the rev - PBGitRef * ref; - if (ref = [repository completeRefForString:cliargs]) { - NSLog(@"[%@ %s] completed ref for %@ = %@", [self class], _cmd, cliargs, ref); - if (ref) { - resolvedRev = [[PBGitRevSpecifier alloc] initWithRef:ref]; - } - } else { - // is it a SHA ? - figure out the branch the SHA lives in - if ((appController.deferredSelectSha = [repository shaExists:cliargs])) { - - NSLog(@"[%@ %s] appController.deferredSelectSha = %@", [self class], _cmd, appController.deferredSelectSha); - - // this little shell script looks up the rev for a SHA and gets the refs/... path - // for its most recent commit (aka head commit (but not _the_ HEAD) - NSString * headRefPathForShaTemplate = [NSString stringWithString:@"#!/bin/sh\n" - @"cd \"%{DIR}\"\n" - @"br=`%{GITPATH} name-rev \"%{SHA}\" | awk '{gsub(/~.*/,\"\",$2);print $2}'`\n" - @"headsha=`%{GITPATH} rev-parse $br`\n" - @"%{GITPATH} show-ref | grep $headsha | awk '{print $2}'\n"]; - - NSDictionary * kwds = [NSDictionary dictionaryWithObjectsAndKeys:[PBGitBinary path], @"GITPATH", - [repository workingDirectory], @"DIR", - cliargs, @"SHA", nil]; - - TerminationStatus retVal = BMScriptNotExecuted; - NSString * output = [repository outputForShellScriptTemplate:headRefPathForShaTemplate - keywordDict:kwds - retValue:&retVal]; - - if (BMScriptFinishedSuccessfully == retVal) { - output = [output substringToIndex:[output length] - 1]; // trim \n - if ([output rangeOfString:@"\n"].location != NSNotFound) { - NSArray * lines = [output componentsSeparatedByString:@"\n"]; - resolvedRev = [[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:[lines objectAtIndex:0]]]; - } else { - resolvedRev = [[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:output]]; - } - } - } - } - // now try to find resolvedRev in the sourceView and store it - // in defereredSelectObject so we can select it later - if (resolvedRev) { - repository.currentBranch = resolvedRev; - //repository.currentBranch.isSimpleRef = YES; - // NSLog(@"[%@ %s] currentBranch = %@", [self class], _cmd, repository.currentBranch); - // NSLog(@"[%@ %s] items = %@", [self class], _cmd, [items description]); - for (PBSourceViewItem * item in items) { - if (deferredSelectObject = [item findRev:resolvedRev]) - break; - } - // NSLog(@"[%@ %s] deferredSelectObject = %@", [self class], _cmd, deferredSelectObject); - } - } + [super closeView]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - // NSLog(@"[%@ %s]", [self class], _cmd); - if ([@"currentBranchChange" isEqualToString:context]) { [sourceView reloadData]; [self selectCurrentBranch]; @@ -223,73 +115,47 @@ [sourceView selectRowIndexes:index byExtendingSelection:NO]; } -- (void) selectBranch:(PBSourceViewItem *)branchItem -{ - [sourceView PBExpandItem:branchItem expandParents:YES]; - NSInteger row = [sourceView rowForItem:branchItem]; - // NSLog(@"[%@ %s] rowForItem (%@) = %d", [self class], _cmd, branchItem, row); - NSIndexSet *index = [NSIndexSet indexSetWithIndex:row]; - [sourceView selectRowIndexes:index byExtendingSelection:NO]; -} - -- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev { - PBSourceViewItem *foundItem = nil; - for (PBSourceViewItem *item in items) { - if (foundItem = [item findRev:rev]) { - //NSLog(@"[%@ %s]: found item! Item = %@ for rev = %@", [self class], _cmd, item, rev); - return foundItem; - } - } - return nil; -} - -- (BOOL) selectCommitWithSha:(NSString *)refSHA { - NSArray *revList = repository.revisionList.commits; - // NSLog(@"[%@ %s] revList = %@", [self class], _cmd, revList); - for (PBGitCommit *commit in revList) { - // NSLog(@"[%@ %s] commit = %@", [self class], _cmd, commit); - if ([[commit realSha] isEqualToString:refSHA]) { - [historyViewController selectCommit:refSHA]; - return YES; - } - } - return NO; -} - - (void) selectCurrentBranch { PBGitRevSpecifier *rev = repository.currentBranch; - - // NSLog(@"[%@ %s] rev = %@", [self class], _cmd, rev); - - if (deferredSelectObject) { - NSString * sha = [ApplicationController sharedApplicationController].deferredSelectSha; - - if (!sha) { - sha = [repository shaForRef:[deferredSelectObject.revSpecifier ref]]; - } - - [self selectBranch:deferredSelectObject]; - - deferredSelectObject = nil; - return; - } - - if (!rev) { - [repository reloadRefs]; - [repository readCurrentBranch]; - return; - } - - PBSourceViewItem *item = [self itemForRev:rev]; - [self selectBranch:item]; + if (!rev) { + [repository reloadRefs]; + [repository readCurrentBranch]; + return; + } + + PBSourceViewItem *item = nil; + for (PBSourceViewItem *it in items) + if ( (item = [it findRev:rev]) != nil ) + break; + + if (!item) { + [self addRevSpec:rev]; + // Try to find the just added item again. + // TODO: refactor with above. + for (PBSourceViewItem *it in items) + if ( (item = [it findRev:rev]) != nil ) + break; + } + + [sourceView PBExpandItem:item expandParents:YES]; + NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:item]]; + + [sourceView selectRowIndexes:index byExtendingSelection:NO]; } +- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev +{ + PBSourceViewItem *foundItem = nil; + for (PBSourceViewItem *item in items) + if ( (foundItem = [item findRev:rev]) != nil ) + return foundItem; + return nil; +} - (void)addRevSpec:(PBGitRevSpecifier *)rev { if (![rev isSimpleRef]) { - NSLog(@"[%@ %s]: rev = %@", [self class], _cmd, rev); [others addChild:[PBSourceViewItem itemWithRevSpec:rev]]; [sourceView reloadData]; return; @@ -319,6 +185,11 @@ [sourceView reloadData]; } +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + [historyViewController.searchController setHistorySearch:searchString mode:mode]; +} + #pragma mark NSOutlineView delegate methods - (void)outlineViewSelectionDidChange:(NSNotification *)notification @@ -339,7 +210,7 @@ } [self updateActionMenu]; - [historyViewController updateRemoteControls:[[self selectedItem] ref]]; + [self updateRemoteControls]; } #pragma mark NSOutlineView delegate methods @@ -369,6 +240,36 @@ return ![item isUncollapsible]; } +- (void)populateList +{ + PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]]; + project.isUncollapsible = YES; + + stage = [PBGitSVStageItem stageItem]; + [project addChild:stage]; + + branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; + remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; + tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; + others = [PBSourceViewItem groupItemWithTitle:@"Other"]; + + for (PBGitRevSpecifier *rev in repository.branches) + [self addRevSpec:rev]; + + [items addObject:project]; + [items addObject:branches]; + [items addObject:remotes]; + [items addObject:tags]; + [items addObject:others]; + + [sourceView reloadData]; + [sourceView expandItem:project]; + [sourceView expandItem:branches expandChildren:YES]; + [sourceView expandItem:remotes]; + + [sourceView reloadItem:nil reloadChildren:YES]; +} + #pragma mark NSOutlineView Datasource methods - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item @@ -449,4 +350,63 @@ [self addMenuItemsForRef:ref toMenu:menu]; } + +#pragma mark Remote controls + +enum { + kAddRemoteSegment = 0, + kFetchSegment, + kPullSegment, + kPushSegment +}; + +- (void) updateRemoteControls +{ + BOOL hasRemote = NO; + + PBGitRef *ref = [[self selectedItem] ref]; + if ([ref isRemote] || ([ref isBranch] && [[repository remoteRefForBranch:ref error:NULL] remoteName])) + hasRemote = YES; + + [remoteControls setEnabled:hasRemote forSegment:kFetchSegment]; + [remoteControls setEnabled:hasRemote forSegment:kPullSegment]; + [remoteControls setEnabled:hasRemote forSegment:kPushSegment]; +} + +- (IBAction) fetchPullPushAction:(id)sender +{ + NSInteger selectedSegment = [sender selectedSegment]; + + if (selectedSegment == kAddRemoteSegment) { + [PBAddRemoteSheet beginAddRemoteSheetForRepository:repository]; + return; + } + + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + PBGitRef *ref = [[item revSpecifier] ref]; + + if (!ref && (item.parent == remotes)) + ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[item title]]]; + + if (![ref isRemote] && ![ref isBranch]) + return; + + PBGitRef *remoteRef = [repository remoteRefForBranch:ref error:NULL]; + if (!remoteRef) + return; + + if (selectedSegment == kFetchSegment) + [repository beginFetchFromRemoteForRef:ref]; + else if (selectedSegment == kPullSegment) + [repository beginPullFromRemote:remoteRef forRef:ref]; + else if (selectedSegment == kPushSegment) { + if ([ref isRemote]) + [historyViewController.refController showConfirmPushRefSheet:nil remote:remoteRef]; + else if ([ref isBranch]) + [historyViewController.refController showConfirmPushRefSheet:ref remote:remoteRef]; + } +} + + @end diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib index 453589f..cdf65f9 100644 --- a/PBGitSidebarView.xib +++ b/PBGitSidebarView.xib @@ -3,15 +3,16 @@ 1050 10C540 - 740 + 759 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 759 YES + @@ -81,7 +82,7 @@ 3 - MC4zMzMzMzI5ODU2AA + MC4zMzMzMzI5OQA 6 @@ -109,7 +110,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -172,7 +173,7 @@ _doScroller: - 0.99698787927627563 + 0.99698790000000004 @@ -182,7 +183,7 @@ 1 _doScroller: - 0.57142859697341919 + 0.57142859999999995 {153, 354} @@ -200,10 +201,74 @@ NSView - + 268 YES + + + 268 + {{52, 2}, {141, 25}} + + YES + + 67239424 + 0 + + LucidaGrande + 13 + 16 + + + + YES + + 33 + + NSImage + AddRemote + + + Add remote + 0 + + + 33 + + NSImage + FetchTemplate + + + Fetch from default remote + 1 + 0 + + + 33 + + NSImage + PullTemplate + + Pull from default remote + 2 + 0 + + + 33 + + NSImage + PushTemplate + + Push to default remote + 3 + 0 + + + 1 + 2 + 2 + + 268 @@ -289,6 +354,7 @@ {200, 31} + NSView @@ -343,6 +409,22 @@ 46 + + + remoteControls + + + + 49 + + + + fetchPullPushAction: + + + + 50 + delegate @@ -439,6 +521,7 @@ YES + Source List Controls View @@ -487,6 +570,20 @@ + + 47 + + + YES + + + + + + 48 + + + @@ -509,6 +606,9 @@ 42.IBPluginDependency 43.IBPluginDependency 44.IBPluginDependency + 47.IBPluginDependency + 48.IBPluginDependency + 48.IBSegmentedControlInspectorSelectedSegmentMetadataKey 8.IBEditorWindowLastContentRect 8.IBPluginDependency 9.IBPluginDependency @@ -523,7 +623,7 @@ com.apple.InterfaceBuilder.CocoaPlugin {{482, 590}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin - {{695, 521}, {200, 31}} + {{626, 507}, {200, 31}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -531,6 +631,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{105, 545}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -557,13 +660,6 @@ YES - - NSObject - - IBProjectSource - BMScript.h - - NSOutlineView @@ -621,10 +717,6 @@ PBViewController NSViewController - - refresh: - id - IBProjectSource PBViewController.h @@ -992,55 +1084,6 @@ Foundation.framework/Headers/NSURLDownload.h - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - NSObject @@ -1177,6 +1220,14 @@ AppKit.framework/Headers/NSScroller.h + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + NSSegmentedControl NSControl @@ -1266,6 +1317,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -1281,5 +1333,9 @@ YES GitX.xcodeproj 3 + + NSActionTemplate + {15, 15} + diff --git a/PBGitTree.h b/PBGitTree.h index 2a552f4..ebffbde 100644 --- a/PBGitTree.h +++ b/PBGitTree.h @@ -7,11 +7,9 @@ // #import -#import #import "PBGitRepository.h" @interface PBGitTree : NSObject { - long long _fileSize; NSString* sha; @@ -23,14 +21,14 @@ NSString* localFileName; NSDate* localMtime; - - NSString * absolutePath; - NSImage * iconImage; - } + + (PBGitTree*) rootForCommit: (id) commit; + (PBGitTree*) treeForTree: (PBGitTree*) tree andPath: (NSString*) path; - (void) saveToFolder: (NSString *) directory; +- (NSString *)textContents; +- (NSString *)blame; +- (NSString *) log:(NSString *)format; - (NSString*) tmpFileNameForContents; - (long long)fileSize; @@ -38,17 +36,11 @@ @property(copy) NSString* sha; @property(copy) NSString* path; @property(assign) BOOL leaf; -@property(assign) BOOL onlyCommit; @property(retain) PBGitRepository* repository; @property(assign) __weak PBGitTree* parent; @property(readonly) NSArray* children; @property(readonly) NSString* fullPath; @property(readonly) NSString* contents; -- (NSString*) contents:(NSInteger)option; -+(NSString *)parseBlame:(NSString *)blame; - -@property (copy) NSString *absolutePath; -@property (retain) NSImage *iconImage; @end diff --git a/PBGitTree.m b/PBGitTree.m index be7aebc..d6e685c 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -14,7 +14,7 @@ @implementation PBGitTree -@synthesize sha, path, repository, leaf, parent, iconImage, absolutePath, onlyCommit; +@synthesize sha, path, repository, leaf, parent; + (PBGitTree*) rootForCommit:(id) commit { @@ -38,15 +38,11 @@ return tree; } -- (id) init +- init { - if (self = [super init]) { - children = nil; - localFileName = nil; - leaf = YES; - absolutePath = [PBGitRepository basePath]; - } - onlyCommit=true; + children = nil; + localFileName = nil; + leaf = YES; return self; } @@ -69,10 +65,12 @@ - (BOOL)hasBinaryHeader:(NSString*)contents { - if(!contents) + if (!contents) return NO; - return [contents rangeOfString:@"\0" options:0 range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound; + return [contents rangeOfString:@"\0" + options:0 + range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound; } - (BOOL)hasBinaryAttributes @@ -105,7 +103,7 @@ { if (!leaf) return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; - + if ([self isLocallyCached]) { NSData *data = [NSData dataWithContentsOfFile:localFileName]; NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; @@ -114,15 +112,11 @@ return string; } - //return [repository outputForArguments:[NSArray arrayWithObjects:@"show", [self refSpec], nil]]; - return [repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", self.path, nil]]; + return [repository outputForArguments:[NSArray arrayWithObjects:@"show", [self refSpec], nil]]; } -// XXX: create img tag for images. -- (NSString*) contents:(NSInteger)option +- (NSString *) blame { - NSString* contents; - if (!leaf) return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; @@ -132,9 +126,32 @@ if ([self fileSize] > 52428800) // ~50MB return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]]; + NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", @"-p", sha, @"--", [self fullPath], nil]]; + if ([self hasBinaryHeader:contents]) return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + return contents; +} + +- (NSString *) log:(NSString *)format +{ + if (!leaf) + return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; + + if ([self hasBinaryAttributes]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + if ([self fileSize] > 52428800) // ~50MB + return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]]; + + NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"log", [NSString stringWithFormat:@"--pretty=format:%@",format], @"--", [self fullPath], nil]]; + + if ([self hasBinaryHeader:contents]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + return contents; } @@ -182,7 +199,7 @@ NSData* data = [handle readDataToEndOfFile]; [data writeToFile:newName atomically:YES]; } else { // Directory - [[NSFileManager defaultManager] createDirectoryAtPath:newName withIntermediateDirectories:YES attributes:nil error:nil]; + [[NSFileManager defaultManager] createDirectoryAtPath:newName attributes:nil]; for (PBGitTree* child in [self children]) [child saveToFolder: newName]; } @@ -231,28 +248,19 @@ if (children != nil) return children; + NSString* ref = [self refSpec]; - NSFileHandle* handle; - - if(onlyCommit){ - handle = [repository handleForArguments:[NSArray arrayWithObjects:@"show",@"--pretty=format:",@"--name-only", self.sha,nil]]; - }else{ - NSString* ref = [self refSpec]; - handle = [repository handleForArguments:[NSArray arrayWithObjects:@"show", ref, nil]]; - [handle readLine]; - } + NSFileHandle* handle = [repository handleForArguments:[NSArray arrayWithObjects:@"show", ref, nil]]; + [handle readLine]; [handle readLine]; NSMutableArray* c = [NSMutableArray array]; NSString* p = [handle readLine]; - while ([p length] > 0) { - if ([p isEqualToString:@"\r"]) - break; - + while (p.length > 0) { BOOL isLeaf = ([p characterAtIndex:p.length - 1] != '/'); if (!isLeaf) - p = [p substringToIndex:[p length]-1]; + p = [p substringToIndex:p.length -1]; PBGitTree* child = [PBGitTree treeForTree:self andPath:p]; child.leaf = isLeaf; @@ -269,85 +277,16 @@ if (!parent) return @""; - if ([[parent fullPath] isEqualToString:@""]) + if ([parent.fullPath isEqualToString:@""]) return self.path; - return [[parent fullPath] stringByAppendingPathComponent: self.path]; + return [parent.fullPath stringByAppendingPathComponent: self.path]; } -// !!! Andre Berg 20100324: finalize seldomly causes the following error message: -// malloc: resurrection error for object 0x12b1110 while assigning NSFilesystemItemRemoveOperation._removePath[32](0x12a0170)[16] = NSPathStore2[240](0x12b1110) -// garbage pointer stored into reachable memory, break on auto_zone_resurrection_error to debug -// objc[40604]: **resurrected** object 0x12b1110 of class NSPathStore2 being finalized -// - (void) finalize -// { -// if (localFileName) -// [[NSFileManager defaultManager] removeItemAtPath:localFileName error:nil]; -// [super finalize]; -// } - -+(NSString *)parseBlame:(NSString *)string +- (void) finalize { - string=[string stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; - string=[string stringByReplacingOccurrencesOfString:@">" withString:@">"]; - - NSArray *lines = [string 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){ - 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; - NSString *summary=nil; - while(summary==nil){ - line=[lines objectAtIndex:i++]; - if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){ - summary=line; - } - } - NSString *block=[NSString stringWithFormat:@"\n\n"]; - }else{ - break; - } - [res appendString:@"\n"]; - } - [res appendString:@"

%@

%@

\n",author,summary]; - [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 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; + if (localFileName) + [[NSFileManager defaultManager] removeFileAtPath:localFileName handler:nil]; + [super finalize]; } @end diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 78a1c98..0f38e22 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -9,16 +9,14 @@ #import #import "PBGitRepository.h" -@class PBViewController, PBGitSidebarController, PBGitHistoryController; +@class PBViewController, PBGitSidebarController, PBGitCommitController; -@interface PBGitWindowController : NSWindowController { +@interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; - __weak PBViewController *contentController; - __weak PBViewController* viewController; - __weak PBGitSidebarController *sidebarController; - __weak PBGitHistoryController *historyController; + PBViewController *contentController; + PBGitSidebarController *sidebarController; IBOutlet NSView *sourceListControlsView; IBOutlet NSSplitView *splitView; IBOutlet NSView *sourceSplitView; @@ -27,20 +25,19 @@ IBOutlet NSTextField *statusField; IBOutlet NSProgressIndicator *progressIndicator; + PBViewController* viewController; + IBOutlet NSToolbarItem *terminalItem; IBOutlet NSToolbarItem *finderItem; } @property (assign) __weak PBGitRepository *repository; -@property (assign) __weak PBViewController * viewController; -@property (assign) __weak PBViewController * contentController; -@property (assign) __weak PBGitSidebarController * sidebarController; -@property (assign) __weak PBGitHistoryController * historyController; - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)display; - (void)changeContentController:(PBViewController *)controller; +- (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)infoText commitController:(PBGitCommitController *)controller; - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output; @@ -51,4 +48,7 @@ - (IBAction) openInTerminal:(id)sender; - (IBAction) cloneTo:(id)sender; - (IBAction) refresh:(id)sender; + +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 2abdfab..9fb9c13 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -9,19 +9,16 @@ #import "PBGitWindowController.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" -#import "PBGitDefaults.h" #import "Terminal.h" #import "PBCloneRepsitoryToSheet.h" +#import "PBCommitHookFailedSheet.h" +#import "PBGitXMessageSheet.h" #import "PBGitSidebarController.h" -#import "NSString_Truncate.h" @implementation PBGitWindowController + @synthesize repository; -@synthesize viewController; -@synthesize contentController; -@synthesize sidebarController; -@synthesize historyController; - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)displayDefault { @@ -35,10 +32,13 @@ - (void)windowWillClose:(NSNotification *)notification { - //NSLog(@"Window will close!"); + NSLog(@"Window will close!"); if (sidebarController) - [sidebarController removeView]; + [sidebarController closeView]; + + if (contentController) + [contentController removeObserver:self forKeyPath:@"status"]; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem @@ -110,30 +110,22 @@ [sidebarController selectCurrentBranch]; } +- (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)infoText commitController:(PBGitCommitController *)controller +{ + [PBCommitHookFailedSheet beginMessageSheetForWindow:[self window] withMessageText:messageText infoText:infoText commitController:controller]; +} + - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText { - if ([PBGitDefaults truncateInfoText] && ([infoText length] > [PBGitDefaults truncateInfoTextSize])) { - infoText = [infoText truncateToLength:[PBGitDefaults truncateInfoTextSize] mode:PBNSStringTruncateModeCenter indicator:@" ... "]; - } - [[NSAlert alertWithMessageText:messageText - defaultButton:nil - alternateButton:nil - otherButton:nil - informativeTextWithFormat:infoText] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; + [PBGitXMessageSheet beginMessageSheetForWindow:[self window] withMessageText:messageText infoText:infoText]; } - (void)showErrorSheet:(NSError *)error { - [[NSAlert alertWithError:error] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; -} - -- (void)windowDidBecomeMain:(NSNotification *)notification { - /* Using ...didBecomeMain is better than ...didBecomeKey here because the QuickLook panel will count as key state change - and the outline view window will trigger a refresh in the middle of the QuickLook panel's closing animation which - causes a half second freeze with left over artifacts. */ - if (self.contentController && [PBGitDefaults refreshAutomatically]) { - [self.contentController refresh:nil]; - } + if ([[error domain] isEqualToString:PBGitRepositoryErrorDomain]) + [PBGitXMessageSheet beginMessageSheetForWindow:[self window] withError:error]; + else + [[NSAlert alertWithError:error] beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; } - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output @@ -205,6 +197,11 @@ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + [sidebarController setHistorySearch:searchString mode:mode]; +} + #pragma mark - diff --git a/PBGitXMessageSheet.h b/PBGitXMessageSheet.h new file mode 100644 index 0000000..60cd3c7 --- /dev/null +++ b/PBGitXMessageSheet.h @@ -0,0 +1,33 @@ +// +// PBGitXMessageSheet.h +// GitX +// +// Created by BrotherBard on 7/4/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import + + +@interface PBGitXMessageSheet : NSWindowController +{ + NSImageView *iconView; + NSTextField *messageField; + NSTextView *infoView; + NSScrollView *scrollView; +} + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withError:(NSError *)error; + + +- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; +- (IBAction)closeMessageSheet:(id)sender; + + +@property (assign) IBOutlet NSImageView *iconView; +@property (assign) IBOutlet NSTextField *messageField; +@property (assign) IBOutlet NSTextView *infoView; +@property (assign) IBOutlet NSScrollView *scrollView; + +@end diff --git a/PBGitXMessageSheet.m b/PBGitXMessageSheet.m new file mode 100644 index 0000000..783cc94 --- /dev/null +++ b/PBGitXMessageSheet.m @@ -0,0 +1,122 @@ +// +// PBGitXMessageSheet.m +// GitX +// +// Created by BrotherBard on 7/4/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import "PBGitXMessageSheet.h" + + +#define MaxScrollViewHeight 125.0f + + +@interface PBGitXMessageSheet () + +- (void)setInfoString:(NSString *)info; +- (void)resizeWindow; + +@end + + + +@implementation PBGitXMessageSheet + + +@synthesize iconView; +@synthesize messageField; +@synthesize infoView; +@synthesize scrollView; + + +#pragma mark - +#pragma mark PBGitXMessageSheet + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info +{ + PBGitXMessageSheet *sheet = [[self alloc] initWithWindowNibName:@"PBGitXMessageSheet"]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:message infoText:info]; +} + + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withError:(NSError *)error +{ + PBGitXMessageSheet *sheet = [[self alloc] initWithWindowNibName:@"PBGitXMessageSheet"]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:[error localizedDescription] infoText:[error localizedRecoverySuggestion]]; +} + + +- (IBAction)closeMessageSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +#pragma mark Private + +- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; +{ + [self window]; + + [self.messageField setStringValue:message]; + [self setInfoString:info]; + [self resizeWindow]; + + [NSApp beginSheet:[self window] modalForWindow:parentWindow modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + +- (void)setInfoString:(NSString *)info +{ + NSDictionary *attributes = [NSDictionary dictionaryWithObject:[NSFont labelFontOfSize:[NSFont smallSystemFontSize]] + forKey:NSFontAttributeName]; + NSAttributedString *attributedInfoString = [[NSAttributedString alloc] initWithString:info attributes:attributes]; + [[self.infoView textStorage] setAttributedString:attributedInfoString]; +} + + +- (void)resizeWindow +{ + // resize for message text + NSRect messageFrame = [self.messageField frame]; + NSSize boundingSize = messageFrame.size; + boundingSize.height = 0.0f; + NSAttributedString *attributedTitle = [self.messageField attributedStringValue]; + NSRect boundingRect = [attributedTitle boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + CGFloat heightDelta = boundingRect.size.height - messageFrame.size.height; + if (heightDelta > 0.0f) { + messageFrame.size.height += heightDelta; + messageFrame.origin.y -= heightDelta; + [self.messageField setFrame:messageFrame]; + + NSRect scrollFrame = [self.scrollView frame]; + scrollFrame.size.height -= heightDelta; + [self.scrollView setFrame:scrollFrame]; + + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + + // resize for info text + NSRect scrollFrame = [self.scrollView frame]; + boundingSize = [self.scrollView bounds].size; + boundingSize.height = 0.0f; + NSAttributedString *attributedInfo = [[self.infoView layoutManager] attributedString]; + boundingRect = [attributedInfo boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + heightDelta = boundingRect.size.height - scrollFrame.size.height; + if (heightDelta > MaxScrollViewHeight) + heightDelta = MaxScrollViewHeight; + if (heightDelta > 0.0f) { + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + [self.infoView scrollRangeToVisible:NSMakeRange(0, 0)]; +} + + +@end diff --git a/PBGitXMessageSheet.xib b/PBGitXMessageSheet.xib new file mode 100644 index 0000000..906c98f --- /dev/null +++ b/PBGitXMessageSheet.xib @@ -0,0 +1,1222 @@ + + + + 1050 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBGitXMessageSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 331}, {540, 179}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 289 + {{430, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{17, 98}, {64, 64}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 0 + 0 + NO + + YES + + + + 266 + {{99, 142}, {424, 17}} + + YES + + 67239424 + 272629760 + <message> + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {423, 55} + + + + + + PGluZm8+A + + + YES + + YES + NSFont + NSParagraphStyle + + + YES + + Helvetica + 12 + 16 + + + 4 + + + + + + + + YES + + + 134 + + + + 423 + 1 + + + 2049 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {423, 1e+07} + {223, 0} + + + + {422, 72} + + + + + + {4, -5} + 1 + + 2 + + + + -2147483392 + {{386, 1}, {15, 163}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + YES + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{98, 60}, {422, 72}} + + + 656 + + + + + + {540, 179} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + iconView + + + + 15 + + + + infoView + + + + 16 + + + + messageField + + + + 17 + + + + window + + + + 18 + + + + closeMessageSheet: + + + + 19 + + + + scrollView + + + + 20 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + YES + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 2.IBPluginDependency + 2.IBUserGuides + 3.IBPluginDependency + 4.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{663, 521}, {540, 179}} + com.apple.InterfaceBuilder.CocoaPlugin + {{663, 521}, {540, 179}} + + {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 + + YES + + + 103 + 0 + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 20 + + + + YES + + PBGitXMessageSheet + NSWindowController + + closeMessageSheet: + id + + + closeMessageSheet: + + closeMessageSheet: + id + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + NSImageView + NSTextView + NSTextField + NSScrollView + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + + iconView + NSImageView + + + infoView + NSTextView + + + messageField + NSTextField + + + scrollView + NSScrollView + + + + + IBProjectSource + PBGitXMessageSheet.h + + + + + 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 + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.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 + 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 + + + + 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 + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + 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 + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../gitx/GitX.xcodeproj + 3 + + NSApplicationIcon + {128, 128} + + + diff --git a/PBGraphCellInfo.h b/PBGraphCellInfo.h index 5948e0f..e959061 100644 --- a/PBGraphCellInfo.h +++ b/PBGraphCellInfo.h @@ -18,7 +18,7 @@ char sign; } -@property(readonly) struct PBGitGraphLine *lines; +@property(assign) struct PBGitGraphLine *lines; @property(assign) int nLines; @property(assign) int position, numColumns; @property(assign) char sign; diff --git a/PBGraphCellInfo.m b/PBGraphCellInfo.m index e5002cf..2a417e6 100644 --- a/PBGraphCellInfo.m +++ b/PBGraphCellInfo.m @@ -19,6 +19,12 @@ return self; } +- (void)setLines:(struct PBGitGraphLine *)l +{ + free(lines); + lines = l; +} + -(void) finalize { free(lines); diff --git a/PBHistorySearchController.h b/PBHistorySearchController.h new file mode 100644 index 0000000..d439906 --- /dev/null +++ b/PBHistorySearchController.h @@ -0,0 +1,66 @@ +// +// PBHistorySearchController.h +// GitX +// +// Created by Nathan Kinsinger on 8/21/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +typedef enum historySearchModes { + kGitXBasicSeachMode = 1, + kGitXPickaxeSearchMode, + kGitXRegexSearchMode, + kGitXPathSearchMode, + kGitXMaxSearchMode // always keep this item last +} PBHistorySearchMode; + +@class PBGitHistoryController; + + +@interface PBHistorySearchController : NSObject { + PBGitHistoryController *historyController; + NSArrayController *commitController; + + PBHistorySearchMode searchMode; + NSIndexSet *results; + + NSSearchField *searchField; + NSSegmentedControl *stepper; + NSTextField *numberOfMatchesField; + NSProgressIndicator *progressIndicator; + NSTimer *searchTimer; + + NSTask *backgroundSearchTask; + + NSPanel *rewindPanel; +} + +@property (assign) IBOutlet PBGitHistoryController *historyController; +@property (assign) IBOutlet NSArrayController *commitController; + +@property (assign) IBOutlet NSSearchField *searchField; +@property (assign) IBOutlet NSSegmentedControl *stepper; +@property (assign) IBOutlet NSTextField *numberOfMatchesField; +@property (assign) IBOutlet NSProgressIndicator *progressIndicator; + +@property (assign) PBHistorySearchMode searchMode; + + +- (BOOL)isRowInSearchResults:(NSInteger)rowIndex; +- (BOOL)hasSearchResults; + +- (void)selectSearchMode:(id)sender; + +- (void)selectNextResult; +- (void)selectPreviousResult; +- (IBAction)stepperPressed:(id)sender; + +- (void)clearSearch; +- (IBAction)updateSearch:(id)sender; + +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + +@end diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m new file mode 100644 index 0000000..d59db39 --- /dev/null +++ b/PBHistorySearchController.m @@ -0,0 +1,544 @@ +// +// PBHistorySearchController.m +// GitX +// +// Created by Nathan Kinsinger on 8/21/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBHistorySearchController.h" +#import "PBGitHistoryController.h" +#import "PBGitRepository.h" +#import "PBGitDefaults.h" +#import + + +@interface PBHistorySearchController () + +- (void)selectNextResultInDirection:(NSInteger)direction; + +- (void)updateUI; +- (void)setupSearchMenuTemplate; + +- (void)startBasicSearch; +- (void)startBackgroundSearch; +- (void)clearProgressIndicator; + +- (void)showSearchRewindPanelReverse:(BOOL)isReversed; + +@end + + +#define kGitXSearchDirectionNext 1 +#define kGitXSearchDirectionPrevious -1 + +#define kGitXBasicSearchLabel @"Subject, Author, SHA" +#define kGitXPickaxeSearchLabel @"Commit (pickaxe)" +#define kGitXRegexSearchLabel @"Commit (pickaxe regex)" +#define kGitXPathSearchLabel @"File path" + +#define kGitXSearchArrangedObjectsContext @"GitXSearchArrangedObjectsContext" + + +@implementation PBHistorySearchController + +@synthesize historyController; +@synthesize commitController; + +@synthesize searchField; +@synthesize stepper; +@synthesize numberOfMatchesField; +@synthesize progressIndicator; + +@synthesize searchMode; + + + +#pragma mark - +#pragma mark Public methods + +- (BOOL)isRowInSearchResults:(NSInteger)rowIndex +{ + return [results containsIndex:rowIndex]; +} + +- (BOOL)hasSearchResults +{ + return ([results count] > 0); +} + +- (void)selectSearchMode:(id)sender +{ + self.searchMode = [sender tag]; + [self updateSearch:self]; +} + +- (void)selectNextResult +{ + [self selectNextResultInDirection:kGitXSearchDirectionNext]; +} + +- (void)selectPreviousResult +{ + [self selectNextResultInDirection:kGitXSearchDirectionPrevious]; +} + +- (IBAction)stepperPressed:(id)sender +{ + NSInteger selectedSegment = [sender selectedSegment]; + + if (selectedSegment == 0) + [self selectPreviousResult]; + else + [self selectNextResult]; +} + +- (void)clearSearch +{ + [searchField setStringValue:@""]; + if (results) { + results = nil; + [historyController.commitList reloadData]; + } + [self updateUI]; +} + +- (IBAction)updateSearch:(id)sender +{ + if (self.searchMode == kGitXBasicSeachMode) + [self startBasicSearch]; + else + [self startBackgroundSearch]; +} + +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + if (searchString && ![searchString isEqualToString:@""]) { + self.searchMode = mode; + [searchField setStringValue:searchString]; + // use performClick: so that the search field will save it as a recent search + [searchField performClick:self]; + } +} + +- (void)awakeFromNib +{ + [self setupSearchMenuTemplate]; + self.searchMode = [PBGitDefaults historySearchMode]; + + [self updateUI]; + + [commitController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:kGitXSearchArrangedObjectsContext]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([(NSString *)context isEqualToString:kGitXSearchArrangedObjectsContext]) { + // the objects in the commitlist changed so the result indexes are no longer valid + [self clearSearch]; + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; +} + + + +#pragma mark - +#pragma mark Private methods + +- (void)selectIndex:(NSUInteger)index +{ + if ([[commitController arrangedObjects] count] > index) { + PBGitCommit *commit = [[commitController arrangedObjects] objectAtIndex:index]; + [historyController selectCommit:[commit sha]]; + } +} + +- (void)selectNextResultInDirection:(NSInteger)direction +{ + if (![results count]) + return; + + NSUInteger selectedRow = [historyController.commitList selectedRow]; + if (selectedRow == NSNotFound) { + [self selectIndex:[results firstIndex]]; + return; + } + + NSUInteger currentResult = NSNotFound; + if (direction == kGitXSearchDirectionNext) + currentResult = [results indexGreaterThanIndex:selectedRow]; + else + currentResult = [results indexLessThanIndex:selectedRow]; + + if (currentResult == NSNotFound) { + if (direction == kGitXSearchDirectionNext) + currentResult = [results firstIndex]; + else + currentResult = [results lastIndex]; + + [self showSearchRewindPanelReverse:(direction != kGitXSearchDirectionNext)]; + } + + [self selectIndex:currentResult]; +} + +- (NSString *)numberOfMatchesString +{ + NSUInteger numberOfMatches = [results count]; + + if (numberOfMatches == 0) + return @"Not found"; + + if (numberOfMatches == 1) + return @"1 match"; + + return [NSString stringWithFormat:@"%d matches", numberOfMatches]; +} + +- (void)updateUI +{ + if ([[searchField stringValue] isEqualToString:@""]) { + [numberOfMatchesField setHidden:YES]; + [stepper setHidden:YES]; + } + else { + [numberOfMatchesField setStringValue:[self numberOfMatchesString]]; + [numberOfMatchesField setHidden:NO]; + [stepper setHidden:NO]; + [historyController.commitList reloadData]; + } + [self clearProgressIndicator]; +} + +// changes the selection to the next match after the current selected row unless the current row is already a match +- (void)updateSelectedResult +{ + NSString *searchString = [searchField stringValue]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + if (![self isRowInSearchResults:[historyController.commitList selectedRow]]) + [self selectNextResult]; + + [self updateUI]; +} + +- (void)setupSearchMenuTemplate +{ + NSMenu *searchMenu = [[NSMenu alloc] initWithTitle:@"Search Menu"]; + NSMenuItem *item; + + item = [[NSMenuItem alloc] initWithTitle:kGitXBasicSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXBasicSeachMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXPickaxeSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXPickaxeSearchMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXRegexSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXRegexSearchMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXPathSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXPathSearchMode]; + [searchMenu addItem:item]; + + item = [NSMenuItem separatorItem]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldRecentsTitleMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"Recents" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldRecentsMenuItemTag]; + [searchMenu addItem:item]; + + item = [NSMenuItem separatorItem]; + [item setTag:NSSearchFieldRecentsTitleMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"Clear Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldClearRecentsMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"No Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldNoRecentsMenuItemTag]; + [searchMenu addItem:item]; + + [[searchField cell] setSearchMenuTemplate:searchMenu]; +} + +- (void)updateSearchMenuState +{ + NSMenu *searchMenu = [[searchField cell] searchMenuTemplate]; + if (!searchMenu) + return; + + NSMenuItem *item; + + item = [searchMenu itemWithTag:kGitXBasicSeachMode]; + [item setState:(searchMode == kGitXBasicSeachMode) ? NSOnState : NSOffState]; + + item = [searchMenu itemWithTag:kGitXPickaxeSearchMode]; + [item setState:(searchMode == kGitXPickaxeSearchMode) ? NSOnState : NSOffState]; + + item = [searchMenu itemWithTag:kGitXRegexSearchMode]; + [item setState:(searchMode == kGitXRegexSearchMode) ? NSOnState : NSOffState]; + + item = [searchMenu itemWithTag:kGitXPathSearchMode]; + [item setState:(searchMode == kGitXPathSearchMode) ? NSOnState : NSOffState]; + + [[searchField cell] setSearchMenuTemplate:searchMenu]; + + [PBGitDefaults setHistorySearchMode:searchMode]; +} + +- (void)updateSearchPlaceholderString +{ + switch (self.searchMode) { + case kGitXPickaxeSearchMode: + [[searchField cell] setPlaceholderString:kGitXPickaxeSearchLabel]; + break; + case kGitXRegexSearchMode: + [[searchField cell] setPlaceholderString:kGitXRegexSearchLabel]; + break; + case kGitXPathSearchMode: + [[searchField cell] setPlaceholderString:kGitXPathSearchLabel]; + break; + default: + [[searchField cell] setPlaceholderString:kGitXBasicSearchLabel]; + break; + } +} + +- (void)setSearchMode:(PBHistorySearchMode)mode +{ + if ((mode < kGitXBasicSeachMode) || (mode >= kGitXMaxSearchMode)) + mode = kGitXBasicSeachMode; + + searchMode = mode; + [PBGitDefaults setHistorySearchMode:searchMode]; + + [self updateSearchMenuState]; + [self updateSearchPlaceholderString]; +} + +- (void)searchTimerFired:(NSTimer*)theTimer +{ + [self.progressIndicator setHidden:NO]; + [self.progressIndicator startAnimation:self]; +} + +- (void)clearProgressIndicator +{ + [searchTimer invalidate]; + searchTimer = nil; + [self.progressIndicator setHidden:YES]; + [self.progressIndicator stopAnimation:self]; +} + +- (void)startProgressIndicator +{ + [self clearProgressIndicator]; + [numberOfMatchesField setHidden:YES]; + [stepper setHidden:YES]; + searchTimer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(searchTimerFired:) userInfo:nil repeats:NO]; +} + + + +#pragma mark Basic Search + +- (void)startBasicSearch +{ + NSString *searchString = [searchField stringValue]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; + NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"subject CONTAINS[cd] %@ OR author CONTAINS[cd] %@ OR realSha BEGINSWITH[c] %@", searchString, searchString, searchString]; + + NSUInteger index = 0; + for (PBGitCommit *commit in [commitController arrangedObjects]) { + if ([searchPredicate evaluateWithObject:commit]) + [indexes addIndex:index]; + index++; + } + + results = indexes; + + [self updateSelectedResult]; +} + + + +#pragma mark Background Search + +- (void)startBackgroundSearch +{ + if (backgroundSearchTask) { + NSFileHandle *handle = [[backgroundSearchTask standardOutput] fileHandleForReading]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; + [backgroundSearchTask terminate]; + } + + NSString *searchString = [[searchField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + results = nil; + + NSMutableArray *searchArguments = [NSMutableArray arrayWithObjects:@"log", @"--pretty=format:%H", nil]; + switch (self.searchMode) { + case kGitXRegexSearchMode: + [searchArguments addObject:@"--pickaxe-regex"]; + case kGitXPickaxeSearchMode: + [searchArguments addObject:[NSString stringWithFormat:@"-S%@", searchString]]; + break; + case kGitXPathSearchMode: + [searchArguments addObject:@"--"]; + [searchArguments addObjectsFromArray:[searchString componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; + break; + default: + return; + } + + backgroundSearchTask = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:searchArguments inDir:[[historyController.repository fileURL] path]]; + [backgroundSearchTask launch]; + + NSFileHandle *handle = [[backgroundSearchTask standardOutput] fileHandleForReading]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(parseBackgroundSearchResults:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; + [handle readToEndOfFileInBackgroundAndNotify]; + + [self startProgressIndicator]; +} + +- (void)parseBackgroundSearchResults:(NSNotification *)notification +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:[notification object]]; + backgroundSearchTask = nil; + + NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; + NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem]; + + NSString *resultsString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSArray *resultsArray = [resultsString componentsSeparatedByString:@"\n"]; + + for (NSString *resultSHA in resultsArray) { + NSUInteger index = 0; + for (PBGitCommit *commit in [commitController arrangedObjects]) { + if ([resultSHA isEqualToString:commit.sha.string]) { + [indexes addIndex:index]; + break; + } + index++; + } + } + + results = indexes; + [self clearProgressIndicator]; + [self updateSelectedResult]; +} + + + +#pragma mark - +#pragma mark Rewind Panel + +#define kRewindPanelSize 125.0f + +- (void)closeRewindPanel +{ + [[[historyController view] window] removeChildWindow:rewindPanel]; + [rewindPanel close]; + rewindPanel = nil; +} + +- (NSPanel *)rewindPanelReverse:(BOOL)isReversed +{ + NSRect windowFrame = [[[historyController view] window] frame]; + NSRect historyFrame = [[historyController view] convertRectToBase:[[historyController view] frame]]; + NSRect panelRect = NSMakeRect(0.0f, 0.0f, kRewindPanelSize, kRewindPanelSize); + panelRect.origin.x = windowFrame.origin.x + historyFrame.origin.x + ((historyFrame.size.width - kRewindPanelSize) / 2.0f); + panelRect.origin.y = windowFrame.origin.y + historyFrame.origin.y + ((historyFrame.size.height - kRewindPanelSize) / 2.0f); + + NSPanel *panel = [[NSPanel alloc] initWithContentRect:panelRect + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:YES]; + [panel setIgnoresMouseEvents:YES]; + [panel setOneShot:YES]; + [panel setOpaque:NO]; + [panel setBackgroundColor:[NSColor clearColor]]; + [panel setHasShadow:NO]; + [panel useOptimizedDrawing:YES]; + [panel setAlphaValue:0.0f]; + + NSBox *box = [[NSBox alloc] initWithFrame:[[panel contentView] frame]]; + [box setBoxType:NSBoxCustom]; + [box setBorderType:NSLineBorder]; + [box setFillColor:[NSColor colorWithCalibratedWhite:0.0f alpha:0.5f]]; + [box setBorderColor:[NSColor colorWithCalibratedWhite:0.5f alpha:0.5f]]; + [box setCornerRadius:12.0f]; + [[panel contentView] addSubview:box]; + + NSImage *rewindImage = [[NSImage imageNamed:@"rewindImage"] copy]; + [rewindImage setFlipped:isReversed]; + NSSize imageSize = [rewindImage size]; + NSRect imageViewFrame = NSMakeRect(21.0f, 5.0f, imageSize.width, imageSize.height); + NSImageView *rewindImageView = [[NSImageView alloc] initWithFrame:imageViewFrame]; + [rewindImageView setImage:rewindImage]; + [[box contentView] addSubview:rewindImageView]; + + return panel; +} + +- (CAKeyframeAnimation *)rewindPanelFadeOutAnimation +{ + CAKeyframeAnimation *animation = [CAKeyframeAnimation animation]; + animation.duration = 1.0f; + animation.values = [NSArray arrayWithObjects: + [NSNumber numberWithFloat:1.0f], + [NSNumber numberWithFloat:1.0f], + [NSNumber numberWithFloat:0.0f], + [NSNumber numberWithFloat:0.0f], nil]; + animation.keyTimes = [NSArray arrayWithObjects: + [NSNumber numberWithFloat:0.1f], + [NSNumber numberWithFloat:0.3f], + [NSNumber numberWithFloat:0.7f], + [NSNumber numberWithFloat:animation.duration], nil]; + + return animation; +} + +- (void)showSearchRewindPanelReverse:(BOOL)isReversed +{ + if (rewindPanel) + [self closeRewindPanel]; + + rewindPanel = [self rewindPanelReverse:isReversed]; + + [[[historyController view] window] addChildWindow:rewindPanel ordered:NSWindowAbove]; + + CAKeyframeAnimation *alphaAnimation = [self rewindPanelFadeOutAnimation]; + [rewindPanel setAnimations:[NSDictionary dictionaryWithObject:alphaAnimation forKey:@"alphaValue"]]; + [[rewindPanel animator] setAlphaValue:0.0f]; + + [self performSelector:@selector(closeRewindPanel) withObject:nil afterDelay:0.7f]; +} + +@end diff --git a/PBPrefsWindowController.m b/PBPrefsWindowController.m index 91dc4ee..aefec82 100644 --- a/PBPrefsWindowController.m +++ b/PBPrefsWindowController.m @@ -62,6 +62,8 @@ [openPanel setAllowsMultipleSelection:NO]; [openPanel setTreatsFilePackagesAsDirectories:YES]; [openPanel setAccessoryView:gitPathOpenAccessory]; + [openPanel setResolvesAliases:NO]; + //[[openPanel _navView] setShowsHiddenFiles:YES]; gitPathOpenPanel = openPanel; } @@ -71,14 +73,9 @@ - (IBAction) showHideAllFiles: sender { - if ([gitPathOpenPanel respondsToSelector:@selector(setShowsHiddenFiles:)]) { - BOOL showHidden = ([sender state] == NSOnState); - [gitPathOpenPanel setShowsHiddenFiles:showHidden]; - } else { - /* FIXME: This uses undocumented OpenPanel features to show hidden files! */ - NSNumber *showHidden = [NSNumber numberWithBool:[sender state] == NSOnState]; - [[gitPathOpenPanel valueForKey:@"_navView"] setValue:showHidden forKey:@"showsHiddenFiles"]; - } + /* FIXME: This uses undocumented OpenPanel features to show hidden files! */ + NSNumber *showHidden = [NSNumber numberWithBool:[sender state] == NSOnState]; + [[gitPathOpenPanel valueForKey:@"_navView"] setValue:showHidden forKey:@"showsHiddenFiles"]; } @end diff --git a/PBQLOutlineView.m b/PBQLOutlineView.m index fe1c1c6..05f9790 100644 --- a/PBQLOutlineView.m +++ b/PBQLOutlineView.m @@ -80,19 +80,17 @@ } /* Implemented to satisfy datasourcee protocol */ -- (BOOL) outlineView:(NSOutlineView *)ov isItemExpandable:(id)item { - return YES; -} +- (BOOL) outlineView: (NSOutlineView *)ov + isItemExpandable: (id)item { return NO; } -- (NSInteger) outlineView:(NSOutlineView *)ov numberOfChildrenOfItem:(id)item { - return 0; -} +- (NSInteger) outlineView: (NSOutlineView *)ov + numberOfChildrenOfItem:(id)item { return 0; } -- (id) outlineView:(NSOutlineView *)ov child:(NSInteger)index ofItem:(id)item { - return nil; -} +- (id) outlineView: (NSOutlineView *)ov + child:(NSInteger)index + ofItem:(id)item { return nil; } -- (id) outlineView:(NSOutlineView *)ov objectValueForTableColumn:(NSTableColumn *)col byItem:(id)item { - return nil; -} +- (id) outlineView: (NSOutlineView *)ov + objectValueForTableColumn:(NSTableColumn*)col + byItem:(id)item { return nil; } @end diff --git a/PBRefContextDelegate.h b/PBRefContextDelegate.h index 1b7a973..9112b8f 100644 --- a/PBRefContextDelegate.h +++ b/PBRefContextDelegate.h @@ -7,8 +7,12 @@ // +@class PBGitRef; +@class PBGitCommit; + @protocol PBRefContextDelegate - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex; @end diff --git a/PBRefController.h b/PBRefController.h index 9eb46e9..15df74b 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -19,6 +19,7 @@ IBOutlet __weak PBGitHistoryController *historyController; IBOutlet NSArrayController *commitController; IBOutlet PBCommitList *commitList; + IBOutlet NSPopUpButton *branchPopUp; } @@ -42,9 +43,7 @@ - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex; + @end - -@interface NSString (PBRefSpecAdditions) -- (NSString *) refForSpec; -@end \ No newline at end of file diff --git a/PBRefController.m b/PBRefController.m index 203fb8c..c9b8c2e 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -147,9 +147,8 @@ - (void) rebaseHeadBranch:(PBRefMenuItem *)sender { id refish = [sender refish]; - PBGitRef *headRef = [[historyController.repository headRef] ref]; - [historyController.repository rebaseBranch:headRef onRefish:refish]; + [historyController.repository rebaseBranch:nil onRefish:refish]; } @@ -275,43 +274,15 @@ return [PBRefMenuItem defaultMenuItemsForCommit:commit target:self]; } -// - (BOOL) addRemoteImplWithName:(NSString *)remoteName forURL:(NSString *)remoteURL -// { -// int ret = 1; -// BOOL success = NO; -// if (!remoteName || !remoteURL) { -// return success; -// } -// NSString *rval = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"remote", @"add", @"-f", remoteName, remoteURL, nil] retValue: &ret]; -// if (ret) { -// NSString *info = [NSString stringWithFormat:@"There was an error adding the remote.\n\n%d\n%@", ret, rval]; -// [[historyController.repository windowController] showMessageSheet:@"Adding Remote failed" infoText:info]; -// return success; -// } -// [historyController.repository reloadRefs]; -// [commitController rearrangeObjects]; -// success = YES; -// return success; -// } -// -// - (void) toggleToolbarItems:(NSToolbar *)tb matchingLabels:(NSArray *)labels enabledState:(BOOL)state { -// NSArray * tbItems = [tb items]; -// -// /* if labels is nil, assume all toolbar items */ -// if (!labels) { -// for (NSToolbarItem * curItem in tbItems) { -// [curItem setEnabled:state]; -// } -// } else { -// for (NSToolbarItem * curItem in tbItems) { -// for (NSString * curLabel in labels) { -// if ([[curItem label] isEqualToString:curLabel]) { -// [curItem setEnabled:state]; -// } -// } -// } -// } -// } +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex +{ + NSArray *commits = [commitController arrangedObjects]; + if ([commits count] <= rowIndex) + return nil; + + return [self menuItemsForCommit:[commits objectAtIndex:rowIndex]]; +} + # pragma mark Tableview delegate methods @@ -331,6 +302,13 @@ if (index == -1) return NO; + + PBGitRef *ref = [[[cell objectValue] refs] objectAtIndex:index]; + if ([ref isTag] || [ref isRemoteBranch]) + return NO; + + if ([[[historyController.repository headRef] ref] isEqualToRef:ref]) + return NO; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:[NSArray arrayWithObjects:[NSNumber numberWithInt:row], [NSNumber numberWithInt:index], NULL]]; [pboard declareTypes:[NSArray arrayWithObject:@"PBGitRef"] owner:self]; @@ -438,4 +416,3 @@ } @end - diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 8a571d5..083de7b 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -44,6 +44,7 @@ NSString *headRefName = [headRef shortName]; BOOL isHead = [ref isEqualToRef:headRef]; BOOL isOnHeadBranch = isHead ? YES : [repo isRefOnHeadBranch:ref]; + BOOL isDetachedHead = (isHead && [headRefName isEqualToString:@"HEAD"]); NSString *remoteName = [ref remoteName]; if (!remoteName && [ref isBranch]) @@ -58,7 +59,8 @@ [items addObject:[PBRefMenuItem separatorItem]]; // create branch - [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; + NSString *createBranchTitle = [ref isRemoteBranch] ? [NSString stringWithFormat:@"Create branch that tracks %@…", targetRefName] : @"Create branch…"; + [items addObject:[PBRefMenuItem itemWithTitle:createBranchTitle action:@selector(createBranch:) enabled:YES]]; // create tag [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; @@ -88,8 +90,7 @@ [items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]]; // pull - NSString *pullRemoteName = [ref isRemoteBranch] ? [ref shortName] : remoteName; - NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull"; + NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", remoteName, headRefName] : @"Pull"; [items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]]; // push @@ -98,6 +99,9 @@ NSString *pushTitle = [NSString stringWithFormat:@"Push updates to %@", remoteName]; [items addObject:[PBRefMenuItem itemWithTitle:pushTitle action:@selector(pushUpdatesToRemote:) enabled:YES]]; } + else if (isDetachedHead) { + [items addObject:[PBRefMenuItem itemWithTitle:@"Push" action:nil enabled:NO]]; + } else { // push to default remote BOOL hasDefaultRemote = NO; @@ -128,7 +132,7 @@ // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:!isDetachedHead]]; for (PBRefMenuItem *item in items) { [item setTarget:target]; @@ -145,7 +149,7 @@ NSString *headBranchName = [[[commit.repository headRef] ref] shortName]; BOOL isOnHeadBranch = [commit isOnHeadBranch]; - BOOL isHead = [[commit realSha] isEqualToString:[commit.repository headSHA]]; + BOOL isHead = [[commit sha] isEqual:[commit.repository headSHA]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; diff --git a/PBRemoteProgressSheet.h b/PBRemoteProgressSheet.h index 71a52b9..e8eca0b 100644 --- a/PBRemoteProgressSheet.h +++ b/PBRemoteProgressSheet.h @@ -17,10 +17,9 @@ extern NSString * const kGitXProgressErrorInfo; @class PBGitRepository; -@class PBGitWindowController; @interface PBRemoteProgressSheet : NSWindowController { - PBGitWindowController *controller; + NSWindowController *controller; NSArray *arguments; NSString *title; @@ -37,7 +36,7 @@ extern NSString * const kGitXProgressErrorInfo; + (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController; -+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo; ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo; @property (assign) IBOutlet NSTextField *progressDescription; diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m index b496241..0160431 100644 --- a/PBRemoteProgressSheet.m +++ b/PBRemoteProgressSheet.m @@ -24,7 +24,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; @interface PBRemoteProgressSheet () -- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDirectory:(NSString *)dir windowController:(PBGitWindowController *)controller; +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController; - (void) showSuccessMessage; - (void) showErrorMessage; @@ -52,10 +52,10 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; #pragma mark - #pragma mark PBRemoteProgressSheet -+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController { PBRemoteProgressSheet *sheet = [[self alloc] initWithWindowNibName:@"PBRemoteProgressSheet"]; - [sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDirectory:dir windowController:windowController]; + [sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:dir windowController:windowController]; } @@ -65,7 +65,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; } -- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDirectory:(NSString *)dir windowController:(PBGitWindowController *)windowController +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController { controller = windowController; arguments = args; @@ -73,7 +73,21 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; description = theDescription; [self window]; // loads the window (if it wasn't already) + + // resize window if the description is larger than the default text field + NSRect originalFrame = [self.progressDescription frame]; [self.progressDescription setStringValue:[self progressTitle]]; + NSAttributedString *attributedTitle = [self.progressDescription attributedStringValue]; + NSSize boundingSize = originalFrame.size; + boundingSize.height = 0.0f; + NSRect boundingRect = [attributedTitle boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + CGFloat heightDelta = boundingRect.size.height - originalFrame.size.height; + if (heightDelta > 0.0f) { + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + [self.progressIndicator startAnimation:nil]; [NSApp beginSheet:[self window] modalForWindow:[controller window] modalDelegate:self didEndSelector:nil contextInfo:nil]; @@ -106,7 +120,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; [self showSuccessMessage]; if ([controller respondsToSelector:@selector(repository)]) - [controller.repository reloadRefs]; + [[(PBGitWindowController *)controller repository] reloadRefs]; } @@ -116,7 +130,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; - (void) checkTask:(NSTimer *)timer { if (![gitTask isRunning]) { - NSLog(@"[%@ %s] gitTask terminated without notification", [self class], _cmd); + NSLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd)); [self taskCompleted:nil]; } } @@ -132,7 +146,8 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; [info appendString:[self commandDescription]]; [info appendString:[self standardOutputDescription]]; - [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info]; + if ([controller respondsToSelector:@selector(showMessageSheet:infoText:)]) + [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info]; } @@ -150,7 +165,8 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; nil]; NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:errorUserInfo]; - [(PBGitWindowController *)controller showErrorSheet:error]; + if ([controller respondsToSelector:@selector(showErrorSheet:)]) + [(PBGitWindowController *)controller showErrorSheet:error]; } diff --git a/PBRepositoryDocumentController.h b/PBRepositoryDocumentController.h index 0c7b22e..1bbaab3 100644 --- a/PBRepositoryDocumentController.h +++ b/PBRepositoryDocumentController.h @@ -12,13 +12,9 @@ @interface PBRepositoryDocumentController : NSDocumentController { - IBOutlet NSWindow *cloneWindow; - IBOutlet NSTextField *cloneURLField; + } - (id) documentForLocation:(NSURL*) url; -- (IBAction) cloneURL:(id)sender; -- (IBAction) showClone:(id)sender; -- (IBAction) hideClone:(id)sender; - +- (void)initNewRepositoryAtURL:(NSURL *)url; @end diff --git a/PBRepositoryDocumentController.m b/PBRepositoryDocumentController.m index 35dda88..cfaeac5 100644 --- a/PBRepositoryDocumentController.m +++ b/PBRepositoryDocumentController.m @@ -15,113 +15,68 @@ // selection of directories - (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions { - [openPanel setCanChooseFiles:YES]; - [openPanel setCanChooseDirectories:YES]; - return [openPanel runModalForDirectory:nil file:nil types:[NSArray arrayWithObject: @"git"]]; + [openPanel setCanChooseFiles:YES]; + [openPanel setCanChooseDirectories:YES]; + return [openPanel runModalForDirectory:nil file:nil types:[NSArray arrayWithObject: @"git"]]; } // Convert paths to the .git dir before searching for an already open document - (id)documentForURL:(NSURL *)URL { - return [super documentForURL:[PBGitRepository gitDirForURL:URL]]; + return [super documentForURL:[PBGitRepository gitDirForURL:URL]]; } -- (IBAction) showClone:(id)sender { - [cloneWindow makeKeyAndOrderFront:sender]; -} - -- (IBAction)cloneURL:(id)sender +- (void)noteNewRecentDocumentURL:(NSURL*)url { - NSString * remoteRepo = [cloneURLField stringValue]; + [super noteNewRecentDocumentURL:[PBGitRepository baseDirForURL:url]]; +} - [cloneWindow close]; +- (id) documentForLocation:(NSURL*) url +{ + id document = [self documentForURL:url]; + if (!document) { + + if (!(document = [[PBGitRepository alloc] initWithURL:url])) + return nil; - NSOpenPanel * op = [NSOpenPanel openPanel]; + [self addDocument:document]; + } + else + [document showWindows]; - [op setCanChooseFiles:NO]; - [op setCanChooseDirectories:YES]; - [op setAllowsMultipleSelection:NO]; - [op setCanCreateDirectories:YES]; - [op setMessage:@"Clone the repository here:"]; - [op setTitle:@"Clone Repository Location"]; - if ([op runModal] == NSFileHandlingPanelOKButton) { - NSString * path = [op filename]; - int terminationStatus; - NSString * result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"clone", remoteRepo, path, nil] inDir:path inputString:nil retValue:&terminationStatus]; + return document; +} - if (terminationStatus == 0) - [self openDocumentWithContentsOfURL:[op URL] display:YES error:NULL]; - else - NSRunAlertPanel(@"Failed to clone Git repository", @"Git returned the following error when trying to clone the repository: %@", nil, nil, nil, result); - } -} // cloneURL +- (void)initNewRepositoryAtURL:(NSURL *)url +{ + int terminationStatus; + NSString *result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"init", @"-q", nil] inDir:[url path] retValue:&terminationStatus]; -- (IBAction) hideClone:(id)sender { - [cloneWindow close]; + if (terminationStatus == 0) + [self openDocumentWithContentsOfURL:url display:YES error:NULL]; + else + NSRunAlertPanel(@"Failed to create new Git repository", @"Git returned the following error when trying to create the repository: %@", nil, nil, nil, result); +} + +- (IBAction)newDocument:(id)sender +{ + NSOpenPanel *op = [NSOpenPanel openPanel]; + + [op setCanChooseFiles:NO]; + [op setCanChooseDirectories:YES]; + [op setAllowsMultipleSelection:NO]; + [op setMessage:@"Initialize a repository here:"]; + [op setTitle:@"New Repository"]; + if ([op runModal] == NSFileHandlingPanelOKButton) + [self initNewRepositoryAtURL:[op URL]]; } -- (void) noteNewRecentDocumentURL:(NSURL *)url { - [super noteNewRecentDocumentURL:[PBGitRepository baseDirForURL:url]]; -} - -// overidden to provide sanity checks and recovery suggestions when a folder is opened that is not a git repo -// this can happen if for example an Open Recent entry now points to a hierarchy which had its .git folder removed -- (id)openDocumentWithContentsOfURL:(NSURL *)absoluteURL display:(BOOL)displayDocument error:(NSError **)outError { - if (![PBGitRepository gitDirForURL:absoluteURL]) { - NSString * reason = @"It does not appear to be a git repository."; - NSString * suggestion = @"Make sure there really is a \u201c.git\u201d folder somewhere in the path hierarchy you are trying to open"; - NSDictionary * errInfo = [NSDictionary dictionaryWithObjectsAndKeys:reason, NSLocalizedFailureReasonErrorKey, suggestion, NSLocalizedRecoverySuggestionErrorKey, nil]; - if (outError) - *outError = [NSError errorWithDomain:NSCocoaErrorDomain code:PBNotAGitRepositoryErrorCode userInfo:errInfo]; - return nil; - } - return [super openDocumentWithContentsOfURL:absoluteURL display:displayDocument error:outError]; -} - -- (id) documentForLocation:(NSURL *)url { - id document = [self documentForURL:url]; - - if (!document) { - - if (!(document = [[PBGitRepository alloc] initWithURL:url])) - return nil; - - [self addDocument:document]; - } else - [document showWindows]; - - return document; -} - -- (IBAction) newDocument:(id)sender { - NSOpenPanel * op = [NSOpenPanel openPanel]; - - [op setCanChooseFiles:NO]; - [op setCanChooseDirectories:YES]; - [op setAllowsMultipleSelection:NO]; - [op setMessage:@"Initialize a repository here:"]; - [op setTitle:@"New Repository"]; - if ([op runModal] == NSFileHandlingPanelOKButton) { - NSString * path = [op filename]; - int terminationStatus; - NSString * result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"init", @"-q", nil] inDir:path inputString:nil retValue:&terminationStatus]; - - if (terminationStatus == 0) - [self openDocumentWithContentsOfURL:[op URL] display:YES error:NULL]; - else - NSRunAlertPanel(@"Failed to create new Git repository", @"Git returned the following error when trying to create the repository: %@", nil, nil, nil, result); - } -} - -- (BOOL) validateMenuItem:(NSMenuItem *)item { - if ([item action] == @selector(newDocument:)) { - return ([PBGitBinary path] != nil); - } else if ([item action] == @selector(saveAction:)) { - // disable the Save menu item if there is no repository document open - return ([[PBRepositoryDocumentController sharedDocumentController] currentDocument] != nil); - } - return [super validateMenuItem:item]; +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + if ([item action] == @selector(newDocument:)) + return ([PBGitBinary path] != nil); + return [super validateMenuItem:item]; } @end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index 054ab3f..5d450fb 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -9,7 +9,6 @@ #import "PBSourceViewItem.h" #import "PBSourceViewItems.h" #import "PBGitRef.h" -#import "BMScript.h" @implementation PBSourceViewItem @synthesize parent, title, isGroupItem, children, revSpecifier, isUncollapsible; @@ -24,18 +23,6 @@ return self; } -- (NSString *) description { - return [NSString stringWithFormat:@"<%@ %p> title = %@, rev = %@, children = %@", - NSStringFromClass([self class]), self, title, revSpecifier, children]; -} - -- (NSString *) debugDescription { - return [NSString stringWithFormat:@"%@, p = %@, ch = %@, grp? %@, unc? %@", - [self description], parent, children, BMStringFromBOOL(isGroupItem), BMStringFromBOOL(isUncollapsible)]; -} - - - + (id)itemWithTitle:(NSString *)title { PBSourceViewItem *item = [[[self class] alloc] init]; @@ -109,15 +96,14 @@ [node addRev:theRevSpecifier toPath:[path subarrayWithRange:NSMakeRange(1, [path count] - 1)]]; } -- (PBSourceViewItem *) findRev:(PBGitRevSpecifier *)rev +- (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev { - // NSLog(@"[%@ %s] rev = %@, revSpecifier = %@", [self class], _cmd, rev, revSpecifier); - if (rev == revSpecifier || [rev isEqual:revSpecifier]) + if (rev == revSpecifier) return self; PBSourceViewItem *item = nil; for (PBSourceViewItem *child in children) - if (item = [child findRev:rev]) + if ( (item = [child findRev:rev]) != nil ) return item; return nil; diff --git a/PBUnsortableTableHeader.h b/PBUnsortableTableHeader.h index a8b9127..2881e93 100644 --- a/PBUnsortableTableHeader.h +++ b/PBUnsortableTableHeader.h @@ -8,6 +8,7 @@ #import + @interface PBUnsortableTableHeader : NSTableHeaderView { IBOutlet NSArrayController *controller; int clickCount; diff --git a/PBUnsortableTableHeader.m b/PBUnsortableTableHeader.m index acff658..9afb8eb 100644 --- a/PBUnsortableTableHeader.m +++ b/PBUnsortableTableHeader.m @@ -8,6 +8,7 @@ #import "PBUnsortableTableHeader.h" + @implementation PBUnsortableTableHeader - (void)mouseDown:(NSEvent *)theEvent @@ -29,7 +30,7 @@ if (++clickCount == 3) { clickCount = 0; - [controller setSortDescriptors:[NSArray array]]; + controller.sortDescriptors = [NSArray array]; [controller rearrangeObjects]; return; } diff --git a/PBViewController.h b/PBViewController.h index fd7a63a..c523de7 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -16,19 +16,17 @@ NSString *status; BOOL isBusy; + BOOL hasViewLoaded; } @property (readonly) __weak PBGitRepository *repository; -@property (readonly) __weak PBGitWindowController *superController; @property(copy) NSString *status; @property(assign) BOOL isBusy; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; -/* removeView is called whenever the view is removed, either to be swapped - * with a different view, or when the repository window will be destroyed - */ -- (void) removeView; +/* closeView is called when the repository window will be closed */ +- (void)closeView; /* Updateview is called every time it is loaded into the main view */ - (void) updateView; diff --git a/PBViewController.m b/PBViewController.m index 580a593..82f6f7c 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -14,7 +14,6 @@ @synthesize repository; @synthesize status; @synthesize isBusy; -@synthesize superController; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { @@ -28,14 +27,16 @@ return self; } -- (void) removeView +- (void)closeView { [self unbind:@"repository"]; - [[self view] removeFromSuperview]; // remove the current view + if (hasViewLoaded) + [[self view] removeFromSuperview]; // remove the current view } -- (void) awakeFromNib +- (void)awakeFromNib { + hasViewLoaded = YES; } - (NSResponder *)firstResponder; @@ -43,6 +44,10 @@ return nil; } +- (IBAction) refresh: sender +{ +} + // The next methods should be implemented in the subclass if necessary - (void)updateView { @@ -50,12 +55,6 @@ - (void)viewLoaded { - return; -} - -- (IBAction) refresh:(id)sender -{ - return; } @end diff --git a/PBWebChangesController.h b/PBWebChangesController.h index e416fea..069f6fc 100644 --- a/PBWebChangesController.h +++ b/PBWebChangesController.h @@ -18,17 +18,11 @@ IBOutlet NSArrayController *cachedFilesController; IBOutlet PBGitCommitController *controller; IBOutlet PBGitIndexController *indexController; - IBOutlet NSSegmentedCell *displayControl; PBChangedFile *selectedFile; BOOL selectedFileIsCached; - FileViewerController *fileViewerController; } -@property(readwrite) FileViewerController *fileViewerController; - --(IBAction)displayControlChanged:(id)sender; - - (void) refresh; - (void) setStateMessage:(NSString *)state; diff --git a/PBWebChangesController.m b/PBWebChangesController.m index be8d76e..1d1bfd7 100644 --- a/PBWebChangesController.m +++ b/PBWebChangesController.m @@ -12,8 +12,6 @@ @implementation PBWebChangesController -@synthesize fileViewerController; - - (void) awakeFromNib { selectedFile = nil; @@ -26,6 +24,15 @@ [cachedFilesController addObserver:self forKeyPath:@"selection" options:0 context:@"cachedFileSelected"]; } +- (void)closeView +{ + [[self script] removeWebScriptKey:@"Index"]; + [unstagedFilesController removeObserver:self forKeyPath:@"selection"]; + [cachedFilesController removeObserver:self forKeyPath:@"selection"]; + + [super closeView]; +} + - (void) didLoad { [[self script] setValue:controller.index forKey:@"Index"]; @@ -68,29 +75,15 @@ [[self script] callWebScriptMethod:@"showMultipleFilesSelection" withArguments:[NSArray arrayWithObject:objects]]; } --(IBAction)displayControlChanged:(id)sender{ - [self refresh]; -} - - (void) refresh { - [fileViewerController showFile:[selectedFile path] sha:nil]; - /*if (!finishedLoading) + if (!finishedLoading) return; - - [fileViewerController showFile:selectedFile sha:@""]; id script = [view windowScriptObject]; - - if([displayControl selectedSegment]==0){ - [script callWebScriptMethod:@"showFileChanges" - withArguments:[NSArray arrayWithObjects:selectedFile ?: (id)[NSNull null], - [NSNumber numberWithBool:selectedFileIsCached], nil]]; - }else{ - [script callWebScriptMethod:@"showFileBlame" - withArguments:[NSArray arrayWithObjects:selectedFile ?: (id)[NSNull null], - [NSNumber numberWithBool:selectedFileIsCached], nil]]; - }*/ + [script callWebScriptMethod:@"showFileChanges" + withArguments:[NSArray arrayWithObjects:selectedFile ?: (id)[NSNull null], + [NSNumber numberWithBool:selectedFileIsCached], nil]]; } - (void)stageHunk:(NSString *)hunk reverse:(BOOL)reverse diff --git a/PBWebController.m b/PBWebController.m index e06f5f6..ab890fb 100644 --- a/PBWebController.m +++ b/PBWebController.m @@ -46,10 +46,14 @@ return [view windowScriptObject]; } -- (void) closeView +- (void)closeView { - if (view) + if (view) { + [[self script] setValue:nil forKey:@"Controller"]; [view close]; + } + + [[NSNotificationCenter defaultCenter] removeObserver:self]; } # pragma mark Delegate methods @@ -58,7 +62,6 @@ { id script = [view windowScriptObject]; [script setValue: self forKey:@"Controller"]; - [script setValue:[PBGitDefaults alloc] forKey:@"Config"]; } - (void) webView:(id) v didFinishLoadForFrame:(id) frame @@ -116,7 +119,8 @@ Boolean reachable; target = SCNetworkReachabilityCreateWithName(NULL, [hostname cStringUsingEncoding:NSASCIIStringEncoding]); reachable = SCNetworkReachabilityGetFlags(target, &flags); - + CFRelease(target); + if (!reachable) return FALSE; @@ -137,8 +141,6 @@ return [PBGitDefaults confirmPublicGists]; else if([feature isEqualToString:@"publicGist"]) return [PBGitDefaults isGistPublic]; - else if ([feature isEqualToString:@"showWhitespaceDifferences"]) - return [PBGitDefaults showWhitespaceDifferences]; else return YES; } diff --git a/PBWebDiffController.m b/PBWebDiffController.m index 0e820b3..01efde7 100644 --- a/PBWebDiffController.m +++ b/PBWebDiffController.m @@ -18,6 +18,14 @@ [diffController addObserver:self forKeyPath:@"diff" options:0 context:@"ChangedDiff"]; } +- (void)closeView +{ + [diffController removeObserver:self forKeyPath:@"diff"]; + + [super closeView]; +} + + - (void) didLoad { [self showDiff:diffController.diff]; diff --git a/PBWebHistoryController.h b/PBWebHistoryController.h index 749725a..f42a42e 100644 --- a/PBWebHistoryController.h +++ b/PBWebHistoryController.h @@ -13,11 +13,15 @@ #import "PBGitHistoryController.h" #import "PBRefContextDelegate.h" + +@class PBGitSHA; + + @interface PBWebHistoryController : PBWebController { IBOutlet PBGitHistoryController* historyController; IBOutlet id contextMenuDelegate; - NSString* currentSha; + PBGitSHA* currentSha; NSString* diff; } diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index af661eb..6c4a486 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -8,6 +8,7 @@ #import "PBWebHistoryController.h" #import "PBGitDefaults.h" +#import "PBGitSHA.h" @implementation PBWebHistoryController @@ -21,9 +22,17 @@ [historyController addObserver:self forKeyPath:@"webCommit" options:0 context:@"ChangedCommit"]; } +- (void)closeView +{ + [[self script] setValue:nil forKey:@"commit"]; + [historyController removeObserver:self forKeyPath:@"webCommit"]; + + [super closeView]; +} + - (void) didLoad { - currentSha = @""; + currentSha = nil; [self changeContentTo: historyController.webCommit]; } @@ -41,7 +50,7 @@ return; // The sha is the same, but refs may have changed.. reload it lazy - if ([currentSha isEqualToString: [content realSha]]) + if ([currentSha isEqual:[content sha]]) { [[self script] callWebScriptMethod:@"reload" withArguments: nil]; return; @@ -54,26 +63,28 @@ [self performSelector:_cmd withObject:content afterDelay:0.05]; return; } - currentSha = [content realSha]; + currentSha = [content sha]; // Now we load the extended details. We used to do this in a separate thread, // but this caused some funny behaviour because NSTask's and NSThread's don't really // like each other. Instead, just do it async. - NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", currentSha, nil]; + NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", [currentSha string], nil]; if (![PBGitDefaults showWhitespaceDifferences]) [taskArguments insertObject:@"-w" atIndex:1]; NSFileHandle *handle = [repository handleForArguments:taskArguments]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; // Remove notification, in case we have another one running - [nc removeObserver:self]; + [nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; [nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; [handle readToEndOfFileInBackgroundAndNotify]; } - (void)commitDetailsLoaded:(NSNotification *)notification { + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; + NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem]; if (!data) return; @@ -88,9 +99,9 @@ [[view windowScriptObject] callWebScriptMethod:@"loadCommitDetails" withArguments:[NSArray arrayWithObject:details]]; } -- (void) selectCommit: (NSString*) sha +- (void)selectCommit:(NSString *)sha { - [historyController selectCommit:sha]; + [historyController selectCommit:[PBGitSHA shaWithString:sha]]; } - (void) sendKey: (NSString*) key @@ -117,7 +128,7 @@ contextMenuItemsForElement:(NSDictionary *)element // Every ref has a class name of 'refs' and some other class. We check on that to see if we pressed on a ref. if ([[node className] hasPrefix:@"refs "]) { NSString *selectedRefString = [[[node childNodes] item:0] textContent]; - for (PBGitRef *ref in [historyController.webCommit refs]) + for (PBGitRef *ref in historyController.webCommit.refs) { if ([[ref shortName] isEqualToString:selectedRefString]) return [contextMenuDelegate menuItemsForRef:ref]; @@ -128,13 +139,13 @@ contextMenuItemsForElement:(NSDictionary *)element if ([node hasAttributes] && [[node attributes] getNamedItem:@"representedFile"]) return [historyController menuItemsForPaths:[NSArray arrayWithObject:[[[node attributes] getNamedItem:@"representedFile"] value]]]; else if ([[node class] isEqual:[DOMHTMLImageElement class]]) { - // !!! Andre Berg 20100324: NSMenuItem: Copy Image is the only one that makes sense here - // since we don't need to download the image or open it in a new window (besides with the - // current implementation these two entries crash GitX anyway - // - // FIXME: determine object index dynamically - // (since this could change between WebKit versions). - defaultMenuItems = [NSArray arrayWithObject:[defaultMenuItems objectAtIndex:2]]; + // Copy Image is the only menu item that makes sense here since we don't need + // to download the image or open it in a new window (besides with the + // current implementation these two entries can crash GitX anyway) + for (NSMenuItem *item in defaultMenuItems) + if ([item tag] == WebMenuItemTagCopyImageToClipboard) + return [NSArray arrayWithObject:item]; + return nil; } node = [node parentNode]; @@ -158,15 +169,14 @@ contextMenuItemsForElement:(NSDictionary *)element return [historyController valueForKeyPath:[@"repository.config." stringByAppendingString:config]]; } -- (void) finalize +- (void)finalize { - [historyController removeObserver:self forKeyPath:@"webCommit"]; - [super finalize]; + [super finalize]; } - (void) preferencesChanged { - [[self script] callWebScriptMethod:@"enableFeatures" withArguments:nil]; + [[self script] callWebScriptMethod:@"enableFeatures" withArguments:nil]; } @end diff --git a/build_libgit2.sh b/build_libgit2.sh new file mode 100755 index 0000000..a94257d --- /dev/null +++ b/build_libgit2.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# build_libgit2.sh +# GitX +# +# Created by BrotherBard on 7/3/10. +# Copyright 2010 BrotherBard. All rights reserved. +# +# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode + +buildAction () { + echo "Building libgit2..." + if [[ -d .git ]] + 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 update + cd libgit2 + rm -f libgit2.a + make CFLAGS="-arch i386 -arch ppc -arch x86_64" + ranlib libgit2.a + else + echo "error: Not a git repository." + echo "error: clone GitX first so that the libgit2 submodule can be updated" + exit 1 + fi +} + +cleanAction () { + echo "Cleaning libgit2..." + cd libgit2 + make clean +} + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# MAIN + +#echo "Running with ACTION=${ACTION}" + +case $ACTION in + # NOTE: it gets set to "" rather than "build" when doing a build. + "") + buildAction + ;; + + "clean") + cleanAction + ;; +esac + +exit 0 + diff --git a/gitx.m b/gitx.m index 4896868..3230d01 100644 --- a/gitx.m +++ b/gitx.m @@ -6,80 +6,90 @@ // Copyright 2008 __MyCompanyName__. All rights reserved. // -#import "PBCLIProxy.h" #import "PBGitBinary.h" #import "PBEasyPipe.h" -#import "PBGitRepository.h" -#include /* for ARG_MAX */ +#import "GitXScriptingConstants.h" +#import "GitX.h" +#import "PBHistorySearchController.h" -NSDistantObject* connectToProxy() -{ - id proxy = [NSConnection rootProxyForConnectionWithRegisteredName:PBDOConnectionName host:nil]; - [proxy setProtocolForProxy:@protocol(GitXCliToolProtocol)]; - return proxy; -} -NSDistantObject *createProxy() -{ - NSDistantObject * proxy = connectToProxy(); - if (proxy) { - return proxy; - } - - // The connection failed, so try to launch the app - [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"nl.frim.GitX" - options:NSWorkspaceLaunchWithoutActivation - additionalEventParamDescriptor:nil - launchIdentifier:nil]; - - // Now attempt to connect, allowing the app time to startup - int attempt; - for (attempt = 0; proxy == nil && attempt < 50; ++attempt) { - if (proxy = connectToProxy()) - break; - usleep(15000); - } - - if (proxy) { - return proxy; - } - - // not succesful! - fprintf(stderr, "Couldn't connect to app server!\n"); - exit(1); - return nil; -} +#pragma mark Commands handled locally void usage(char const *programName) { - printf("Usage: %s (-h|--help|--version)\n", programName); + printf("Usage: %s (--help|--version|--git-path)\n", programName); printf(" or: %s (--commit)\n", programName); - printf(" or: %s (--subject=|--sha=|--author=)\n", programName); + printf(" or: %s (--all|--local|--branch) [branch/tag]\n", programName); printf(" or: %s \n", programName); + printf(" or: %s (--diff)\n", programName); + printf(" or: %s (--init)\n", programName); + printf(" or: %s (--clone [destination])\n", programName); printf("\n"); - printf("\t-h, --help print this help\n"); - printf("\t--commit, -c start GitX in commit mode\n"); + printf(" -h, --help print this help\n"); + printf(" -v, --version prints version info for both GitX and git\n"); + printf(" --git-path prints the path to the directory containing git\n"); + printf("\n"); + printf("Repository path\n"); + printf(" By default gitx opens the repository in the current directory.\n"); + printf(" Use --git-dir= to send commands to a repository somewhere else.\n"); + printf(" Note: This must be the first argument.\n"); + printf("\n"); + printf(" --git-dir= [gitx commands]\n"); + printf(" send the gitx commands to the repository located at \n"); + printf("\n"); + printf("Commit/Stage view\n"); + printf(" -c, --commit start GitX in commit/stage mode\n"); + printf("\n"); + printf("Branch filter options\n"); + printf(" Add an optional branch or tag name to select that branch using the given branch filter\n"); + printf("\n"); + printf(" --all [branch] view history for all branches\n"); + printf(" --local [branch] view history for local branches only\n"); + printf(" --branch [branch] view history for the selected branch only\n"); printf("\n"); printf("RevList options\n"); - printf("\tSee 'man git-log' and 'man git-rev-list' for options you can pass to gitx\n"); + printf(" See 'man git-log' and 'man git-rev-list' for options you can pass to gitx\n"); + printf("\n"); + printf(" select specific branch or tag\n"); + printf(" -- show commits touching paths\n"); + printf("\n"); + printf("Diff options\n"); + printf(" See 'man git-diff' for options you can pass to gitx --diff\n"); + printf("\n"); + printf(" -d, --diff [] {0,2} [--] [...]\n"); + printf(" shows the diff in a window in GitX\n"); + printf(" git diff [options] | gitx\n"); + printf(" use gitx to pipe diff output to a GitX window\n"); + printf("\n"); + printf("Search\n"); + printf("\n"); + printf(" -s, --search=\n"); + printf(" search for string in Subject, Author or SHA\n"); + printf(" -S, --Search=\n"); + printf(" commits that introduce or remove an instance of \n"); + printf(" -r, --regex=\n"); + printf(" commits that introduce or remove strings that match \n"); + printf(" -p, --path=\n"); + printf(" commits that modify the file at file path\n"); + printf("\n"); + printf("Creating repositories\n"); + printf(" These commands will create a git repository and then open it up in GitX\n"); + printf("\n"); + printf(" --init creates (or reinitializes) a git repository\n"); + printf(" --clone [destination path]\n"); + printf(" clones the repository (at the specified URL) into the current\n"); + printf(" directory or into the specified path\n"); printf("\n"); - printf("\t--all show all branches\n"); - printf("\t--local show local branches\n"); - printf("\t--sha= filter the current branch for \n"); - printf("\t--author= filter the current branch for \n"); - printf("\t--subject= filter the current branch for \n"); - printf("\t-S same as above (included for legacy compatibility)\n"); - printf("\t show specific branch\n"); - printf("\t -- show commits touching paths\n"); exit(1); } void version_info() { NSString *version = [[[NSBundle bundleForClass:[PBGitBinary class]] infoDictionary] valueForKey:@"CFBundleVersion"]; - printf("This is GitX version %s\n", [version UTF8String]); + NSString *gitVersion = [[[NSBundle bundleForClass:[PBGitBinary class]] infoDictionary] valueForKey:@"CFBundleGitVersion"]; + printf("GitX version %s (%s)\n", [version UTF8String], [gitVersion UTF8String]); if ([PBGitBinary path]) printf("Using git found at %s, version %s\n", [[PBGitBinary path] UTF8String], [[PBGitBinary version] UTF8String]); else @@ -93,36 +103,233 @@ void git_path() exit(101); NSString *path = [[PBGitBinary path] stringByDeletingLastPathComponent]; - printf("%s", [path UTF8String]); + printf("%s\n", [path UTF8String]); exit(0); } -void handleSTDINDiff(id proxy) + +#pragma mark - +#pragma mark Commands sent to GitX + +void handleSTDINDiff() { NSFileHandle *handle = [NSFileHandle fileHandleWithStandardInput]; NSData *data = [handle readDataToEndOfFile]; - NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSString *diff = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - if (string && [string length] > 0) { - [proxy openDiffWindowWithDiff:string]; + if (diff && [diff length] > 0) { + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp showDiff:diff]; exit(0); } } -void handleDiffWithArguments(NSArray *arguments, NSString *directory, id proxy) +void handleDiffWithArguments(NSURL *repositoryURL, NSMutableArray *arguments) { - int ret; - arguments = [[NSArray arrayWithObject:@"diff"] arrayByAddingObjectsFromArray:arguments]; - NSString *diff = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:directory retValue:&ret]; - if (ret) { - printf("Invalid diff command\n"); + [arguments insertObject:@"diff" atIndex:0]; + + int retValue = 1; + NSString *diffOutput = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:[repositoryURL path] retValue:&retValue]; + if (retValue) { + // if there is an error diffOutput should have the error output from git + if (diffOutput) + printf("%s\n", [diffOutput UTF8String]); + else + printf("Invalid diff command [%d]\n", retValue); exit(3); } - [proxy openDiffWindowWithDiff:diff]; + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp showDiff:diffOutput]; + exit(0); } +void handleOpenRepository(NSURL *repositoryURL, NSMutableArray *arguments) +{ + // if there are command line arguments send them to GitX through an Apple Event + // the recordDescriptor will be stored in keyAEPropData inside the openDocument or openApplication event + NSAppleEventDescriptor *recordDescriptor = nil; + if ([arguments count]) { + recordDescriptor = [NSAppleEventDescriptor recordDescriptor]; + + NSAppleEventDescriptor *listDescriptor = [NSAppleEventDescriptor listDescriptor]; + uint listIndex = 1; // AppleEvent list descriptor's are one based + for (NSString *argument in arguments) + [listDescriptor insertDescriptor:[NSAppleEventDescriptor descriptorWithString:argument] atIndex:listIndex++]; + + [recordDescriptor setParamDescriptor:listDescriptor forKeyword:kGitXAEKeyArgumentsList]; + + // this is used as a double check in GitX + NSAppleEventDescriptor *url = [NSAppleEventDescriptor descriptorWithString:[repositoryURL absoluteString]]; + [recordDescriptor setParamDescriptor:url forKeyword:typeFileURL]; + } + + // use NSWorkspace to open GitX and send the arguments + // this allows the repository document to modify itself before it shows it's GUI + BOOL didOpenURLs = [[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObject:repositoryURL] + withAppBundleIdentifier:kGitXBundleIdentifier + options:0 + additionalEventParamDescriptor:recordDescriptor + launchIdentifiers:NULL]; + if (!didOpenURLs) { + printf("Unable to open GitX.app\n"); + exit(2); + } +} + +void handleInit(NSURL *repositoryURL) +{ + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp initRepository:repositoryURL]; + + exit(0); +} + +void handleClone(NSURL *repositoryURL, NSMutableArray *arguments) +{ + if ([arguments count]) { + NSString *repository = [arguments objectAtIndex:0]; + + if ([arguments count] > 1) { + NSURL *url = [NSURL fileURLWithPath:[arguments objectAtIndex:1]]; + if (url) + repositoryURL = url; + } + + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp cloneRepository:repository to:repositoryURL isBare:NO]; + } + else { + printf("Error: --clone needs the URL of the repository to clone.\n"); + exit(2); + } + + + exit(0); +} + +#define kShortBasicSearch @"-s" +#define kBasicSearch @"--search=" +#define kShortPickaxeSearch @"-S" +#define kPickaxeSearch @"--Search=" +#define kShortRegexSearch @"-r" +#define kRegexSearch @"--regex=" +#define kShortPathSearch @"-p" +#define kPathSearch @"--path=" + +NSArray *commandLineSearchPrefixes() +{ + return [NSArray arrayWithObjects:kShortBasicSearch, kBasicSearch, kShortPickaxeSearch, kPickaxeSearch, kShortRegexSearch, kRegexSearch, kShortPathSearch, kPathSearch, nil]; +} + +PBHistorySearchMode searchModeForCommandLineArgument(NSString *argument) +{ + if ([argument hasPrefix:kShortBasicSearch] || [argument hasPrefix:kBasicSearch]) + return kGitXBasicSeachMode; + + if ([argument hasPrefix:kShortPickaxeSearch] || [argument hasPrefix:kPickaxeSearch]) + return kGitXPickaxeSearchMode; + + if ([argument hasPrefix:kShortRegexSearch] || [argument hasPrefix:kRegexSearch]) + return kGitXRegexSearchMode; + + if ([argument hasPrefix:kShortPathSearch] || [argument hasPrefix:kPathSearch]) + return kGitXPathSearchMode; + + return 0; +} + +GitXDocument *documentForURL(SBElementArray *documents, NSURL *URL) +{ + NSString *path = [URL path]; + + for (GitXDocument *document in documents) { + NSString *documentPath = [[document file] path]; + if ([[documentPath lastPathComponent] isEqualToString:@".git"]) + documentPath = [documentPath stringByDeletingLastPathComponent]; + + if ([documentPath isEqualToString:path]) + return document; + } + + return nil; +} + +void handleGitXSearch(NSURL *repositoryURL, NSMutableArray *arguments) +{ + NSString *searchString = [arguments componentsJoinedByString:@" "]; + NSInteger mode = searchModeForCommandLineArgument(searchString); + + // remove the prefix from search string before sending it + NSArray *prefixes = commandLineSearchPrefixes(); + for (NSString *prefix in prefixes) + if ([searchString hasPrefix:prefix]) { + searchString = [searchString substringFromIndex:[prefix length]]; + break; + } + + if ([searchString isEqualToString:@""]) + exit(0); + + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp open:[NSArray arrayWithObject:repositoryURL]]; + + // need to find the document after opening it + GitXDocument *repositoryDocument = documentForURL([gitXApp documents], repositoryURL); + [repositoryDocument searchString:searchString inMode:mode]; + + exit(0); +} + + +#pragma mark - +#pragma mark main + + +#define kGitDirPrefix @"--git-dir=" + +NSURL *workingDirectoryURL(NSMutableArray *arguments) +{ + NSString *path = nil; + + if ([arguments count] && [[arguments objectAtIndex:0] hasPrefix:kGitDirPrefix]) { + path = [[[arguments objectAtIndex:0] substringFromIndex:[kGitDirPrefix length]] stringByStandardizingPath]; + + // the path must exist and point to a directory + BOOL isDirectory = YES; + if (![[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory] || !isDirectory) { + if (!isDirectory) + printf("Fatal: --git-dir path does not point to a directory.\n"); + else + printf("Fatal: --git-dir path does not exist.\n"); + printf("Cannot open git repository at path: '%s'\n", [path UTF8String]); + exit(2); + } + + // remove the git-dir argument + [arguments removeObjectAtIndex:0]; + } else { + path = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; + } + + NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES]; + if (!url) { + printf("Unable to create url to path: %s\n", [path UTF8String]); + exit(2); + } + + return url; +} + +NSMutableArray *argumentsArray() +{ + NSMutableArray *arguments = [[[NSProcessInfo processInfo] arguments] mutableCopy]; + [arguments removeObjectAtIndex:0]; // url to executable path is not needed + + return arguments; +} + int main(int argc, const char** argv) { if (argc >= 2 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h"))) @@ -132,54 +339,45 @@ int main(int argc, const char** argv) if (argc >= 2 && !strcmp(argv[1], "--git-path")) git_path(); + // From here on everything needs to access git, so make sure it's installed if (![PBGitBinary path]) { - printf("%s\n", [[PBGitBinary notFoundError] UTF8String]); + printf("%s\n", [[PBGitBinary notFoundError] cStringUsingEncoding:NSUTF8StringEncoding]); exit(2); } - - // Create arguments - argv++; argc--; - - NSMutableArray* arguments = [NSMutableArray arrayWithCapacity:argc]; - int i = 0; - for (i = 0; i < argc; i++) - [arguments addObject: [NSString stringWithUTF8String:argv[i]]]; - - // I hate using env vars for this but I don't see how else we get the parameters - // to the Application client as the proxy connection routines above start up the - // ApplicationController which in turn initializes the PBCLIProxy and starts with - // the usual business of calling -populateList from PBGitSidebarController. - NSString * fullargs = [arguments componentsJoinedByString:@" "]; - if ([fullargs length] <= ARG_MAX) { - setenv("GITX_CLI_ARGUMENTS", [fullargs UTF8String], 1); - setenv("GITX_LAUNCHED_FROM_CLI", "YES", 1); - } else { - fprintf(stderr, "Argument size exceeds system limit of (%d)! Ignoring args.", ARG_MAX); - } - - id proxy = createProxy(); - + + // gitx can be used to pipe diff output to be displayed in GitX if (!isatty(STDIN_FILENO) && fdopen(STDIN_FILENO, "r")) - handleSTDINDiff(proxy); + handleSTDINDiff(); - // From this point, we require a working directory - NSString *pwd = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; - if (!pwd) - exit(2); + // From this point, we require a working directory and the arguments + NSMutableArray *arguments = argumentsArray(); + NSURL *wdURL = workingDirectoryURL(arguments); - if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--diff"] || - [[arguments objectAtIndex:0] isEqualToString:@"-d"])) - handleDiffWithArguments([arguments subarrayWithRange:NSMakeRange(1, [arguments count] - 1)], pwd, proxy); + if ([arguments count]) { + NSString *firstArgument = [arguments objectAtIndex:0]; - // No diff, just open the current dir - NSError* error = nil; + if ([firstArgument isEqualToString:@"--diff"] || [firstArgument isEqualToString:@"-d"]) { + [arguments removeObjectAtIndex:0]; + handleDiffWithArguments(wdURL, arguments); + } - if (![proxy openRepository:pwd arguments: arguments error:&error]) { - fprintf(stderr, "Error opening repository at %s\n", [pwd UTF8String]); - if (error) - fprintf(stderr, "\t%s\n", [[error localizedFailureReason] UTF8String]); - return 1; + if ([firstArgument isEqualToString:@"--init"]) { + [arguments removeObjectAtIndex:0]; + handleInit(wdURL); + } + + if ([firstArgument isEqualToString:@"--clone"]) { + [arguments removeObjectAtIndex:0]; + handleClone(wdURL, arguments); + } + + if (searchModeForCommandLineArgument(firstArgument)) { + handleGitXSearch(wdURL, arguments); + } } - + + // No commands handled by gitx, open the current dir in GitX with the arguments + handleOpenRepository(wdURL, arguments); + return 0; } diff --git a/gitx_askpasswd_main.m b/gitx_askpasswd_main.m index 1da6044..6c8c2af 100644 --- a/gitx_askpasswd_main.m +++ b/gitx_askpasswd_main.m @@ -16,15 +16,16 @@ #define CANCELBUTTONHEIGHT 24.0 #define PASSHEIGHT 22.0 #define PASSLABELHEIGHT 16.0 +#define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame" -@interface GAPAppDelegate : NSObject +@interface GAPAppDelegate : NSObject { NSPanel* mPasswordPanel; NSSecureTextField* mPasswordField; } --(NSPanel*) passwordPanel:(NSString *)title; +-(NSPanel*) passwordPanel; -(IBAction) doOKButton: (id)sender; -(IBAction) doCancelButton: (id)sender; @@ -34,39 +35,31 @@ @implementation GAPAppDelegate --(void) dealloc -{ - [mPasswordPanel release]; - mPasswordPanel = nil; - - [mPasswordField release]; - mPasswordField = nil; - - [super dealloc]; -} - --(NSPanel*) passwordPanel:(NSString *)title +-(NSPanel*) passwordPanel { if( !mPasswordPanel ) { - NSRect box = NSMakeRect( 100, 100, 250, 100 ); - mPasswordPanel = [[NSPanel alloc] initWithContentRect: box - styleMask: NSTitledWindowMask - backing: NSBackingStoreBuffered - defer: NO]; + NSRect box = NSMakeRect( 100, 100, 400, 134 ); + mPasswordPanel = [[NSPanel alloc] initWithContentRect: box + styleMask: NSTitledWindowMask + backing: NSBackingStoreBuffered defer: NO]; [mPasswordPanel setHidesOnDeactivate: NO]; [mPasswordPanel setLevel: NSFloatingWindowLevel]; - [mPasswordPanel center]; + [mPasswordPanel setTitle: @"GitX SSH Remote Login"]; + if (![mPasswordPanel setFrameUsingName: WINDOWAUTOSAVENAME]) { + [mPasswordPanel center]; + [mPasswordPanel setFrameAutosaveName: WINDOWAUTOSAVENAME]; + } box.origin = NSZeroPoint; // Only need local coords from now on. // OK: - NSRect okBox = box; - okBox.origin.x = NSMaxX( box ) -OKBUTTONWIDTH -10; + NSRect okBox = box; + okBox.origin.x = NSMaxX( box ) -OKBUTTONWIDTH -20; okBox.size.width = OKBUTTONWIDTH; - okBox.origin.y += 10; + okBox.origin.y += 20; okBox.size.height = OKBUTTONHEIGHT; - NSButton* okButton = [[[NSButton alloc] initWithFrame: okBox] autorelease]; + NSButton *okButton = [[NSButton alloc] initWithFrame: okBox]; [okButton setTarget: self]; [okButton setAction: @selector(doOKButton:)]; [okButton setTitle: @"OK"]; // +++ Localize. @@ -79,22 +72,22 @@ NSRect cancelBox = box; cancelBox.origin.x = NSMinX( okBox ) -CANCELBUTTONWIDTH -6; cancelBox.size.width = CANCELBUTTONWIDTH; - cancelBox.origin.y += 10; + cancelBox.origin.y += 20; cancelBox.size.height = CANCELBUTTONHEIGHT; - okButton = [[[NSButton alloc] initWithFrame: cancelBox] autorelease]; - [okButton setTarget: self]; - [okButton setAction: @selector(doCancelButton:)]; - [okButton setTitle: @"Cancel"]; // +++ Localize. - [okButton setBordered: YES]; - [okButton setBezelStyle: NSRoundedBezelStyle]; - [[mPasswordPanel contentView] addSubview: okButton]; + NSButton *cancleButton = [[NSButton alloc] initWithFrame: cancelBox]; + [cancleButton setTarget: self]; + [cancleButton setAction: @selector(doCancelButton:)]; + [cancleButton setTitle: @"Cancel"]; // +++ Localize. + [cancleButton setBordered: YES]; + [cancleButton setBezelStyle: NSRoundedBezelStyle]; + [[mPasswordPanel contentView] addSubview: cancleButton]; // Password field: - NSRect passBox = box; - passBox.origin.y = NSMaxY(okBox) + 12; + NSRect passBox = box; + passBox.origin.y = NSMaxY(okBox) + 24; passBox.size.height = PASSHEIGHT; - passBox.origin.x += 12; - passBox.size.width -= 12 * 2; + passBox.origin.x += 104; + passBox.size.width -= 104 + 20; mPasswordField = [[NSSecureTextField alloc] initWithFrame: passBox]; [mPasswordField setSelectable: YES]; [mPasswordField setEditable: YES]; @@ -105,19 +98,32 @@ [[mPasswordPanel contentView] addSubview: mPasswordField]; // Password label: - NSRect passLabelBox = box; - passLabelBox.origin.y = NSMaxY(passBox) + 6; + NSRect passLabelBox = box; + passLabelBox.origin.y = NSMaxY(passBox) + 8; passLabelBox.size.height = PASSLABELHEIGHT; - passLabelBox.origin.x += 12; - passLabelBox.size.width -= 12 * 2; - NSTextField* passwordLabel = [[[NSTextField alloc] initWithFrame: passLabelBox] autorelease]; + passLabelBox.origin.x += 100; + passLabelBox.size.width -= 100 + 20; + NSTextField *passwordLabel = [[NSTextField alloc] initWithFrame: passLabelBox]; [passwordLabel setSelectable: YES]; [passwordLabel setEditable: NO]; [passwordLabel setBordered: NO]; [passwordLabel setBezeled: NO]; [passwordLabel setDrawsBackground: NO]; - [passwordLabel setStringValue: title]; // +++ Localize. + [passwordLabel setStringValue: @"Please enter your password:"]; // +++ Localize. [[mPasswordPanel contentView] addSubview: passwordLabel]; + + // GitX icon: + NSRect gitxIconBox = box; + gitxIconBox.origin.y = NSMaxY(box) - 78; + gitxIconBox.size.height = 64; + gitxIconBox.origin.x += 20; + gitxIconBox.size.width = 64; + NSImageView *gitxIconView = [[NSImageView alloc] initWithFrame: gitxIconBox]; + [gitxIconView setEditable: NO]; + NSString *gitxIconPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"gitx.icns"]; + NSImage *gitxIcon = [[NSImage alloc] initWithContentsOfFile: gitxIconPath]; + [gitxIconView setImage: gitxIcon]; + [[mPasswordPanel contentView] addSubview: gitxIconView]; } return mPasswordPanel; @@ -127,14 +133,16 @@ -(IBAction) doOKButton: (id)sender { printf( "%s\n", [[mPasswordField stringValue] UTF8String] ); - [[NSApplication sharedApplication] terminate: self]; + [[NSApplication sharedApplication] stopModalWithCode: 0]; } +// TODO: Need to find out how to get SSH to cancel. +// When the user cancels the window it is opened again for however +// many times the remote server allows failed attempts. -(IBAction) doCancelButton: (id)sender { - printf("\n"); - [[NSApplication sharedApplication] terminate: self]; + [[NSApplication sharedApplication] stopModalWithCode: 1]; } @end @@ -143,32 +151,25 @@ int main( int argc, const char** argv ) { + // close stderr to stop cocoa log messages from being picked up by GitX + close(STDERR_FILENO); + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + ProcessSerialNumber myPSN = { 0, kCurrentProcess }; TransformProcessType( &myPSN, kProcessTransformToForegroundApplication ); - NSApplication * app = [NSApplication sharedApplication]; - GAPAppDelegate * appDel = [[GAPAppDelegate alloc] init]; + NSApplication *app = [NSApplication sharedApplication]; + GAPAppDelegate *appDel = [[GAPAppDelegate alloc] init]; [app setDelegate: appDel]; - - NSString * title; - const char * envtitle = getenv("GITX_ASKPASSWD_DIALOG_TITLE"); - - if (envtitle != NULL) { - title = [NSString stringWithUTF8String:envtitle]; - } else { - if (argc > 1) { - title = [NSString stringWithUTF8String:argv[1]]; - } else { - title = @"Please enter your password:"; - } - } - - NSWindow* passPanel = [appDel passwordPanel:title]; + NSWindow *passPanel = [appDel passwordPanel]; [app activateIgnoringOtherApps: YES]; [passPanel makeKeyAndOrderFront: nil]; - [app runModalForWindow: passPanel]; + NSInteger code = [app runModalForWindow: passPanel]; - return 0; + [defaults synchronize]; + + return code; } diff --git a/html/css/diff.css b/html/css/diff.css index d1560ee..73087c3 100644 --- a/html/css/diff.css +++ b/html/css/diff.css @@ -1,5 +1,4 @@ -.diff .file, -#log .commit { +.diff .file { margin: 10px; padding: 10px; -webkit-border-radius: 10px; @@ -15,8 +14,7 @@ .diff .file .diffContent { white-space: pre; - font-family: Meslo, "Andale Mono", Menlo, Monaco; - font-size: 11px; + font-family: Menlo, Monaco; } .diff .file .diffcontent .lineno { diff --git a/html/css/shCoreGitX.css b/html/css/shCoreGitX.css new file mode 100644 index 0000000..a7fc58f --- /dev/null +++ b/html/css/shCoreGitX.css @@ -0,0 +1,225 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Menlo" , "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 0 !important; + position: relative !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} diff --git a/html/css/shThemeGitX.css b/html/css/shThemeGitX.css new file mode 100644 index 0000000..e134c46 --- /dev/null +++ b/html/css/shThemeGitX.css @@ -0,0 +1,120 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: white !important; + font: 11px "Menlo" !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #e0e0e0 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: black !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #6ce26c !important; + display: block !important; + width: 30px !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #6ce26c !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: blue !important; + background: white !important; + border: 1px solid #6ce26c !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: blue !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #6ce26c !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: black !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #008200 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: blue !important; +} +.syntaxhighlighter .keyword { + color: #006699 !important; +} +.syntaxhighlighter .preprocessor { + color: gray !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #006699 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/html/lib/GitX.js b/html/lib/GitX.js index 7050eb1..7a51f88 100644 --- a/html/lib/GitX.js +++ b/html/lib/GitX.js @@ -55,46 +55,3 @@ var notify = function(text, state) { var hideNotification = function() { $("notification").style.display = "none"; } - - -//cookie functions from quirksmode -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - } - else var expires = ""; - document.cookie = name+"="+value+expires+"; path=/"; -} -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -// cookie functions from W3C Schools -function setCookie(c_name, value, expiredays) { - var exdate = new Date(); - exdate.setDate(exdate.getDate() + expiredays); - document.cookie = c_name + "=" + escape(value) + - ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); -} - -function getCookie(c_name) { - if (document.cookie.length > 0) { - c_start = document.cookie.indexOf(c_name + "="); - if (c_start != -1) { - c_start = c_start + c_name.length + 1; - c_end = document.cookie.indexOf(";", c_start); - if (c_end == -1) c_end = document.cookie.length; - return unescape(document.cookie.substring(c_start, c_end)); - } - } - return ""; -}; \ No newline at end of file diff --git a/html/lib/diffHighlighter.js b/html/lib/diffHighlighter.js index ffeffae..cda95a8 100644 --- a/html/lib/diffHighlighter.js +++ b/html/lib/diffHighlighter.js @@ -1,13 +1,12 @@ // If we run from a Safari instance, we don't // have a Controller object. Instead, we fake it by // using the console +if (typeof Controller == 'undefined') { + Controller = console; + Controller.log_ = console.log; +} var highlightDiff = function(diff, element, callbacks) { - - alert("window="+window); - alert("window.Config="+window.Config); - alert("window.Config.isFeatureEnabled_="+window.Config.isFeatureEnabled_); - if (!diff || diff == "") return; @@ -189,11 +188,10 @@ var highlightDiff = function(diff, element, callbacks) { sindex = "index=" + lindex.toString() + " "; if (firstChar == "+") { - if (window.Config.isFeatureEnabled_("showWhitespaceDifferences")) { - // Highlight trailing whitespace - if (m = l.match(/\s+$/)) - l = l.replace(/\s+$/, "" + m + ""); - } + // Highlight trailing whitespace + if (m = l.match(/\s+$/)) + l = l.replace(/\s+$/, "" + m + ""); + line1 += "\n"; line2 += ++hunk_start_line_2 + "\n"; diffContent += "
" + l + "
"; @@ -229,5 +227,5 @@ var highlightDiff = function(diff, element, callbacks) { // TODO: Replace this with a performance pref call if (false) - alert("Total time:" + (new Date().getTime() - start)); + Controller.log_("Total time:" + (new Date().getTime() - start)); } \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/LGPL-LICENSE b/html/lib/syntaxhighlighter/LGPL-LICENSE new file mode 100644 index 0000000..3f9959f --- /dev/null +++ b/html/lib/syntaxhighlighter/LGPL-LICENSE @@ -0,0 +1,165 @@ + 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/MIT-LICENSE b/html/lib/syntaxhighlighter/MIT-LICENSE new file mode 100644 index 0000000..e7c70ba --- /dev/null +++ b/html/lib/syntaxhighlighter/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2003, 2004 Jim Weirich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/html/lib/syntaxhighlighter/compass/_theme_template.scss b/html/lib/syntaxhighlighter/compass/_theme_template.scss new file mode 100644 index 0000000..53f4df5 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/_theme_template.scss @@ -0,0 +1,120 @@ +$background: white !default; + +$line_alt1_background: $background !default; +$line_alt2_background: $background !default; + +$line_highlighted_background: #e0e0e0 !default; +$line_highlighted_number: black !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #6ce26c !default; +$gutter_border: 3px solid $gutter_border_color !default; + +$toolbar_collapsed_a: #00f !default; +$toolbar_collapsed_a_hover: #f00 !default; +$toolbar_collapsed_background: #fff !default; +$toolbar_collapsed_border: 1px solid $gutter_border_color !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #000 !default; +$toolbar_background: $gutter_border_color !default; +$toolbar_border: none !default; + +$code_plain: black !default; +$code_comments: #008200 !default; +$code_string: blue !default; +$code_keyword: #006699 !default; +$code_preprocessor: gray !default; +$code_variable: #aa7700 !default; +$code_value: #009900 !default; +$code_functions: #ff1493 !default; +$code_constants: #0066cc !default; +$code_script: $code_keyword !default; +$code_script_background: none !default; +$code_color1: gray !default; +$code_color2: #ff1493 !default; +$code_color3: red !default; + +$caption_color: $code_plain !default; + +// Interface elements. +.syntaxhighlighter { + background-color: $background !important; + + // Highlighed line number + .line { + &.alt1 { background-color: $line_alt1_background !important; } + &.alt2 { background-color: $line_alt2_background !important; } + + // Highlighed line + &.highlighted { + &.alt1, &.alt2 { background-color: $line_highlighted_background !important; } + &.number { color: $line_highlighted_number !important; } + } + } + + table { + caption { + color: $caption_color !important; + } + } + + // Add border to the lines + .gutter { + color: $gutter_text !important; + .line { + border-right: $gutter_border !important; + + &.highlighted { + background-color: $gutter_border_color !important; + color: $background !important; + } + } + } + + &.printing .line .content { border: none !important; } + + &.collapsed { + overflow: visible !important; + + .toolbar { + color: $toolbar_collapsed_a !important; + background: $toolbar_collapsed_background !important; + border: $toolbar_collapsed_border !important; + + a { + color: $toolbar_collapsed_a !important; + &:hover { color: $toolbar_collapsed_a_hover !important; } + } + } + } + + .toolbar { + color: $toolbar_a !important; + background: $toolbar_background !important; + border: $toolbar_border !important; + a { + color: $toolbar_a !important; + &:hover { color: $toolbar_a_hover !important; } + } + } + + // Actual syntax highlighter colors. + .plain, .plain a { color: $code_plain !important; } + .comments, .comments a { color: $code_comments !important; } + .string, .string a { color: $code_string !important; } + .keyword { color: $code_keyword !important; } + .preprocessor { color: $code_preprocessor !important; } + .variable { color: $code_variable !important; } + .value { color: $code_value !important; } + .functions { color: $code_functions !important; } + .constants { color: $code_constants !important; } + .script { + font-weight: bold !important; + color: $code_script !important; + background-color: $code_script_background !important; + } + .color1, .color1 a { color: $code_color1 !important; } + .color2, .color2 a { color: $code_color2 !important; } + .color3, .color3 a { color: $code_color3 !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/config.rb b/html/lib/syntaxhighlighter/compass/config.rb new file mode 100644 index 0000000..6f82de1 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/config.rb @@ -0,0 +1,14 @@ +environment = :production +project_type = :stand_alone +http_path = "/" +css_dir = "../styles" +sass_dir = "." +images_dir = "images" +sass_options = { + :line_numbers => false, + :debug_info => false +} + +# output_style = :compressed +# output_style = :compact +output_style = :expanded diff --git a/html/lib/syntaxhighlighter/compass/shCore.scss b/html/lib/syntaxhighlighter/compass/shCore.scss new file mode 100644 index 0000000..a67e4f9 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCore.scss @@ -0,0 +1,216 @@ +@mixin round_corners_custom($top, $right, $bottom, $left) { + -moz-border-radius: $top $right $bottom $left !important; + -webkit-border-radius: $top $right $bottom $left !important; +} + +@mixin round_corners($radius) { + @include round_corners_custom($radius, $radius, $radius, $radius); +} + +.syntaxhighlighter { + a, + div, + code, + table, + table td, + table tr, + table tbody, + table thead, + table caption, + textarea { + @include round_corners(0); + + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font: { + family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + weight: normal !important; + style: normal !important; + size: 1em !important; + } + min: { + // For IE8, FF & WebKit + height: inherit !important; + // For IE7 + height: auto !important; + } + } +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + + position: relative !important; + overflow: auto !important; + font-size: 1em !important; + + &.source { overflow: hidden !important; } + + // set up bold and italic + .bold { font-weight: bold !important; } + .italic { font-style: italic !important; } + + .line { white-space: pre !important; } + + // main table and columns + table { + width: 100% !important; + caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; + } + + td.code { + width: 100% !important; + + .container { + position: relative !important; + + textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; + } + } + } + + // middle spacing between line numbers and lines + td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; + } + + td.code .line { + padding: 0 1em !important; + } + } + + &.nogutter { + td.code { + .container textarea, .line { padding-left: 0em !important; } + } + } + + &.show { display: block !important; } + + // Adjust some properties when collapsed + &.collapsed { + table { display: none !important; } + + .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; + + span { + display: inline !important; + margin-right: 1em !important; + + a { + padding: 0 !important; + display: none !important; + &.expandSource { display: inline !important; } + } + } + } + } + + // Styles for the toolbar + .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; + + span.title { display: inline !important; } + + a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; + + &.expandSource { display: none !important; } + } + } + + &.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; + + .toolbar { + line-height: 8px !important; + a { + padding-top: 0px !important; + } + } + } + + // Print view. + // Colors are based on the default theme without background. + &.printing { + .line.alt1 .content, + .line.alt2 .content, + .line.highlighted .number, + .line.highlighted.alt1 .content, + .line.highlighted.alt2 .content { background: none !important; } + + // Gutter line numbers + .line { + .number { color: #bbbbbb !important; } + // Add border to the lines + .content { color: black !important; } + } + + // Toolbar when visible + .toolbar { display: none !important; } + a { text-decoration: none !important; } + .plain, .plain a { color: black !important; } + .comments, .comments a { color: #008200 !important; } + .string, .string a { color: blue !important; } + .keyword { + color: #006699 !important; + font-weight: bold !important; + } + .preprocessor { color: gray !important; } + .variable { color: #aa7700 !important; } + .value { color: #009900 !important; } + .functions { color: #ff1493 !important; } + .constants { color: #0066cc !important; } + .script { font-weight: bold !important; } + .color1, .color1 a { color: gray !important; } + .color2, .color2 a { color: #ff1493 !important; } + .color3, .color3 a { color: red !important; } + .break, .break a { color: black !important; } + } +} \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/compass/shCoreDefault.scss b/html/lib/syntaxhighlighter/compass/shCoreDefault.scss new file mode 100644 index 0000000..ff80c7f --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreDefault.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeDefault.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreDjango.scss b/html/lib/syntaxhighlighter/compass/shCoreDjango.scss new file mode 100644 index 0000000..ef572e9 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreDjango.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeDjango.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss b/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss new file mode 100644 index 0000000..9767f53 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeEclipse.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss b/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss new file mode 100644 index 0000000..5e466f3 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeEmacs.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss b/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss new file mode 100644 index 0000000..4628595 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeFadeToGrey.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss b/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss new file mode 100644 index 0000000..10ad4c5 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeMDUltra.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss b/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss new file mode 100644 index 0000000..e357eb2 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeMidnight.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreRDark.scss b/html/lib/syntaxhighlighter/compass/shCoreRDark.scss new file mode 100644 index 0000000..5c26da3 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreRDark.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeRDark.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeDefault.scss b/html/lib/syntaxhighlighter/compass/shThemeDefault.scss new file mode 100644 index 0000000..1574dae --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeDefault.scss @@ -0,0 +1,7 @@ +// Default Syntax Highlighter theme. + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .keyword { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeDjango.scss b/html/lib/syntaxhighlighter/compass/shThemeDjango.scss new file mode 100644 index 0000000..8e95c56 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeDjango.scss @@ -0,0 +1,36 @@ +// Django SyntaxHighlighter theme + +$background: #0a2b1d !default; + +$line_highlighted_background: #233729 !default; +$line_highlighted_number: white !default; + +$gutter_text: #497958 !default; +$gutter_border_color: #41a83e !default; + +$toolbar_collapsed_a: #96dd3b !default; +$toolbar_collapsed_a_hover: #fff !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #ffe862 !default; + +$code_plain: #f8f8f8 !default; +$code_comments: #336442 !default; +$code_string: #9df39f !default; +$code_keyword: #96dd3b !default; +$code_preprocessor: #91bb9e !default; +$code_variable: #ffaa3e !default; +$code_value: #f7e741 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #eb939a !default; +$code_color2: #91bb9e !default; +$code_color3: #edef7d !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .comments { font-style: italic !important; } + .keyword { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss b/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss new file mode 100644 index 0000000..193fb1d --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss @@ -0,0 +1,48 @@ +// Eclipse IDE SyntaxHighlighter color theme +// (C) Code-House +// :http//blog.code-house.org/2009/10/xml-i-adnotacje-kod-ogolnego-przeznaczenia-i-jpa/ + +$background: #fff !default; + +$line_highlighted_background: #c3defe !default; +$line_highlighted_number: #fff !default; + +$gutter_text: #787878 !default; +$gutter_border_color: #d4d0c8 !default; + +$toolbar_collapsed_a: #3f5fbf !default; +$toolbar_collapsed_a_hover: #aa7700 !default; +$toolbar_collapsed_background: #fff !default; + +$toolbar_a: #a0a0a0 !default; +$toolbar_a_hover: red !default; + +$code_plain: black !default; +$code_comments: #3f5fbf !default; +$code_string: #2a00ff !default; +$code_keyword: #7f0055 !default; +$code_preprocessor: #646464 !default; +$code_variable: #aa7700 !default; +$code_value: #009900 !default; +$code_functions: #ff1493 !default; +$code_constants: #0066cc !default; +$code_color1: gray !default; +$code_color2: #ff1493 !default; +$code_color3: red !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .keyword { font-weight: bold !important; } + + .xml { + .keyword { + color: #3f7f7f !important; + font-weight: normal !important; } + .color1, .color1 a { color: #7f007f !important; } + .string { + font-style: italic !important; + color: #2a00ff !important; + } + } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss b/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss new file mode 100644 index 0000000..11c9deb --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss @@ -0,0 +1,32 @@ +// Emacs SyntaxHighlighter theme based on theme by Joshua Emmons +// http://www.skia.net/ + +$background: black !default; + +$line_highlighted_background: #2A3133 !default; +$line_highlighted_number: white !default; + +$gutter_text: #d3d3d3 !default; +$gutter_border_color: #990000 !default; + +$toolbar_collapsed_a: #ebdb8d !default; +$toolbar_collapsed_a_hover: #ff7d27 !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #9ccff4 !default; + +$code_plain: #d3d3d3 !default; +$code_comments: #ff7d27 !default; +$code_string: #ff9e7b !default; +$code_keyword: aqua !default; +$code_preprocessor: #aec4de !default; +$code_variable: #ffaa3e !default; +$code_value: #009900 !default; +$code_functions: #81cef9 !default; +$code_constants: #ff9e7b !default; +$code_color1: #ebdb8d !default; +$code_color2: #ff7d27 !default; +$code_color3: #aec4de !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss b/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss new file mode 100644 index 0000000..7963814 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss @@ -0,0 +1,36 @@ +// Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager +// :http//www.ibrasten.com/ + +$background: #121212 !default; + +$line_highlighted_background: #2C2C29 !default; +$line_highlighted_number: white !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #3185b9 !default; + +$toolbar_collapsed_a: #3185b9 !default; +$toolbar_collapsed_a_hover: #d01d33 !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #96daff !default; + +$code_plain: white !default; +$code_comments: #696854 !default; +$code_string: #e3e658 !default; +$code_keyword: #d01d33 !default; +$code_preprocessor: #435a5f !default; +$code_variable: #898989 !default; +$code_value: #009900 !default; +$code_functions: #aaaaaa !default; +$code_constants: #96daff !default; +$code_color1: #ffc074 !default; +$code_color2: #4a8cdb !default; +$code_color3: #96daff !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .functions { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss b/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss new file mode 100644 index 0000000..0356fa6 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss @@ -0,0 +1,32 @@ +// MDUltra SyntaxHighlighter theme based on Midnight Theme +// http://www.mddev.co.uk/ + +$background: #222222 !default; + +$line_highlighted_background: #253e5a !default; +$line_highlighted_number: white !default; + +$gutter_text: #38566f !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #428bdd !default; +$toolbar_collapsed_a_hover: lime !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #aaaaff !default; +$toolbar_a_hover: #9ccff4 !default; + +$code_plain: lime !default; +$code_comments: #428bdd !default; +$code_string: lime !default; +$code_keyword: #aaaaff !default; +$code_preprocessor: #8aa6c1 !default; +$code_variable: aqua !default; +$code_value: #f7e741 !default; +$code_functions: #ff8000 !default; +$code_constants: yellow !default; +$code_color1: red !default; +$code_color2: yellow !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss b/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss new file mode 100644 index 0000000..a4dae02 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss @@ -0,0 +1,32 @@ +// Midnight SyntaxHighlighter theme based on theme by J.D. Myers +// http://webdesign.lsnjd.com/ + +$background: #0f192a !default; + +$line_highlighted_background: #253e5a !default; +$line_highlighted_number: #38566f !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #428bdd !default; +$toolbar_collapsed_a_hover: #1dc116 !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #D1EDFF !default; +$toolbar_a_hover: #8aa6c1 !default; + +$code_plain: #d1edff !default; +$code_comments: #428bdd !default; +$code_string: #1dc116 !default; +$code_keyword: #b43d3d !default; +$code_preprocessor: #8aa6c1 !default; +$code_variable: #ffaa3e !default; +$code_value: #f7e741 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #f8bb00 !default; +$code_color2: white !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeRDark.scss b/html/lib/syntaxhighlighter/compass/shThemeRDark.scss new file mode 100644 index 0000000..3b67b15 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeRDark.scss @@ -0,0 +1,32 @@ +// RDark SyntaxHighlighter theme based on theme by Radu Dineiu +// http://www.vim.org/scripts/script.php?script_id=1732 + +$background: #1b2426 !default; + +$line_highlighted_background: #323E41 !default; +$line_highlighted_number: #b9bdb6 !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #5ba1cf !default; +$toolbar_collapsed_a_hover: #5ce638 !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #e0e8ff !default; + +$code_plain: #b9bdb6 !default; +$code_comments: #878a85 !default; +$code_string: #5ce638 !default; +$code_keyword: #5ba1cf !default; +$code_preprocessor: #435a5f !default; +$code_variable: #ffaa3e !default; +$code_value: #009900 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #e0e8ff !default; +$code_color2: white !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/index.html b/html/lib/syntaxhighlighter/index.html new file mode 100644 index 0000000..60908f4 --- /dev/null +++ b/html/lib/syntaxhighlighter/index.html @@ -0,0 +1,22 @@ + + + + + Hello SyntaxHighlighter + + + + + + + + +

Hello SyntaxHighlighter

+
+function helloSyntaxHighlighter()
+{
+	return "hi!";
+}
+
+ + diff --git a/html/lib/syntaxhighlighter/scripts/shAutoloader.js b/html/lib/syntaxhighlighter/scripts/shAutoloader.js new file mode 100644 index 0000000..4e29bdd --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shAutoloader.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +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}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g, + css: 'color2' }, + + { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, + css: 'keyword' }, + + { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals + css: 'keyword' }, + + { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g, + css: 'color3' }, + + { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, + css: 'color3' }, + + { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['applescript']; + + SyntaxHighlighter.brushes.AppleScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushBash.js b/html/lib/syntaxhighlighter/scripts/shBrushBash.js new file mode 100644 index 0000000..8c29696 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushBash.js @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne 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.regexList = [ + { regex: /^#!.*$/gm, css: 'preprocessor bold' }, + { regex: /\/[\w-\/]+/gm, css: 'plain' }, + { 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 + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['bash', 'shell']; + + SyntaxHighlighter.brushes.Bash = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js b/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js new file mode 100644 index 0000000..079214e --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js @@ -0,0 +1,65 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['c#', 'c-sharp', 'csharp']; + + SyntaxHighlighter.brushes.CSharp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js b/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js new file mode 100644 index 0000000..627dbb9 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js @@ -0,0 +1,100 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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 + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['coldfusion','cf']; + + SyntaxHighlighter.brushes.ColdFusion = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCpp.js b/html/lib/syntaxhighlighter/scripts/shBrushCpp.js new file mode 100644 index 0000000..9f70d3a --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCpp.js @@ -0,0 +1,97 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['cpp', 'c']; + + SyntaxHighlighter.brushes.Cpp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCss.js b/html/lib/syntaxhighlighter/scripts/shBrushCss.js new file mode 100644 index 0000000..4297a9a --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCss.js @@ -0,0 +1,91 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['css']; + + SyntaxHighlighter.brushes.CSS = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js b/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js new file mode 100644 index 0000000..e1060d4 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['delphi', 'pascal', 'pas']; + + SyntaxHighlighter.brushes.Delphi = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushDiff.js b/html/lib/syntaxhighlighter/scripts/shBrushDiff.js new file mode 100644 index 0000000..e9b14fc --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushDiff.js @@ -0,0 +1,41 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['diff', 'patch']; + + SyntaxHighlighter.brushes.Diff = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushErlang.js b/html/lib/syntaxhighlighter/scripts/shBrushErlang.js new file mode 100644 index 0000000..6ba7d9d --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushErlang.js @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['erl', 'erlang']; + + SyntaxHighlighter.brushes.Erland = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js b/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js new file mode 100644 index 0000000..6ec5c18 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js @@ -0,0 +1,67 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['groovy']; + + SyntaxHighlighter.brushes.Groovy = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJScript.js b/html/lib/syntaxhighlighter/scripts/shBrushJScript.js new file mode 100644 index 0000000..ff98dab --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJScript.js @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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' + ; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: r.singleLineCComments, css: 'comments' }, // one line comments + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(r.scriptScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['js', 'jscript', 'javascript']; + + SyntaxHighlighter.brushes.JScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJava.js b/html/lib/syntaxhighlighter/scripts/shBrushJava.js new file mode 100644 index 0000000..d692fd6 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJava.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['java']; + + SyntaxHighlighter.brushes.Java = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js b/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js new file mode 100644 index 0000000..1a150a6 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js @@ -0,0 +1,58 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['jfx', 'javafx']; + + SyntaxHighlighter.brushes.JavaFX = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter/scripts/shBrushObjC.js new file mode 100644 index 0000000..d99555d --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushObjC.js @@ -0,0 +1,59 @@ +/** + * 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: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline 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/scripts/shBrushPerl.js b/html/lib/syntaxhighlighter/scripts/shBrushPerl.js new file mode 100644 index 0000000..d94a2e0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPerl.js @@ -0,0 +1,72 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['perl', 'Perl', 'pl']; + + SyntaxHighlighter.brushes.Perl = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPhp.js b/html/lib/syntaxhighlighter/scripts/shBrushPhp.js new file mode 100644 index 0000000..95e6e43 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPhp.js @@ -0,0 +1,88 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 print 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 = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + + 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + + 'function include include_once global goto if implements interface instanceof namespace new ' + + 'old_function or private protected public return require require_once static switch ' + + 'throw try use var while xor '; + + 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['php']; + + SyntaxHighlighter.brushes.Php = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPlain.js b/html/lib/syntaxhighlighter/scripts/shBrushPlain.js new file mode 100644 index 0000000..9f7d9e9 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPlain.js @@ -0,0 +1,33 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['text', 'plain']; + + SyntaxHighlighter.brushes.Plain = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js b/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js new file mode 100644 index 0000000..0be1752 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js @@ -0,0 +1,74 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['powershell', 'ps']; + + SyntaxHighlighter.brushes.PowerShell = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPython.js b/html/lib/syntaxhighlighter/scripts/shBrushPython.js new file mode 100644 index 0000000..ce77462 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPython.js @@ -0,0 +1,64 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['py', 'python']; + + SyntaxHighlighter.brushes.Python = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushRuby.js b/html/lib/syntaxhighlighter/scripts/shBrushRuby.js new file mode 100644 index 0000000..ff82130 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushRuby.js @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; + + SyntaxHighlighter.brushes.Ruby = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushSass.js b/html/lib/syntaxhighlighter/scripts/shBrushSass.js new file mode 100644 index 0000000..aa04da0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushSass.js @@ -0,0 +1,94 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 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'; + + var statements = '!important !default'; + var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: r.singleLineCComments, css: 'comments' }, // singleline comments + { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements + { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor + { 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 + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sass', 'scss']; + + SyntaxHighlighter.brushes.Sass = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushScala.js b/html/lib/syntaxhighlighter/scripts/shBrushScala.js new file mode 100644 index 0000000..4b0b6f0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushScala.js @@ -0,0 +1,51 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // 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 + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['scala']; + + SyntaxHighlighter.brushes.Scala = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushSql.js b/html/lib/syntaxhighlighter/scripts/shBrushSql.js new file mode 100644 index 0000000..5c2cd88 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushSql.js @@ -0,0 +1,66 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sql']; + + SyntaxHighlighter.brushes.Sql = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/html/lib/syntaxhighlighter/scripts/shBrushVb.js b/html/lib/syntaxhighlighter/scripts/shBrushVb.js new file mode 100644 index 0000000..be845dc --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushVb.js @@ -0,0 +1,56 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['vb', 'vbnet']; + + SyntaxHighlighter.brushes.Vb = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushXml.js b/html/lib/syntaxhighlighter/scripts/shBrushXml.js new file mode 100644 index 0000000..69d9fd0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushXml.js @@ -0,0 +1,69 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + 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 } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; + + SyntaxHighlighter.brushes.Xml = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shCore.js b/html/lib/syntaxhighlighter/scripts/shCore.js new file mode 100644 index 0000000..b47b645 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shCore.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +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}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) diff --git a/html/lib/syntaxhighlighter/scripts/shLegacy.js b/html/lib/syntaxhighlighter/scripts/shLegacy.js new file mode 100644 index 0000000..6d9fd4d --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shLegacy.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +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}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?\\\\w+)\\\\]$","U"),i=1,p=0;p tags to the document body + for (i = 0; i < elements.length; i++) + { + var url = brushes[elements[i].params.brush]; + + if (!url) + continue; + + scripts[url] = false; + loadScript(url); + } + + function loadScript(url) + { + var script = document.createElement('script'), + done = false + ; + + script.src = url; + script.type = 'text/javascript'; + script.language = 'javascript'; + script.onload = script.onreadystatechange = function() + { + if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) + { + done = true; + scripts[url] = true; + checkAll(); + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + script.parentNode.removeChild(script); + } + }; + + // sync way of adding script tags to the page + document.body.appendChild(script); + }; + + function checkAll() + { + for(var url in scripts) + if (scripts[url] == false) + return; + + if (allCalled) + SyntaxHighlighter.highlight(allParams); + }; +}; + +})(); diff --git a/html/lib/syntaxhighlighter/src/shCore.js b/html/lib/syntaxhighlighter/src/shCore.js new file mode 100644 index 0000000..4214763 --- /dev/null +++ b/html/lib/syntaxhighlighter/src/shCore.js @@ -0,0 +1,1721 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +var SyntaxHighlighter = function() { + +// CommonJS +if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') +{ + XRegExp = require('XRegExp').XRegExp; +} + +// 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' : false, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Title to be displayed above the code block. */ + 'title' : 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, + + /** Enables quick code copy and paste from double click. */ + 'quick-code' : 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, + + 'html-script' : false + }, + + config : { + space : ' ', + + /** Enables use of tags. */ + scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } + }, + + toolbar: { + /** + * Generates HTML markup for the toolbar. + * @param {Highlighter} highlighter Highlighter instance. + * @return {String} Returns HTML markup. + */ + getHtml: function(highlighter) + { + var html = '
', + items = sh.toolbar.items, + list = items.list + ; + + function defaultGetHtml(highlighter, name) + { + return sh.toolbar.getButtonHtml(highlighter, name, sh.config.strings[name]); + }; + + for (var i = 0; i < list.length; i++) + html += (items[list[i]].getHtml || defaultGetHtml)(highlighter, list[i]); + + html += '
'; + + return html; + }, + + /** + * Generates HTML markup for a regular button in the toolbar. + * @param {Highlighter} highlighter Highlighter instance. + * @param {String} commandName Command name that would be executed. + * @param {String} label Label text to display. + * @return {String} Returns HTML markup. + */ + getButtonHtml: function(highlighter, commandName, label) + { + return '' + label + '' + ; + }, + + /** + * Event handler for a toolbar anchor. + */ + handler: function(e) + { + var target = e.target, + className = target.className || '' + ; + + function getValue(name) + { + var r = new RegExp(name + '_(\\w+)'), + match = r.exec(className) + ; + + return match ? match[1] : null; + }; + + var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id), + commandName = getValue('command') + ; + + // execute the toolbar command + if (highlighter && commandName) + sh.toolbar.items[commandName].execute(highlighter); + + // disable default A click behaviour + e.preventDefault(); + }, + + /** Collection of toolbar items. */ + items : { + // Ordered lis of items in the toolbar. Can't expect `for (var n in items)` to be consistent. + list: ['expandSource', 'help'], + + expandSource: { + getHtml: function(highlighter) + { + if (highlighter.getParam('collapse') != true) + return ''; + + var title = highlighter.getParam('title'); + return sh.toolbar.getButtonHtml(highlighter, 'expandSource', title ? title : sh.config.strings.expandSource); + }, + + execute: function(highlighter) + { + var div = getHighlighterDivById(highlighter.id); + removeClass(div, 'collapsed'); + } + }, + + /** Command to display the about dialog window. */ + help: { + execute: function(highlighter) + { + var wnd = popup('', '_blank', 500, 250, 'scrollbars=0'), + doc = wnd.document + ; + + doc.write(sh.config.strings.aboutDialog); + doc.close(); + wnd.focus(); + } + } + } + }, + + /** + * Finds all elements on the page which should be processes by SyntaxHighlighter. + * + * @param {Object} globalParams Optional parameters which override element's + * parameters. Only used if element is specified. + * + * @param {Object} element Optional element to highlight. If none is + * provided, all elements in the current document + * are returned which qualify. + * + * @return {Array} Returns list of { target: DOMElement, params: Object } objects. + */ + findElements: function(globalParams, element) + { + var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)), + conf = sh.config, + result = [] + ; + + // support for \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/brushes_tests.html b/html/lib/syntaxhighlighter/tests/brushes_tests.html new file mode 100644 index 0000000..e1e2068 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/brushes_tests.html @@ -0,0 +1,136 @@ + + + + + SyntaxHighlighter Brushes Tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/cases/001_basic.html b/html/lib/syntaxhighlighter/tests/cases/001_basic.html new file mode 100644 index 0000000..1d57334 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/001_basic.html @@ -0,0 +1,42 @@ +
+	/**
+	 * multiline comment 
+	 */
+	
+	text
+	
+	// single line comment
+	
+	text
+	
+	"string" text 'string' text "string"
+	"string with \" escape" text 'string with \' escape' text "string with \" escape"
+	
+	var code = '\
+		function helloWorld()\
+		{\
+			// this is great!\
+			for(var i = 0; i <= 1; i++)\
+				alert("yay");\
+		}\
+		';
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/002_brushes.html b/html/lib/syntaxhighlighter/tests/cases/002_brushes.html new file mode 100644 index 0000000..e9c64e2 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/002_brushes.html @@ -0,0 +1,50 @@ +
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html b/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html new file mode 100644 index 0000000..9b44292 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html @@ -0,0 +1,42 @@ +
+ +
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html b/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html new file mode 100644 index 0000000..d489a66 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html @@ -0,0 +1,43 @@ +
+/**
+ * Please see <http://www.alexgorbatchev.come/?test=1&y=2>
+ */
+var home = "http://www.alexgorbatchev.come/?test=1&y=2;test/1/2/3;";
+// < http://www.gnu.org/licenses/?test=1&y=2 >.
+
+// Test embedded URLs that terminate at a left angle bracket.
+// See bug #28: http://bitbucket.org/alexg/syntaxhighlighter/issue/28/
+"http://www.example.com/song2.mp3";
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html b/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html new file mode 100644 index 0000000..6e6b1be --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html @@ -0,0 +1,33 @@ +
+			public Image getImage(URL url, String name) {
+				try {
+					/*
+					   Regular multiline comment.
+					*/
+				    return getImage(new URL(url, name));
+				} catch (MalformedURLException e) {
+				    return null;
+				}
+			}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html b/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html new file mode 100644 index 0000000..8ebdd55 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html @@ -0,0 +1,39 @@ +
+/**
+ * Returns an Image object that can then be painted on the screen. 
+ * The url argument must specify an absolute {@link URL}. The name
+ * argument is a specifier that is relative to the url argument. 
+ *
+ * @param  url  an absolute URL giving the base location of the image
+ * @param  name the location of the image, relative to the url argument
+ * @return      the image at the specified URL
+ * @see         Image
+ */
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/007_collapse.html b/html/lib/syntaxhighlighter/tests/cases/007_collapse.html new file mode 100644 index 0000000..2643bb5 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/007_collapse.html @@ -0,0 +1,60 @@ +
+	/**
+	 * Returns an Image object that can then be painted on the screen. 
+	 * The url argument must specify an absolute {@link URL}. The name
+	 * argument is a specifier that is relative to the url argument. 
+	 *
+	 * @param  url  an absolute URL giving the base location of the image
+	 * @param  name the location of the image, relative to the url argument
+	 * @return      the image at the specified URL
+	 * @see         Image
+	 */
+
+ +
+	/**
+	 * Returns an Image object that can then be painted on the screen. 
+	 * The url argument must specify an absolute {@link URL}. The name
+	 * argument is a specifier that is relative to the url argument. 
+	 *
+	 * @param  url  an absolute URL giving the base location of the image
+	 * @param  name the location of the image, relative to the url argument
+	 * @return      the image at the specified URL
+	 * @see         Image
+	 */
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html b/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html new file mode 100644 index 0000000..ea72046 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html @@ -0,0 +1,44 @@ + diff --git a/html/lib/syntaxhighlighter/tests/cases/008_first_line.html b/html/lib/syntaxhighlighter/tests/cases/008_first_line.html new file mode 100644 index 0000000..169dc38 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/008_first_line.html @@ -0,0 +1,29 @@ +
+	partial class Foo
+	{
+		function test()
+		{
+			yield return;
+		}
+	}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/009_class_name.html b/html/lib/syntaxhighlighter/tests/cases/009_class_name.html new file mode 100644 index 0000000..f2437d5 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/009_class_name.html @@ -0,0 +1,32 @@ +
+	public Image getImage(URL url, String name) {
+		try {
+			/*
+			   Regular multiline comment.
+			*/
+		    return getImage(new URL(url, name));
+		} catch (MalformedURLException e) {
+		    return null;
+		}
+	}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/010_highlight.html b/html/lib/syntaxhighlighter/tests/cases/010_highlight.html new file mode 100644 index 0000000..64b6613 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/010_highlight.html @@ -0,0 +1,70 @@ +
+	public function validateStrongPassword(password:String):Boolean
+	{
+		if (password == null || password.length <= 0)
+		{
+			return false;
+		}
+		
+		return STRONG_PASSWORD_PATTERN.test(password);
+	}
+
+ + + diff --git a/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html b/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html new file mode 100644 index 0000000..d6d62fc --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html @@ -0,0 +1,98 @@ +
+	the		words	in		this	paragraph
+	should	look	like	they	are
+	evenly	spaced	between	columns
+
+ +
+	the	words	in	this	paragraph
+	should	look	like	they	are
+	evenly	spaced	between	columns
+
+ +
+	the		words	in		this	paragraph
+	should	look	out		of		whack
+	because	smart	tabs	are		disabled
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/012_server_side.html b/html/lib/syntaxhighlighter/tests/cases/012_server_side.html new file mode 100644 index 0000000..1bb4217 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/012_server_side.html @@ -0,0 +1,35 @@ + + +
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/013_html_script.html b/html/lib/syntaxhighlighter/tests/cases/013_html_script.html new file mode 100644 index 0000000..c0a1201 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/013_html_script.html @@ -0,0 +1,34 @@ +
+<hello>
+	<%
+		package free.cafekiwi.gotapi;
+	%>
+</hello>
+
+
+<%= print(); %>
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/014_legacy.html b/html/lib/syntaxhighlighter/tests/cases/014_legacy.html new file mode 100644 index 0000000..eb4343e --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/014_legacy.html @@ -0,0 +1,70 @@ +
basic check
+
no toolbar
+
no gutter
+
collapsed
+
first line
+ + diff --git a/html/lib/syntaxhighlighter/tests/commonjs_tests.js b/html/lib/syntaxhighlighter/tests/commonjs_tests.js new file mode 100644 index 0000000..cda8162 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/commonjs_tests.js @@ -0,0 +1,52 @@ +/** + * This is a CommonJS compatibility test. You can run this file with node. + */ +require.paths.unshift(__dirname + '/../scripts'); + +var sys = require('sys'), + shSyntaxHighlighter = require('shCore').SyntaxHighlighter, + code = 'test', + brushes = [ + 'AS3', + 'AppleScript', + 'Bash', + 'CSharp', + 'ColdFusion', + 'Cpp', + 'Css', + 'Delphi', + 'Diff', + 'Erlang', + 'Groovy', + 'JScript', + 'Java', + 'JavaFX', + 'Perl', + 'Php', + 'Plain', + 'PowerShell', + 'Python', + 'Ruby', + 'Sass', + 'Scala', + 'Sql', + 'Vb', + 'Xml' + ] + ; + +brushes.sort(); + +for (var i = 0; i < brushes.length; i++) +{ + var name = brushes[i], + brush = require('shBrush' + name).Brush + ; + + brush = new brush(); + brush.init({ toolbar: false }); + + var result = brush.getHtml(code); + + sys.puts(name + (result != null ? ': ok' : ': NOT OK')); +} diff --git a/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js b/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js new file mode 100644 index 0000000..e414a7e --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js @@ -0,0 +1,6240 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function( window, undefined ) { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwnProperty = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + indexOf = Array.prototype.indexOf; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + if ( elem ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && /^\w+$/.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging object literal values or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { + var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src + : jQuery.isArray(copy) ? [] : {}; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // Handle when the DOM is ready + ready: function() { + // Make sure that the DOM is not already loaded + if ( !jQuery.isReady ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 13 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, i = 0; + while ( (fn = readyList[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Reset the list of functions + readyList = null; + } + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + return jQuery.ready(); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor + && !hasOwnProperty.call(obj, "constructor") + && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwnProperty.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") + .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + trim: function( text ) { + return (text || "").replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = []; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + if ( !inv !== !callback( elems[ i ], i ) ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch( error ) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +function evalScript( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } +} + +// Mutifunctional method to get and set values to a collection +// The value/s can be optionally by executed if its a function +function access( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; +} + +function now() { + return (new Date).getTime(); +} +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + now(); + + div.style.display = "none"; + div.innerHTML = "
a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, + + parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null, + + // Will be defined later + deleteExpando: true, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null + }; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ).style.display = 'none'; + + div = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; +var expando = "jQuery" + now(), uuid = 0, windowData = {}; + +jQuery.extend({ + cache: {}, + + expando:expando, + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + "object": true, + "applet": true + }, + + data: function( elem, name, data ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache; + + if ( !id && typeof name === "string" && data === undefined ) { + return null; + } + + // Compute a unique ID for the element + if ( !id ) { + id = ++uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + elem[ expando ] = id; + thisCache = cache[ id ] = jQuery.extend(true, {}, name); + + } else if ( !cache[ id ] ) { + elem[ expando ] = id; + cache[ id ] = {}; + } + + thisCache = cache[ id ]; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } + + // Completely remove the data cache + delete cache[ id ]; + } + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + if ( typeof key === "undefined" && this.length ) { + return jQuery.data( this[0] ); + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + } + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else { + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { + jQuery.data( this, key, value ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i, elem ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); +var rclass = /[\n\t]/g, + rspace = /\s+/, + rreturn = /\r/g, + rspecialurl = /href|src|style/, + rtype = /(button|input)/i, + rfocusable = /(button|input|object|select|textarea)/i, + rclickable = /^(a|area)$/i, + rradiocheck = /radio|checkbox/; + +jQuery.fn.extend({ + attr: function( name, value ) { + return access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", setClass = elem.className; + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split(rspace); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, i = 0, self = jQuery(this), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Typecast each time if the value is a Function and the appended + // value is therefore different each time. + if ( typeof val === "number" ) { + val += ""; + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // Only do all the following if this is a node (faster for style) + if ( elem.nodeType === 1 ) { + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + if ( name in elem && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + elem[ name ] = value; + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } + + // elem is actually elem.style ... set the style + // Using attr for specific style information is now deprecated. Use style instead. + return jQuery.style( elem, name, value ); + } +}); +var rnamespaces = /\.(.*)$/, + fcleanup = function( nm ) { + return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { + return "\\" + ch; + }); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events = elemData.events || {}, + eventHandle = elemData.handle, eventHandle; + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + handleObj.guid = handler.guid; + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( var j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( var j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[expando] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery.data( elem, "handle" ); + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var target = event.target, old, + isClick = jQuery.nodeName(target, "a") && type === "click", + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ type ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + type ]; + + if ( old ) { + target[ "on" + type ] = null; + } + + jQuery.event.triggered = true; + target[ type ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( old ) { + target[ "on" + type ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace, events; + + event = arguments[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + var events = jQuery.data(this, "events"), handlers = events[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, arguments ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, body = document.body; + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { + event.which = event.charCode || event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); + }, + + remove: function( handleObj ) { + var remove = true, + type = handleObj.origType.replace(rnamespaces, ""); + + jQuery.each( jQuery.data(this, "events").live || [], function() { + if ( type === this.origType.replace(rnamespaces, "") ) { + remove = false; + return false; + } + }); + + if ( remove ) { + jQuery.event.remove( this, handleObj.origType, liveHandler ); + } + } + + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( this.setInterval ) { + this.onbeforeunload = eventHandle; + } + + return false; + }, + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +var removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + elem.removeEventListener( type, handle, false ); + } : + function( elem, type, handle ) { + elem.detachEvent( "on" + type, handle ); + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = now(); + + // Mark it as fixed + this[ expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + } + // otherwise set the returnValue property of the original event to false (IE) + e.returnValue = false; + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var formElems = /textarea|input|select/i, + + changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information/focus[in] is not needed anymore + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return formElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return formElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.handle.call( this, e ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + context.each(function(){ + jQuery.event.add( this, liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + }); + + } else { + // unbind live handler + context.unbind( liveConvert( type, selector ), fn ); + } + } + + return this; + } +}); + +function liveHandler( event ) { + var stop, elems = [], selectors = [], args = arguments, + related, match, handleObj, elem, j, i, l, data, + events = jQuery.data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( match[i].selector === handleObj.selector ) { + elem = match[i].elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) { + stop = false; + break; + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( fn ) { + return fn ? this.bind( name, fn ) : this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + window.attachEvent("onunload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function(selector, context, results, seed) { + results = results || []; + var origContext = context = context || document; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + var ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } + + if ( context ) { + var ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + var cur = parts.pop(), pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); + } + } + } + } + + return results; +}; + +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; + +Sizzle.find = function(expr, context, isXML){ + var set, match; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && isXML(set[0]); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string"; + + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return /h\d/i.test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return /input|select|textarea|button/i.test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var i = 0, l = not.length; i < l; i++ ) { + if ( not[i] === elem ) { + return false; + } + } + + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + return true; + case 'nth': + var first = match[2], last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ + return "\\" + (num - 0 + 1); + })); +} + +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var i = 0, l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( var i = 0; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } + + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } + + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } + + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date).getTime(); + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; + + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + root = form = null; // release memory in IE +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } + + div = null; // release memory in IE +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function(query, context, extra, seed){ + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && context.nodeType === 9 && !isXML(context) ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + div = null; // release memory in IE + })(); +} + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context, isXML) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + div = null; // release memory in IE +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +var contains = document.compareDocumentPosition ? function(a, b){ + return !!(a.compareDocumentPosition(b) & 16); +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; + +var isXML = function(elem){ + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function(selector, context){ + var tmpSet = [], later = "", match, + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = getText; +jQuery.isXMLDoc = isXML; +jQuery.contains = contains; + +return; + +window.Sizzle = Sizzle; + +})(); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + slice = Array.prototype.slice; + +// Implement the identical functionality for filter and not +var winnow = function( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + if ( jQuery.isArray( selectors ) ) { + var ret = [], cur = this[0], match, matches = {}, selector; + + if ( cur && selectors.length ) { + for ( var i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur }); + delete matches[selector]; + } + } + cur = cur.parentNode; + } + } + + return ret; + } + + var pos = jQuery.expr.match.POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + return this.map(function( i, cur ) { + while ( cur && cur.ownerDocument && cur !== context ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { + return cur; + } + cur = cur.parentNode; + } + return null; + }); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], cur = elem[dir]; + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, + rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, + rtagName = /<([\w:]+)/, + rtbody = /"; + }, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

SyntaxHighlighter Highlight Lines Test

+

+
+

+
    + + + +
    +
    + + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/theme_tests.html b/html/lib/syntaxhighlighter/tests/theme_tests.html new file mode 100644 index 0000000..da07ecf --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/theme_tests.html @@ -0,0 +1,134 @@ + + + + + SyntaxHighlighter Theme Tests + + + + + +
    + + + + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/webrick.rb b/html/lib/syntaxhighlighter/tests/webrick.rb new file mode 100755 index 0000000..0b3c93c --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/webrick.rb @@ -0,0 +1,11 @@ +require 'webrick' +include WEBrick + +s = HTTPServer.new( + :Port => 2010, + :DocumentRoot => Dir::pwd +) +s.mount('/sh/scripts', WEBrick::HTTPServlet::FileHandler, '../scripts') +s.mount('/sh/styles', WEBrick::HTTPServlet::FileHandler, '../styles') +trap('INT') { s.stop } +s.start diff --git a/html/lib/syntaxhighlighter/tests/webrick.sh b/html/lib/syntaxhighlighter/tests/webrick.sh new file mode 100755 index 0000000..7e249f8 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/webrick.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ruby webrick.rb diff --git a/html/views/blame/blame.css b/html/views/blame/blame.css index a020e8a..c16ffc0 100644 --- a/html/views/blame/blame.css +++ b/html/views/blame/blame.css @@ -1,54 +1,60 @@ table { - border-collapse: collapse; - border-spacing: 0; + border-collapse: collapse !important; + border-spacing: 0 !important; } body,th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; + margin: 0 !important; + padding: 0 !important; + border: 0 !important; + outline: 0 !important; + font-size: 100% !important; + vertical-align: baseline !important; + background: transparent !important; +} + +p.summary { } p{ - margin: 0; - padding: 0; + margin: 0 !important; + padding: 0 !important; + font-size: 11px; + font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + white-space: nowrap; } -tr.block.l2 p.summary, tr.block.l3 p.summary, +tr.block.l2 p.summary, tr.block.l1 p.summary{ - display: none; + display: none !important; } table.blocks td { - vertical-align: top; + vertical-align: top !important; } p.author { - white-space: nowrap; + white-space: nowrap !important; } table.blocks { - font: 11px "Menlo" !important; + font: 11px "Menlo" !important !important; } table tr.block{ - border-top: 1px solid #c9c9c9; + border-top: 1px solid #c9c9c9 !important; } table.blocks{ - border-bottom: 1px solid #c9c9c9; - width: 100%; + border-bottom: 1px solid #c9c9c9 !important; + width: 100% !important; } table.blocks tr td:nth-of-type(2) { - width: 100%; + width: 100% !important; } table.blocks tr.block td:nth-of-type(1){ - padding-right: 5px; - padding-left: 5px; + padding-right: 5px !important; + padding-left: 5px !important; } \ No newline at end of file diff --git a/html/views/blame/index.html b/html/views/blame/index.html index 8be6a6f..5efde8e 100644 --- a/html/views/blame/index.html +++ b/html/views/blame/index.html @@ -1,12 +1,12 @@ - - + + - - + +
    hola diff --git a/html/views/commit/commit.css b/html/views/commit/commit.css index 9bd8157..8f97168 100644 --- a/html/views/commit/commit.css +++ b/html/views/commit/commit.css @@ -81,10 +81,6 @@ table.diff { -webkit-border-radius: 2px; } -.diff .hunkbutton:hover{ - padding: 0 1px 0 1px; - border: 2px solid #3465a4; -} #selected { background-color: #B5D5FE !important; } diff --git a/html/views/commit/commit.js b/html/views/commit/commit.js index 3ebd40d..849d9d5 100644 --- a/html/views/commit/commit.js +++ b/html/views/commit/commit.js @@ -1,7 +1,8 @@ /* Commit: Interface for selecting, staging, discarding, and unstaging hunks, individual lines, or ranges of lines. */ -contextLines = getCookie("GitXContextLines"); +var contextLines = 0; + var showNewFile = function(file) { setTitle("New file: " + file.path); @@ -38,24 +39,7 @@ var setTitle = function(status) { var displayContext = function() { $("contextSize").style.display = ""; $("contextTitle").style.display = ""; -} - -var showFileBlame = function(file, cached) { - if (!file) { - setState("No file selected"); - return; - } - - //setState("blame "+file.path); - var changes = Index.blameFile_(file); - - hideNotification(); - hideState(); - - $("diff").style.display = ""; - $("diff").innerHTML="
    "+changes+"
    "; - - return; + contextLines = $("contextSize").value; } var showFileChanges = function(file, cached) { @@ -68,7 +52,8 @@ var showFileChanges = function(file, cached) { hideState(); $("contextSize").oninput = function(element) { - contextSize = $("contextSize").value; + contextLines = $("contextSize").value; + Controller.refresh(); } if (file.status == 0) // New file? @@ -178,10 +163,6 @@ var diffHeader; var originalDiff; var originalCached; -var showFile = function(diff) { - displayDiff(diff,false); -} - var displayDiff = function(diff, cached) { diffHeader = diff.split("\n").slice(0,4).join("\n"); diff --git a/html/views/commit/index.html b/html/views/commit/index.html index c82cc6b..54698da 100644 --- a/html/views/commit/index.html +++ b/html/views/commit/index.html @@ -8,36 +8,20 @@ - - - - - + + - +

    - + Context: Nothing to commit +

    -