Merge branch 'master' into gui-refresh

This commit is contained in:
Alex Brand
2011-04-29 22:01:03 +02:00
122 changed files with 2999 additions and 7998 deletions
+4 -4
View File
@@ -31,7 +31,7 @@
if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load])
if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load])
NSLog(@"Could not load QuickLook");
DLog(@"Could not load QuickLook");
/* Value Transformers */
NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init];
@@ -55,7 +55,7 @@
int serviceVersion = [[NSUserDefaults standardUserDefaults] integerForKey:@"Services Version"];
if (serviceVersion < 2)
{
NSLog(@"Updating services menu…");
DLog(@"Updating services menu…");
NSUpdateDynamicServices();
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"Services Version"];
}
@@ -245,7 +245,7 @@
fileManager = [NSFileManager defaultManager];
applicationSupportFolder = [self applicationSupportFolder];
if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) {
[fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil];
[fileManager createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil];
}
url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"GitTest.xml"]];
@@ -414,7 +414,7 @@
- (IBAction)reportAProblem:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.lighthouseapp.com/tickets"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/laullon/gitx/issues"]];
}
+1 -1
View File
@@ -9,5 +9,5 @@
#import "PBGitRepository.h"
@protocol PBCommandFactory
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository;
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository;
@end
+1 -1
View File
@@ -16,7 +16,7 @@
@synthesize parameterDisplayName;
- initWithCommand:(PBCommand *) aCommand parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName {
if (self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]]) {
if ((self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]])) {
command = [aCommand retain];
parameterName = [param retain];
parameterDisplayName = [paramDisplayName retain];
+1 -1
View File
@@ -13,7 +13,7 @@
@implementation PBOpenDocumentCommand
- (id) initWithDocumentAbsolutePath:(NSString *) path {
if (self = [super initWithDisplayName:@"Open" parameters:nil repository:nil]) {
if ((self = [super initWithDisplayName:@"Open" parameters:nil repository:nil])) {
documentURL = [[NSURL alloc] initWithString:path];
}
return self;
+1 -1
View File
@@ -58,7 +58,7 @@
return commands;
}
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository {
if ([object isKindOfClass:[PBGitSubmodule class]]) {
return [PBRemoteCommandFactory commandsForSubmodule:(id)object inRepository:repository];
}
+1 -1
View File
@@ -17,7 +17,7 @@
return nil;
}
if (self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil]) {
if ((self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil])) {
documentURL = [[NSURL alloc] initWithString:path];
}
return self;
+1 -1
View File
@@ -22,7 +22,7 @@
@implementation PBStashCommandFactory
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
+ (NSArray *) commandsForObject:(id<PBPresentable>) object repository:(PBGitRepository *) repository {
NSArray *cmds = nil;
if ([object isKindOfClass:[PBGitStash class]]) {
cmds = [PBStashCommandFactory commandsForStash:(id)object repository:repository];
+1 -1
View File
@@ -13,7 +13,7 @@
@implementation PBArgumentPickerController
- initWithCommandWithParameter:(PBCommandWithParameter *) aCommand {
if (self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self]) {
if ((self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self])) {
cmdWithParameter = [aCommand retain];
}
return self;
+3 -1
View File
@@ -7,8 +7,10 @@
//
#import <Cocoa/Cocoa.h>
#import "PBResetSheet.h"
@class PBGitRepository;
@protocol PBGitRefish;
@interface PBGitResetController : NSObject {
PBGitRepository *repository;
@@ -17,8 +19,8 @@
- (NSArray *) menuItems;
// actions
- (void) resetToRefish: (id<PBGitRefish>) spec type: (PBResetType) type;
- (void) resetHardToHead;
@end
+8 -33
View File
@@ -9,36 +9,25 @@
#import "PBGitResetController.h"
#import "PBGitRepository.h"
#import "PBCommand.h"
#import "PBGitRefish.h"
#import "PBResetSheet.h"
static NSString * const kCommandKey = @"command";
@implementation PBGitResetController
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
}
- (void) resetHardToHead {
NSAlert *alert = [NSAlert alertWithMessageText:@"Reseting working copy and index"
defaultButton:@"Cancel"
alternateButton:nil
otherButton:@"Reset"
informativeTextWithFormat:@"Are you sure you want to reset your working copy and index? All changes to them will be gone!"];
NSArray *arguments = [NSArray arrayWithObjects:@"reset", @"--hard", @"HEAD", nil];
PBCommand *cmd = [[PBCommand alloc] initWithDisplayName:@"Reset hard to HEAD" parameters:arguments repository:repository];
cmd.commandTitle = cmd.displayName;
cmd.commandDescription = @"Reseting head";
NSMutableDictionary *info = [NSMutableDictionary dictionaryWithObject:cmd forKey:kCommandKey];
[alert beginSheetModalForWindow:[repository.windowController window]
modalDelegate:self
didEndSelector:@selector(confirmResetSheetDidEnd:returnCode:contextInfo:)
contextInfo:info];
[self resetToRefish: [PBGitRef refFromString: @"HEAD"] type: PBResetTypeHard];
}
- (void) resetToRefish:(id<PBGitRefish>) refish type:(PBResetType)type {
[PBResetSheet beginResetSheetForRepository: repository refish: refish andType: type];
}
- (void) reset {
@@ -70,18 +59,4 @@ static NSString * const kCommandKey = @"command";
[super dealloc];
}
#pragma mark -
#pragma mark Confirm Window
- (void) confirmResetSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
[[sheet window] orderOut:nil];
if (returnCode != NSAlertDefaultReturn) {
PBCommand *cmd = [(NSDictionary *)contextInfo objectForKey:kCommandKey];
[cmd invoke];
}
}
@end
+3 -2
View File
@@ -19,7 +19,7 @@
@synthesize submodules;
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
@@ -42,7 +42,8 @@
if ([submoduleLine length] == 0)
continue;
PBGitSubmodule *submodule = [[PBGitSubmodule alloc] initWithRawSubmoduleStatusString:submoduleLine];
[loadedSubmodules addObject:submodule];
if (submodule)
[loadedSubmodules addObject:submodule];
}
NSMutableArray *groupedSubmodules = [[NSMutableArray alloc] init];
+1 -1
View File
@@ -42,7 +42,7 @@
#import <Cocoa/Cocoa.h>
@interface DBPrefsWindowController : NSWindowController {
@interface DBPrefsWindowController : NSWindowController <NSAnimationDelegate,NSToolbarDelegate>{
NSMutableArray *toolbarIdentifiers;
NSMutableDictionary *toolbarViews;
NSMutableDictionary *toolbarItems;
+64 -672
View File
@@ -2,17 +2,33 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">10J567</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.SystemVersion">10J869</string>
<string key="IBDocument.InterfaceBuilderVersion">1305</string>
<string key="IBDocument.AppKitVersion">1038.35</string>
<string key="IBDocument.HIToolboxVersion">462.00</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">788</string>
<string key="NS.object.0">1305</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="367"/>
<string>NSSegmentedCell</string>
<string>NSToolbar</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>NSSplitView</string>
<string>NSButton</string>
<string>NSSegmentedControl</string>
<string>NSButtonCell</string>
<string>NSTextFieldCell</string>
<string>NSToolbarSpaceItem</string>
<string>NSProgressIndicator</string>
<string>NSToolbarSeparatorItem</string>
<string>NSCustomView</string>
<string>NSCustomObject</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>NSTextField</string>
<string>NSToolbarItem</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -47,7 +63,7 @@
<nil key="NSToolbarDelegate"/>
<bool key="NSToolbarPrefersToBeShown">YES</bool>
<bool key="NSToolbarShowsBaselineSeparator">YES</bool>
<bool key="NSToolbarAllowsUserCustomization">YES</bool>
<bool key="NSToolbarAllowsUserCustomization">NO</bool>
<bool key="NSToolbarAutosavesConfiguration">YES</bool>
<int key="NSToolbarDisplayMode">1</int>
<int key="NSToolbarSizeMode">1</int>
@@ -93,10 +109,9 @@
<string key="NSToolbarItemPaletteLabel">Clone Repository To</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="703553818">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{38, 14}, {40, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="64590231">
<int key="NSCellFlags">-2080244224</int>
@@ -139,10 +154,9 @@
<string key="NSToolbarItemPaletteLabel">Refresh</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="438380428">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{8, 14}, {32, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="604536609">
<int key="NSCellFlags">-2080244224</int>
@@ -181,10 +195,9 @@
<string key="NSToolbarItemPaletteLabel">View</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="371591001">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 14}, {94, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="399933706">
<int key="NSCellFlags">67239424</int>
@@ -366,7 +379,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{600, 450}</string>
<object class="NSView" key="NSWindowView" id="751230759">
<reference key="NSNextResponder"/>
@@ -383,6 +395,8 @@
<int key="NSvFlags">272</int>
<string key="NSFrameSize">{184, 483}</string>
<reference key="NSSuperview" ref="120427370"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="933485175"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="933485175">
@@ -390,11 +404,15 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{185, 0}, {705, 483}}</string>
<reference key="NSSuperview" ref="120427370"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="207262158"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrame">{{0, 31}, {890, 483}}</string>
<reference key="NSSuperview" ref="751230759"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="3950721"/>
<bool key="NSIsVertical">YES</bool>
<int key="NSDividerStyle">2</int>
<string key="NSAutosaveName">sourceSplitView</string>
@@ -404,6 +422,8 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, 1}, {515, 31}}</string>
<reference key="NSSuperview" ref="751230759"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="44848571"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="44848571">
@@ -417,6 +437,8 @@
<object class="NSPSMatrix" key="NSDrawMatrix"/>
<string key="NSFrame">{{20, 7}, {16, 16}}</string>
<reference key="NSSuperview" ref="44848571"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="508249619"/>
<int key="NSpiFlags">20746</int>
<double key="NSMaxValue">100</double>
</object>
@@ -425,6 +447,8 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{41, 8}, {188, 14}}</string>
<reference key="NSSuperview" ref="44848571"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="708164574">
<int key="NSCellFlags">67239488</int>
@@ -459,15 +483,19 @@
</object>
<string key="NSFrame">{{552, 0}, {246, 31}}</string>
<reference key="NSSuperview" ref="751230759"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="490597384"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrameSize">{890, 514}</string>
<string key="NSFrame">{{7, 11}, {890, 514}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="120427370"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{600, 528}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSMaxSize">{1e+13, 1e+13}</string>
<string key="NSFrameAutosaveName">GitX</string>
<double key="NSContentBorderThicknessMinY">31</double>
</object>
@@ -507,14 +535,6 @@
</object>
<int key="connectionID">356</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">splitView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="120427370"/>
</object>
<int key="connectionID">357</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">sourceListControlsView</string>
@@ -595,6 +615,14 @@
</object>
<int key="connectionID">423</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">mainSplitView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="120427370"/>
</object>
<int key="connectionID">424</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -831,10 +859,6 @@
<string>3.ImportedFromIB2</string>
<string>3.NSWindowTemplate.visibleAtLaunch</string>
<string>3.editorWindowContentRectSynchronizationRect</string>
<string>3.windowTemplate.hasMaxSize</string>
<string>3.windowTemplate.hasMinSize</string>
<string>3.windowTemplate.maxSize</string>
<string>3.windowTemplate.minSize</string>
<string>351.IBPluginDependency</string>
<string>352.IBPluginDependency</string>
<string>352.IBViewBoundsToFrameTransform</string>
@@ -874,10 +898,6 @@
<integer value="1"/>
<integer value="1"/>
<string>{{15, 196}, {850, 418}}</string>
<boolean value="NO"/>
<integer value="1"/>
<string>{3.40282e+38, 3.40282e+38}</string>
<string>{600, 450}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
@@ -918,38 +938,20 @@
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">423</int>
<int key="maxID">424</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">NSApplication+GitXScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">View/CellTrackingRect.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PBGitWindowController</string>
<string key="superclassName">NSWindowController</string>
@@ -1026,10 +1028,10 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>contentSplitView</string>
<string>finderItem</string>
<string>mainSplitView</string>
<string>progressIndicator</string>
<string>sourceListControlsView</string>
<string>sourceSplitView</string>
<string>splitView</string>
<string>statusField</string>
<string>terminalItem</string>
</object>
@@ -1037,10 +1039,10 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>NSView</string>
<string>NSToolbarItem</string>
<string>NSSplitView</string>
<string>NSProgressIndicator</string>
<string>NSView</string>
<string>NSView</string>
<string>NSSplitView</string>
<string>NSTextField</string>
<string>NSToolbarItem</string>
</object>
@@ -1051,10 +1053,10 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>contentSplitView</string>
<string>finderItem</string>
<string>mainSplitView</string>
<string>progressIndicator</string>
<string>sourceListControlsView</string>
<string>sourceSplitView</string>
<string>splitView</string>
<string>statusField</string>
<string>terminalItem</string>
</object>
@@ -1068,6 +1070,10 @@
<string key="name">finderItem</string>
<string key="candidateClassName">NSToolbarItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">mainSplitView</string>
<string key="candidateClassName">NSSplitView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">progressIndicator</string>
<string key="candidateClassName">NSProgressIndicator</string>
@@ -1080,10 +1086,6 @@
<string key="name">sourceSplitView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">splitView</string>
<string key="candidateClassName">NSSplitView</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">statusField</string>
<string key="candidateClassName">NSTextField</string>
@@ -1096,616 +1098,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">PBGitWindowController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PBGitWindowController</string>
<string key="superclassName">NSWindowController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSActionCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="580458777">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="396382550">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="953535086">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButton</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButtonCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="877774742">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSFormatter</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="908857395">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="580458777"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="396382550"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="953535086"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="877774742"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="908857395"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="111590702">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="274393093">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">ScriptingBridge.framework/Headers/SBApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Sparkle.framework/Headers/SUAppcast.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Sparkle.framework/Headers/SUUpdater.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebDownload.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebEditingDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebFrameLoadDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebJavaPlugIn.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPlugin.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPluginContainer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebPolicyDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebResourceLoadDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebScriptObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebUIDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSProgressIndicator</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSegmentedCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSegmentedCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSegmentedControl</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSegmentedControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSplitView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSplitView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextField</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextFieldCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSToolbar</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSToolbarItem</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="111590702"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<string key="superclassName">NSResponder</string>
<reference key="sourceIdentifier" ref="274393093"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindowController</string>
<string key="superclassName">NSResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showWindow:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showWindow:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showWindow:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
<string key="minorKey">./Classes/PBGitWindowController.h</string>
</object>
</object>
</object>
@@ -1725,7 +1118,6 @@
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../GitX.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<bool key="EncodedWithXMLCoder">YES</bool>
+7
View File
@@ -12,6 +12,7 @@
#import "PBGitCommit.h"
#import "PBGitHistoryController.h"
#import "PBRefContextDelegate.h"
#import "SearchWebView.h"
@class PBGitGradientBarView;
@@ -23,6 +24,8 @@
NSString *diffType;
IBOutlet NSView *accessoryView;
IBOutlet NSSplitView *fileListSplitView;
IBOutlet NSSearchField *searchField;
PBGitTree *lastFile;
}
- (void)showFile;
@@ -42,6 +45,10 @@
+(BOOL)isImage:(NSString*)file;
+(BOOL)isDiffHeader:(NSString*)line;
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2;
-(IBAction)updateSearch:(NSSearchField *)sender;
@property(retain) NSMutableArray *groups;
@property(retain) NSString *logFormat;
+322 -242
View File
@@ -20,6 +20,10 @@
@interface GLFileView ()
- (void)saveSplitViewPosition;
+ (NSString *)parseDiffBlock:(NSString *)txt;
+ (NSString *)parseDiffHeader:(NSString *)txt;
+ (NSString *)parseDiffChunk:(NSString *)txt;
+ (NSString *)parseBinaryDiff:(NSString *)txt;
@end
@@ -98,37 +102,52 @@
NSArray *files=[historyController.treeController selectedObjects];
if ([files count]>0) {
PBGitTree *file=[files objectAtIndex:0];
NSString *fileTxt = @"";
if(startFile==@"fileview"){
fileTxt=[file textContents:&theError];
if(!theError)
fileTxt=[GLFileView parseHTML:fileTxt];
}else if(startFile==@"blame"){
fileTxt=[file blame:&theError];
if(!theError)
fileTxt=[self parseBlame:fileTxt];
}else if(startFile==@"log"){
fileTxt=[file log:logFormat error:&theError];
}else if(startFile==@"diff"){
fileTxt=[file diff:diffType error:&theError];
if(!theError)
fileTxt=[GLFileView parseDiff:fileTxt];
}
id script = [view windowScriptObject];
if(!theError){
NSString *filePath = [file fullPath];
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObjects:fileTxt, filePath, nil]];
}else{
[script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObjects:[theError localizedDescription], nil]];
}
DLog(@"file=%@ == %@ => %d",file,lastFile,[file isEqualTo:lastFile]);
if(![file isEqualTo:lastFile]){
lastFile=file;
NSString *fileTxt = @"";
if(startFile==@"fileview"){
fileTxt=[file textContents:&theError];
if(!theError)
fileTxt=[GLFileView parseHTML:fileTxt];
}else if(startFile==@"blame"){
fileTxt=[file blame:&theError];
if(!theError)
fileTxt=[self parseBlame:fileTxt];
}else if(startFile==@"log"){
fileTxt=[file log:logFormat error:&theError];
}else if(startFile==@"diff"){
fileTxt=[file diff:diffType error:&theError];
if(!theError)
fileTxt=[GLFileView parseDiff:fileTxt];
}
id script = [view windowScriptObject];
if(!theError){
NSString *filePath = [file fullPath];
fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"\t" withString:@"&nbsp;&nbsp;&nbsp;&nbsp;"];
DLog(@"file.sha='%@'",file.sha);
fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:file.sha];
if(diffType==@"h") {
fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA}" withString:@"HEAD"];
}else {
fileTxt=[fileTxt stringByReplacingOccurrencesOfString:@"{SHA}" withString:@"--"];
}
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObjects:fileTxt, filePath, nil]];
}else{
[script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObjects:[theError localizedDescription], nil]];
}
[self updateSearch:searchField];
}
}
#ifdef DEBUG_BUILD
NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML];
DOMHTMLElement *dom=(DOMHTMLElement *)[[[view mainFrame] DOMDocument] documentElement];
NSString *domH=[dom outerHTML];
NSString *tmpFile=@"~/tmp/test.html";
[dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil];
[domH writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil];
#endif
}
@@ -139,6 +158,13 @@
[historyController selectCommit:[PBGitSHA shaWithString:c]];
}
// TODO: need to be refactoring
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2;
{
NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,file,nil];
[historyController.repository handleInWorkDirForArguments:args];
}
#pragma mark MGScopeBarDelegate methods
- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar
@@ -193,6 +219,7 @@
[[view mainFrame] reload];
}
}
lastFile=nil;
}
- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar
@@ -270,241 +297,286 @@
+ (NSString *)parseDiff:(NSString *)txt
{
txt=[self parseHTML:txt];
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
NSString *line;
NSMutableString *res=[NSMutableString string];
NSScanner *scan=[NSScanner scannerWithString:txt];
NSString *block;
if(![txt hasPrefix:@"diff --git"])
[scan scanUpToString:@"diff --git" intoString:&block]; //move to first diff
while([scan scanString:@"diff --git" intoString:NULL]){ // is a diff start?
[scan scanUpToString:@"\ndiff --git" intoString:&block];
[res appendString:[GLFileView parseDiffBlock:[NSString stringWithFormat:@"diff --git %@",block]]];
}
return res;
}
int l_line,l_end;
int r_line,r_end;
+ (NSString *)parseDiffBlock:(NSString *)txt
{
NSMutableString *res=[NSMutableString string];
NSScanner *scan=[NSScanner scannerWithString:txt];
NSString *block;
[scan scanUpToString:@"\n@@ " intoString:&block];
[res appendString:@"<table class='diff'><thead>"];
[res appendString:[GLFileView parseDiffHeader:block]];
[res appendString:@"</td></tr></thead><tbody>"];
if([block rangeOfString:@"Binary files"].location!=NSNotFound){
[res appendString:[GLFileView parseBinaryDiff:block]];
}
while([scan scanString:@"@@ " intoString:NULL]){
[scan scanUpToString:@"\n@@ " intoString:&block];
[res appendString:[GLFileView parseDiffChunk:[NSString stringWithFormat:@"@@ %@",block]]];
}
[res appendString:@"</tbody></table>"];
return res;
}
int i=0;
do {
line=[lines objectAtIndex:i];
if([GLFileView isStartDiff:line]){
NSString *fileName=[self getFileName:line];
[res appendString:[NSString stringWithFormat:@"<table id='%@' class='diff'><thead><tr><td colspan='3'><div style='float:left;'>",fileName]];
do{
[res appendString:[NSString stringWithFormat:@"<p>%@</p>",line]];
line=[lines objectAtIndex:++i];
}while([GLFileView isDiffHeader:line]);
[res appendString:@"</div>"];
if(![self isBinaryFile:line]){
[res appendString:[NSString stringWithFormat:@"<div class='filemerge'><a href='' onclick='openFileMerge(\"%@\",\"{SHA}\"); return false;'><img src='GitX://app:/filemerge' width='32' height='32'/><br/>open in<br/>FileMerge</a></div>",fileName]];
}
[res appendString:@"</td></tr></thead><tbody>"];
+ (NSString *)parseBinaryDiff:(NSString *)txt
{
NSMutableString *res=[NSMutableString string];
NSScanner *scan=[NSScanner scannerWithString:txt];
NSString *block;
[scan scanUpToString:@"Binary files" intoString:NULL];
[scan scanUpToString:@"" intoString:&block];
NSArray *files=[self getFilesNames:block];
[res appendString:@"<tr class='images'><td>"];
[res appendString:[NSString stringWithFormat:@"%@<br/>",[files objectAtIndex:0]]];
if(![[files objectAtIndex:0] isAbsolutePath]){
if([GLFileView isImage:[files objectAtIndex:0]]){
[res appendString:[NSString stringWithFormat:@"<img src='GitX://{SHA}:/prev/%@'/>",[files objectAtIndex:0]]];
}
}
[res appendString:@"</td><td>=&gt;</td><td>"];
[res appendString:[NSString stringWithFormat:@"%@<br/>",[files objectAtIndex:1]]];
if(![[files objectAtIndex:1] isAbsolutePath]){
if([GLFileView isImage:[files objectAtIndex:1]]){
[res appendString:[NSString stringWithFormat:@"<img src='GitX://{SHA}:/%@'/>",[files objectAtIndex:1]]];
}
}
[res appendString:@"</td></tr>"];
return res;
}
if([self isBinaryFile:line]){
NSArray *files=[self getFilesNames:line];
if(![[files objectAtIndex:0] isAbsolutePath]){
[res appendString:[NSString stringWithFormat:@"<tr><td colspan='3'>%@</td></tr>",[files objectAtIndex:0]]];
if([GLFileView isImage:[files objectAtIndex:0]]){
[res appendString:[NSString stringWithFormat:@"<tr><td colspan='3'><img src='GitX://{SHA}:/prev/%@'/></td></tr>",[files objectAtIndex:0]]];
}
}
if(![[files objectAtIndex:1] isAbsolutePath]){
[res appendString:[NSString stringWithFormat:@"<tr><td colspan='3'>%@</td></tr>",[files objectAtIndex:1]]];
if([GLFileView isImage:[files objectAtIndex:1]]){
[res appendString:[NSString stringWithFormat:@"<tr><td colspan='3'><img src='GitX://{SHA}/%@'/></td></tr>",[files objectAtIndex:1]]];
}
}
}else{
do{
NSString *header=[line substringFromIndex:3];
NSRange hr = NSMakeRange(0, [header rangeOfString:@" @@"].location);
header=[header substringWithRange:hr];
NSArray *pos=[header componentsSeparatedByString:@" "];
NSArray *pos_l=[[pos objectAtIndex:0] componentsSeparatedByString:@","];
NSArray *pos_r=[[pos objectAtIndex:1] componentsSeparatedByString:@","];
l_end=l_line=abs([[pos_l objectAtIndex:0]integerValue]);
if ([pos_l count]>1) {
l_end=l_line+[[pos_l objectAtIndex:1]integerValue];
}
r_end=r_line=[[pos_r objectAtIndex:0]integerValue];
if ([pos_r count]>1) {
r_end=r_line+[[pos_r objectAtIndex:1]integerValue];
}
[res appendString:[NSString stringWithFormat:@"<tr class='header'><td colspan='3'>%@</td></tr>",line]];
do{
line=[lines objectAtIndex:++i];
NSString *s=[line substringToIndex:1];
if([s isEqualToString:@" "]){
[res appendString:[NSString stringWithFormat:@"<tr><td class='l'>%d</td><td class='r'>%d</td>",l_line++,r_line++]];
}else if([s isEqualToString:@"-"]){
[res appendString:[NSString stringWithFormat:@"<tr class='l'><td class='l'>%d</td><td class='r'></td>",l_line++]];
}else if([s isEqualToString:@"+"]){
[res appendString:[NSString stringWithFormat:@"<tr class='r'><td class='l'></td><td class='r'>%d</td>",r_line++]];
}
[res appendString:[NSString stringWithFormat:@"<td class='code'>%@</td></tr>",[line substringFromIndex:1]]];
}while((l_line<l_end) || (r_line<r_end));
if(i<([lines count]-1)){
line=[lines objectAtIndex:++i];
}
}while([GLFileView isStartBlock:line]);
}
[res appendString:@"</tbody></table>"];
}else {
i++;
}
}while(i<[lines count]);
return res;
+ (NSString *)parseDiffChunk:(NSString *)txt
{
NSEnumerator *lines = [[txt componentsSeparatedByString:@"\n"] objectEnumerator];
NSMutableString *res=[NSMutableString string];
NSString *line;
int l_line;
int r_line;
line=[lines nextObject];
DLog(@"-=%@=-",line);
NSString *header=[line substringFromIndex:3];
NSRange hr = NSMakeRange(0, [header rangeOfString:@" @@"].location);
header=[header substringWithRange:hr];
NSArray *pos=[header componentsSeparatedByString:@" "];
NSArray *pos_l=[[pos objectAtIndex:0] componentsSeparatedByString:@","];
NSArray *pos_r=[[pos objectAtIndex:1] componentsSeparatedByString:@","];
l_line=abs([[pos_l objectAtIndex:0]integerValue]);
r_line=[[pos_r objectAtIndex:0]integerValue];
[res appendString:[NSString stringWithFormat:@"<tr class='header'><td colspan='3'>%@</td></tr>",line]];
while((line=[lines nextObject])){
NSString *s=[line substringToIndex:1];
if([s isEqualToString:@" "]){
[res appendString:[NSString stringWithFormat:@"<tr><td class='l'>%d</td><td class='r'>%d</td>",l_line++,r_line++]];
}else if([s isEqualToString:@"-"]){
[res appendString:[NSString stringWithFormat:@"<tr class='l'><td class='l'>%d</td><td class='r'></td>",l_line++]];
}else if([s isEqualToString:@"+"]){
[res appendString:[NSString stringWithFormat:@"<tr class='r'><td class='l'></td><td class='r'>%d</td>",r_line++]];
}
if(![s isEqualToString:@"\\"]){
[res appendString:[NSString stringWithFormat:@"<td class='code'>%@</td></tr>",[line substringFromIndex:1]]];
}
}
return res;
}
+ (NSString *)parseDiffHeader:(NSString *)txt
{
NSEnumerator *lines = [[txt componentsSeparatedByString:@"\n"] objectEnumerator];
NSMutableString *res=[NSMutableString string];
NSString *line=[lines nextObject];
NSString *fileName=[self getFileName:line];
[res appendString:[NSString stringWithFormat:@"<tr id='%@'><td colspan='3'><div style='float:left;'>",fileName]];
do{
[res appendString:[NSString stringWithFormat:@"<p>%@</p>",line]];
}while((line=[lines nextObject]));
[res appendString:@"</div>"];
if([txt rangeOfString:@"Binary files"].location==NSNotFound){
[res appendString:[NSString stringWithFormat:@"<div class='filemerge'><a href='' onclick='openFileMerge(\"%@\",\"{SHA_PREV}\",\"{SHA}\"); return false;'><img src='GitX://app:/filemerge' width='32' height='32'/><br/>open in<br/>FileMerge</a></div>",fileName]];
}
[res appendString:@"</td></tr>"];
return res;
}
+(NSString *)getFileName:(NSString *)line
{
NSRange b = [line rangeOfString:@"b/"];
NSString *file=[line substringFromIndex:b.location+2];
return file;
NSRange b = [line rangeOfString:@" b/"];
NSString *file=[line substringFromIndex:b.location+3];
DLog(@"line=%@",line);
DLog(@"file=%@",file);
return file;
}
+(NSArray *)getFilesNames:(NSString *)line
{
NSString *a = nil;
NSString *b = nil;
NSScanner *scanner=[NSScanner scannerWithString:line];
if([scanner scanString:@"Binary files " intoString:NULL]){
[scanner scanUpToString:@" and" intoString:&a];
[scanner scanString:@"and" intoString:NULL];
[scanner scanUpToString:@" differ" intoString:&b];
}
if (![a isAbsolutePath]) {
a=[a substringFromIndex:2];
}
if (![b isAbsolutePath]) {
b=[b substringFromIndex:2];
}
return [NSArray arrayWithObjects:a,b,nil];
NSString *a = nil;
NSString *b = nil;
NSScanner *scanner=[NSScanner scannerWithString:line];
if([scanner scanString:@"Binary files " intoString:NULL]){
[scanner scanUpToString:@" and" intoString:&a];
[scanner scanString:@"and" intoString:NULL];
[scanner scanUpToString:@" differ" intoString:&b];
}
if (![a isAbsolutePath]) {
a=[a substringFromIndex:2];
}
if (![b isAbsolutePath]) {
b=[b substringFromIndex:2];
}
return [NSArray arrayWithObjects:a,b,nil];
}
+(NSString*)mimeTypeForFileName:(NSString*)name
{
NSString *mimeType = nil;
NSInteger i=[name rangeOfString:@"." options:NSBackwardsSearch].location;
if(i!=NSNotFound){
NSString *ext=[name substringFromIndex:i+1];
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)ext, NULL);
if(UTI){
CFStringRef registeredType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType);
if(registeredType){
mimeType = NSMakeCollectable(registeredType);
}
CFRelease(UTI);
}
}
NSInteger i=[name rangeOfString:@"." options:NSBackwardsSearch].location;
if(i!=NSNotFound){
NSString *ext=[name substringFromIndex:i+1];
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)ext, NULL);
if(UTI){
CFStringRef registeredType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType);
if(registeredType){
mimeType = NSMakeCollectable(registeredType);
}
CFRelease(UTI);
}
}
return mimeType;
}
+(BOOL)isDiffHeader:(NSString*)line
{
unichar c=[line characterAtIndex:0];
return (c=='i') || (c=='m') || (c=='n') || (c=='d') || (c=='-') || (c=='+');
unichar c=[line characterAtIndex:0];
return (c=='i') || (c=='m') || (c=='n') || (c=='d') || (c=='-') || (c=='+');
}
+(BOOL)isImage:(NSString*)file
{
NSString *mimeType=[GLFileView mimeTypeForFileName:file];
return (mimeType!=nil) && ([mimeType rangeOfString:@"image/" options:NSCaseInsensitiveSearch].location!=NSNotFound);
NSString *mimeType=[GLFileView mimeTypeForFileName:file];
return (mimeType!=nil) && ([mimeType rangeOfString:@"image/" options:NSCaseInsensitiveSearch].location!=NSNotFound);
}
+(BOOL)isBinaryFile:(NSString *)line
{
return (([line length]>12) && [[line substringToIndex:12] isEqualToString:@"Binary files"]);
return (([line length]>12) && [[line substringToIndex:12] isEqualToString:@"Binary files"]);
}
+(BOOL)isStartDiff:(NSString *)line
{
return (([line length]>10) && [[line substringToIndex:10] isEqualToString:@"diff --git"]);
return (([line length]>10) && [[line substringToIndex:10] isEqualToString:@"diff --git"]);
}
+(BOOL)isStartBlock:(NSString *)line
{
return (([line length]>3) && [[line substringToIndex:3] isEqualToString:@"@@ "]);
return (([line length]>3) && [[line substringToIndex:3] isEqualToString:@"@@ "]);
}
- (NSString *) parseBlame:(NSString *)txt
{
txt=[GLFileView parseHTML:txt];
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
NSString *line;
NSMutableDictionary *headers=[NSMutableDictionary dictionary];
NSMutableString *res=[NSMutableString string];
[res appendString:@"<table class='blocks'>\n"];
int i=0;
while(i<[lines count]){
line=[lines objectAtIndex:i];
NSArray *header=[line componentsSeparatedByString:@" "];
if([header count]==4){
NSString *commitID = (NSString *)[header objectAtIndex:0];
int nLines=[(NSString *)[header objectAtIndex:3] intValue];
[res appendFormat:@"<tr class='block l%d'>\n",nLines];
line=[lines objectAtIndex:++i];
if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){
NSString *author=[line stringByReplacingOccurrencesOfString:@"author" withString:@""];
NSString *summary=nil;
while(summary==nil){
line=[lines objectAtIndex:i++];
if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){
summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""];
}
}
NSRange trunc_c={0,7};
NSString *truncate_c=commitID;
if([commitID length]>8){
truncate_c=[commitID substringWithRange:trunc_c];
}
NSRange trunc={0,22};
NSString *truncate_a=author;
if([author length]>22){
truncate_a=[author substringWithRange:trunc];
}
NSString *truncate_s=summary;
if([summary length]>30){
truncate_s=[summary substringWithRange:trunc];
}
NSString *block=[NSString stringWithFormat:@"<td><p class='author'><a href='' onclick='selectCommit(\"%@\"); return false;'>%@</a> %@</p><p class='summary'>%@</p></td>\n<td>\n",commitID,truncate_c,truncate_a,truncate_s];
[headers setObject:block forKey:[header objectAtIndex:0]];
}
[res appendString:[headers objectForKey:[header objectAtIndex:0]]];
NSMutableString *code=[NSMutableString string];
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
line=[line substringFromIndex:1];
line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"&nbsp;&nbsp;&nbsp;&nbsp;"];
[code appendString:line];
[code appendString:@"\n"];
int n;
for(n=1;n<nLines;n++){
line=[lines objectAtIndex:i++];
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
line=[line substringFromIndex:1];
line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"&nbsp;&nbsp;&nbsp;&nbsp;"];
[code appendString:line];
[code appendString:@"\n"];
}
[res appendFormat:@"<pre class='first-line: %@;brush: objc'>%@</pre>",[header objectAtIndex:2],code];
[res appendString:@"</td>\n"];
}else{
break;
}
[res appendString:@"</tr>\n"];
}
[res appendString:@"</table>\n"];
//NSLog(@"%@",res);
return (NSString *)res;
txt=[GLFileView parseHTML:txt];
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
NSString *line;
NSMutableDictionary *headers=[NSMutableDictionary dictionary];
NSMutableString *res=[NSMutableString string];
[res appendString:@"<table class='blocks'>\n"];
int i=0;
while(i<[lines count]){
line=[lines objectAtIndex:i];
NSArray *header=[line componentsSeparatedByString:@" "];
if([header count]==4){
NSString *commitID = (NSString *)[header objectAtIndex:0];
int nLines=[(NSString *)[header objectAtIndex:3] intValue];
[res appendFormat:@"<tr class='block l%d'>\n",nLines];
line=[lines objectAtIndex:++i];
if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){
NSString *author=[line stringByReplacingOccurrencesOfString:@"author" withString:@""];
NSString *summary=nil;
while(summary==nil){
line=[lines objectAtIndex:i++];
if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){
summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""];
}
}
NSRange trunc_c={0,7};
NSString *truncate_c=commitID;
if([commitID length]>8){
truncate_c=[commitID substringWithRange:trunc_c];
}
NSRange trunc={0,22};
NSString *truncate_a=author;
if([author length]>22){
truncate_a=[author substringWithRange:trunc];
}
NSString *truncate_s=summary;
if([summary length]>30){
truncate_s=[summary substringWithRange:trunc];
}
NSString *block=[NSString stringWithFormat:@"<td><p class='author'><a href='' onclick='selectCommit(\"%@\"); return false;'>%@</a> %@</p><p class='summary'>%@</p></td>\n<td>\n",commitID,truncate_c,truncate_a,truncate_s];
[headers setObject:block forKey:[header objectAtIndex:0]];
}
[res appendString:[headers objectForKey:[header objectAtIndex:0]]];
NSMutableString *code=[NSMutableString string];
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
line=[line substringFromIndex:1];
[code appendString:line];
[code appendString:@"\n"];
int n;
for(n=1;n<nLines;n++){
do{
line=[lines objectAtIndex:i++];
}while([line characterAtIndex:0]!='\t');
line=[line substringFromIndex:1];
[code appendString:line];
[code appendString:@"\n"];
}
[res appendFormat:@"<pre class='first-line: %@;brush: objc'>%@</pre>",[header objectAtIndex:2],code];
[res appendString:@"</td>\n"];
}else{
break;
}
[res appendString:@"</tr>\n"];
}
[res appendString:@"</table>\n"];
//DLog(@"%@",res);
return (NSString *)res;
}
@@ -517,38 +589,38 @@
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
{
return kFileListSplitViewLeftMin;
return kFileListSplitViewLeftMin;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
{
return [splitView frame].size.width - [splitView dividerThickness] - kFileListSplitViewRightMin;
return [splitView frame].size.width - [splitView dividerThickness] - kFileListSplitViewRightMin;
}
// while the user resizes the window keep the left (file list) view constant and just resize the right view
// unless the right view gets too small
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
{
NSRect newFrame = [splitView frame];
float dividerThickness = [splitView dividerThickness];
NSView *leftView = [[splitView subviews] objectAtIndex:0];
NSRect leftFrame = [leftView frame];
leftFrame.size.height = newFrame.size.height;
if ((newFrame.size.width - leftFrame.size.width - dividerThickness) < kFileListSplitViewRightMin) {
leftFrame.size.width = newFrame.size.width - kFileListSplitViewRightMin - dividerThickness;
}
NSView *rightView = [[splitView subviews] objectAtIndex:1];
NSRect rightFrame = [rightView frame];
rightFrame.origin.x = leftFrame.size.width + dividerThickness;
rightFrame.size.width = newFrame.size.width - rightFrame.origin.x;
rightFrame.size.height = newFrame.size.height;
[leftView setFrame:leftFrame];
[rightView setFrame:rightFrame];
NSRect newFrame = [splitView frame];
float dividerThickness = [splitView dividerThickness];
NSView *leftView = [[splitView subviews] objectAtIndex:0];
NSRect leftFrame = [leftView frame];
leftFrame.size.height = newFrame.size.height;
if ((newFrame.size.width - leftFrame.size.width - dividerThickness) < kFileListSplitViewRightMin) {
leftFrame.size.width = newFrame.size.width - kFileListSplitViewRightMin - dividerThickness;
}
NSView *rightView = [[splitView subviews] objectAtIndex:1];
NSRect rightFrame = [rightView frame];
rightFrame.origin.x = leftFrame.size.width + dividerThickness;
rightFrame.size.width = newFrame.size.width - rightFrame.origin.x;
rightFrame.size.height = newFrame.size.height;
[leftView setFrame:leftFrame];
[rightView setFrame:rightFrame];
}
// NSSplitView does not save and restore the position of the SplitView correctly so do it manually
@@ -570,6 +642,14 @@
[fileListSplitView setHidden:NO];
}
#pragma mark IBActions
-(IBAction)updateSearch:(NSSearchField *)sender
{
[view updateSearch:sender];
}
#pragma mark -
@synthesize groups;
+38 -41
View File
@@ -62,6 +62,7 @@
31460CD6124185BA00B90AED /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB1124185BA00B90AED /* TODO */; };
316E7202131EE9C600AFBB36 /* list_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7200131EE9C600AFBB36 /* list_Template.png */; };
316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */ = {isa = PBXBuildFile; fileRef = 316E7201131EE9C600AFBB36 /* sidebar_Template.png */; };
31776089133569350025876E /* SearchWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 31776088133569350025876E /* SearchWebView.m */; };
31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 31DAA7EC1317737100463846 /* gitx_l_pub.pem */; };
3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; };
3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; };
@@ -72,6 +73,8 @@
47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */; };
551BF11E112F376C00265053 /* gitx_askpasswd_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */; };
551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */ = {isa = PBXBuildFile; fileRef = 551BF111112F371800265053 /* gitx_askpasswd */; };
65D58BC4132D27A8003F7290 /* PBResetSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65D58BC3132D27A7003F7290 /* PBResetSheet.xib */; };
65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 65D58BC6132D48C0003F7290 /* PBResetSheet.m */; };
770B37ED0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */; };
77C8280E06725ACE000B614F /* ApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C8280C06725ACE000B614F /* ApplicationController.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
@@ -138,10 +141,6 @@
D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; };
D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; };
D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; };
EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; };
F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; };
F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; };
F50A41230EBB875D00208746 /* PBNiceSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = F50A41220EBB875D00208746 /* PBNiceSplitView.m */; };
F50FE0E30E07BE9600854FCD /* PBGitRevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */; };
F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; };
F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; };
@@ -352,6 +351,8 @@
31460CB1124185BA00B90AED /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = "<group>"; };
316E7200131EE9C600AFBB36 /* list_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = list_Template.png; sourceTree = "<group>"; };
316E7201131EE9C600AFBB36 /* sidebar_Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sidebar_Template.png; sourceTree = "<group>"; };
31776087133569350025876E /* SearchWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchWebView.h; sourceTree = "<group>"; };
31776088133569350025876E /* SearchWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchWebView.m; sourceTree = "<group>"; };
31DAA7EC1317737100463846 /* gitx_l_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gitx_l_pub.pem; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX_Prefix.pch; sourceTree = "<group>"; };
3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HistoryViewTemplate.png; path = Images/HistoryViewTemplate.png; sourceTree = "<group>"; };
@@ -366,6 +367,9 @@
47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNSURLPathUserDefaultsTransfomer.m; sourceTree = "<group>"; };
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 = "<group>"; };
65D58BC3132D27A7003F7290 /* PBResetSheet.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PBResetSheet.xib; sourceTree = "<group>"; };
65D58BC5132D48BF003F7290 /* PBResetSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBResetSheet.h; sourceTree = "<group>"; };
65D58BC6132D48C0003F7290 /* PBResetSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBResetSheet.m; sourceTree = "<group>"; };
770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = GitTest_DataModel.xcdatamodel; sourceTree = "<group>"; };
77C82804067257F0000B614F /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
77C8280B06725ACE000B614F /* ApplicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationController.h; sourceTree = "<group>"; };
@@ -468,12 +472,6 @@
D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = "<group>"; };
D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = "<group>"; };
D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = "<group>"; };
EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = "<group>"; };
EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = "<group>"; };
F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = "<group>"; };
F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterDimple.tiff; path = Images/mainSplitterDimple.tiff; sourceTree = "<group>"; };
F50A41210EBB875D00208746 /* PBNiceSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBNiceSplitView.h; sourceTree = "<group>"; };
F50A41220EBB875D00208746 /* PBNiceSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNiceSplitView.m; sourceTree = "<group>"; };
F50FE0E10E07BE9600854FCD /* PBGitRevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRevisionCell.h; sourceTree = "<group>"; };
F50FE0E20E07BE9600854FCD /* PBGitRevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRevisionCell.m; sourceTree = "<group>"; };
F51308590E0740F2000C8BCD /* PBQLOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLOutlineView.h; sourceTree = "<group>"; };
@@ -827,7 +825,6 @@
02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */,
F5F7D0641062E7940072C81C /* UpdateKey.pem */,
31DAA7EC1317737100463846 /* gitx_l_pub.pem */,
F50A41130EBB872D00208746 /* Widgets */,
47DBDB920E94F47200671A1E /* Preference Icons */,
D26DC6440E782C9000C777B2 /* gitx.icns */,
8D1107310486CEB800E47090 /* Info.plist */,
@@ -849,6 +846,7 @@
21230ED11285EB5A0046E5A1 /* PBArgumentPicker.xib */,
F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */,
D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */,
65D58BC3132D27A7003F7290 /* PBResetSheet.xib */,
);
name = Resources;
sourceTree = "<group>";
@@ -940,6 +938,8 @@
D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */,
D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */,
D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */,
65D58BC5132D48BF003F7290 /* PBResetSheet.h */,
65D58BC6132D48C0003F7290 /* PBResetSheet.m */,
);
name = Sheets;
sourceTree = "<group>";
@@ -981,15 +981,6 @@
name = "Source View Items";
sourceTree = "<group>";
};
F50A41130EBB872D00208746 /* Widgets */ = {
isa = PBXGroup;
children = (
F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */,
F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */,
);
name = Widgets;
sourceTree = "<group>";
};
F56174540E05887E001DCD79 /* Git */ = {
isa = PBXGroup;
children = (
@@ -1064,10 +1055,6 @@
F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */,
F56244070E9684B0002B6C44 /* PBUnsortableTableHeader.h */,
F56244080E9684B0002B6C44 /* PBUnsortableTableHeader.m */,
F50A41210EBB875D00208746 /* PBNiceSplitView.h */,
F50A41220EBB875D00208746 /* PBNiceSplitView.m */,
EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */,
EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */,
F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */,
F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */,
D823487410CB382C00944BDE /* Terminal.h */,
@@ -1079,6 +1066,8 @@
D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */,
D87129FE122B14EC00012334 /* GitXTextFieldCell.h */,
D87129FF122B14EC00012334 /* GitXTextFieldCell.m */,
31776087133569350025876E /* SearchWebView.h */,
31776088133569350025876E /* SearchWebView.m */,
);
name = Aux;
sourceTree = "<group>";
@@ -1387,8 +1376,6 @@
F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */,
F5E92A230E88569500056E75 /* new_file.png in Resources */,
F5E424110EA3E4D60046E362 /* PBDiffWindow.xib in Resources */,
F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */,
F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */,
056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */,
F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */,
F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */,
@@ -1441,6 +1428,7 @@
31DAA7ED1317737100463846 /* gitx_l_pub.pem in Resources */,
316E7202131EE9C600AFBB36 /* list_Template.png in Resources */,
316E7203131EE9C600AFBB36 /* sidebar_Template.png in Resources */,
65D58BC4132D27A8003F7290 /* PBResetSheet.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1551,7 +1539,6 @@
F5E424150EA3E4E10046E362 /* PBDiffWindowController.m in Sources */,
F5E424180EA3E4EB0046E362 /* PBWebDiffController.m in Sources */,
F5FE6C030EB13BC900F30D12 /* PBServicesController.m in Sources */,
F50A41230EBB875D00208746 /* PBNiceSplitView.m in Sources */,
F5FC41F40EBCBD4300191D80 /* PBGitXProtocol.m in Sources */,
F574A2850EAE2EAC003F2CB1 /* PBRefController.m in Sources */,
F5FC43FE0EBD08EE00191D80 /* PBRefMenuItem.m in Sources */,
@@ -1560,7 +1547,6 @@
47DBDB670E94EE8B00671A1E /* PBPrefsWindowController.m in Sources */,
47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */,
F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */,
EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */,
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */,
D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */,
D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */,
@@ -1610,6 +1596,8 @@
217FF0BA12A1CB3300785A65 /* PBSubmoduleController.m in Sources */,
217FF0BB12A1CB3300785A65 /* PBGitResetController.m in Sources */,
217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */,
65D58BC7132D48C2003F7290 /* PBResetSheet.m in Sources */,
31776089133569350025876E /* SearchWebView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1794,6 +1782,7 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = libgit2;
PRODUCT_NAME = GitX;
SDKROOT = "";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
};
@@ -1820,6 +1809,7 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = libgit2;
PRODUCT_NAME = GitX;
SDKROOT = "";
WRAPPER_EXTENSION = app;
};
name = Release;
@@ -1827,7 +1817,7 @@
26FC0A890875C7B200E6366F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_ENABLE_OBJC_GC = required;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
@@ -1835,29 +1825,25 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
SDKROOT = macosx10.5;
};
name = Debug;
};
26FC0A8A0875C7B200E6366F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
x86_64,
);
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_ENABLE_OBJC_GC = required;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision;
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
SDKROOT = macosx10.5;
};
name = Release;
};
@@ -1881,6 +1867,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = gitx_askpasswd;
SDKROOT = "";
};
name = Debug;
};
@@ -1889,7 +1876,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1903,6 +1890,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = gitx_askpasswd;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -1924,6 +1912,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = gitx_askpasswd;
SDKROOT = "";
};
name = Install;
};
@@ -1947,6 +1936,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = gitx;
SDKROOT = "";
ZERO_LINK = YES;
};
name = Debug;
@@ -1970,6 +1960,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = gitx;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -1981,6 +1972,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = libgit2;
SDKROOT = "";
};
name = Debug;
};
@@ -1991,6 +1983,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PRODUCT_NAME = libgit2;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -2002,6 +1995,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
};
name = Debug;
};
@@ -2013,6 +2007,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
INFOPLIST_PREPROCESS = YES;
PRODUCT_NAME = "Generate PList Prefix";
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -2049,6 +2044,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
};
name = Debug;
};
@@ -2079,6 +2075,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = GitXTesting;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
@@ -2108,7 +2105,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = macosx10.5;
SDKROOT = "";
};
name = Debug;
};
@@ -2133,7 +2130,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = SpeedTest;
SDKROOT = iphoneos2.0;
SDKROOT = "";
ZERO_LINK = NO;
};
name = Release;
+12
View File
@@ -5,3 +5,15 @@
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
#ifndef DLog
#ifdef DEBUG
# define DLog(...) NSLog(__VA_ARGS__)
#else
# define DLog(...) /* */
#endif
#endif
#ifndef ALog
#define ALog(...) DLog(__VA_ARGS__)
#endif
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -451,11 +451,11 @@
// We're widening. See if we can expand this group and still be within availableWidth.
if (((theoreticalOccupiedWidth - contractedWidth) + expandedWidth) > availableWidth) {
// We'd be too wide if we expanded this group. Terminate iteration without updating _firstCollapsedGroup.
//NSLog(@"We'd be too wide if we expanded right now");
//DLog(@"We'd be too wide if we expanded right now");
break;
} // else, continue trying to expand groups.
theoreticalOccupiedWidth = ((theoreticalOccupiedWidth - contractedWidth) + expandedWidth);
//NSLog(@"We can continue expanding");
//DLog(@"We can continue expanding");
}
// Update _firstCollapsedGroup appropriately.
@@ -474,7 +474,7 @@
// Work out how many groups we need to actually change.
NSRange changedRange = NSMakeRange(0, [_groups count]);
BOOL adjusting = YES;
//NSLog(@"Old firstCollapsedGroup: %d, new: %d", oldFirstCollapsedGroup, _firstCollapsedGroup);
//DLog(@"Old firstCollapsedGroup: %d, new: %d", oldFirstCollapsedGroup, _firstCollapsedGroup);
if (_firstCollapsedGroup != oldFirstCollapsedGroup) {
if (narrower) {
// Narrower. _firstCollapsedGroup will be less (earlier) than oldFirstCollapsedGroup.
@@ -492,7 +492,7 @@
// If a change is required, ensure that each group is expanded or contracted as appropriate.
if (adjusting || shouldAdjustPopups) {
//NSLog(@"Got %@ - modifying groups %@", ((narrower) ? @"narrower" : @"wider"), NSStringFromRange(changedRange));
//DLog(@"Got %@ - modifying groups %@", ((narrower) ? @"narrower" : @"wider"), NSStringFromRange(changedRange));
NSInteger nextXCoord = NSNotFound;
if (adjusting) {
int i;
+1 -1
View File
@@ -16,7 +16,7 @@
@synthesize stashSourceMessage;
- initWithRawStashLine:(NSString *) stashLineFromStashListOutput {
if (self = [super init]) {
if ((self = [super init])) {
stashRawString = [stashLineFromStashListOutput retain];
NSArray *lineComponents = [stashLineFromStashListOutput componentsSeparatedByString:@":"];
name = [[lineComponents objectAtIndex:0] retain];
+1
View File
@@ -13,6 +13,7 @@ typedef enum {
PBGitSubmoduleStateNotInitialized,
PBGitSubmoduleStateMatchingIndex,
PBGitSubmoduleStateDoesNotMatchIndex,
PBGitSubmoduleStateFailed,
} PBGitSubmoduleState;
@interface PBGitSubmodule : NSObject<PBPresentable> {
+7 -3
View File
@@ -32,9 +32,13 @@
- (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString {
NSParameterAssert([submoduleStatusString length] > 0);
if (self = [super init]) {
if ((self = [super init])) {
unichar status = [submoduleStatusString characterAtIndex:0];
submoduleState = [PBGitSubmodule submoduleStateFromCharacter:status];
if (submoduleState == PBGitSubmoduleStateFailed) {
DLog(@"Submodule status failed:\n %@", submoduleStatusString);
return nil;
}
NSScanner *scanner = [NSScanner scannerWithString:[submoduleStatusString substringFromIndex:1]];
NSString *sha1 = nil;
NSString *fullPath = nil;
@@ -47,7 +51,7 @@
shouldContinue = [scanner scanString:@"(" intoString:NULL];
}
if (shouldContinue) {
shouldContinue = [scanner scanUpToString:@")" intoString:&coName];
[scanner scanUpToString:@")" intoString:&coName];
}
self.path = [fullPath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
coName = [coName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
@@ -114,7 +118,7 @@
} else if (character == '+') {
state = PBGitSubmoduleStateDoesNotMatchIndex;
} else if (character != ' ') {
NSAssert1(NO, @"Ooops unsupported submodule status character: %c", character);
return PBGitSubmoduleStateFailed;
}
return state;
+2 -2
View File
@@ -26,9 +26,9 @@
{
NSAssert(status == NEW || self.commitBlobSHA, @"File is not new, but doesn't have an index entry!");
if (!self.commitBlobSHA)
return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@\0", self.path];
return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@", self.path];
else
return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path];
return [NSString stringWithFormat:@"%@ %@\t%@", self.commitBlobMode, self.commitBlobSHA, self.path];
}
+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus {
+1 -1
View File
@@ -71,7 +71,7 @@
if (code == NSOKButton) {
NSString *clonePath = [(NSOpenPanel *)sheet filename];
NSLog(@"clone path = %@", clonePath);
DLog(@"clone path = %@", clonePath);
[self.repository cloneRepositoryToPath:clonePath bare:self.isBare];
}
}
-29
View File
@@ -1,29 +0,0 @@
//
// PBCollapsibleSplitView.h
// GitX
//
// This is a limited subclass of a SplitView. It adds methods to aid in
// collapsing/uncollapsing subviews using the mouse or programmatically.
// Right now it only works for vertical layouts and with two subviews.
//
// Created by Johannes Gilger on 6/21/09.
// Copyright 2009 Johannes Gilger. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PBNiceSplitView.h"
@interface PBCollapsibleSplitView : PBNiceSplitView {
CGFloat topViewMin;
CGFloat bottomViewMin;
CGFloat splitterPosition;
}
@property (readonly) CGFloat topViewMin;
@property (readonly) CGFloat bottomViewMin;
- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin;
- (void)uncollapse;
- (void)keyDown:(NSEvent *)event;
@end
-57
View File
@@ -1,57 +0,0 @@
//
// PBCollapsibleSplitView.m
// GitX
//
// Created by Johannes Gilger on 6/21/09.
// Copyright 2009 Johannes Gilger. All rights reserved.
//
#import "PBCollapsibleSplitView.h"
@implementation PBCollapsibleSplitView
@synthesize topViewMin, bottomViewMin;
- (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin {
topViewMin = topMin;
bottomViewMin = bottomMin;
}
- (void)uncollapse {
for (NSView *subview in [self subviews]) {
if([self isSubviewCollapsed:subview]) {
[self setPosition:[self frame].size.height / 3 ofDividerAtIndex:0];
[self adjustSubviews];
}
}
}
- (void)collapseSubview:(NSInteger)index {
// Already collapsed, just uncollapse
if ([self isSubviewCollapsed:[[self subviews] objectAtIndex:index]]) {
[self setPosition:splitterPosition ofDividerAtIndex:0];
return;
}
// Store splitterposition if the other view isn't collapsed
if (![self isSubviewCollapsed:[[self subviews] objectAtIndex:(index + 1) % 2]])
splitterPosition = [[[self subviews] objectAtIndex:0] frame].size.height;
if (index == 0) // Top view
[self setPosition:0.0 ofDividerAtIndex:0];
else // Bottom view
[self setPosition:[self frame].size.height ofDividerAtIndex:0];
}
- (void)keyDown:(NSEvent *)event {
if (!([event modifierFlags] & NSShiftKeyMask && [event modifierFlags] & NSCommandKeyMask))
return [super keyDown:event];
if ([event keyCode] == 0x07E) { // Up-Key
[self collapseSubview:0];
[[self window] makeFirstResponder:[[self subviews] objectAtIndex:1]];
} else if ([event keyCode] == 0x07D) { // Down-Key
[self collapseSubview:1];
[[self window] makeFirstResponder:[[self subviews] objectAtIndex:0]];
}
}
@end
+1 -1
View File
@@ -18,7 +18,7 @@
@synthesize command;
- initWithCommand:(PBCommand *) aCommand {
if (self = [super init]) {
if ((self = [super init])) {
self.command = aCommand;
super.title = [aCommand displayName];
[self setTarget:aCommand];
+6 -6
View File
@@ -63,7 +63,7 @@
// a little bit depending on how much the bottom half of the split view is dragged down.
- (NSRect)adjustScroll:(NSRect)proposedVisibleRect {
//NSLog(@"[%@ %s]: proposedVisibleRect: %@", [self class], _cmd, NSStringFromRect(proposedVisibleRect));
//DLog(@"[%@ %s]: proposedVisibleRect: %@", [self class], _cmd, NSStringFromRect(proposedVisibleRect));
NSRect newRect = proposedVisibleRect;
// !!! Andre Berg 20100330: only modify if -scrollSelectionToTopOfViewFrom: has set useAdjustScroll to YES
@@ -74,18 +74,18 @@
NSInteger adj = rh - ny;
// check the targeted row and see if we need to add or subtract the difference (if there is one)...
NSRect sr = [self rectOfRow:[self selectedRow]];
// NSLog(@"[%@ %s]: selectedRow %d, rect: %@", [self class], _cmd, [self selectedRow], NSStringFromRect(sr));
// DLog(@"[%@ %s]: selectedRow %d, rect: %@", [self class], _cmd, [self selectedRow], NSStringFromRect(sr));
if (sr.origin.y > proposedVisibleRect.origin.y) {
// NSLog(@"[%@ %s] selectedRow.origin.y > proposedVisibleRect.origin.y. adding adj (%d)", [self class], _cmd, adj);
// DLog(@"[%@ %s] selectedRow.origin.y > proposedVisibleRect.origin.y. adding adj (%d)", [self class], _cmd, adj);
newRect = NSMakeRect(newRect.origin.x, newRect.origin.y + adj, newRect.size.width, newRect.size.height);
} else if (sr.origin.y < proposedVisibleRect.origin.y) {
// NSLog(@"[%@ %s] selectedRow.origin.y < proposedVisibleRect.origin.y. subtracting ny (%d)", [self class], _cmd, ny);
// DLog(@"[%@ %s] selectedRow.origin.y < proposedVisibleRect.origin.y. subtracting ny (%d)", [self class], _cmd, ny);
newRect = NSMakeRect(newRect.origin.x, newRect.origin.y - ny , newRect.size.width, newRect.size.height);
} else {
// NSLog(@"[%@ %s] selectedRow.origin.y == proposedVisibleRect.origin.y. leaving as is", [self class], _cmd);
// DLog(@"[%@ %s] selectedRow.origin.y == proposedVisibleRect.origin.y. leaving as is", [self class], _cmd);
}
}
//NSLog(@"[%@ %s]: newRect: %@", [self class], _cmd, NSStringFromRect(newRect));
//DLog(@"[%@ %s]: newRect: %@", [self class], _cmd, NSStringFromRect(newRect));
return newRect;
}
+8 -2
View File
@@ -10,6 +10,7 @@
#import "PBGitRepository.h"
#import "PBGitCommit.h"
#import "PBGitDefaults.h"
#import "GLFileView.h"
@implementation PBDiffWindowController
@@ -21,6 +22,7 @@
return nil;
diff = aDiff;
return self;
}
@@ -47,11 +49,15 @@
int retValue;
NSString *diff = [startCommit.repository outputInWorkdirForArguments:arguments retValue:&retValue];
if (retValue) {
NSLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff);
DLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff);
return;
}
diff=[GLFileView parseDiff:diff];
diff=[diff stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[startCommit realSha]];
diff=[diff stringByReplacingOccurrencesOfString:@"{SHA}" withString:[diffCommit realSha]];
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]];
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diff];
[diffController showWindow:nil];
}
+1 -1
View File
@@ -7,7 +7,7 @@
//
#import <Cocoa/Cocoa.h>
#import "GitX_Prefix.pch"
@interface PBEasyPipe : NSObject {
+3 -4
View File
@@ -8,7 +8,6 @@
#import "PBEasyPipe.h"
@implementation PBEasyPipe
+ (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args
@@ -33,9 +32,9 @@
[task setCurrentDirectoryPath:dir];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Show Debug Messages"])
NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir);
DLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir);
#ifdef CLI
NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir);
DLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir);
#endif
NSPipe* pipe = [NSPipe pipe];
@@ -128,7 +127,7 @@
data = [handle readDataToEndOfFile];
}
@catch (NSException * e) {
NSLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd));
DLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd));
if ([NSThread currentThread] != [NSThread mainThread])
[task waitUntilExit];
+1
View File
@@ -7,6 +7,7 @@
//
#import <Cocoa/Cocoa.h>
#import "GitX_Prefix.pch"
#define MIN_GIT_VERSION "1.6.0"
+2 -2
View File
@@ -43,7 +43,7 @@ static NSString* gitPath = nil;
return YES;
}
NSLog(@"Found a git binary at %@, but is only version %@", path, version);
DLog(@"Found a git binary at %@, but is only version %@", path, version);
return NO;
}
@@ -80,7 +80,7 @@ static NSString* gitPath = nil;
return;
}
NSLog(@"Could not find a git binary higher than version " MIN_GIT_VERSION);
DLog(@"Could not find a git binary higher than version " MIN_GIT_VERSION);
}
+ (NSString *) path;
+5 -5
View File
@@ -11,7 +11,6 @@
#import "PBChangedFile.h"
#import "PBWebChangesController.h"
#import "PBGitIndex.h"
#import "PBNiceSplitView.h"
#define kCommitSplitViewPositionDefault @"Commit SplitView Position"
@@ -172,6 +171,7 @@
[commitMessageView setEditable:YES];
[commitMessageView setString:@""];
[webController setStateMessage:[NSString stringWithFormat:[[notification userInfo] objectForKey:@"description"]]];
[repository reloadRefs];
}
- (void)commitFailed:(NSNotification *)notification
@@ -228,16 +228,16 @@
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
{
if (splitView == commitSplitView)
if (proposedMin < kCommitSplitViewTopViewMin)
return kCommitSplitViewTopViewMin;
return proposedMin;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
{
if (splitView == commitSplitView)
return [splitView frame].size.height - [splitView dividerThickness] - kCommitSplitViewBottomViewMin;
CGFloat max=[splitView frame].size.height - [splitView dividerThickness] - kCommitSplitViewBottomViewMin;
if (max < proposedMax)
return max;
return proposedMax;
}
+1 -1
View File
@@ -41,7 +41,7 @@
int ret;
[PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:array inDir:nil retValue:&ret];
if (ret)
NSLog(@"Writing to config file failed!");
DLog(@"Writing to config file failed!");
[self didChangeValueForKey:[key substringToIndex:[key rangeOfString:@"."].location]];
}
+1 -1
View File
@@ -137,7 +137,7 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in
previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines];
if (currentLine > maxLines)
NSLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines);
DLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines);
previous.nLines = currentLine;
previous.sign = commit.sign;
+4 -6
View File
@@ -10,7 +10,6 @@
#import "PBGitCommit.h"
#import "PBGitTree.h"
#import "PBViewController.h"
#import "PBCollapsibleSplitView.h"
@class PBGitSidebarController;
@class PBWebHistoryController;
@@ -23,7 +22,7 @@
@class PBHistorySearchController;
@interface PBGitHistoryController : PBViewController {
@interface PBGitHistoryController : PBViewController <NSOutlineViewDelegate>{
IBOutlet PBRefController *refController;
IBOutlet NSSearchField *searchField;
IBOutlet NSArrayController* commitController;
@@ -32,7 +31,7 @@
IBOutlet NSOutlineView* fileBrowser;
NSArray *currentFileBrowserSelectionPath;
IBOutlet PBCommitList* commitList;
IBOutlet PBCollapsibleSplitView *historySplitView;
IBOutlet NSSplitView *historySplitView;
IBOutlet PBWebHistoryController *webHistoryController;
QLPreviewPanel* previewPanel;
IBOutlet PBHistorySearchController *searchController;
@@ -55,10 +54,11 @@
PBGitTree *gitTree;
PBGitCommit *webCommit;
PBGitCommit *selectedCommit;
PBGitCommit *selectedCommitBeforeRefresh;
}
@property (readonly) NSTreeController* treeController;
@property (readonly) PBCollapsibleSplitView *historySplitView;
@property (readonly) NSSplitView *historySplitView;
@property (assign) int selectedCommitDetailsIndex;
@property (retain) PBGitCommit *webCommit;
@property (retain) PBGitTree* gitTree;
@@ -106,7 +106,5 @@
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview;
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex;
- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset;
- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset;
@end
+23 -38
View File
@@ -83,7 +83,7 @@
// Add a menu that allows a user to select which columns to view
[[commitList headerView] setMenu:[self tableColumnMenu]];
[historySplitView setTopMin:58.0 andBottomMin:100.0];
// [historySplitView setTopMin:58.0 andBottomMin:100.0];
[historySplitView setHidden:YES];
[self performSelector:@selector(restoreSplitViewPositiion) withObject:nil afterDelay:0];
@@ -250,7 +250,9 @@
}else if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) {
[self updateStatus];
if ([repository.currentBranch isSimpleRef])
if (selectedCommitBeforeRefresh && [repository commitForSHA:[selectedCommitBeforeRefresh sha]])
[self selectCommit:[selectedCommitBeforeRefresh sha]];
else if ([repository.currentBranch isSimpleRef])
[self selectCommit:[repository shaForRef:[repository.currentBranch ref]]];
else
[self selectCommit:[[self firstCommit] sha]];
@@ -405,11 +407,13 @@
- (IBAction) refresh:(id)sender
{
selectedCommitBeforeRefresh = selectedCommit;
[repository forceUpdateRevisions];
}
- (void) updateView
{
[self refresh: nil];
[self updateKeys];
}
@@ -624,42 +628,6 @@
return FALSE;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
{
return historySplitView.topViewMin;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
{
return [splitView frame].size.height - [splitView dividerThickness] - historySplitView.bottomViewMin;
}
// while the user resizes the window keep the upper (history) view constant and just resize the lower view
// unless the lower view gets too small
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
{
NSRect newFrame = [splitView frame];
float dividerThickness = [splitView dividerThickness];
NSView *upperView = [[splitView subviews] objectAtIndex:0];
NSRect upperFrame = [upperView frame];
upperFrame.size.width = newFrame.size.width;
if ((newFrame.size.height - upperFrame.size.height - dividerThickness) < historySplitView.bottomViewMin) {
upperFrame.size.height = newFrame.size.height - historySplitView.bottomViewMin - dividerThickness;
}
NSView *lowerView = [[splitView subviews] objectAtIndex:1];
NSRect lowerFrame = [lowerView frame];
lowerFrame.origin.y = upperFrame.size.height + dividerThickness;
lowerFrame.size.height = newFrame.size.height - lowerFrame.origin.y;
lowerFrame.size.width = newFrame.size.width;
[upperView setFrame:upperFrame];
[lowerView setFrame:lowerFrame];
}
// NSSplitView does not save and restore the position of the SplitView correctly so do it manually
- (void)saveSplitViewPosition
{
@@ -680,6 +648,23 @@
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
{
if (proposedMin < 100)
return 100;
return proposedMin;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
{
CGFloat max=[splitView frame].size.height - [splitView dividerThickness] - 100;
if (max < proposedMax)
return max;
return proposedMax;
}
#pragma mark Repository Methods
- (IBAction) createBranch:(id)sender
+1 -1
View File
@@ -65,7 +65,7 @@
}
}
//NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start];
//NSLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration);
//DLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration);
[self sendCommits:commits];
[delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO];
+720 -916
View File
File diff suppressed because it is too large Load Diff
+16 -23
View File
@@ -235,6 +235,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
return;
repository.hasChanged = YES;
[repository reloadRefs];
amendEnvironment = nil;
if (amend)
@@ -299,7 +300,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
PBChangedFile *file = [stageFiles objectAtIndex:i];
[input appendFormat:@"%@\0", file.path];
[input appendFormat:@"%@", file.path];
}
@@ -390,9 +391,9 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
- (void)discardChangesForFiles:(NSArray *)discardFiles
{
NSArray *paths = [discardFiles valueForKey:@"path"];
NSString *input = [paths componentsJoinedByString:@"\0"];
NSString *input = [paths componentsJoinedByString:@"\n"];
NSArray *arguments = [NSArray arrayWithObjects:@"checkout-index", @"--index", @"--quiet", @"--force", @"-z", @"--stdin", nil];
NSArray *arguments = [NSArray arrayWithObjects:@"checkout-index", @"--index", @"--quiet", @"--force", @"--stdin", nil];
int ret = 1;
[PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:[workingDirectory path] inputString:input retValue:&ret];
@@ -499,7 +500,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
// Other files (not tracked, not ignored)
refreshStatus++;
NSFileHandle *handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
withArgs:[NSArray arrayWithObjects:@"ls-files", @"--others", @"--exclude-standard", @"-z", nil]
withArgs:[NSArray arrayWithObjects:@"ls-files", @"--others", @"--exclude-standard", nil]
inDir:[workingDirectory path]];
[nc addObserver:self selector:@selector(readOtherFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
[handle readToEndOfFileInBackgroundAndNotify];
@@ -507,7 +508,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
// Unstaged files
refreshStatus++;
handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
withArgs:[NSArray arrayWithObjects:@"diff-files", @"-z", nil]
withArgs:[NSArray arrayWithObjects:@"diff-files", nil]
inDir:[workingDirectory path]];
[nc addObserver:self selector:@selector(readUnstagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
[handle readToEndOfFileInBackgroundAndNotify];
@@ -515,7 +516,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
// Staged files
refreshStatus++;
handle = [PBEasyPipe handleForCommand:[PBGitBinary path]
withArgs:[NSArray arrayWithObjects:@"diff-index", @"--cached", @"-z", [self parentTree], nil]
withArgs:[NSArray arrayWithObjects:@"diff-index", @"--cached", [self parentTree], nil]
inDir:[workingDirectory path]];
[nc addObserver:self selector:@selector(readStagedFiles:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
[handle readToEndOfFileInBackgroundAndNotify];
@@ -641,35 +642,27 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed";
return [NSArray array];
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
// FIXME: throw an error?
if (!string)
return [NSArray array];
// Strip trailing null
if ([string hasSuffix:@"\0"])
string = [string substringToIndex:[string length]-1];
if ([string length] == 0)
return [NSArray array];
return [string componentsSeparatedByString:@"\0"];
string=[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
return [string componentsSeparatedByString:@"\n"];
}
- (NSMutableDictionary *)dictionaryForLines:(NSArray *)lines
{
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[lines count]/2];
// Fill the dictionary with the new information. These lines are in the form of:
// :00000 :0644 OTHER INDEX INFORMATION
// Filename
NSAssert1([lines count] % 2 == 0, @"Lines must have an even number of lines: %@", lines);
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:[lines count]];
NSEnumerator *enumerator = [lines objectEnumerator];
NSString *fileStatus;
while (fileStatus = [enumerator nextObject]) {
NSString *fileName = [enumerator nextObject];
[dictionary setObject:[fileStatus componentsSeparatedByString:@" "] forKey:fileName];
NSString *line;
while ((line = [enumerator nextObject])) {
NSArray *lineComp=[line componentsSeparatedByString:@"\t"];
NSArray *fileStatus=[[lineComp objectAtIndex:0] componentsSeparatedByString:@" "];
NSString *fileName = [lineComp objectAtIndex:1];
[dictionary setObject:fileStatus forKey:fileName];
}
return dictionary;
+1 -1
View File
@@ -17,7 +17,7 @@
//---------------------------------------------------------------------------------------------
- initWithSourceObject:(id<PBPresentable>) anObject {
if (self = [super init]) {
if ((self = [super init])) {
super.title = [anObject displayDescription];
sourceObject = [anObject retain];
}
+27 -15
View File
@@ -143,7 +143,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
NSURL* gitDirURL = [PBGitRepository gitDirForURL:[self fileURL]];
if (!gitDirURL) {
if (outError) {
NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileName]]
NSDictionary* userInfo = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"%@ does not appear to be a git repository.", [self fileURL]]
forKey:NSLocalizedRecoverySuggestionErrorKey];
*outError = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo];
}
@@ -690,22 +690,34 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
}
NSString *remoteName = [remoteRef remoteName];
[arguments addObject:remoteName];
NSString *branchName = nil;
if ([ref isRemote] || !ref) {
branchName = @"all updates";
}
else if ([ref isTag]) {
branchName = [NSString stringWithFormat:@"tag '%@'", [ref tagName]];
[arguments addObject:@"tag"];
[arguments addObject:[ref tagName]];
}
else {
branchName = [ref shortName];
[arguments addObject:branchName];
NSString *actionType = nil;
if ([config valueForKeyPath:[NSString stringWithFormat:@"remote.%@.mirror", remoteName]]) {
// we must check for mirror parameter in config.
// if we push branch name in this case to the arguments, push failed
actionType = @"Mirroring";
} else {
if ([ref isRemote] || !ref) {
branchName = @"all updates";
}
else if ([ref isTag]) {
branchName = [NSString stringWithFormat:@"tag '%@'", [ref tagName]];
[arguments addObject:@"tag"];
[arguments addObject:[ref tagName]];
}
else {
branchName = [ref shortName];
[arguments addObject:branchName];
}
actionType = [NSString stringWithFormat:@"Pushing %@", branchName];
}
NSString *description = [NSString stringWithFormat:@"Pushing %@ to %@", branchName, remoteName];
NSString *description = [actionType stringByAppendingFormat:@" to %@", remoteName];
NSString *title = @"Pushing to remote";
[PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self];
}
@@ -1270,7 +1282,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
- (void) finalize
{
NSLog(@"Dealloc of repository");
//DLog(@"Dealloc of repository");
[super finalize];
}
@end
+4 -4
View File
@@ -165,7 +165,7 @@ using namespace std;
if (parentString.size() != 0)
{
if (((parentString.size() + 1) % 41) != 0) {
NSLog(@"invalid parents: %zu", parentString.size());
DLog(@"invalid parents: %zu", parentString.size());
continue;
}
int nParents = (parentString.size() + 1) / 41;
@@ -191,7 +191,7 @@ using namespace std;
stream >> c; // Remove separator
stream >> c;
if (c != '>' && c != '<' && c != '^' && c != '-')
NSLog(@"Error loading commits: sign not correct");
DLog(@"Error loading commits: sign not correct");
[newCommit setSign: c];
}
@@ -216,7 +216,7 @@ using namespace std;
if (![currentThread isCancelled]) {
NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start];
NSLog(@"Loaded %i commits in %f seconds (%f/sec)", num, duration, num/duration);
DLog(@"Loaded %i commits in %f seconds (%f/sec)", num, duration, num/duration);
// Make sure the commits are stored before exiting.
NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil];
@@ -225,7 +225,7 @@ using namespace std;
[self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO];
}
else {
NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd));
DLog(@"[%@ %@] thread has been canceled", [self class], NSStringFromSelector(_cmd));
}
[task terminate];
+1 -1
View File
@@ -13,7 +13,7 @@
@class PBGitHistoryController;
@class PBGitCommitController;
@interface PBGitSidebarController : PBViewController {
@interface PBGitSidebarController : PBViewController <NSOutlineViewDelegate>{
IBOutlet NSWindow *window;
IBOutlet NSOutlineView *sourceView;
IBOutlet NSView *sourceListControlsView;
+4 -3
View File
@@ -170,8 +170,9 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged";
-(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote
{
NSLog(@"remote.title=%@",[remote title]);
[remote setAlert:[self remoteNeedFetch:[remote title]]];
DLog(@"remote.title=%@",[remote title]);
if([remote isKindOfClass:[PBGitSVRemoteItem class]])
[remote setAlert:[self remoteNeedFetch:[remote title]]];
}
-(NSNumber *)countCommintsOf:(NSString *)range
@@ -244,7 +245,7 @@ static NSString * const kObservingContextSubmodules = @"submodulesChanged";
PBSourceViewItem *item = [self selectedItem];
if ([item isKindOfClass:[PBGitMenuItem class]]) {
PBGitMenuItem *sidebarItem = (PBGitMenuItem *) item;
NSObject *sourceObject = [sidebarItem sourceObject];
id<PBPresentable> sourceObject = [sidebarItem sourceObject];
if ([sourceObject isKindOfClass:[PBGitSubmodule class]]) {
[[repository.submoduleController defaultCommandForSubmodule:(id)sourceObject] invoke];
}
+9 -14
View File
@@ -113,16 +113,6 @@
return NO;
}
- (BOOL)hasBinaryHeader:(NSString*)contents
{
if (!contents)
return NO;
return [contents rangeOfString:@"\0"
options:0
range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound;
}
- (BOOL)hasBinaryAttributes
{
// First ask git check-attr if the file has a binary attribute custom set
@@ -231,12 +221,12 @@
}
res=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff", sha, des,[self fullPath], nil]];
if ([res length]==0) {
NSLog(@"--%d",[res length]);
DLog(@"--%@",[res length]);
if (anError != NULL) {
*anError = [NSError errorWithDomain:@"diff" code:1 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"No Diff",NSLocalizedDescriptionKey,nil]];
}
}else{
NSLog(@"--%@",[res substringToIndex:80]);
DLog(@"--%@",[res substringToIndex:80]);
}
}else{
if (anError != NULL) {
@@ -296,7 +286,7 @@
NSData* data = [handle readDataToEndOfFile];
[data writeToFile:newName atomically:YES];
} else { // Directory
[[NSFileManager defaultManager] createDirectoryAtPath:newName attributes:nil];
[[NSFileManager defaultManager] createDirectoryAtPath:newName withIntermediateDirectories:YES attributes:nil error:nil];
for (PBGitTree* child in [self children])
[child saveToFolder: newName];
}
@@ -383,7 +373,12 @@
- (void) finalize
{
if (localFileName)
[[NSFileManager defaultManager] removeFileAtPath:localFileName handler:nil];
[[NSFileManager defaultManager] removeItemAtPath:localFileName error:nil];
[super finalize];
}
- (BOOL)isEqualTo:(PBGitTree *)object
{
return [sha isEqualTo:[object sha]] && [[self fullPath] isEqualTo:[object fullPath]];
}
@end
+8 -4
View File
@@ -14,14 +14,14 @@
@class PBViewController, PBGitSidebarController, PBGitCommitController;
@interface PBGitWindowController : NSWindowController {
@interface PBGitWindowController : NSWindowController <NSWindowDelegate>{
__weak PBGitRepository* repository;
PBViewController *contentController;
PBGitSidebarController *sidebarController;
IBOutlet NSView *sourceListControlsView;
IBOutlet NSSplitView *splitView;
IBOutlet NSSplitView *mainSplitView;
IBOutlet NSView *sourceSplitView;
IBOutlet NSView *contentSplitView;
@@ -30,6 +30,9 @@
IBOutlet NSToolbarItem *terminalItem;
IBOutlet NSToolbarItem *finderItem;
NSArray *splitViews;
NSMutableArray *splitViewsSize;
}
@property (assign) __weak PBGitRepository *repository;
@@ -42,7 +45,9 @@
- (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText;
- (void)showErrorSheet:(NSError *)error;
- (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output;
- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show;
-(void)initChangeLayout;
-(IBAction)changeLayout:(id)sender;
- (IBAction) showCommitView:(id)sender;
- (IBAction) showHistoryView:(id)sender;
@@ -50,7 +55,6 @@
- (IBAction) openInTerminal:(id)sender;
- (IBAction) cloneTo:(id)sender;
- (IBAction) refresh:(id)sender;
- (IBAction) changeLayout:(id)sender;
- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode;
+82 -50
View File
@@ -25,19 +25,19 @@
{
if (!(self = [self initWithWindowNibName:@"RepositoryWindow"]))
return nil;
self.repository = theRepository;
return self;
}
- (void)windowWillClose:(NSNotification *)notification
{
NSLog(@"Window will close!");
//DLog(@"Window will close!");
if (sidebarController)
[sidebarController closeView];
if (contentController)
[contentController removeObserver:self forKeyPath:@"status"];
}
@@ -59,22 +59,23 @@
[[self window] setDelegate:self];
[[self window] setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge];
[[self window] setContentBorderThickness:31.0f forEdge:NSMinYEdge];
sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self];
[[sidebarController view] setFrame:[sourceSplitView bounds]];
[sourceSplitView addSubview:[sidebarController view]];
[sourceListControlsView addSubview:sidebarController.sourceListControlsView];
[[statusField cell] setBackgroundStyle:NSBackgroundStyleRaised];
[progressIndicator setUsesThreadedAnimation:YES];
NSImage *finderImage = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kFinderIcon)];
[finderItem setImage:finderImage];
NSImage *terminalImage = [[NSWorkspace sharedWorkspace] iconForFile:@"/Applications/Utilities/Terminal.app/"];
[terminalItem setImage:terminalImage];
[self showWindow:nil];
[self initChangeLayout];
}
- (void) removeAllContentSubViews
@@ -88,17 +89,17 @@
{
if (!controller || (contentController == controller))
return;
if (contentController)
[contentController removeObserver:self forKeyPath:@"status"];
[self removeAllContentSubViews];
contentController = controller;
[[contentController view] setFrame:[contentSplitView bounds]];
[contentSplitView addSubview:[contentController view]];
[self setNextResponder: contentController];
[[self window] makeFirstResponder:[contentController firstResponder]];
[contentController updateView];
@@ -197,21 +198,22 @@
- (IBAction) refresh:(id)sender
{
[contentController refresh:self];
[sidebarController.historyViewController refresh: self];
[sidebarController.commitViewController refresh: self];
}
- (void) updateStatus
{
NSString *status = contentController.status;
BOOL isBusy = contentController.isBusy;
if (!status) {
status = @"";
isBusy = NO;
}
[statusField setStringValue:status];
if (isBusy) {
[progressIndicator startAnimation:self];
[progressIndicator setHidden:NO];
@@ -228,7 +230,7 @@
[self updateStatus];
return;
}
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
@@ -237,47 +239,77 @@
[sidebarController setHistorySearch:searchString mode:mode];
}
- (IBAction) changeLayout:(id)sender{
NSLog(@"selectedSegment=%ld (%d)",[sender selectedSegment],[sender isSelectedForSegment:[sender selectedSegment]]);
NSSplitView *sp=nil;
switch ([sender selectedSegment]) {
case 0:
sp=splitView;
break;
case 1:
sp=[[sidebarController historyViewController] historySplitView];
break;
}
NSLog(@"sp=%@",sp);
if(sp!=nil) {
[self collapseSplitView:sp show:[sender isSelectedForSegment:[sender selectedSegment]]];
}
#pragma mark - SplitView changeLayout
-(void)initChangeLayout
{
splitViews=[NSArray arrayWithObjects:mainSplitView,[[sidebarController historyViewController] historySplitView], nil];
splitViewsSize=[NSMutableArray arrayWithCapacity:[splitViews count]];
for (int n=0; n<[splitViews count]; n++) {
NSSplitView *splitView=[splitViews objectAtIndex:n];
NSView *left=[[splitView subviews] objectAtIndex:0];
[splitViewsSize addObject:[NSNumber numberWithInt:[left frame].size.width]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(resizeSubviewsHandler:)
name:NSSplitViewWillResizeSubviewsNotification
object:splitView
];
}
}
- (void)collapseSplitView:(NSSplitView *)sp show:(BOOL)show{
NSView *clipview = [[sp subviews] objectAtIndex:0];
NSRect clipFrame = [clipview frame];
- (IBAction)changeLayout:(id)sender
{
NSInteger index=[sender selectedSegment];
NSSplitView *splitView=[splitViews objectAtIndex:index];
NSView *left=[[splitView subviews] objectAtIndex:0];
CGFloat pos;
if ([splitView isSubviewCollapsed:left])
pos=[[splitViewsSize objectAtIndex:index] intValue];
else
pos=[splitView minPossiblePositionOfDividerAtIndex:0];
if ([sp isVertical]) {
clipFrame.size.width = kGitSplitViewMinWidth * show;
}else{
clipFrame.size.height = kGitSplitViewMinWidth * show;
}
[splitView setPosition:pos ofDividerAtIndex:0 ];
}
[[clipview animator] setFrame:clipFrame];
[sp adjustSubviews];
- (void)resizeSubviewsHandler:(NSNotification *)notif
{
NSSplitView *splitView=[notif object];
NSInteger index=[splitViews indexOfObject:splitView];
NSView *left=[[splitView subviews] objectAtIndex:0];
NSNumber *pos;
if([splitView isVertical]){
pos=[NSNumber numberWithInt:[left frame].size.width];
}else{
pos=[NSNumber numberWithInt:[left frame].size.height];
}
[splitViewsSize removeObjectAtIndex:index];
[splitViewsSize insertObject:pos atIndex:index];
}
#pragma mark -
#pragma mark SplitView Delegates
- (BOOL)splitView:(NSSplitView *)sp canCollapseSubview:(NSView *)subview
{
return TRUE;
}
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex
{
NSUInteger index = [[splitView subviews] indexOfObject:subview];
return index==0;
}
#pragma mark min/max widths while moving the divider
- (CGFloat)splitView:(NSSplitView *)view constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
{
if (proposedMin < kGitSplitViewMinWidth)
return kGitSplitViewMinWidth;
return proposedMin;
}
@@ -285,7 +317,7 @@
{
if (dividerIndex == 0)
return kGitSplitViewMaxWidth;
return proposedMax;
}
@@ -294,19 +326,19 @@
- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize
{
NSRect newFrame = [sender frame];
float dividerThickness = [sender dividerThickness];
NSView *sourceView = [[sender subviews] objectAtIndex:0];
NSRect sourceFrame = [sourceView frame];
sourceFrame.size.height = newFrame.size.height;
NSView *mainView = [[sender subviews] objectAtIndex:1];
NSRect mainFrame = [mainView frame];
mainFrame.origin.x = sourceFrame.size.width + dividerThickness;
mainFrame.size.width = newFrame.size.width - mainFrame.origin.x;
mainFrame.size.height = newFrame.size.height;
[sourceView setFrame:sourceFrame];
[mainView setFrame:mainFrame];
}
+3 -3
View File
@@ -17,7 +17,7 @@
// note that this leaks!
CFRetain(client);
if (self = [super initWithRequest:request cachedResponse:cachedResponse client:client])
if ((self = [super initWithRequest:request cachedResponse:cachedResponse client:client]))
{
}
@@ -47,10 +47,10 @@
if ([[url host] isEqualToString:@"app"]) {
NSString *app=[[url path] substringFromIndex:1];
NSString *appPath=[[NSWorkspace sharedWorkspace] fullPathForApplication:app];
NSLog(@"app=%@ appPath=%@",app,appPath);
DLog(@"app=%@ appPath=%@",app,appPath);
if(appPath){
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:appPath];
NSLog(@"icon=%@",icon);
DLog(@"icon=%@",icon);
[[self client] URLProtocol:self didLoadData:[icon TIFFRepresentation]];
[[self client] URLProtocolDidFinishLoading:self];
}else{
-15
View File
@@ -1,15 +0,0 @@
//
// PBNiceSplitView.h
// GitX
//
// Created by Pieter de Bie on 31-10-08.
// Copyright 2008 Pieter de Bie. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface PBNiceSplitView : NSSplitView {
}
@end
-45
View File
@@ -1,45 +0,0 @@
//
// PBNiceSplitView.m
// GitX
//
// Created by Pieter de Bie on 31-10-08.
// Copyright 2008 Pieter de Bie. All rights reserved.
//
#import "PBNiceSplitView.h"
static NSImage *bar;
static NSImage *grip;
@implementation PBNiceSplitView
+(void) initialize
{
NSString *barPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterBar" ofType:@"tiff"];
bar = [[NSImage alloc] initWithContentsOfFile: barPath];
[bar setFlipped: YES];
NSString *gripPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterDimple" ofType:@"tiff"];
grip = [[NSImage alloc] initWithContentsOfFile: gripPath];
[grip setFlipped: YES];
}
- (void)drawDividerInRect:(NSRect)aRect
{
// Draw bar and grip onto the canvas
NSRect gripRect = aRect;
gripRect.origin.x = (NSMidX(aRect) - ([grip size].width/2));
gripRect.size.width = 8;
[self lockFocus];
[bar drawInRect:aRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
[grip drawInRect:gripRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
[self unlockFocus];
}
- (CGFloat)dividerThickness
{
return 10.0;
}
@end
+1
View File
@@ -31,6 +31,7 @@
- (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef;
- (void) checkout:(PBRefMenuItem *)sender;
- (void) reset:(PBRefMenuItem *)sender;
- (void) merge:(PBRefMenuItem *)sender;
- (void) cherryPick:(PBRefMenuItem *)sender;
- (void) rebaseHeadBranch:(PBRefMenuItem *)sender;
+7
View File
@@ -149,6 +149,13 @@
[historyController.repository checkoutRefish:refish];
}
#pragma mark Reset
- (void) reset:(PBRefMenuItem *)sender
{
id <PBGitRefish> refish = [sender refish];
[historyController.repository.resetController resetToRefish: refish type: PBResetTypeMixed];
}
#pragma mark Cherry Pick
+9
View File
@@ -61,6 +61,10 @@
[items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]];
[items addObject:[PBRefMenuItem separatorItem]];
NSString *resetTitle = [NSString stringWithFormat:@"Reset %@ to %@", headRefName, targetRefName];
[items addObject:[PBRefMenuItem itemWithTitle: resetTitle action:@selector(reset:) enabled:YES]];
[items addObject:[PBRefMenuItem separatorItem]];
// create branch
NSString *createBranchTitle = [ref isRemoteBranch] ? [NSString stringWithFormat:@"Create branch that tracks %@…", targetRefName] : @"Create branch…";
[items addObject:[PBRefMenuItem itemWithTitle:createBranchTitle action:@selector(createBranch:) enabled:YES]];
@@ -156,7 +160,12 @@
[items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]];
[items addObject:[PBRefMenuItem separatorItem]];
NSString *resetTitle = [NSString stringWithFormat:@"Reset %@ to here", headBranchName];
[items addObject:[PBRefMenuItem itemWithTitle: resetTitle action:@selector(reset:) enabled:YES]];
[items addObject:[PBRefMenuItem separatorItem]];
[items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]];
[items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]];
[items addObject:[PBRefMenuItem separatorItem]];
+1 -1
View File
@@ -130,7 +130,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo";
- (void) checkTask:(NSTimer *)timer
{
if (![gitTask isRunning]) {
NSLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd));
DLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd));
[self taskCompleted:nil];
}
}
+35
View File
@@ -0,0 +1,35 @@
//
// PBResetSheet.h
// GitX
//
// Created by Leszek Slazynski on 11-03-13.
// Copyright 2011 LSL. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@protocol PBGitRefish;
@class PBGitRepository;
typedef enum PBResetType {
PBResetTypeNone,
PBResetTypeSoft,
PBResetTypeMixed,
PBResetTypeHard,
PBResetTypeMerge,
PBResetTypeKeep
} PBResetType;
@interface PBResetSheet : NSWindowController {
IBOutlet NSSegmentedControl* resetType;
IBOutlet NSTabView* resetDesc;
PBResetType defaultType;
id<PBGitRefish> targetRefish;
PBGitRepository* repository;
}
+ (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id<PBGitRefish>)refish andType:(PBResetType)type;
- (IBAction)resetBranch:(id)sender;
- (IBAction)cancel:(id)sender;
@end
+67
View File
@@ -0,0 +1,67 @@
//
// PBResetSheet.m
// GitX
//
// Created by Leszek Slazynski on 11-03-13.
// Copyright 2011 LSL. All rights reserved.
//
#import "PBResetSheet.h"
#import "PBGitRefish.h"
#import "PBCommand.h"
#import "PBGitRepository.h"
static const char* StringFromResetType(PBResetType type) {
static const char* resetTypes[] = {
"none", "soft", "mixed", "hard", "merge", "keep"
};
return resetTypes[type];
}
@implementation PBResetSheet
- (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id<PBGitRefish>)refish andType:(PBResetType)type {
defaultType = type;
targetRefish = refish;
repository = repo;
[NSApp beginSheet: [self window]
modalForWindow: [[repository windowController] window]
modalDelegate: self
didEndSelector: nil
contextInfo: NULL];
}
+ (void) beginResetSheetForRepository:(PBGitRepository*) repo refish:(id<PBGitRefish>)refish andType:(PBResetType)type {
PBResetSheet* sheet = [[self alloc] initWithWindowNibName: @"PBResetSheet"];
[sheet beginResetSheetForRepository: repo refish: refish andType: type];
}
- (id) init {
if ( (self = [super initWithWindowNibName: @"PBResetSheet"]) ) {
defaultType = PBResetTypeMixed;
}
return self;
}
- (void) windowDidLoad {
[resetType setSelectedSegment: defaultType - 1];
[resetDesc selectTabViewItemAtIndex: defaultType - 1];
}
- (IBAction)resetBranch:(id)sender {
[NSApp endSheet:[self window]];
[[self window] orderOut:self];
PBResetType type = [resetType selectedSegment] + 1;
NSString* type_arg = [NSString stringWithFormat: @"--%s", StringFromResetType(type)];
NSArray *arguments = [NSArray arrayWithObjects:@"reset", type_arg, [targetRefish refishName], nil];
PBCommand *cmd = [[PBCommand alloc] initWithDisplayName:@"Reset branch" parameters:arguments repository:repository];
[cmd invoke];
}
- (IBAction)cancel:(id)sender {
[NSApp endSheet:[self window]];
[[self window] orderOut:self];
}
@end
+1109
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -22,7 +22,7 @@
# pragma mark context menu delegate methods
- init {
if (self = [super init]) {
if ((self = [super init])) {
}
return self;
+1 -1
View File
@@ -23,7 +23,7 @@ static NSString * const kCommandName = @"stash";
@synthesize stashes;
- (id) initWithRepository:(PBGitRepository *) repo {
if (self = [super init]){
if ((self = [super init])){
repository = [repo retain];
}
return self;
+1 -1
View File
@@ -19,7 +19,7 @@
{
NSString *nibName = [[[self class] description] stringByReplacingOccurrencesOfString:@"Controller"
withString:@"View"];
if(self = [self initWithNibName:nibName bundle:nil]) {
if((self = [self initWithNibName:nibName bundle:nil])) {
repository = theRepository;
superController = controller;
}
+4 -4
View File
@@ -73,12 +73,12 @@
- (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)dictionary
{
NSLog(@"Error from webkit: %@", dictionary);
DLog(@"Error from webkit: %@", dictionary);
}
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
{
NSLog(@"Message from webkit: %@", message);
DLog(@"Message from webkit: %@", message);
}
- (NSURLRequest *)webView:(WebView *)sender
@@ -114,7 +114,7 @@
- (void) log: (NSString*) logMessage
{
NSLog(@"%@", logMessage);
DLog(@"%@", logMessage);
}
- (BOOL) isReachable:(NSString *)hostname
@@ -189,7 +189,7 @@
{
WebScriptObject *a = [callbacks objectForKey: object];
if (!a) {
NSLog(@"Could not find a callback for object: %@", object);
DLog(@"Could not find a callback for object: %@", object);
return;
}
+9 -1
View File
@@ -46,7 +46,15 @@
if ([diff length] == 0)
[script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObject:@"There are no differences"]];
else
[script callWebScriptMethod:@"showDiff" withArguments:[NSArray arrayWithObject:diff]];
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:diff]];
}
// TODO: need to be refactoring
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2;
{
NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,file,nil];
[repository handleInWorkDirForArguments:args];
}
@end
+1 -1
View File
@@ -29,7 +29,7 @@
- (NSString *)parseHeader:(NSString *)txt withRefs:(NSString *)badges;
- (NSMutableDictionary *)parseStats:(NSString *)txt;
- (NSString *) someMethodThatReturnsSomeHashForSomeString:(NSString*)concat;
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha;
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2;
@property (readonly) NSString* diff;
@end
+6 -4
View File
@@ -116,6 +116,7 @@
NSString *html=[NSString stringWithFormat:@"%@%@<div id='diffs'>%@</div>",header,fileList,diffs];
html=[html stringByReplacingOccurrencesOfString:@"{SHA_PREV}" withString:[NSString stringWithFormat:@"%@^",[currentSha string]]];
html=[html stringByReplacingOccurrencesOfString:@"{SHA}" withString:[currentSha string]];
[[view windowScriptObject] callWebScriptMethod:@"showCommit" withArguments:[NSArray arrayWithObject:html]];
@@ -224,10 +225,11 @@
[historyController selectCommit:[PBGitSHA shaWithString:sha]];
}
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha
// TODO: need to be refactoring
- (void) openFileMerge:(NSString*)file sha:(NSString *)sha sha2:(NSString *)sha2
{
NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",[NSString stringWithFormat:@"%@^",sha],sha,@"--",file,nil];
[historyController.repository handleForArguments:args];
NSArray *args=[NSArray arrayWithObjects:@"difftool",@"--no-prompt",@"--tool=opendiff",sha,sha2,@"--",file,nil];
[historyController.repository handleInWorkDirForArguments:args];
}
@@ -260,7 +262,7 @@ contextMenuItemsForElement:(NSDictionary *)element
if ([[ref shortName] isEqualToString:selectedRefString])
return [contextMenuDelegate menuItemsForRef:ref];
}
NSLog(@"Could not find selected ref!");
DLog(@"Could not find selected ref!");
return defaultMenuItems;
}
if ([node hasAttributes] && [[node attributes] getNamedItem:@"representedFile"])
+47 -36
View File
@@ -1,68 +1,79 @@
GitX
GitX (L)
---------------
# What is GitX?
# What is GitX (L)?
GitX is a gitk like clone written specifically for OS X Leopard and higher.
GitX (L) is a gitk like clone written for OS X Leopard and higher.
This means that it has a native interface and tries to integrate with the
operating system as good as possible. Examples of this are drag and drop
support and QuickLook support.
# Features
The project is currently still in its starting phases. As time goes on,
hopefully more features will be added. Currently GitX supports the following:
hopefully more features will be added. Currently GitX (L) supports the following:
* Commit view
* Commit/Parents/Tree SHA links
* File changes counts
* File Diffs
* Commit Tags and Refs
* File view
* Source Code Highlight
* Blame
* File History (log)
* Diff with local and HEAD
* Sidebar
* Branches
* Remotes
* Stashes
* Submodules
* Stage view
* Unstaged/Staged files
* Stage/Discard by lines
* Amend
* File diff
* History browsing of your repository
* See a nicely formatted diff of any revision
* Search based on author or revision subject
* Look at the complete tree of any revision
* Preview any file in the tree in a text view or with QuickLook
* Drag and drop files out of the tree view to copy them to your system
* Support for all parameters git rev-list has
# License
GitX is licensed under the GPL version 2. For more information, see the attached COPYING file.
# Downloading
GitX is currently hosted at GitHub. It's project page can be found at
http://github.com/pieter/gitx. Recent binary releases can be found at
http://github.com/pieter/gitx/wikis.
GitX (L) is currently hosted at GitHub. It's project page can be found at
If you wish to follow GitX development, you can download the source code
https://github.com/laullon/gitx
Recent binary releases can be found at
http://gitx.laullon.com
If you wish to follow GitX (L) development, you can download the source code
through git:
git clone git://github.com/pieter/gitx
git clone https://github.com/laullon/gitx.git
# Installation
The easiest way to get GitX running is to download the binary release from the
wiki. If you wish to compile it yourself, you will need XCode 3.0 or later. As
The easiest way to get GitX (L) running is to download the binary release from
http://gitx.laullon.com
If you wish to compile it yourself, you will need XCode 3.0 or later. As
GitX makes use of features available only on Leopard (such as garbage
collection), you will not be able to compile it on previous versions of OS X.
To compile GitX, open the GitX.xcodeproj file and hit "Build".
To compile GitX (L), open the GitX.xcodeproj file and hit "Build".
# Usage
GitX itself is fairly simple. Most of its power is in the 'gitx' binary, which
GitX (L) itself is fairly simple. Most of its power is in the 'gitx' binary, which
you should install through the menu. the 'gitx' binary supports most of git
rev-list's arguments. For example, you can run `gitx --all' to display all
branches in the repository, or `gitx -- Documentation' to only show commits
relating to the 'Documentation' subdirectory. With `gitx -Shaha', gitx will
only show commits that contain the word 'haha'. Similarly, with 'gitx
v0.2.1..', you will get a list of all commits since version 0.2.1.
rev-list's arguments. For example, you can run `gitx --all` to display all
branches in the repository, or `gitx -- Documentation` to only show commits
relating to the 'Documentation' subdirectory. With `gitx -Shaha`, gitx will
only show commits that contain the word 'haha'. Similarly, with `gitx
v0.2.1..`, you will get a list of all commits since version 0.2.1.
# Helping out
Any help on GitX is welcome. GitX is programmed in Objective-C, but even if
you are not a programmer you can do useful things. A short selection:
* Create a nice icon;
* Help with the Javascript/HTML views, such as the diff view;
* File bug reports and feature requests.
A TODO list can be found on the wiki: http://github.com/pieter/gitx/wikis/todo
Any help on GitX (L) is welcome.
+19
View File
@@ -0,0 +1,19 @@
//
// SearchWebView.h
// GitX
//
// Created by German Laullon on 19/03/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
@interface WebView (SearchWebView)
- (DOMRange *)highlightAllOccurencesOfString:(NSString*)str;
- (NSInteger)highlightAllOccurencesOfString:(NSString*)str inNode:(DOMNode *)node;
- (void)removeAllHighlights;
- (void)updateSearch:(NSSearchField *)sender;
@end
+121
View File
@@ -0,0 +1,121 @@
//
// SearchWebView.m
// GitX
//
// Created by German Laullon on 19/03/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "SearchWebView.h"
@implementation WebView (SearchWebView)
- (NSInteger)highlightAllOccurencesOfString:(NSString*)str inNode:(DOMNode *)_node
{
NSInteger count=0;
DOMDocument *document=[[self mainFrame] DOMDocument];
DOMNodeList *nodes=[_node childNodes];
DOMNode *node=[nodes item:0];
while(node!=nil){
if([node nodeType]==DOM_TEXT_NODE){
NSString *block;
if([[node nodeValue] rangeOfString:str options:NSCaseInsensitiveSearch].location!=NSNotFound){
NSScanner *scanner=[NSScanner scannerWithString:[node nodeValue]];
[scanner setCharactersToBeSkipped:nil];
[scanner setCaseSensitive:NO];
while([scanner scanUpToString:str intoString:&block]){
DOMNode *newNode=[document createTextNode:block];
[[node parentNode] appendChild:newNode];
while([scanner scanString:str intoString:&block]){
DOMElement *span=[document createElement:@"span"];
[span setAttribute:@"id" value:[NSString stringWithFormat:@"SWVHL_%d",count++]];
[span setAttribute:@"class" value:@"SWVHL"];
newNode=[document createTextNode:block];
[span appendChild:newNode];
[[node parentNode] appendChild:span];
}
}
[[node parentNode] removeChild:node];
}
}else if([node nodeType]==DOM_ELEMENT_NODE){
count+=[self highlightAllOccurencesOfString:str inNode:node];
}else{
DLog(@"--->%@",node);
}
node=[node nextSibling];
}
return count;
}
- (DOMRange *)highlightAllOccurencesOfString:(NSString*)str
{
NSInteger count=0;
DOMRange *res=nil;
if([[[[self mainFrame] DOMDocument] documentElement] isKindOfClass:[DOMHTMLElement class]]){
DOMHTMLElement *dom=(DOMHTMLElement *)[[[self mainFrame] DOMDocument] documentElement];
if(![str isEqualToString:[dom getAttribute:@"searchStr"]]){
[self removeAllHighlights];
count=[self highlightAllOccurencesOfString:str inNode:dom];
if(count>0){
[dom setAttribute:@"searchStr" value:str];
}
}
if([self searchFor:str direction:YES caseSensitive:NO wrap:YES]){
res=[self selectedDOMRange];
}
}
return res;
}
- (void)updateSearch:(NSSearchField *)sender
{
NSString *searchString = [sender stringValue];
DLog(@"searchString:%@",searchString);
DOMRange *selection;
if([searchString length]>0){
selection=[self highlightAllOccurencesOfString:searchString];
[[sender window] makeFirstResponder:sender];
if(selection!=nil)
[self setSelectedDOMRange:selection affinity:NSSelectionAffinityDownstream];
}else{
[self removeAllHighlights];
}
}
- (void)removeAllHighlights:(DOMNode *)_node
{
DOMNode *node=[_node firstChild];
while(node!=nil){
if ([node nodeType]==DOM_ELEMENT_NODE) {
if ([[(DOMElement *)node getAttribute:@"class"] isEqualToString:@"SWVHL"]) {
DOMNode *txt=[node firstChild];
DOMNode *parent=[node parentNode];
[node removeChild:txt];
[parent insertBefore:txt refChild:node];
[parent removeChild:node];
[parent normalize];
[self removeAllHighlights:parent];
}else{
[self removeAllHighlights:node];
}
}
node=[node nextSibling];
}
}
- (void)removeAllHighlights
{
if([[[[self mainFrame] DOMDocument] documentElement] isKindOfClass:[DOMHTMLElement class]]){
DOMHTMLElement *dom=(DOMHTMLElement *)[[[self mainFrame] DOMDocument] documentElement];
[self removeAllHighlights:dom];
}
}
@end
+2 -1
View File
@@ -14,10 +14,11 @@ buildAction () {
then
export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path`
git submodule init
git submodule sync
git submodule update
cd libgit2
rm -f libgit2.a
make CFLAGS="-arch i386 -arch ppc -arch x86_64"
make CFLAGS="-arch i386 -arch x86_64"
ranlib libgit2.a
else
echo "error: Not a git repository."
+5 -5
View File
@@ -30,7 +30,7 @@
#define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame"
@interface GAPAppDelegate : NSObject
@interface GAPAppDelegate : NSObject <NSApplicationDelegate>
{
NSPanel* mPasswordPanel;
NSSecureTextField* mPasswordField;
@@ -48,7 +48,7 @@ NSString* url;
OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* password,UInt32 passwordLength);
@implementation GAPAppDelegate
@implementation GAPAppDelegate
-(NSPanel*)passwordPanel:(NSString *)prompt remember:(BOOL)remember
{
@@ -167,7 +167,7 @@ OSStatus StorePasswordKeychain (const char *url, UInt32 urlLength, void* passw
if ((rememberCheck!=nil) && [rememberCheck state]==NSOnState) {
OSStatus status = StorePasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding],
[url lengthOfBytesUsingEncoding:NSASCIIStringEncoding],
[pas cStringUsingEncoding:NSASCIIStringEncoding],
(void *)[pas cStringUsingEncoding:NSASCIIStringEncoding],
[pas lengthOfBytesUsingEncoding:NSASCIIStringEncoding]); //Call
if (status != noErr) {
[[NSApplication sharedApplication] stopModalWithCode:-1];
@@ -329,14 +329,14 @@ int main( int argc, const char* argv[] )
void *passwordData = nil;
SecKeychainItemRef itemRef = nil;
UInt32 passwordLength = nil;
UInt32 passwordLength = 0;
OSStatus status = GetPasswordKeychain ([url cStringUsingEncoding:NSASCIIStringEncoding],[url lengthOfBytesUsingEncoding:NSASCIIStringEncoding],&passwordData,&passwordLength,&itemRef);
if (status == noErr) {
SecKeychainItemFreeContent (NULL,passwordData);
NSString *pas=[[NSString stringWithCString:passwordData encoding:NSASCIIStringEncoding] substringToIndex:passwordLength];
printf( "%s", [pas UTF8String] );
//NSLog(@"--> '%@'",pas);
//DLog(@"--> '%@'",pas);
return 0;
}else if (status != errSecItemNotFound) {
return -1;
+4
View File
@@ -24,3 +24,7 @@ body {
-webkit-border-radius: 10px;
}
.SWVHL{
background-color: yellow;
black: black;
}
+100
View File
@@ -0,0 +1,100 @@
// Based on http://www.icab.de/blog/2010/01/12/search-and-highlight-text-in-uiwebview/
// We're using a global variable to store the number of occurrences
var SearchResultCount = 0;
var SearchResultShow = 0;
// helper function, recursively searches in elements and their child nodes
function HighlightAllOccurencesOfStringForElement(element,keyword) {
if (element) {
if (element.nodeType == 3) { // Text node
while (true) {
var value = element.nodeValue; // Search for keyword in text node
var idx = value.toLowerCase().indexOf(keyword);
if (idx < 0) break; // not found, abort
var span = document.createElement("span");
var text = document.createTextNode(value.substr(idx,keyword.length));
span.appendChild(text);
span.setAttribute("id","Highlight"+SearchResultCount);
span.setAttribute("class","Highlight");
span.style.backgroundColor="yellow";
span.style.color="black";
text = document.createTextNode(value.substr(idx+keyword.length));
element.deleteData(idx, value.length - idx);
var next = element.nextSibling;
element.parentNode.insertBefore(span, next);
element.parentNode.insertBefore(text, next);
element = text;
SearchResultCount++; // update the counter
}
} else if (element.nodeType == 1) { // Element node
if (element.style.display != "none" && element.nodeName.toLowerCase() != 'select') {
for (var i=0; i<element.childNodes.length; i++) {
if((element.childNodes[i].nodeType==1)
alert("-->"+element.childNodes[i].getAttribute('class'));
HighlightAllOccurencesOfStringForElement(element.childNodes[i],keyword);
}
}
}
}
return SearchResultCount;
}
// the main entry point to start the search
function HighlightAllOccurencesOfString(keyword) {
RemoveAllHighlights();
var c=HighlightAllOccurencesOfStringForElement(document.body, keyword.toLowerCase());
if(c>0){
span=$("Highlight0");
span.style.backgroundColor="cyan";
}
return c;
}
function HighlightNext(){
alert("SearchResultShow="+SearchResultShow+" SearchResultCount="+SearchResultCount);
if(SearchResultCount>0){
var span=$("Highlight"+SearchResultShow);
span.style.backgroundColor="yellow";
SearchResultShow++;
if(SearchResultShow >= SearchResultCount)
SearchResultShow=0;
span=$("Highlight"+SearchResultShow);
span.style.backgroundColor="cyan";
location.href = "#Highlight"+SearchResultShow;
}
}
// helper function, recursively removes the highlights in elements and their childs
function RemoveAllHighlightsForElement(element) {
if (element) {
if (element.nodeType == 1) {
if (element.getAttribute("class") == "Highlight") {
var text = element.removeChild(element.firstChild);
element.parentNode.insertBefore(text,element);
element.parentNode.removeChild(element);
return true;
} else {
var normalize = false;
for (var i=element.childNodes.length-1; i>=0; i--) {
if (RemoveAllHighlightsForElement(element.childNodes[i])) {
normalize = true;
}
}
if (normalize) {
element.normalize();
}
}
}
}
return false;
}
// the main entry point to remove the highlights
function RemoveAllHighlights() {
SearchResultCount = 0;
SearchResultShow=0;
RemoveAllHighlightsForElement(document.body);
}
@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
@@ -1,61 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.AS3 = function()
{
// Created by Peter Atoria @ http://iAtoria.com
var inits = 'class interface function package';
var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
'extends false final finally flash_proxy for get if implements import in include Infinity ' +
'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
'return set static String super switch this throw true try typeof uint undefined unescape ' +
'use void while with'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
{ regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3'];
@@ -1,66 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Bash = function()
{
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
'vi watch wc whereis which who whoami Wget xargs yes'
;
this.findMatches = function(regexList, code)
{
code = code.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
this.code = code;
return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]);
};
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
];
}
SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
@@ -1,67 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.CSharp = function()
{
var keywords = 'abstract as base bool break byte case catch char checked class const ' +
'continue decimal default delegate do double else enum event explicit ' +
'extern false finally fixed float for foreach get goto if implicit in int ' +
'interface internal is lock long namespace new null object operator out ' +
'override params private protected public readonly ref return sbyte sealed set ' +
'short sizeof stackalloc static string struct switch this throw true try ' +
'typeof uint ulong unchecked unsafe ushort using virtual void while';
function fixComments(match, regexInfo)
{
var css = (match[0].indexOf("///") == 0)
? 'color1'
: 'comments'
;
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
}
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
{ regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp'];
@@ -1,102 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.ColdFusion = function()
{
// Contributed by Jen
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
'XmlValidate Year YesNoFormat';
var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
'cfwindow cfxml cfzip cfzipparam';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
}
SyntaxHighlighter.brushes.ColdFusion.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.ColdFusion.aliases = ['coldfusion','cf'];
@@ -1,99 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Cpp = function()
{
// Copyright 2006 Shin, YoungJin
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
'va_list wchar_t wctrans_t wctype_t wint_t signed';
var keywords = 'break case catch class const __finally __exception __try ' +
'const_cast continue private public protected __declspec ' +
'default delete deprecated dllexport dllimport do dynamic_cast ' +
'else enum explicit extern if for friend goto inline ' +
'mutable naked namespace new noinline noreturn nothrow ' +
'register reinterpret_cast return selectany ' +
'sizeof static static_cast struct switch template this ' +
'thread throw true false try typedef typeid typename union ' +
'using uuid virtual void volatile whcar_t while';
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
'fwrite getc getchar gets perror printf putc putchar puts remove ' +
'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
'clock ctime difftime gmtime localtime mktime strftime time';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^ *#.*/gm, css: 'preprocessor' },
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
{ regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
];
};
SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c'];
@@ -1,93 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.CSS = function()
{
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
function getValuesCSS(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
};
var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
{ regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
{ regex: /!important/g, css: 'color3' }, // !important
{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
];
this.forHtmlScript({
left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
});
};
SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.CSS.aliases = ['css'];
@@ -1,57 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Delphi = function()
{
var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
'case char class comp const constructor currency destructor div do double ' +
'downto else end except exports extended false file finalization finally ' +
'for function goto if implementation in inherited int64 initialization ' +
'integer interface is label library longint longword mod nil not object ' +
'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
'pint64 pointer private procedure program property pshortstring pstring ' +
'pvariant pwidechar pwidestring protected public published raise real real48 ' +
'record repeat set shl shortint shortstring shr single smallint string then ' +
'threadvar to true try type unit until uses val var varirnt while widechar ' +
'widestring with word write writeln xor';
this.regexList = [
{ regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
{ regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
{ regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
};
SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas'];
@@ -1,43 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Diff = function()
{
this.regexList = [
{ regex: /^\+\+\+.*$/gm, css: 'color2' },
{ regex: /^\-\-\-.*$/gm, css: 'color2' },
{ regex: /^\s.*$/gm, css: 'color1' },
{ regex: /^@@.*@@$/gm, css: 'variable' },
{ regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
{ regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
];
};
SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch'];
@@ -1,54 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Erlang = function()
{
// Contributed by Jean-Lou Dupont
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
'case catch cond div end fun if let not of or orelse '+
'query receive rem try when xor'+
// additional
' module export import define';
this.regexList = [
{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
{ regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
};
SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang'];
@@ -1,69 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Groovy = function()
{
// Contributed by Andres Almiray
// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
var keywords = 'as assert break case catch class continue def default do else extends finally ' +
'if in implements import instanceof interface new package property return switch ' +
'throw throws try while public protected private static';
var types = 'void boolean byte char short int long float double';
var constants = 'null';
var methods = 'allProperties count get size '+
'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
'findIndexOf grep inject max min reverseEach sort ' +
'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
'transformChar transformLine withOutputStream withPrintWriter withStream ' +
'withStreams withWriter withWriterAppend write writeLine '+
'dump inspect invokeMethod print println step times upto use waitForOrKill '+
'getText';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /""".*"""/g, css: 'string' }, // GStrings
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
{ regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
{ regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
}
SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Groovy.aliases = ['groovy'];
@@ -1,52 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.JScript = function()
{
var keywords = 'break case catch continue ' +
'default delete do else false ' +
'for function if in instanceof ' +
'new null return super switch ' +
'this throw true try typeof var while with'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
@@ -1,59 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Java = function()
{
var keywords = 'abstract assert boolean break byte case catch char class const ' +
'continue default do double else enum extends ' +
'false final finally float for goto if implements import ' +
'instanceof int interface long native new null ' +
'package private protected public return ' +
'short static strictfp super switch synchronized this throw throws true ' +
'transient try void volatile while';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
{ regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
];
this.forHtmlScript({
left : /(&lt;|<)%[@!=]?/g,
right : /%(&gt;|>)/g
});
};
SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Java.aliases = ['java'];
@@ -1,60 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.JavaFX = function()
{
// Contributed by Patrick Webster
// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
var datatypes = 'Boolean Byte Character Double Duration '
+ 'Float Integer Long Number Short String Void'
;
var keywords = 'abstract after and as assert at before bind bound break catch class '
+ 'continue def delete else exclusive extends false finally first for from '
+ 'function if import in indexof init insert instanceof into inverse last '
+ 'lazy mixin mod nativearray new not null on or override package postinit '
+ 'protected public public-init public-read replace return reverse sizeof '
+ 'step super then this throw true try tween typeof var where while with '
+ 'attribute let private readonly static trigger'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx'];
@@ -1,59 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
* Copyright (C) 2010 German Laullon.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.ObjC = function()
{
var keywords = 'abstract assert boolean break byte case catch char class const ' +
'continue default do double else enum extends ' +
'false final finally float for goto if implements import ' +
'instanceof int interface long native new null ' +
'package private protected public return ' +
'short static strictfp super switch synchronized this throw throws true ' +
'transient try void volatile while id synthesize pragma self IBAction IBOutlet property';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: /(\w*):/g, css: 'color1' }, //
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
];
this.forHtmlScript({
left : /(&lt;|<)%[@!=]?/g,
right : /%(&gt;|>)/g
});
};
SyntaxHighlighter.brushes.ObjC.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.ObjC.aliases = ['objc'];
@@ -1,74 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Perl = function()
{
// Contributed by David Simmons-Duffin and Marty Kube
var funcs =
'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
'chroot close closedir connect cos crypt defined delete each endgrent ' +
'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
'getservbyname getservbyport getservent getsockname getsockopt glob ' +
'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
'oct open opendir ord pack pipe pop pos print printf prototype push ' +
'quotemeta rand read readdir readline readlink readpipe recv rename ' +
'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
'undef unlink unpack unshift utime values vec wait waitpid warn write';
var keywords =
'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
'for foreach goto if import last local my next no our package redo ref ' +
'require return sub tie tied unless untie until use wantarray while';
this.regexList = [
{ regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
{ regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
}
SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl'];
@@ -1,91 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Php = function()
{
var funcs = 'abs acos acosh addcslashes addslashes ' +
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
'array_push array_rand array_reduce array_reverse array_search array_shift '+
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
'strtoupper strtr strval substr substr_compare';
var keywords = 'and or xor array as break case ' +
'cfunction class const continue declare default die do else ' +
'elseif enddeclare endfor endforeach endif endswitch endwhile ' +
'extends for foreach function include include_once global if ' +
'new old_function return static switch use require require_once ' +
'var while abstract interface public implements extends private protected throw';
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\$\w+/g, css: 'variable' }, // variables
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
};
SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Php.aliases = ['php'];
@@ -1,35 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Plain = function()
{
};
SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain'];
@@ -1,76 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.PowerShell = function()
{
// Contributes by B.v.Zanten, Getronics
// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
'spps spsv sv tee cat cd cp h history kill lp ls ' +
'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
'erase rd ren type % \\?';
this.regexList = [
{ regex: /#.*$/gm, css: 'comments' }, // one line comments
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
{ regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
];
};
SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps'];
@@ -1,66 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Python = function()
{
// Contributed by Gheorghe Milas and Ahmad Sherif
var keywords = 'and assert break class continue def del elif else ' +
'except exec finally for from global if import in is ' +
'lambda not or pass print raise return try yield while';
var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
'chr classmethod cmp coerce compile complex delattr dict dir ' +
'divmod enumerate eval execfile file filter float format frozenset ' +
'getattr globals hasattr hash help hex id input int intern ' +
'isinstance issubclass iter len list locals long map max min next ' +
'object oct open ord pow print property range raw_input reduce ' +
'reload repr reversed round set setattr slice sorted staticmethod ' +
'str sum super tuple type type unichr unicode vars xrange zip';
var special = 'None True False self cls class_';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
{ regex: /^\s*@\w+/gm, css: 'decorator' },
{ regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
{ regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
{ regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
{ regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
{ regex: /\b\d+\.?\w*/g, css: 'value' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Python.aliases = ['py', 'python'];
@@ -1,57 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Ruby = function()
{
// Contributed by Erik Peterson.
var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
'self super then throw true undef unless until when while yield';
var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
'ThreadGroup Thread Time TrueClass';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
{ regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
{ regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb'];
@@ -1,53 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Scala = function()
{
// Contributed by Yegor Jbanov and David Bernard.
var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
'override try lazy for var catch throw type extends class while with new final yield abstract ' +
'else do if return protected private this package false';
var keyops = '[_:=><%#@]+';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
];
}
SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Scala.aliases = ['scala'];
@@ -1,68 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Sql = function()
{
var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
'current_user day isnull left lower month nullif replace right ' +
'session_user space substring sum system_user upper user year';
var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
'binary bit by cascade char character check checkpoint close collate ' +
'column commit committed connect connection constraint contains continue ' +
'create cube current current_date current_time cursor database date ' +
'deallocate dec decimal declare default delete desc distinct double drop ' +
'dynamic else end end-exec escape except exec execute false fetch first ' +
'float for force foreign forward free from full function global goto grant ' +
'group grouping having hour ignore index inner insensitive insert instead ' +
'int integer intersect into is isolation key last level load local max min ' +
'minute modify move name national nchar next no numeric of off on only ' +
'open option order out output partial password precision prepare primary ' +
'prior privileges procedure public read real references relative repeatable ' +
'restrict return returns revoke rollback rollup rows rule schema scroll ' +
'second section select sequence serializable set size smallint static ' +
'statistics table temp temporary then time timestamp to top transaction ' +
'translation trigger true truncate uncommitted union unique update values ' +
'varchar varying view when where with work';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
};
SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Sql.aliases = ['sql'];
-58
View File
@@ -1,58 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Vb = function()
{
var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
'Variant When While With WithEvents WriteOnly Xor';
this.regexList = [
{ regex: /'.*$/gm, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet'];
@@ -1,71 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.1.364 (October 15 2009)
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* @license
* This file is part of SyntaxHighlighter.
*
* SyntaxHighlighter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SyntaxHighlighter is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
*/
SyntaxHighlighter.brushes.Xml = function()
{
function process(match, regexInfo)
{
var constructor = SyntaxHighlighter.Match,
code = match[0],
tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
result = []
;
if (match.attributes != null)
{
var attributes,
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
'\\s*=\\s*' +
'(?<value> ".*?"|\'.*?\'|\\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('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
{ regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
];
};
SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html'];

Some files were not shown because too many files have changed in this diff Show More