From 16e0ca2add34e389d0ed14c297e42c46ec4f18b7 Mon Sep 17 00:00:00 2001 From: Gautam Dey Date: Sat, 13 Mar 2010 04:46:21 -0800 Subject: [PATCH 001/110] [#228:fixed] removed default text when no commits are found --- html/views/history/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/html/views/history/index.html b/html/views/history/index.html index 65117c3..e9ad54b 100644 --- a/html/views/history/index.html +++ b/html/views/history/index.html @@ -27,23 +27,23 @@ Author: - Pieter de Bie + Date: - Pieter de Bie + Committer: - Pieter de Bie + Commit Date: - Pieter de Bie + Subject: - Pieter de Bie + Refs: From b87f9b0e358899d9214da21970cd0df5bf5b25ba Mon Sep 17 00:00:00 2001 From: Kevin LaCoste Date: Tue, 16 Mar 2010 13:54:48 +0900 Subject: [PATCH 002/110] Resize the text in the toolbar search field. The default text size of 13 causes highlighting to be off by one pixel. With a text size of 12 highlighting behaves correctly. --- PBGitHistoryView.xib | 1188 +++++++++++++++++++++++++++++++++++------- 1 file changed, 1004 insertions(+), 184 deletions(-) diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 68b7789..1bc52ec 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -1,25 +1,36 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 762 + 1038.25 + 458.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 762 + 762 + + YES - - + YES - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES - + YES @@ -100,20 +111,21 @@ 293 {{376, 6}, {71, 25}} + YES -2080244224 0 LucidaGrande - 1.300000e+01 + 13 1044 YES - 3.200000e+01 + 32 NSImage DetailViewTemplate @@ -157,12 +169,14 @@ 256 {852, 194} + YES 256 {852, 17} + @@ -170,21 +184,22 @@ -2147483392 {{-26, 0}, {16, 17}} + YES SubjectColumn - 5.090000e+02 - 4.000000e+01 - 1.000000e+03 + 509 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Subject LucidaGrande - 1.100000e+01 + 11 3100 @@ -213,7 +228,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -229,12 +244,12 @@ AuthorColumn - 1.900000e+02 - 4.000000e+01 - 1.000000e+03 + 190 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Author @@ -255,12 +270,12 @@ DateColumn - 1.440000e+02 - 1.000000e+01 - 3.402823e+38 + 144 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 Date @@ -289,12 +304,12 @@ SHAColumn - 6.400000e+01 - 1.000000e+01 - 3.402823e+38 + 64 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 SHA @@ -315,8 +330,8 @@ YES - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -327,17 +342,21 @@ MC41AA - 1.700000e+01 + 17 -683671552 + + CommitView 5 15 0 YES + 0 {{0, 17}, {852, 194}} + @@ -348,20 +367,22 @@ -2147483392 {{837, 17}, {15, 179}} + _doScroller: - 3.700000e+01 - 1.947368e-01 + 37 + 0.19473679999999999 -2147483392 {{0, 196}, {837, 15}} + 1 _doScroller: - 2.193211e-01 + 0.21932109999999999 @@ -372,6 +393,7 @@ {852, 17} + @@ -381,6 +403,7 @@ {852, 211} + 560 @@ -395,6 +418,7 @@ 18 {{0, 212}, {852, 186}} + YES @@ -409,7 +433,7 @@ 274 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -430,6 +454,7 @@ {{1, 0}, {851, 186}} + @@ -437,7 +462,7 @@ YES - + YES WebKitDefaultFixedFontSize WebKitDefaultFontSize @@ -445,9 +470,9 @@ YES - - - + + + @@ -457,6 +482,7 @@ {852, 186} + Details @@ -503,12 +529,12 @@ YES - 1.880000e+02 - 1.600000e+01 - 1.000000e+03 + 188 + 16 + 1000 - 75628032 - 0 + 75628096 + 2048 @@ -531,16 +557,19 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.700000e+01 + 17 -624951296 + + 4 15 0 YES + 0 {{1, 1}, {191, 186}} @@ -557,7 +586,7 @@ _doScroller: - 9.948186e-01 + 0.9948186 @@ -567,8 +596,8 @@ 1 _doScroller: - 4.504505e-03 - 9.980119e-01 + 0.0045045049999999998 + 0.99801189999999995 {208, 188} @@ -603,7 +632,7 @@ YES - + YES NSFont NSParagraphStyle @@ -612,7 +641,7 @@ YES Monaco - 1.000000e+01 + 10 16 @@ -620,100 +649,100 @@ YES - 0.000000e+00 + 0.0 - 5.600000e+01 + 56 - 1.120000e+02 + 112 - 1.680000e+02 + 168 - 2.240000e+02 + 224 - 2.800000e+02 + 280 - 3.360000e+02 + 336 - 3.920000e+02 + 392 - 4.480000e+02 + 448 - 5.040000e+02 + 504 - 5.600000e+02 + 560 - 6.160000e+02 + 616 - 6.720000e+02 + 672 - 7.280000e+02 + 728 - 7.840000e+02 + 784 - 8.400000e+02 + 840 - 8.960000e+02 + 896 - 9.520000e+02 + 952 - 1.008000e+03 + 1008 - 1.064000e+03 + 1064 - 1.120000e+03 + 1120 - 1.176000e+03 + 1176 - 1.232000e+03 + 1232 - 1.288000e+03 + 1288 - 1.344000e+03 + 1344 - 1.400000e+03 + 1400 - 1.456000e+03 + 1456 - 1.512000e+03 + 1512 - 1.568000e+03 + 1568 - 1.624000e+03 + 1624 - 1.680000e+03 + 1680 - 1.736000e+03 + 1736 @@ -729,16 +758,17 @@ - 5.430000e+02 + 543 1 11233 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -759,10 +789,10 @@ - + YES - + YES NSColor NSUnderline @@ -773,7 +803,7 @@ 1 MCAwIDEAA - + @@ -802,7 +832,7 @@ _doScroller: - 3.003168e-02 + 0.030031680000000002 @@ -812,8 +842,8 @@ 1 _doScroller: - 1.000000e+00 - 9.456522e-01 + 1 + 0.94565220000000005 {{209, 0}, {643, 188}} @@ -851,6 +881,7 @@ {{0, 35}, {852, 398}} + 2 HistoryViewSplitView @@ -859,6 +890,7 @@ 292 {{17, 7}, {305, 17}} + YES 67239488 @@ -875,6 +907,7 @@ 289 {{795, 6}, {37, 25}} + YES -2080244224 @@ -897,6 +930,7 @@ {852, 432} + NSView @@ -913,7 +947,7 @@ {1000, 102} {346, 102} - + 256 YES @@ -1022,7 +1056,6 @@ {346, 102} - {{0, 0}, {1680, 1028}} {346, 124} @@ -1041,7 +1074,7 @@ 1 YES - + YES 1E431E79-1591-49E7-9E17-49497CA4622A 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 @@ -1060,9 +1093,10 @@ View selector - + 268 {{0, 14}, {87, 25}} + 3 YES @@ -1073,7 +1107,7 @@ YES - 4.000000e+01 + 40 NSImage HistoryViewTemplate @@ -1083,7 +1117,7 @@ 0 - 4.000000e+01 + 40 NSImage CommitViewTemplate @@ -1119,14 +1153,19 @@ - + 265 {{0, 14}, {183, 22}} + YES 343014976 268436480 - + + LucidaGrande + 12 + 16 + Subject YES @@ -1137,9 +1176,9 @@ 130560 0 search + _searchFieldSearch: - 138690815 0 @@ -1154,7 +1193,7 @@ YES YES - + YES AXDescription NSAccessibilityEncodedAttributesValueType @@ -1162,13 +1201,13 @@ YES cancel - + + _searchFieldCancel: - 138690815 0 @@ -1198,9 +1237,10 @@ Create Branch - + 268 {{21, 14}, {40, 25}} + YES -2080244224 @@ -1239,9 +1279,10 @@ Branch - + 268 {{0, 14}, {134, 26}} + YES -2076049856 @@ -1312,7 +1353,7 @@ {134, 25} - {134, 25} + {134, 26} YES YES 0 @@ -1462,7 +1503,7 @@ arrangedObjects.author NSConditionallySetsEditable - + 2 @@ -1498,7 +1539,7 @@ arrangedObjects NSConditionallySetsEditable - + 2 @@ -1614,7 +1655,7 @@ arrangedObjects.path NSConditionallySetsEditable - + 2 @@ -1650,7 +1691,7 @@ arrangedObjects.dateString NSConditionallySetsEditable - + 2 @@ -1746,7 +1787,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1775,7 +1816,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1917,7 +1958,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1979,15 +2020,15 @@ selection.textContents YES - + YES NSAllowsEditingMultipleValuesSelection NSConditionallySetsEditable YES - - + + 2 @@ -2001,45 +2042,43 @@ YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application 38 - + 39 - + CommitsController 40 - + 46 @@ -2051,7 +2090,7 @@ - + 2 @@ -2242,7 +2281,7 @@ 231 - + 236 @@ -2251,7 +2290,7 @@ YES - + 237 @@ -2416,7 +2455,7 @@ - + History Toolbar @@ -2583,10 +2622,8 @@ YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency @@ -2624,8 +2661,8 @@ 223.IBPluginDependency 224.IBPluginDependency 225.IBPluginDependency - 231.IBPluginDependency 236.IBEditorWindowLastContentRect + 236.IBPluginDependency 236.IBWindowTemplateEditedContentRect 236.NSWindowTemplate.visibleAtLaunch 236.windowTemplate.hasMaxSize @@ -2681,7 +2718,6 @@ 39.ImportedFromIB2 4.IBAttributePlaceholdersKey 4.IBPluginDependency - 40.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 47.IBPluginDependency @@ -2698,8 +2734,6 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{312, 366}, {616, 227}} @@ -2729,13 +2763,11 @@ PBCollapsibleSplitView {{312, 577}, {852, 384}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -2744,12 +2776,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{504, 612}, {346, 102}} com.apple.InterfaceBuilder.CocoaPlugin {{504, 612}, {346, 102}} - {{504, 612}, {346, 102}} - - - + + + {1000, 102} {346, 102} com.apple.InterfaceBuilder.CocoaPlugin @@ -2774,49 +2806,46 @@ com.apple.InterfaceBuilder.CocoaPlugin PBCommitList com.apple.InterfaceBuilder.CocoaPlugin - + - - - + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + PBUnsortableTableHeader com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin PBGitRevisionCell com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + YES - - YES - + YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin {{321, 67}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2833,9 +2862,7 @@ YES - - YES - + YES @@ -2843,9 +2870,7 @@ YES - - YES - + YES @@ -2869,7 +2894,7 @@ NSTableView YES - + YES controller webController @@ -2892,7 +2917,7 @@ PBViewController YES - + YES openFilesAction: openSelectedFile: @@ -2919,7 +2944,7 @@ YES - + YES commitController commitList @@ -2958,7 +2983,7 @@ NSActionCell YES - + YES contextMenuDelegate controller @@ -2999,7 +3024,7 @@ NSObject YES - + YES addRef: changeBranch: @@ -3016,7 +3041,7 @@ YES - + YES branchPopUp commitController @@ -3071,7 +3096,7 @@ NSObject YES - + YES repository view @@ -3092,7 +3117,7 @@ PBWebController YES - + YES contextMenuDelegate historyController @@ -3121,9 +3146,804 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES GitX.xcodeproj 3 + + YES + + YES + AddBranchTemplate + CommitViewTemplate + DetailViewTemplate + HistoryViewTemplate + NSMenuCheckmark + NSMenuMixedState + NSPathTemplate + NSQuickLookTemplate + + + YES + {25, 13} + {23, 15} + {17, 17} + {25, 15} + {9, 8} + {7, 2} + {16, 9} + {19, 11} + + From 64f2745dfa02bdb9e5a542b52e4074ee02bf8d46 Mon Sep 17 00:00:00 2001 From: Kevin LaCoste Date: Tue, 16 Mar 2010 13:27:34 +0900 Subject: [PATCH 003/110] Make the Preferences window a panel. This enables the standard behaviour of dismissing the panel with the key. --- DBPrefsWindowController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DBPrefsWindowController.m b/DBPrefsWindowController.m index 3988a99..64a13c6 100644 --- a/DBPrefsWindowController.m +++ b/DBPrefsWindowController.m @@ -74,13 +74,13 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil; // Create a new window to display the preference views. // If the developer attached a window to this controller // in Interface Builder, it gets replaced with this one. - NSWindow *window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,1000,1000) + NSPanel *panel = [[[NSPanel alloc] initWithContentRect:NSMakeRect(0,0,1000,1000) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:YES] autorelease]; - [self setWindow:window]; + [self setWindow:panel]; contentSubview = [[[NSView alloc] initWithFrame:[[[self window] contentView] frame]] autorelease]; [contentSubview setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; [[[self window] contentView] addSubview:contentSubview]; From f60f8ad7ad591cf5b6dac45deef26b8bb15e2f6b Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:54:25 -0700 Subject: [PATCH 004/110] Bugfix: fix the contextual menu and drag-n-drop of refs When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work. Offset the mouse click's x value by the x origin of the Subject column. In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one). --- PBCommitList.m | 3 ++- PBGitRevisionCell.m | 2 +- PBRefController.m | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PBCommitList.m b/PBCommitList.m index 9f76422..264b5e2 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -61,8 +61,9 @@ int row = [self rowAtPoint:location]; int column = [self columnAtPoint:location]; PBGitRevisionCell *cell = (PBGitRevisionCell *)[self preparedCellAtColumn:column row:row]; + NSRect cellFrame = [self frameOfCellAtColumn:column row:row]; - int index = [cell indexAtX:location.x]; + int index = [cell indexAtX:(location.x - cellFrame.origin.x)]; if (index == -1) return [super dragImageForRowsWithIndexes:dragRows tableColumns:tableColumns event:dragEvent offset:dragImageOffset]; diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 98f978b..579168b 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -283,7 +283,7 @@ if (!contextMenuDelegate) return [self menu]; - int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x]; + int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x - rect.origin.x]; if (i < 0) return [self menu]; diff --git a/PBRefController.m b/PBRefController.m index 31c5590..f25d7e8 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -92,12 +92,14 @@ NSPoint location = [tv convertPointFromBase:[(PBCommitList *)tv mouseDownPoint]]; int row = [tv rowAtPoint:location]; int column = [tv columnAtPoint:location]; - if (column != 0) + int subjectColumn = [tv columnWithIdentifier:@"SubjectColumn"]; + if (column != subjectColumn) return NO; PBGitRevisionCell *cell = (PBGitRevisionCell *)[tv preparedCellAtColumn:column row:row]; + NSRect cellFrame = [tv frameOfCellAtColumn:column row:row]; - int index = [cell indexAtX:location.x]; + int index = [cell indexAtX:(location.x - cellFrame.origin.x)]; if (index == -1) return NO; From 2e549a18f82f98465bbf3cd9367f1cdb61f7565f Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:30:02 -0700 Subject: [PATCH 005/110] Fix for "Remote host closed connection" exception EINTR errors are recoverable, just need to read() again. Randomly while looking at files in the file browser the contents view will be empty or files will not be shown when clicking a discloser triangle. Seems to happen more when running in XCode than when running by itself. --- NSFileHandleExt.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NSFileHandleExt.m b/NSFileHandleExt.m index 2772855..6d30cc9 100644 --- a/NSFileHandleExt.m +++ b/NSFileHandleExt.m @@ -33,8 +33,14 @@ while (n > 0) { n = read(fd, buffer + bytesReceived++, 1); - if (n < 0) - [[NSException exceptionWithName:@"Socket error" reason:@"Remote host closed connection" userInfo:nil] raise]; + if (n < 0) { + if (errno == EINTR) { + n = 1; + bytesReceived--; + } else { + [[NSException exceptionWithName:@"Socket error" reason:@"Remote host closed connection" userInfo:nil] raise]; + } + } if (bytesReceived >= bufferSize) { // Make buffer bigger From 1917bca23b1dc0fa9cfdc2a002d8bfd1ff77a059 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Mar 2010 16:41:49 -0700 Subject: [PATCH 006/110] Fix file names with spaces not working in the contextual menu Files with spaces end up with 4 extra spaces after the name. This stops them from working with the various commands in the contextual menus. --- PBGitHistoryController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index b4a5d66..242777d 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -287,7 +287,11 @@ - (NSArray *)menuItemsForPaths:(NSArray *)paths { - BOOL multiple = [paths count] != 1; + NSMutableArray *filePaths = [NSMutableArray array]; + for (NSString *filePath in paths) + [filePaths addObject:[filePath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; + + BOOL multiple = [filePaths count] != 1; NSMenuItem *historyItem = [[NSMenuItem alloc] initWithTitle:multiple? @"Show history of files" : @"Show history of file" action:@selector(showCommitsFromTree:) keyEquivalent:@""]; @@ -301,7 +305,7 @@ NSArray *menuItems = [NSArray arrayWithObjects:historyItem, finderItem, openFilesItem, nil]; for (NSMenuItem *item in menuItems) { [item setTarget:self]; - [item setRepresentedObject:paths]; + [item setRepresentedObject:filePaths]; } return menuItems; From 5ea536be9779133eb192ea73f37e4c3445ad0b76 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 25 Feb 2010 21:16:38 -0700 Subject: [PATCH 007/110] Fix drawing ref labels on the next tableview column If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns. This will not show any labels that don't fit. --- PBGitRevisionCell.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 579168b..ae76b68 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -149,8 +149,8 @@ static const int ref_spacing = 2; NSRect lastRect = rect; - lastRect.origin.x = round(lastRect.origin.x) - 0.5; - lastRect.origin.y = round(lastRect.origin.y) - 0.5; + lastRect.origin.x = round(lastRect.origin.x) + 0.5; + lastRect.origin.y = round(lastRect.origin.y) + 0.5; for (PBGitRef *ref in self.objectValue.refs) { NSMutableDictionary* attributes = [self attributesForRefLabelSelected:NO]; @@ -161,9 +161,11 @@ newRect.size.height = textSize.height; newRect.origin.y = rect.origin.y + (rect.size.height - newRect.size.height) / 2; - [array addObject:[NSValue valueWithRect:newRect]]; - lastRect = newRect; - lastRect.origin.x += (int)lastRect.size.width + ref_spacing; + if (NSContainsRect(rect, newRect)) { + [array addObject:[NSValue valueWithRect:newRect]]; + lastRect = newRect; + lastRect.origin.x += (int)lastRect.size.width + ref_spacing; + } } return array; From 6e06e4b931542d092f86cffc6ef110083bc116e8 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 30 Mar 2010 12:59:34 -0700 Subject: [PATCH 008/110] Bugfix: Avoid looping while parsing the children of a tree Happens very intermittently, readLine keeps returning "\r". --- PBGitTree.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBGitTree.m b/PBGitTree.m index c8003d1..2310121 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -216,6 +216,8 @@ NSString* p = [handle readLine]; while (p.length > 0) { + if ([p isEqualToString:@"\r"]) + break; BOOL isLeaf = ([p characterAtIndex:p.length - 1] != '/'); if (!isLeaf) p = [p substringToIndex:p.length -1]; From dcba769fd34e9e728420546260ef729a60aeea4c Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 28 Mar 2010 13:30:29 -0600 Subject: [PATCH 009/110] Fix hanging and leaks in readLine After the last line is read from the fileDescriptor the callee will call readLine once last time. If the (uninitialized) buffer just happened to contain '\r' then this method would increment bytesReceived, then decrement it (because it has '\r' in it), then decrement it agin and assign a null byte to the byte before the buffer (stepping on who knows what). Then it would return the '\r'. Then, since it received something, the callee would call readLine again, malloc would give the same buffer it did before (with the '\r') and everything would repeat. - initialize the buffer - increment bytesReceived only if a byte is actually received - don't do any work in the loop if there were no bytes received - EINTR is a recoverable error, just reread - give the actual reason for an error rather than some random string - free the buffer when a newline is found or when there is an error --- NSFileHandleExt.m | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/NSFileHandleExt.m b/NSFileHandleExt.m index 6d30cc9..54b9098 100644 --- a/NSFileHandleExt.m +++ b/NSFileHandleExt.m @@ -27,42 +27,46 @@ char *buffer = (char*)malloc(bufferSize + 1); if (buffer == NULL) [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; + buffer[0] = '\0'; - int bytesReceived = 0, n = 1; + int bytesReceived = 0, n = 0; - while (n > 0) { - n = read(fd, buffer + bytesReceived++, 1); + while (1) { + n = read(fd, buffer + bytesReceived, 1); + + if (n == 0) + break; if (n < 0) { - if (errno == EINTR) { - n = 1; - bytesReceived--; - } else { - [[NSException exceptionWithName:@"Socket error" reason:@"Remote host closed connection" userInfo:nil] raise]; - } - } + if (errno == EINTR) + continue; + + free(buffer); + NSString *reason = [NSString stringWithFormat:@"%s:%d: read() error: %s", __PRETTY_FUNCTION__, __LINE__, strerror(errno)]; + [[NSException exceptionWithName:@"Socket error" reason:reason userInfo:nil] raise]; + } + + bytesReceived++; if (bytesReceived >= bufferSize) { // Make buffer bigger bufferSize += BUFFER_SIZE; - buffer = (char*)realloc(buffer, bufferSize + 1); + buffer = (char *)reallocf(buffer, bufferSize + 1); if (buffer == NULL) [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; } - switch (*(buffer + bytesReceived - 1)) { - case '\n': - buffer[bytesReceived-1] = '\0'; - NSString* s = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding]; - if ([s length] == 0) - s = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; - return s; - case '\r': - bytesReceived--; + char receivedByte = buffer[bytesReceived-1]; + if (receivedByte == '\n') { + bytesReceived--; + break; } + + if (receivedByte == '\r') + bytesReceived--; } - buffer[bytesReceived-1] = '\0'; + buffer[bytesReceived] = '\0'; NSString *retVal = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding]; if ([retVal length] == 0) retVal = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; From 0eb011b8d99266033ac8984c61d9559e80474b9b Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 28 Mar 2010 17:05:20 -0600 Subject: [PATCH 010/110] Bugfix: include detached HEAD in local branches --- PBGitHistoryList.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 89142a9..17140f5 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -159,6 +159,9 @@ if ([ref isBranch] || [ref isTag]) [baseCommitSHAs addObject:sha]; + if (![[PBGitRef refFromString:[[repository headRef] simpleRef]] type]) + [baseCommitSHAs addObject:[repository headSHA]]; + return baseCommitSHAs; } From cd9d469eda44479fb22d09b0da8627efaf019969 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 28 Mar 2010 17:15:23 -0600 Subject: [PATCH 011/110] Use NSOperation's maxConcurrentOperationCount --- PBGitHistoryList.h | 1 - PBGitHistoryList.m | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index c3e3a0b..4cf55e0 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -31,7 +31,6 @@ PBGitHistoryGrapher *grapher; NSOperationQueue *graphQueue; - NSInvocationOperation *lastOperation; NSMutableArray *commits; BOOL isUpdating; diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 17140f5..584dbe1 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -131,8 +131,8 @@ if (graphQueue) [graphQueue removeObserver:self forKeyPath:@"operations"]; graphQueue = [[NSOperationQueue alloc] init]; + [graphQueue setMaxConcurrentOperationCount:1]; [graphQueue addObserver:self forKeyPath:@"operations" options:0 context:@"operations"]; - lastOperation = nil; grapher = [self grapher]; } @@ -140,12 +140,7 @@ - (NSInvocationOperation *) operationForCommits:(NSArray *)newCommits { - NSInvocationOperation *graphOperation = [[NSInvocationOperation alloc] initWithTarget:grapher selector:@selector(graphCommits:) object:newCommits]; - if (lastOperation) - [graphOperation addDependency:lastOperation]; - lastOperation = graphOperation; - - return graphOperation; + return [[NSInvocationOperation alloc] initWithTarget:grapher selector:@selector(graphCommits:) object:newCommits]; } From 694b2ed0d71949276cb232ff5905f1a1cb3c4cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Wed, 24 Mar 2010 18:41:56 +0100 Subject: [PATCH 012/110] Add Cmd+Shift+F for "Reveal in Finder" and Cmd+Shift+T for "Open Terminal". --- English.lproj/MainMenu.xib | 213 ++++++++++++++++++++++++++++++++----- 1 file changed, 188 insertions(+), 25 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index bec5dd0..a70e278 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -3,15 +3,16 @@ 1050 10C540 - 762 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 762 + 740 YES + YES @@ -709,7 +710,8 @@ Open in Terminal - + T + 1048576 2147483647 @@ -717,7 +719,8 @@ Reveal in Finder - + F + 1048576 2147483647 @@ -2323,7 +2326,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{624, 493}, {240, 243}} + {{522, 787}, {240, 243}} com.apple.InterfaceBuilder.CocoaPlugin {{455, 493}, {243, 243}} @@ -2384,7 +2387,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{552, 706}, {420, 20}} + {{419, 1030}, {420, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{297, 739}, {329, 20}} @@ -2442,7 +2445,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{668, 623}, {206, 113}} + {{566, 917}, {206, 113}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2704,6 +2707,14 @@ PBGitCommitController.h + + PBGitGradientBarView + NSView + + IBProjectSource + PBGitGradientBarView.h + + PBGitHistoryController PBViewController @@ -2711,13 +2722,16 @@ YES YES + cherryPick: createBranch: createTag: + merge: openFilesAction: openSelectedFile: + rebase: refresh: + setBranchFilter: setDetailedView: - setRawView: setTreeView: showAddRemoteSheet: showCommitsFromTree: @@ -2738,30 +2752,49 @@ id id id + id + id + id YES YES + allBranchesFilterItem + cherryPickButton commitController commitList fileBrowser historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton refController + scopeBarView searchField + selectedBranchFilterItem treeController + upperToolbarView webView YES + NSButton + NSButton NSArrayController NSTableView NSOutlineView PBCollapsibleSplitView + NSButton + NSButton + NSButton PBRefController + PBGitGradientBarView NSSearchField + NSButton NSTreeController + PBGitGradientBarView id @@ -2819,6 +2852,7 @@ YES cloneTo: openInTerminal: + refresh: revealInFinder: showCommitView: showHistoryView: @@ -2830,6 +2864,7 @@ id id id + id @@ -2870,7 +2905,6 @@ YES openSelectedFile: - refresh: setDetailedView: setRawView: setTreeView: @@ -2883,7 +2917,6 @@ id id id - id @@ -2929,13 +2962,13 @@ copySHA: createBranch: createTag: + diffWithHEAD: fetchRemote: merge: pullRemote: pushDefaultRemoteForRef: pushToRemote: pushUpdatesToRemote: - rebaseActiveBranch: rebaseHeadBranch: showTagInfoSheet: @@ -2966,6 +2999,9 @@ commitController commitList historyController + pullItem + pushItem + rebaseItem YES @@ -2973,6 +3009,9 @@ NSArrayController PBCommitList PBGitHistoryController + KBPopUpToolbarItem + KBPopUpToolbarItem + KBPopUpToolbarItem @@ -2995,6 +3034,34 @@ PBRepositoryDocumentController NSDocumentController + + YES + + YES + cloneURL: + hideClone: + showClone: + + + YES + id + id + id + + + + YES + + YES + cloneURLField + cloneWindow + + + YES + NSTextField + NSWindow + + IBProjectSource PBRepositoryDocumentController.h @@ -3011,6 +3078,10 @@ PBViewController NSViewController + + refresh: + id + IBProjectSource PBViewController.h @@ -3553,6 +3624,55 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + NSObject @@ -3816,6 +3936,63 @@ AppKit.framework/Headers/NSWindowController.h + + PDFView + NSView + + YES + + YES + goBack: + goForward: + goToFirstPage: + goToLastPage: + goToNextPage: + goToPreviousPage: + selectAll: + takeBackgroundColorFrom: + zoomIn: + zoomOut: + + + YES + id + id + id + id + id + id + id + id + id + id + + + + + + QCView + NSView + + YES + + YES + play: + start: + stop: + + + YES + id + id + id + + + + IBFrameworkSource + QuartzComposer.framework/Headers/QCView.h + + SUUpdater NSObject @@ -3871,7 +4048,6 @@ 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3887,18 +4063,5 @@ YES ../GitX.xcodeproj 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - From 9e8002a97e78085e8754d341196f15c3ef0328d4 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 27 Jun 2010 06:10:29 -0600 Subject: [PATCH 013/110] Only allow the "Copy Image" menu item for images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit André Berg pointed out that the "Open Image in New Window" and "Download Image" items from the contextual menu for images in the web view does not work and may cause crashes. So limit the menu to either just show "Copy Image" or don't have a menu at all. --- PBWebHistoryController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 98de77b..e3467c0 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -127,6 +127,15 @@ contextMenuItemsForElement:(NSDictionary *)element } if ([node hasAttributes] && [[node attributes] getNamedItem:@"representedFile"]) return [historyController menuItemsForPaths:[NSArray arrayWithObject:[[[node attributes] getNamedItem:@"representedFile"] value]]]; + else if ([[node class] isEqual:[DOMHTMLImageElement class]]) { + // Copy Image is the only menu item that makes sense here since we don't need + // to download the image or open it in a new window (besides with the + // current implementation these two entries can crash GitX anyway) + for (NSMenuItem *item in defaultMenuItems) + if ([item tag] == WebMenuItemTagCopyImageToClipboard) + return [NSArray arrayWithObject:item]; + return nil; + } node = [node parentNode]; } From e192ce801d61718fedeab3df8cb6e5f941f23226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Wed, 24 Mar 2010 11:09:09 +0100 Subject: [PATCH 014/110] Set a copy of the "Push" message strings for the alert panel message with a small case "p" letter because it will be appended in the middle of a sentence. --- PBRefController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBRefController.m b/PBRefController.m index d3b183b..c609b2a 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -60,11 +60,12 @@ else description = [NSString stringWithFormat:@"Push updates to remote %@", [remoteRef remoteName]]; + NSString * sdesc = [NSString stringWithFormat:@"p%@", [description substringFromIndex:1]]; NSAlert *alert = [NSAlert alertWithMessageText:description defaultButton:@"Push" alternateButton:@"Cancel" otherButton:nil - informativeTextWithFormat:@"Are you sure you want to %@?", description]; + informativeTextWithFormat:@"Are you sure you want to %@?", sdesc]; NSMutableDictionary *info = [NSMutableDictionary dictionary]; if (ref) From a5acfe5b4a708d305951ecf99fc0ea63f7582eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Wed, 24 Mar 2010 04:54:54 +0100 Subject: [PATCH 015/110] Make some of the sheets resizable (you never know how much a user wants to enter ;)). --- English.lproj/PBCreateBranchSheet.xib | 97 ++++++++++++++++++++++----- English.lproj/PBCreateTagSheet.xib | 93 +++++++++++++++++++++---- 2 files changed, 162 insertions(+), 28 deletions(-) diff --git a/English.lproj/PBCreateBranchSheet.xib b/English.lproj/PBCreateBranchSheet.xib index e3abaf8..8ade334 100644 --- a/English.lproj/PBCreateBranchSheet.xib +++ b/English.lproj/PBCreateBranchSheet.xib @@ -1,18 +1,18 @@ - 1050 + 1060 10C540 - 732 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 740 YES - + YES @@ -39,15 +39,15 @@ NSApplication - 1 + 9 2 {{196, 343}, {480, 167}} 544736256 Window NSWindow - {1.79769e+308, 1.79769e+308} - {480, 201} + {2000, 167} + {480, 167} 274 @@ -75,7 +75,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -230,8 +230,8 @@ {{0, 0}, {1680, 1028}} - {480, 223} - {1.79769e+308, 1.79769e+308} + {480, 189} + {2000, 189} @@ -345,11 +345,11 @@ YES - + @@ -463,7 +463,9 @@ 1.NSWindowTemplate.visibleAtLaunch 1.WindowOrigin 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMaxSize 1.windowTemplate.hasMinSize + 1.windowTemplate.maxSize 1.windowTemplate.minSize 2.IBPluginDependency 20.IBPluginDependency @@ -483,14 +485,16 @@ YES - {{667, 732}, {480, 167}} + {{553, 730}, {480, 167}} com.apple.InterfaceBuilder.CocoaPlugin - {{667, 732}, {480, 167}} + {{553, 730}, {480, 167}} {196, 240} {{202, 428}, {480, 270}} - {480, 201} + + {2000, 167} + {480, 167} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -911,6 +915,69 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKSaveOptions.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + + + NSObject + + IBFrameworkSource + QuickLookUI.framework/Headers/QLPreviewPanel.h + + NSObject @@ -1091,7 +1158,7 @@ 0 com.apple.InterfaceBuilder.CocoaPlugin.macosx - + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/English.lproj/PBCreateTagSheet.xib b/English.lproj/PBCreateTagSheet.xib index a47eb30..3f58ceb 100644 --- a/English.lproj/PBCreateTagSheet.xib +++ b/English.lproj/PBCreateTagSheet.xib @@ -1,17 +1,18 @@ - 1050 + 1060 10C540 - 732 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 740 YES + YES @@ -38,17 +39,17 @@ NSApplication - 1 + 9 2 {{196, 233}, {425, 277}} 544736256 Window NSWindow - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} {425, 277} - + 256 YES @@ -74,7 +75,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -157,7 +158,7 @@ - 266 + 274 YES @@ -392,10 +393,11 @@ {425, 277} + {{0, 0}, {1680, 1028}} {425, 299} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} @@ -679,9 +681,9 @@ YES - {{798, 694}, {425, 277}} + {{768, 672}, {425, 277}} com.apple.InterfaceBuilder.CocoaPlugin - {{798, 694}, {425, 277}} + {{768, 672}, {425, 277}} {196, 240} {{202, 428}, {480, 270}} @@ -754,12 +756,14 @@ errorMessageField tagMessageText tagNameField + targetRefish YES NSTextField NSTextView NSTextField + id @@ -1113,6 +1117,69 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKSaveOptions.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + + + NSObject + + IBFrameworkSource + QuickLookUI.framework/Headers/QLPreviewPanel.h + + NSObject @@ -1325,14 +1392,14 @@ 0 com.apple.InterfaceBuilder.CocoaPlugin.macosx - + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES - GitX.xcodeproj + ../GitX.xcodeproj 3 From a980fcea035a70dd4203ba1e2736522b906310c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Wed, 24 Mar 2010 10:55:16 +0100 Subject: [PATCH 016/110] Make remaining sheets resizable as well. --- English.lproj/PBAddRemoteSheet.xib | 76 ++++++++++++++++++---- English.lproj/PBCloneRepositoryPanel.xib | 80 ++++++++++++++++++++---- English.lproj/PBRemoteProgressSheet.xib | 71 +++++++++++++++++---- 3 files changed, 193 insertions(+), 34 deletions(-) diff --git a/English.lproj/PBAddRemoteSheet.xib b/English.lproj/PBAddRemoteSheet.xib index 03ecd45..5c90b77 100644 --- a/English.lproj/PBAddRemoteSheet.xib +++ b/English.lproj/PBAddRemoteSheet.xib @@ -3,17 +3,17 @@ 1050 10C540 - 759 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 759 + 740 YES - + YES @@ -40,15 +40,15 @@ NSApplication - 1 + 9 2 {{196, 317}, {480, 193}} 544736256 Add Remote Sheet NSWindow - {1.79769e+308, 1.79769e+308} - {480, 156} + {2000, 193} + {480, 193} 256 @@ -110,7 +110,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -216,7 +216,7 @@ - 268 + 265 {{384, 58}, {76, 17}} YES @@ -263,8 +263,8 @@ {{0, 0}, {1680, 1028}} - {480, 178} - {1.79769e+308, 1.79769e+308} + {480, 215} + {2000, 215} @@ -598,7 +598,9 @@ 1.NSWindowTemplate.visibleAtLaunch 1.WindowOrigin 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMaxSize 1.windowTemplate.hasMinSize + 1.windowTemplate.maxSize 1.windowTemplate.minSize 10.IBPluginDependency 11.IBPluginDependency @@ -634,7 +636,9 @@ {196, 240} {{202, 428}, {480, 270}} - {480, 156} + + {2000, 193} + {480, 193} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1078,6 +1082,55 @@ dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvAFoundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + NSObject @@ -1256,7 +1309,6 @@ dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvA 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/English.lproj/PBCloneRepositoryPanel.xib b/English.lproj/PBCloneRepositoryPanel.xib index 01e2318..78bc84b 100644 --- a/English.lproj/PBCloneRepositoryPanel.xib +++ b/English.lproj/PBCloneRepositoryPanel.xib @@ -3,12 +3,12 @@ 1050 10C540 - 759 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 759 + 740 YES @@ -46,7 +46,8 @@ Clone Git Repository NSWindow - {1.79769e+308, 1.79769e+308} + {2000, 185} + {488, 185} 256 @@ -108,7 +109,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -258,7 +259,7 @@ - 265 + 268 {{136, 63}, {177, 18}} YES @@ -288,7 +289,8 @@ {{0, 0}, {2560, 1578}} - {1.79769e+308, 1.79769e+308} + {488, 207} + {2000, 207} PBCloneRepositoryPanel @@ -330,7 +332,7 @@ Window NSWindow - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} 274 @@ -369,7 +371,7 @@ {397, 98} {{0, 0}, {2560, 1578}} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} @@ -727,6 +729,10 @@ 1.NSWindowTemplate.visibleAtLaunch 1.WindowOrigin 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMaxSize + 1.windowTemplate.hasMinSize + 1.windowTemplate.maxSize + 1.windowTemplate.minSize 10.IBPluginDependency 11.IBPluginDependency 12.IBPluginDependency @@ -769,12 +775,16 @@ YES - {{468, 1011}, {488, 185}} + {{587, 784}, {488, 185}} com.apple.InterfaceBuilder.CocoaPlugin - {{468, 1011}, {488, 185}} + {{587, 784}, {488, 185}} {196, 240} {{202, 428}, {480, 270}} + + + {2000, 185} + {488, 185} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1241,6 +1251,55 @@ dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvAFoundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + NSObject @@ -1427,7 +1486,6 @@ dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvA 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/English.lproj/PBRemoteProgressSheet.xib b/English.lproj/PBRemoteProgressSheet.xib index 2a01a42..ca616cf 100644 --- a/English.lproj/PBRemoteProgressSheet.xib +++ b/English.lproj/PBRemoteProgressSheet.xib @@ -3,12 +3,12 @@ 1050 10C540 - 732 + 740 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 740 YES @@ -41,12 +41,12 @@ 1 2 - {{196, 412}, {397, 98}} + {{196, 408}, {397, 102}} 544736256 Window NSWindow - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} 274 @@ -56,7 +56,7 @@ 1314 - {{35, 16}, {344, 20}} + {{23, 24}, {351, 20}} 16394 100 @@ -64,7 +64,7 @@ 274 - {{17, 44}, {363, 34}} + {{17, 52}, {363, 30}} YES @@ -83,7 +83,7 @@ controlColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -98,11 +98,11 @@ - {397, 98} + {397, 102} {{0, 0}, {1680, 1028}} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} @@ -220,9 +220,9 @@ YES - {{639, 822}, {397, 98}} + {{814, 826}, {397, 102}} com.apple.InterfaceBuilder.CocoaPlugin - {{639, 822}, {397, 98}} + {{814, 826}, {397, 102}} {196, 240} {{202, 428}, {480, 270}} @@ -606,6 +606,55 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + NSObject From d5f9c822af952cec5b03051532758172553f8089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Wed, 24 Mar 2010 04:56:59 +0100 Subject: [PATCH 017/110] PBGitHistoryView.xib: Set Key Equiv. of QuickLook button to Space. --- PBGitHistoryView.xib | 137 ++++++++++++++++++++++++++++--------------- 1 file changed, 90 insertions(+), 47 deletions(-) diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 8641614..0f486eb 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -3,7 +3,7 @@ 1050 10C540 - 762 + 740 1038.25 458.00 @@ -15,18 +15,18 @@ YES - 762 - 762 + 740 + 740 YES - + YES - com.apple.InterfaceBuilder.CocoaPlugin com.apple.WebKitIBPlugin + com.apple.InterfaceBuilder.CocoaPlugin YES @@ -131,7 +131,7 @@ NSQuickLookTemplate - + IA 400 75 @@ -408,7 +408,7 @@ 3 - MC4zMzMzMzI5OQA + MC4zMzMzMzI5ODU2AA 6 @@ -436,7 +436,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2ODY1AA @@ -480,7 +480,7 @@ DateColumn 165 10 - 3.4028229999999999e+38 + 3.4028230607370965e+38 75628096 2048 @@ -511,7 +511,7 @@ SHAColumn 30 10 - 3.4028229999999999e+38 + 3.4028230607370965e+38 75628096 2048 @@ -573,7 +573,7 @@ _doScroller: - 0.87603305785123964 + 0.87603306770324707 @@ -583,7 +583,7 @@ 1 _doScroller: - 0.9988276670574443 + 0.99882769584655762 @@ -881,7 +881,7 @@ 3 - MC4zMzMzMzI5OQA + MC4zMzMzMzI5ODU2AA @@ -928,7 +928,7 @@ _doScroller: - 0.9948186 + 0.99481862783432007 @@ -938,8 +938,8 @@ 1 _doScroller: - 0.0045045049999999998 - 0.99801189999999995 + 0.0045045050792396069 + 0.99801188707351685 {208, 234} @@ -964,7 +964,7 @@ 2322 - {545, 120} + {545, 98} @@ -1151,7 +1151,7 @@ 7 - {1186, 1e+07} + {1190, 1e+07} {0, 0} @@ -1174,7 +1174,7 @@ _doScroller: - 0.030031680000000002 + 0.030031679198145866 @@ -1185,7 +1185,7 @@ _doScroller: 1 - 0.94565220000000005 + 0.94565218687057495 {{209, 0}, {645, 234}} @@ -2980,6 +2980,9 @@ commitController commitList historyController + pullItem + pushItem + rebaseItem YES @@ -2987,6 +2990,9 @@ NSArrayController PBCommitList PBGitHistoryController + KBPopUpToolbarItem + KBPopUpToolbarItem + KBPopUpToolbarItem @@ -3470,6 +3476,69 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKSaveOptions.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + + + NSObject + + IBFrameworkSource + QuickLookUI.framework/Headers/QLPreviewPanel.h + + NSObject @@ -3800,14 +3869,13 @@ 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.macosx - + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 @@ -3816,30 +3884,5 @@ YES GitX.xcodeproj 3 - - YES - - YES - AddBranchTemplate - AddLabelTemplate - CherryPickTemplate - DetailViewTemplate - MergeTemplate - NSPathTemplate - NSQuickLookTemplate - RebaseTemplate - - - YES - {20, 12} - {23, 12} - {18.5143, 12.3429} - {17, 17} - {16.4571, 12.3429} - {16, 9} - {19, 11} - {16.4571, 13.3714} - - From fffa02425af59759e3a47401b3c7d2eb6790571b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Wed, 24 Mar 2010 09:20:37 +0100 Subject: [PATCH 018/110] SCNetworkCheckReachabilityByName will be deprecated anyways, so replace it with the docs example which will work on any OS version from 10.3. Modified-by: Nathan Kinsinger Released the target to stop memory leak. --- PBWebController.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PBWebController.m b/PBWebController.m index d185593..27b672c 100644 --- a/PBWebController.m +++ b/PBWebController.m @@ -110,8 +110,14 @@ - (BOOL) isReachable:(NSString *)hostname { - SCNetworkConnectionFlags flags; - if (!SCNetworkCheckReachabilityByName([hostname cStringUsingEncoding:NSASCIIStringEncoding], &flags)) + SCNetworkReachabilityRef target; + SCNetworkConnectionFlags flags = 0; + Boolean reachable; + target = SCNetworkReachabilityCreateWithName(NULL, [hostname cStringUsingEncoding:NSASCIIStringEncoding]); + reachable = SCNetworkReachabilityGetFlags(target, &flags); + CFRelease(target); + + if (!reachable) return FALSE; // If a connection is required, then it's not reachable From 71c0f30ae515d66b059df6400ae5149f7a45779f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Tue, 30 Mar 2010 14:33:49 +0200 Subject: [PATCH 019/110] Stability: employ more sanity checks when parsing author details from history.js --- html/views/history/history.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/html/views/history/history.js b/html/views/history/history.js index ab06b4f..eabcf41 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -32,15 +32,25 @@ var Commit = function(obj) { } this.header = this.raw.substring(0, messageStart); - var match = this.header.match(/\nauthor (.*) <(.*@.*|.*)> ([0-9].*)/); - if (!(match[2].match(/@[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/))) - this.author_email = match[2]; + if (typeof this.header !== 'undefined') { + var match = this.header.match(/\nauthor (.*) <(.*@.*|.*)> ([0-9].*)/); + if (typeof match !== 'undefined' && typeof match[2] !== 'undefined') { + if (!(match[2].match(/@[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/))) + this.author_email = match[2]; + + this.author_date = new Date(parseInt(match[3]) * 1000); + + match = this.header.match(/\ncommitter (.*) <(.*@.*|.*)> ([0-9].*)/); + if (typeof match !== 'undefined') { + this.committer_name = match[1]; + this.committer_email = match[2]; + } else { + this.committer_name = "undefined"; + this.committer_email = "undefined"; + } + } + } - this.author_date = new Date(parseInt(match[3]) * 1000); - - match = this.header.match(/\ncommitter (.*) <(.*@.*|.*)> ([0-9].*)/); - this.committer_name = match[1]; - this.committer_email = match[2]; this.committer_date = new Date(parseInt(match[3]) * 1000); } From 10149fc5f3654df0a1e94bcea5d0b5ed2ea01c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Tue, 30 Mar 2010 15:53:20 +0200 Subject: [PATCH 020/110] Add in left-out (id) return labels to some methods in PBGitCommit. --- PBGitCommit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PBGitCommit.h b/PBGitCommit.h index 3e361e9..02ceb03 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -34,11 +34,11 @@ extern NSString * const kGitXCommitType; PBGitRepository* repository; } -+ commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha; -- initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; ++ (id) commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha; +- (id) initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; -- (void)addRef:(PBGitRef *)ref; -- (void)removeRef:(id)ref; +- (void) addRef:(PBGitRef *)ref; +- (void) removeRef:(id)ref; - (BOOL) hasRef:(PBGitRef *)ref; - (NSString *)realSha; From dac9bd303b98a5daea41cef506cf70ac15e88874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Mon, 5 Apr 2010 11:04:00 +0200 Subject: [PATCH 021/110] Make default (id) explicit for some method decls/defs in PBGitHistoryController.m --- PBGitHistoryController.h | 4 ++-- PBGitHistoryController.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index e96b87a..ba10842 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -58,9 +58,9 @@ - (IBAction) setBranchFilter:(id)sender; - (void) selectCommit: (NSString*) commit; -- (IBAction) refresh: sender; +- (IBAction) refresh:(id)sender; - (IBAction) toggleQLPreviewPanel:(id)sender; -- (IBAction) openSelectedFile: sender; +- (IBAction) openSelectedFile:(id)sender; - (void) updateQuicklookForce: (BOOL) force; // Context menu methods diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index e9559c8..8ff0b8c 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -243,7 +243,7 @@ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } -- (IBAction) openSelectedFile: sender +- (IBAction) openSelectedFile:(id)sender { NSArray* selectedFiles = [treeController selectedObjects]; if ([selectedFiles count] == 0) @@ -339,7 +339,7 @@ } } -- (IBAction) refresh: sender +- (IBAction) refresh:(id)sender { [repository forceUpdateRevisions]; } From 427409b1c954ab8e54a81080081069121625596c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Mon, 5 Apr 2010 10:52:21 +0200 Subject: [PATCH 022/110] Populate the revList if empty in -commitForSHA: I found that at a few points logic was based on items from revList but at that point in the execution the revList was always empty. --- PBGitRepository.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PBGitRepository.m b/PBGitRepository.m index efc5600..f21902c 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -333,6 +333,10 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return nil; NSArray *revList = revisionList.projectCommits; + if (!revList) { + [revisionList forceUpdate]; + revList = revisionList.projectCommits; + } for (PBGitCommit *commit in revList) if ([[commit realSha] isEqualToString:sha]) return commit; From c073202699861c253001fcfe8d7c2d34acd11ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Mon, 5 Apr 2010 16:12:11 +0200 Subject: [PATCH 023/110] Put at-sign in front of multi-line continued string. Probably doesn't matter since the compiler should concatenate both forms equally. --- PBGitBinary.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitBinary.m b/PBGitBinary.m index 795891d..6b1a488 100644 --- a/PBGitBinary.m +++ b/PBGitBinary.m @@ -110,7 +110,7 @@ static NSMutableArray *locations = nil; { NSMutableString *error = [NSMutableString stringWithString: @"Could not find a git binary version " MIN_GIT_VERSION " or higher.\n" - "Please make sure there is a git binary in one of the following locations:\n\n"]; + @"Please make sure there is a git binary in one of the following locations:\n\n"]; for (NSString *location in [PBGitBinary searchLocations]) { [error appendFormat:@"\t%@\n", location]; } From 504b61744d73786ec5fef7f05dd57913f5607872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Mon, 5 Apr 2010 16:22:06 +0200 Subject: [PATCH 024/110] Add PBStringFromBranchFilterType() function for debugging purposes to PBGitRepository. Add a PBGitXBranchFilterType typedef to the kGitX... branch filters enum. --- PBGitRepository.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index 4ef3dac..f9e6dda 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -13,11 +13,28 @@ #import "PBGitRefish.h" extern NSString* PBGitRepositoryErrorDomain; -enum branchFilterTypes { +typedef enum branchFilterTypes { kGitXAllBranchesFilter = 0, kGitXLocalRemoteBranchesFilter, kGitXSelectedBranchFilter -}; +} PBGitXBranchFilterType; + +static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { + switch (type) { + case kGitXAllBranchesFilter: + return @"All"; + break; + case kGitXLocalRemoteBranchesFilter: + return @"Local"; + break; + case kGitXSelectedBranchFilter: + return @"Selected"; + break; + default: + break; + } + return @"Not a branch filter type"; +} @class PBGitWindowController; @class PBGitCommit; From a7106ba60df3e31d40ea10cc8900abbf7971bcb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Mon, 5 Apr 2010 16:25:08 +0200 Subject: [PATCH 025/110] Add a method declaration to PBGitRevSpecifier.h to silence a compiler warning. --- PBGitRevSpecifier.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PBGitRevSpecifier.h b/PBGitRevSpecifier.h index 4e13175..a8d97f2 100644 --- a/PBGitRevSpecifier.h +++ b/PBGitRevSpecifier.h @@ -16,6 +16,7 @@ BOOL isSimpleRef; } +- (id) initWithParameters:(NSArray *)params description:(NSString *)descrip; - (id) initWithParameters:(NSArray*) params; - (id) initWithRef: (PBGitRef*) ref; From 969ff24ac70d1dbd9f212b144cf8ded86ef48fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Berg?= Date: Mon, 5 Apr 2010 16:32:59 +0200 Subject: [PATCH 026/110] Bug fix: correct visible index scrolling in PBGitHistoryController and PBCommitList. If the current branch filter is switched to "All" or "Local" the index that's calculated as being the targeted index to scroll to visible, is off by the amount in Y that the bottom split view separator is off from a multiple of rows. -adjustScroll: on PBCommitList is called automatically whenever the list needs laying out. An ivar keeps track if we come from the -scrollSelectionToTopOfViewFrom: method of PBGitHistoryController. I'll leave the commented out NSLogs in there in case they're needed for debugging again later. --- PBCommitList.h | 3 ++- PBCommitList.m | 36 +++++++++++++++++++++++++++++++++++- PBGitHistoryController.h | 3 ++- PBGitHistoryController.m | 13 ++++++++++--- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/PBCommitList.h b/PBCommitList.h index 069aeae..d83dd80 100644 --- a/PBCommitList.h +++ b/PBCommitList.h @@ -16,9 +16,10 @@ IBOutlet WebView* webView; IBOutlet PBWebHistoryController *webController; IBOutlet PBGitHistoryController *controller; - + BOOL useAdjustScroll; NSPoint mouseDownPoint; } @property (readonly) NSPoint mouseDownPoint; +@property (assign) BOOL useAdjustScroll; @end diff --git a/PBCommitList.m b/PBCommitList.m index e2f6f23..0060a07 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -13,6 +13,8 @@ @implementation PBCommitList @synthesize mouseDownPoint; +@synthesize useAdjustScroll; + - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL) local { return NSDragOperationCopy; @@ -47,7 +49,39 @@ - (void) copy:(id)sender { [controller copyCommitInfo]; -}; +} + +// !!! Andre Berg 20100330: Used from -scrollSelectionToTopOfViewFrom: of PBGitHistoryController +// so that when the history controller udpates the branch filter the origin of the superview gets +// shifted into multiples of the row height. Otherwise the top selected row will always be off by +// 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)); + NSRect newRect = proposedVisibleRect; + + // !!! Andre Berg 20100330: only modify if -scrollSelectionToTopOfViewFrom: has set useAdjustScroll to YES + // Otherwise we'd also constrain things like middle mouse scrolling. + if (useAdjustScroll) { + NSInteger rh = [self rowHeight]; + NSInteger ny = (NSInteger)proposedVisibleRect.origin.y % (NSInteger)rh; + 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)); + if (sr.origin.y > proposedVisibleRect.origin.y) { + // NSLog(@"[%@ %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); + 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); + } + } + //NSLog(@"[%@ %s]: newRect: %@", [self class], _cmd, NSStringFromRect(newRect)); + return newRect; +} - (void)mouseDown:(NSEvent *)theEvent { diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index ba10842..3c92168 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -16,6 +16,7 @@ @class PBGitGradientBarView; @class PBRefController; @class QLPreviewPanel; +@class PBCommitList; @interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; @@ -24,7 +25,7 @@ IBOutlet NSTreeController* treeController; IBOutlet NSOutlineView* fileBrowser; NSArray *currentFileBrowserSelectionPath; - IBOutlet NSTableView* commitList; + IBOutlet PBCommitList* commitList; IBOutlet PBCollapsibleSplitView *historySplitView; QLPreviewPanel* previewPanel; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 8ff0b8c..9e0fafb 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -363,19 +363,26 @@ - (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex { - if (oldIndex == NSIntegerMax) + if (oldIndex == NSNotFound) oldIndex = 0; NSInteger newIndex = [[commitController selectionIndexes] firstIndex]; if (newIndex > oldIndex) { - NSInteger visibleRows = floorf([[commitList superview] bounds].size.height / [commitList rowHeight]); - newIndex += visibleRows - 1; + CGFloat sviewHeight = [[commitList superview] bounds].size.height; + CGFloat rowHeight = [commitList rowHeight]; + NSInteger visibleRows = roundf(sviewHeight / rowHeight ); + newIndex += (visibleRows - 1); if (newIndex >= [[commitController content] count]) newIndex = [[commitController content] count] - 1; } + if (newIndex != oldIndex) { + commitList.useAdjustScroll = YES; + } + [commitList scrollRowToVisible:newIndex]; + commitList.useAdjustScroll = NO; } - (NSArray *) selectedObjectsForSHA:(NSString *)commitSHA From 2ad624f7a88a537ea54e5e8f2c4f6312881f5541 Mon Sep 17 00:00:00 2001 From: Seth Raphael Date: Tue, 11 May 2010 15:07:07 -0700 Subject: [PATCH 027/110] Follow Commit-msg hook rules: allow it to edit the commit message, before committing. --- PBGitIndex.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index 39ed3b4..4265766 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -175,13 +175,6 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; [self postCommitUpdate:@"Creating commit"]; int ret = 1; - NSString *commit = [repository outputForArguments:arguments - inputString:commitMessage - byExtendingEnvironment:amendEnvironment - retValue: &ret]; - - if (ret || [commit length] != 40) - return [self postCommitFailure:@"Could not create a commit object"]; [self postCommitUpdate:@"Running hooks"]; if (![repository executeHook:@"pre-commit" output:nil]) @@ -190,6 +183,16 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) return [self postCommitFailure:@"Commit-msg hook failed"]; + commitMessage = [NSString stringWithContentsOfFile:commitMessageFile encoding:NSUTF8StringEncoding error:nil]; + + NSString *commit = [repository outputForArguments:arguments + inputString:commitMessage + byExtendingEnvironment:amendEnvironment + retValue: &ret]; + + if (ret || [commit length] != 40) + return [self postCommitFailure:@"Could not create a commit object"]; + [self postCommitUpdate:@"Updating HEAD"]; [repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-m", commitSubject, @"HEAD", commit, nil] retValue: &ret]; From 83e7c42ab482e4610d88d6ac32df3db91243f0b1 Mon Sep 17 00:00:00 2001 From: ngu Date: Sat, 10 Apr 2010 20:46:17 +0300 Subject: [PATCH 028/110] Highlight the current commit with an orange circle --- PBGitRepository.h | 1 + PBGitRepository.m | 8 +++++++- PBGitRevisionCell.m | 18 +++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index f9e6dda..0236a06 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -50,6 +50,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { NSMutableDictionary *refs; PBGitRevSpecifier *_headRef; // Caching + NSString* _headSha; } - (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare; diff --git a/PBGitRepository.m b/PBGitRepository.m index f21902c..f401aa6 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -234,6 +234,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; - (void) reloadRefs { _headRef = nil; + _headSha = nil; refs = [NSMutableDictionary dictionary]; NSMutableArray *oldBranches = [branches mutableCopy]; @@ -287,12 +288,17 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; else _headRef = [[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:@"HEAD"]]; + _headSha = [self shaForRef:[_headRef ref]]; + return _headRef; } - (NSString *) headSHA { - return [self shaForRef:[[self headRef] ref]]; + if (! _headSha) + [self headRef]; + + return _headSha; } - (PBGitCommit *) headCommit diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 0a129f1..9a7ccac 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -54,6 +54,16 @@ } +- (BOOL) isCurrentCommit +{ + NSString* thisSha = [self.objectValue realSha]; + + PBGitRepository* repository = [self.objectValue repository]; + NSString* currentSha = [repository headSHA]; + + return [ currentSha isEqualToString : thisSha ]; +} + - (void) drawCircleInRect: (NSRect) r { @@ -71,7 +81,13 @@ [path fill]; NSRect smallOval = { columnOrigin.x - 3, columnOrigin.y + r.size.height * 0.5 - 3, 6, 6}; - [[NSColor whiteColor] set]; + + if ( [self isCurrentCommit ] ) { + [[NSColor colorWithCalibratedRed: 0Xfc/256.0 green:0Xa6/256.0 blue: 0X4f/256.0 alpha: 1.0] set]; + } else { + [[NSColor whiteColor] set]; + } + path = [NSBezierPath bezierPathWithOvalInRect:smallOval]; [path fill]; } From 1b3f4ea4da76645c7fb77b7dadd329f463f5c8e5 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Jun 2010 09:05:43 -0600 Subject: [PATCH 029/110] Remove uses of dot notation for non properties of NSTask. --- PBEasyPipe.m | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PBEasyPipe.m b/PBEasyPipe.m index 5108254..f2d49fa 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -19,10 +19,10 @@ + (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir { NSTask* task = [[NSTask alloc] init]; - task.launchPath = cmd; - task.arguments = args; + [task setLaunchPath:cmd]; + [task setArguments:args]; if (dir) - task.currentDirectoryPath = dir; + [task setCurrentDirectoryPath:dir]; if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Show Debug Messages"]) NSLog(@"Starting command `%@ %@` in dir %@", cmd, [args componentsJoinedByString:@" "], dir); @@ -31,15 +31,15 @@ #endif NSPipe* pipe = [NSPipe pipe]; - task.standardOutput = pipe; - task.standardError = pipe; + [task setStandardOutput:pipe]; + [task setStandardError:pipe]; return task; } + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir { NSTask *task = [self taskForCommand:cmd withArgs:args inDir:dir]; - NSFileHandle* handle = [task.standardOutput fileHandleForReading]; + NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; [task launch]; return handle; @@ -76,14 +76,14 @@ if (dict) { NSMutableDictionary *env = [[[NSProcessInfo processInfo] environment] mutableCopy]; [env addEntriesFromDictionary:dict]; - task.environment = env; + [task setEnvironment:env]; } - NSFileHandle* handle = [task.standardOutput fileHandleForReading]; + NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; if (input) { - task.standardInput = [NSPipe pipe]; - NSFileHandle *inHandle = [task.standardInput fileHandleForWriting]; + [task setStandardInput:[NSPipe pipe]]; + NSFileHandle *inHandle = [[task standardInput] fileHandleForWriting]; [inHandle writeData:[input dataUsingEncoding:NSUTF8StringEncoding]]; [inHandle closeFile]; } @@ -111,10 +111,10 @@ + (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir { NSTask *task = [self taskForCommand:cmd withArgs:args inDir:dir]; - NSFileHandle* handle = [task.standardOutput fileHandleForReading]; + NSFileHandle* handle = [[task standardOutput] fileHandleForReading]; [task launch]; -#warning This can cause a "Bad file descriptor"... when? + // This can cause a "Bad file descriptor"... when? NSData *data; @try { data = [handle readDataToEndOfFile]; From 693a23d545b758cd3cc60b714ffbed08c55c075a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Jun 2010 12:07:41 -0600 Subject: [PATCH 030/110] Bugfix: don't remove all notifications from the web history controller removeObserver: removes the controller from all notifications. The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences. --- PBWebHistoryController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index e3467c0..08279cf 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -67,13 +67,15 @@ NSFileHandle *handle = [repository handleForArguments:taskArguments]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; // Remove notification, in case we have another one running - [nc removeObserver:self]; + [nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; [nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; [handle readToEndOfFileInBackgroundAndNotify]; } - (void)commitDetailsLoaded:(NSNotification *)notification { + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil]; + NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem]; if (!data) return; From e4f6f960c7461e647bc08e70469ec67fb61a1fcb Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Jun 2010 14:34:52 -0600 Subject: [PATCH 031/110] Remove call to finalize --- PBGitCommitController.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 37f5773..18cfd55 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -64,10 +64,9 @@ [unstagedFilesController setAutomaticallyRearrangesObjects:NO]; } -- (void) removeView +- (void)removeView { [webController closeView]; - [super finalize]; } - (NSResponder *)firstResponder; From 2c6a16a6a993f065105dcded59f883cec0cc6c19 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Jun 2010 14:38:16 -0600 Subject: [PATCH 032/110] Stop a view that was not loaded from being loaded while being removed. Example: If GitX started in stage view and the window was closed without ever looking at the history view, then [self view] will cause the history view's nib to be loaded which kicks off loading in the rev list. Wastes a lot of CPU cycles for no reason. --- PBViewController.h | 1 + PBViewController.m | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PBViewController.h b/PBViewController.h index 9c15d69..6dae8af 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -16,6 +16,7 @@ NSString *status; BOOL isBusy; + BOOL hasViewLoaded; } @property (readonly) __weak PBGitRepository *repository; diff --git a/PBViewController.m b/PBViewController.m index d4c1832..717912e 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -27,14 +27,16 @@ return self; } -- (void) removeView +- (void)removeView { [self unbind:@"repository"]; - [[self view] removeFromSuperview]; // remove the current view + if (hasViewLoaded) + [[self view] removeFromSuperview]; // remove the current view } -- (void) awakeFromNib +- (void)awakeFromNib { + hasViewLoaded = YES; } - (NSResponder *)firstResponder; From fb5f9a5cd501ea4d66b4bfdc2875c70e0655536f Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 26 Jun 2010 17:49:28 -0600 Subject: [PATCH 033/110] Cache the lane colors To reduce the number of objects created and destroyed while scrolling through the history list. Also use a more descriptive name. --- PBGitRevisionCell.m | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 9a7ccac..abbf29c 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -20,16 +20,20 @@ return self; } -- (NSArray*) colors ++ (NSArray *)laneColors { - return [NSArray arrayWithObjects: - [NSColor colorWithCalibratedRed: 0X4e/256.0 green:0X9A/256.0 blue: 0X06/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0X20/256.0 green:0X4A/256.0 blue: 0X87/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XC4/256.0 green:0XA0/256.0 blue: 0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0X5C/256.0 green:0X35/256.0 blue: 0X66/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XA4/256.0 green:0X00/256.0 blue: 0X00/256.0 alpha: 1.0], - [NSColor colorWithCalibratedRed: 0XCE/256.0 green:0X5C/256.0 blue: 0 alpha: 1.0], - nil]; + static NSArray *laneColors = nil; + if (!laneColors) + laneColors = [NSArray arrayWithObjects: + [NSColor colorWithCalibratedRed: 0X4e/256.0 green:0X9A/256.0 blue: 0X06/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0X20/256.0 green:0X4A/256.0 blue: 0X87/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XC4/256.0 green:0XA0/256.0 blue: 0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0X5C/256.0 green:0X35/256.0 blue: 0X66/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XA4/256.0 green:0X00/256.0 blue: 0X00/256.0 alpha: 1.0], + [NSColor colorWithCalibratedRed: 0XCE/256.0 green:0X5C/256.0 blue: 0 alpha: 1.0], + nil]; + + return laneColors; } - (void) drawLineFromColumn: (int) from toColumn: (int) to inRect: (NSRect) r offset: (int) offset color: (int) c @@ -41,8 +45,7 @@ NSPoint source = NSMakePoint(origin.x + columnWidth* from, origin.y + offset); NSPoint center = NSMakePoint( origin.x + columnWidth * to, origin.y + r.size.height * 0.5 + 0.5); - // Just use red for now. - NSArray* colors = [self colors]; + NSArray* colors = [PBGitRevisionCell laneColors]; [[colors objectAtIndex: c % [colors count]] set]; NSBezierPath * path = [NSBezierPath bezierPath]; From 25caa849fe05b6352f2b1eb7b30da1f837ca766b Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Fri, 18 Jun 2010 15:12:27 +0200 Subject: [PATCH 034/110] Fix safari 5 render issue --- html/views/history/history.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/history/history.css b/html/views/history/history.css index 2f2c9c5..dbad36d 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -3,7 +3,7 @@ body { } #commit_header { - width: 100%; + width: auto; font-size: 12px; padding-left: 5px; padding-right: 5px; From 1bad051779739d05ff330ef740bf246dc861a841 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 09:04:03 -0600 Subject: [PATCH 035/110] Bugfix: fix duplicate commits in the history view 1) stop a threading issue with old commits being added after the commits array was reset 2) stop using --early-output (shouldn't there be an incremental output option???) --- PBGitHistoryGrapher.h | 7 ++++++- PBGitHistoryGrapher.m | 14 +++++++++++--- PBGitHistoryList.h | 2 +- PBGitHistoryList.m | 13 ++++++++++++- PBGitRevList.mm | 26 +------------------------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/PBGitHistoryGrapher.h b/PBGitHistoryGrapher.h index adb0ee2..0e02e6a 100644 --- a/PBGitHistoryGrapher.h +++ b/PBGitHistoryGrapher.h @@ -9,18 +9,23 @@ #import +#define kCurrentQueueKey @"kCurrentQueueKey" +#define kNewCommitsKey @"kNewCommitsKey" + + @class PBGitGrapher; @interface PBGitHistoryGrapher : NSObject { id delegate; + NSOperationQueue *currentQueue; NSMutableSet *searchSHAs; PBGitGrapher *grapher; BOOL viewAllBranches; } -- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate; +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll queue:(NSOperationQueue *)queue delegate:(id)theDelegate; - (void) graphCommits:(NSArray *)revList; @end diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index 76bbd70..4769950 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -13,9 +13,10 @@ @implementation PBGitHistoryGrapher -- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll queue:(NSOperationQueue *)queue delegate:(id)theDelegate { delegate = theDelegate; + currentQueue = queue; searchSHAs = [NSMutableSet setWithSet:commits]; grapher = [[PBGitGrapher alloc] initWithRepository:nil]; viewAllBranches = viewAll; @@ -24,6 +25,13 @@ } +- (void)sendCommits:(NSArray *)commits +{ + NSDictionary *commitData = [NSDictionary dictionaryWithObjectsAndKeys:currentQueue, kCurrentQueueKey, commits, kNewCommitsKey, nil]; + [delegate performSelectorOnMainThread:@selector(updateCommitsFromGrapher:) withObject:commitData waitUntilDone:NO]; +} + + - (void) graphCommits:(NSArray *)revList { if (!revList || [revList count] == 0) @@ -43,12 +51,12 @@ } } if (++counter % 2000 == 0) { - [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:[commits copy] waitUntilDone:NO]; + [self sendCommits:commits]; commits = [NSMutableArray array]; } } - [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:commits waitUntilDone:YES]; + [self sendCommits:commits]; [delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO]; } diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index 4cf55e0..93fdcd3 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -40,7 +40,7 @@ - (void) forceUpdate; - (void) updateHistory; -- (void) addCommitsFromArray:(NSArray *)array; +- (void) updateCommitsFromGrapher:(NSDictionary *)commitData; @property (retain) PBGitRevList *projectRevList; diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 584dbe1..59cb3c4 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -95,6 +95,7 @@ { if (!array || [array count] == 0) return; + if (resetCommits) { self.commits = [NSMutableArray array]; resetCommits = NO; @@ -109,6 +110,14 @@ } +- (void) updateCommitsFromGrapher:(NSDictionary *)commitData +{ + if ([commitData objectForKey:kCurrentQueueKey] != graphQueue) + return; + + [self addCommitsFromArray:[commitData objectForKey:kNewCommitsKey]]; +} + - (void) finishedGraphing { if (!currentRevList.isParsing && ([[graphQueue operations] count] == 0)) { @@ -204,7 +213,7 @@ { BOOL viewAllBranches = (repository.currentBranchFilter == kGitXAllBranchesFilter); - return [[PBGitHistoryGrapher alloc] initWithBaseCommits:[self baseCommits] viewAllBranches:viewAllBranches delegate:self]; + return [[PBGitHistoryGrapher alloc] initWithBaseCommits:[self baseCommits] viewAllBranches:viewAllBranches queue:graphQueue delegate:self]; } @@ -301,6 +310,7 @@ lastBranchFilter = -1; lastRemoteRef = nil; lastSHA = nil; + self.commits = [NSMutableArray array]; [projectRevList loadRevisons]; return; } @@ -318,6 +328,7 @@ lastBranchFilter = -1; lastRemoteRef = nil; lastSHA = nil; + self.commits = [NSMutableArray array]; [otherRevListParser loadRevisons]; } diff --git a/PBGitRevList.mm b/PBGitRevList.mm index e0374ec..f282484 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -102,7 +102,7 @@ using namespace std; if (showSign) formatString = [formatString stringByAppendingString:@"\01%m"]; - NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--early-output", @"--topo-order", @"--children", formatString, nil]; + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--topo-order", @"--children", formatString, nil]; if (!rev) [arguments addObject:@"HEAD"]; @@ -124,30 +124,6 @@ using namespace std; if (!getline(stream, sha, '\1')) break; - // We reached the end of some temporary output. Show what we have - // until now, and then start again. The sha of the next thing is still - // in this buffer. So, we use a substring of current input. - if (sha[1] == 'i') // Matches 'Final output' - { - num = 0; - if ([currentThread isCancelled]) - break; - - NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; - [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; - revisions = [NSMutableArray array]; - - if (isGraphing) - g = [[PBGitGrapher alloc] initWithRepository:repository]; - revisions = [NSMutableArray array]; - - // If the length is < 40, then there are no commits.. quit now - if (sha.length() < 40) - break; - - sha = sha.substr(sha.length() - 40, 40); - } - // From now on, 1.2 seconds string encoding_str; getline(stream, encoding_str, '\1'); From e067390fb22a9619efdbb8c29952ed9b7ec09ee3 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 09:04:30 -0600 Subject: [PATCH 036/110] Bugfix: Stop committer names from getting mangled If the commit's detail is not UTF8 then PBWebHistoryController's commitDetailsLoaded: method will drop down to Latin1. That can cause character's in the committer's name to not be converted correctly. Move parsing the name to PBGitRevList where the correct encoding can be determined. --- PBGitCommit.h | 2 ++ PBGitCommit.m | 1 + PBGitRevList.mm | 6 +++++- html/views/history/history.js | 21 +++++++++------------ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/PBGitCommit.h b/PBGitCommit.h index 02ceb03..9e4da8d 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -23,6 +23,7 @@ extern NSString * const kGitXCommitType; NSString* subject; NSString* author; + NSString *committer; NSString* details; NSString *_patch; NSArray* parents; @@ -53,6 +54,7 @@ extern NSString * const kGitXCommitType; @property (readonly) git_oid *sha; @property (copy) NSString* subject; @property (copy) NSString* author; +@property (copy) NSString *committer; @property (readonly) NSArray* parents; // TODO: remove this and its uses @property (assign) git_oid *parentShas; diff --git a/PBGitCommit.m b/PBGitCommit.m index a9b3b15..6bb9d56 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -16,6 +16,7 @@ NSString * const kGitXCommitType = @"commit"; @implementation PBGitCommit @synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo; +@synthesize committer; - (NSArray *) parents { diff --git a/PBGitRevList.mm b/PBGitRevList.mm index f282484..4a033fb 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -96,7 +96,7 @@ using namespace std; std::map encodingMap; NSThread *currentThread = [NSThread currentThread]; - NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at"; + NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%cn\01%s\01%P\01%at"; BOOL showSign = [rev hasLeftRight]; if (showSign) @@ -145,6 +145,9 @@ using namespace std; string author; getline(stream, author, '\1'); + string committer; + getline(stream, committer, '\1'); + string subject; getline(stream, subject, '\1'); @@ -171,6 +174,7 @@ using namespace std; [newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]]; [newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]]; + [newCommit setCommitter:[NSString stringWithCString:committer.c_str() encoding:encoding]]; [newCommit setTimestamp:time]; if (showSign) diff --git a/html/views/history/history.js b/html/views/history/history.js index eabcf41..4c9db52 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -7,6 +7,7 @@ var Commit = function(obj) { this.refs = obj.refs(); this.author_name = obj.author; + this.committer_name = obj.committer; this.sha = obj.realSha(); this.parents = obj.parents; this.subject = obj.subject; @@ -37,21 +38,17 @@ var Commit = function(obj) { if (typeof match !== 'undefined' && typeof match[2] !== 'undefined') { if (!(match[2].match(/@[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/))) this.author_email = match[2]; - - this.author_date = new Date(parseInt(match[3]) * 1000); - + + if (typeof match[3] !== 'undefined') + this.author_date = new Date(parseInt(match[3]) * 1000); + match = this.header.match(/\ncommitter (.*) <(.*@.*|.*)> ([0-9].*)/); - if (typeof match !== 'undefined') { - this.committer_name = match[1]; - this.committer_email = match[2]; - } else { - this.committer_name = "undefined"; - this.committer_email = "undefined"; - } + if (typeof match[2] !== 'undefined') + this.committer_email = match[2]; + if (typeof match[3] !== 'undefined') + this.committer_date = new Date(parseInt(match[3]) * 1000); } } - - this.committer_date = new Date(parseInt(match[3]) * 1000); } this.reloadRefs = function() { From c17215e55e9637bbf95546e2d3d3b249aa3fc621 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:34:18 -0600 Subject: [PATCH 037/110] Create wrapper class around git_oid and use it This is a convenience class to replace using NSStrings to store and compare SHAs. PBGitSHA has a much faster isEqual: function. It is compliant and implements isEqual: and hash so it can be used as a key in dictionaries. --- GitX.xcodeproj/project.pbxproj | 6 ++ PBGitCommit.h | 19 ++--- PBGitCommit.m | 68 +++++++--------- PBGitGrapher.mm | 27 ++++--- PBGitHistoryController.h | 3 +- PBGitHistoryController.m | 12 +-- PBGitHistoryGrapher.m | 5 +- PBGitHistoryList.h | 3 +- PBGitHistoryList.m | 12 +-- PBGitLane.h | 4 +- PBGitRepository.h | 25 +++--- PBGitRepository.m | 40 +++++----- PBGitRevList.mm | 12 ++- PBGitRevisionCell.m | 6 +- PBGitSHA.h | 28 +++++++ PBGitSHA.m | 139 +++++++++++++++++++++++++++++++++ PBRefMenuItem.m | 2 +- PBWebHistoryController.h | 6 +- PBWebHistoryController.m | 13 +-- html/views/history/history.js | 2 +- 20 files changed, 300 insertions(+), 132 deletions(-) create mode 100644 PBGitSHA.h create mode 100644 PBGitSHA.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index c0f7d62..331d554 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -73,6 +73,7 @@ D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E105461157C18200FC28A4 /* PBQLTextView.m */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; + D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FBCF18115FA20C0098676A /* PBGitSHA.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; D8FDDA6B114335E8005647F6 /* PBGitSVFolderItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5F114335E8005647F6 /* PBGitSVFolderItem.m */; }; @@ -293,6 +294,8 @@ D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; + D8FBCF17115FA20C0098676A /* PBGitSHA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSHA.h; sourceTree = ""; }; + D8FBCF18115FA20C0098676A /* PBGitSHA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSHA.m; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; D8FDDA5C114335E8005647F6 /* PBGitSVBranchItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVBranchItem.h; sourceTree = ""; }; D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVBranchItem.m; sourceTree = ""; }; @@ -828,6 +831,8 @@ F56524EF0E02D45200F03B52 /* PBGitCommit.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, F5C007740E731B48007B84B2 /* PBGitRef.m */, + D8FBCF17115FA20C0098676A /* PBGitSHA.h */, + D8FBCF18115FA20C0098676A /* PBGitSHA.m */, D8295D281130A1DC00C838E8 /* PBGitHistoryList.h */, D8295D291130A1DC00C838E8 /* PBGitHistoryList.m */, F5FF4E160E0829C20006317A /* PBGitRevList.h */, @@ -1175,6 +1180,7 @@ D8295D2A1130A1DC00C838E8 /* PBGitHistoryList.m in Sources */, D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */, D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, + D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitCommit.h b/PBGitCommit.h index 9e4da8d..e77ee32 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -10,23 +10,21 @@ #import "PBGitRepository.h" #import "PBGitTree.h" #import "PBGitRefish.h" -#include "git/oid.h" +#import "PBGitSHA.h" extern NSString * const kGitXCommitType; @interface PBGitCommit : NSObject { - git_oid sha; - git_oid *parentShas; - int nParents; + PBGitSHA *sha; NSString* subject; NSString* author; NSString *committer; NSString* details; NSString *_patch; - NSArray* parents; + NSArray *parents; NSString *realSHA; int timestamp; @@ -35,8 +33,8 @@ extern NSString * const kGitXCommitType; PBGitRepository* repository; } -+ (id) commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha; -- (id) initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; ++ (PBGitCommit *)commitWithRepository:(PBGitRepository*)repo andSha:(PBGitSHA *)newSha; +- (id)initWithRepository:(PBGitRepository *)repo andSha:(PBGitSHA *)newSha; - (void) addRef:(PBGitRef *)ref; - (void) removeRef:(id)ref; @@ -51,14 +49,13 @@ extern NSString * const kGitXCommitType; - (NSString *) shortName; - (NSString *) refishType; -@property (readonly) git_oid *sha; +@property (readonly) PBGitSHA *sha; @property (copy) NSString* subject; @property (copy) NSString* author; @property (copy) NSString *committer; -@property (readonly) NSArray* parents; // TODO: remove this and its uses +@property (retain) NSArray *parents; -@property (assign) git_oid *parentShas; -@property (assign) int nParents, timestamp; +@property (assign) int timestamp; @property (retain) NSMutableArray* refs; @property (readonly) NSDate *date; diff --git a/PBGitCommit.m b/PBGitCommit.m index 6bb9d56..ac2bd1f 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -7,6 +7,7 @@ // #import "PBGitCommit.h" +#import "PBGitSHA.h" #import "PBGitDefaults.h" @@ -15,24 +16,11 @@ NSString * const kGitXCommitType = @"commit"; @implementation PBGitCommit -@synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo; +@synthesize repository, subject, timestamp, author, sign, lineInfo; +@synthesize sha; +@synthesize parents; @synthesize committer; -- (NSArray *) parents -{ - if (nParents == 0) - return NULL; - - int i; - NSMutableArray *p = [NSMutableArray arrayWithCapacity:nParents]; - for (i = 0; i < nParents; ++i) - { - char *s = git_oid_mkhex(parentShas + i); - [p addObject:[NSString stringWithUTF8String:s]]; - free(s); - } - return p; -} - (NSDate *)date { @@ -50,17 +38,12 @@ NSString * const kGitXCommitType = @"commit"; return self.tree.children; } -- (git_oid *)sha ++ (PBGitCommit *)commitWithRepository:(PBGitRepository*)repo andSha:(PBGitSHA *)newSha { - return &sha; + return [[self alloc] initWithRepository:repo andSha:newSha]; } -+ commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha -{ - return [[[self alloc] initWithRepository:repo andSha:newSha] autorelease]; -} - -- initWithRepository:(PBGitRepository*) repo andSha:(git_oid)newSha +- (id)initWithRepository:(PBGitRepository*) repo andSha:(PBGitSHA *)newSha { details = nil; repository = repo; @@ -70,27 +53,18 @@ NSString * const kGitXCommitType = @"commit"; - (NSString *)realSha { - if (!realSHA) { - char *hex = git_oid_mkhex(&sha); - realSHA = [NSString stringWithUTF8String:hex]; - free(hex); - } - - return realSHA; + return sha.string; } -- (BOOL) isOnSameBranchAs:(PBGitCommit *)other +- (BOOL) isOnSameBranchAs:(PBGitCommit *)otherCommit { - if (!other) + if (!otherCommit) return NO; - NSString *mySHA = [self realSha]; - NSString *otherSHA = [other realSha]; - - if ([otherSHA isEqualToString:mySHA]) + if ([self isEqual:otherCommit]) return YES; - return [repository isOnSameBranch:otherSHA asSHA:mySHA]; + return [repository isOnSameBranch:otherCommit.sha asSHA:self.sha]; } - (BOOL) isOnHeadBranch @@ -98,6 +72,19 @@ NSString * const kGitXCommitType = @"commit"; return [self isOnSameBranchAs:[repository headCommit]]; } +- (BOOL)isEqual:(id)otherCommit +{ + if (![otherCommit isMemberOfClass:[PBGitCommit class]]) + return NO; + + return [self.sha isEqual:[(PBGitCommit *)otherCommit sha]]; +} + +- (NSUInteger)hash +{ + return [self.sha hash]; +} + // FIXME: Remove this method once it's unused. - (NSString*) details { @@ -150,17 +137,16 @@ NSString * const kGitXCommitType = @"commit"; - (NSMutableArray *)refs { - return [[repository refs] objectForKey:[self realSha]]; + return [[repository refs] objectForKey:[self sha]]; } - (void) setRefs:(NSMutableArray *)refs { - [[repository refs] setObject:refs forKey:[self realSha]]; + [[repository refs] setObject:refs forKey:[self sha]]; } - (void)finalize { - free(parentShas); [super finalize]; } diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index f9daf84..abd6327 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -39,8 +39,10 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in int i = 0, newPos = -1; std::list *currentLanes = new std::list; std::list *previousLanes = (std::list *)pl; + NSArray *parents = [commit parents]; + int nParents = [parents count]; - int maxLines = (previousLanes->size() + commit.nParents + 2) * 2; + int maxLines = (previousLanes->size() + nParents + 2) * 2; struct PBGitGraphLine *lines = (struct PBGitGraphLine *)malloc(sizeof(struct PBGitGraphLine) * maxLines); int currentLine = 0; @@ -55,14 +57,14 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in i++; // This is our commit! We should do a "merge": move the line from // our upperMapping to their lowerMapping - if ((*it)->isCommit([commit sha])) { + if ((*it)->isCommit([[commit sha] oid])) { if (!didFirst) { didFirst = YES; currentLanes->push_back(*it); currentLane = currentLanes->back(); newPos = currentLanes->size(); add_line(lines, ¤tLine, 1, i, newPos,(*it)->index()); - if (commit.nParents) + if (nParents) add_line(lines, ¤tLine, 0, newPos, newPos,(*it)->index()); } else { @@ -84,8 +86,9 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in //Add your own parents // If we already did the first parent, don't do so again - if (!didFirst && currentLanes->size() < MAX_LANES && commit.nParents) { - PBGitLane *newLane = new PBGitLane(commit.parentShas); + if (!didFirst && currentLanes->size() < MAX_LANES && nParents) { + git_oid parentOID = [[parents objectAtIndex:0] oid]; + PBGitLane *newLane = new PBGitLane(&parentOID); currentLanes->push_back(newLane); newPos = currentLanes->size(); add_line(lines, ¤tLine, 0, newPos, newPos, newLane->index()); @@ -97,15 +100,15 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in // This boolean will tell us if that happened BOOL addedParent = NO; - int parentIndex; - for (parentIndex = 1; parentIndex < commit.nParents; ++parentIndex) { - git_oid *parent = commit.parentShas + parentIndex; + int parentIndex = 0; + for (parentIndex = 1; parentIndex < nParents; ++parentIndex) { + git_oid parentOID = [[parents objectAtIndex:parentIndex] oid]; int i = 0; BOOL was_displayed = NO; std::list::iterator it = currentLanes->begin(); for (; it != currentLanes->end(); ++it) { i++; - if ((*it)->isCommit(parent)) { + if ((*it)->isCommit(parentOID)) { add_line(lines, ¤tLine, 0, i, newPos,(*it)->index()); was_displayed = YES; break; @@ -119,7 +122,7 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in // Really add this parent addedParent = YES; - PBGitLane *newLane = new PBGitLane(parent); + PBGitLane *newLane = new PBGitLane(&parentOID); currentLanes->push_back(newLane); add_line(lines, ¤tLine, 0, currentLanes->size(), newPos, newLane->index()); } @@ -138,8 +141,8 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in previous.numColumns = currentLanes->size(); // Update the current lane to point to the new parent - if (currentLane && commit.nParents > 0) - currentLane->setSha(commit.parentShas[0]); + if (currentLane && nParents > 0) + currentLane->setSha([[parents objectAtIndex:0] oid]); else currentLanes->remove(currentLane); diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 3c92168..6489930 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -17,6 +17,7 @@ @class PBRefController; @class QLPreviewPanel; @class PBCommitList; +@class PBGitSHA; @interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; @@ -58,7 +59,7 @@ - (IBAction) setTreeView:(id)sender; - (IBAction) setBranchFilter:(id)sender; -- (void) selectCommit: (NSString*) commit; +- (void)selectCommit:(PBGitSHA *)commit; - (IBAction) refresh:(id)sender; - (IBAction) toggleQLPreviewPanel:(id)sender; - (IBAction) openSelectedFile:(id)sender; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 9e0fafb..9d5a428 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -236,7 +236,7 @@ if ([repository.currentBranch isSimpleRef]) [self selectCommit:[repository shaForRef:[repository.currentBranch ref]]]; else - [self selectCommit:[[self firstCommit] realSha]]; + [self selectCommit:[[self firstCommit] sha]]; return; } @@ -385,9 +385,9 @@ commitList.useAdjustScroll = NO; } -- (NSArray *) selectedObjectsForSHA:(NSString *)commitSHA +- (NSArray *) selectedObjectsForSHA:(PBGitSHA *)commitSHA { - NSPredicate *selection = [NSPredicate predicateWithFormat:@"realSha == %@", commitSHA]; + NSPredicate *selection = [NSPredicate predicateWithFormat:@"sha == %@", commitSHA]; NSArray *selectedCommits = [[commitController content] filteredArrayUsingPredicate:selection]; if (([selectedCommits count] == 0) && [self firstCommit]) @@ -396,9 +396,9 @@ return selectedCommits; } -- (void) selectCommit:(NSString *)commitSHA +- (void)selectCommit:(PBGitSHA *)commitSHA { - if (!forceSelectionUpdate && [[selectedCommit realSha] isEqualToString:commitSHA]) + if (!forceSelectionUpdate && [[selectedCommit sha] isEqual:commitSHA]) return; NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; @@ -521,7 +521,7 @@ PBGitRef *headRef = [[repository headRef] ref]; NSString *headRefName = [headRef shortName]; NSString *diffTitle = [NSString stringWithFormat:@"Diff %@ with %@", multiple ? @"files" : @"file", headRefName]; - BOOL isHead = [[selectedCommit realSha] isEqualToString:[repository headSHA]]; + BOOL isHead = [[selectedCommit sha] isEqual:[repository headSHA]]; NSMenuItem *diffItem = [[NSMenuItem alloc] initWithTitle:diffTitle action:isHead ? nil : @selector(diffFilesAction:) keyEquivalent:@""]; diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index 4769950..891d342 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -8,6 +8,7 @@ #import "PBGitHistoryGrapher.h" #import "PBGitGrapher.h" +#import "PBGitSHA.h" @implementation PBGitHistoryGrapher @@ -41,13 +42,13 @@ NSInteger counter = 0; for (PBGitCommit *commit in revList) { - NSString *commitSHA = [commit realSha]; + PBGitSHA *commitSHA = [commit sha]; if (viewAllBranches || [searchSHAs containsObject:commitSHA]) { [grapher decorateCommit:commit]; [commits addObject:commit]; if (!viewAllBranches) { [searchSHAs removeObject:commitSHA]; - [searchSHAs addObjectsFromArray:commit.parents]; + [searchSHAs addObjectsFromArray:[commit parents]]; } } if (++counter % 2000 == 0) { diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index 93fdcd3..9f00a66 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -14,6 +14,7 @@ @class PBGitRef; @class PBGitRevList; @class PBGitHistoryGrapher; +@class PBGitSHA; @interface PBGitHistoryList : NSObject { PBGitRepository *repository; @@ -21,7 +22,7 @@ PBGitRevList *projectRevList; PBGitRevList *currentRevList; - NSString *lastSHA; + PBGitSHA *lastSHA; NSSet *lastRefSHAs; NSInteger lastBranchFilter; PBGitRef *lastRemoteRef; diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 59cb3c4..017a757 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -11,6 +11,7 @@ #import "PBGitRevList.h" #import "PBGitGrapher.h" #import "PBGitHistoryGrapher.h" +#import "PBGitSHA.h" @@ -158,7 +159,7 @@ NSMutableSet *baseCommitSHAs = [NSMutableSet set]; NSDictionary *refs = repository.refs; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *ref in [refs objectForKey:sha]) if ([ref isBranch] || [ref isTag]) [baseCommitSHAs addObject:sha]; @@ -177,7 +178,7 @@ PBGitRef *remoteRef = [[repository.currentBranch ref] remoteRef]; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *ref in [refs objectForKey:sha]) if ([remoteRef isEqualToRef:[ref remoteRef]]) [baseCommitSHAs addObject:sha]; @@ -193,7 +194,7 @@ return [NSMutableSet setWithObject:lastSHA]; else if ([repository.currentBranch isSimpleRef]) { PBGitRef *currentRef = [repository.currentBranch ref]; - NSString *sha = [repository shaForRef:currentRef]; + PBGitSHA *sha = [repository shaForRef:currentRef]; if (sha) return [NSMutableSet setWithObject:sha]; } @@ -267,8 +268,8 @@ return NO; } - NSString *revSHA = [repository shaForRef:[rev ref]]; - if ([revSHA isEqualToString:lastSHA] && (lastBranchFilter == repository.currentBranchFilter)) + PBGitSHA *revSHA = [repository shaForRef:[rev ref]]; + if ([revSHA isEqual:lastSHA] && (lastBranchFilter == repository.currentBranchFilter)) return NO; lastBranchFilter = repository.currentBranchFilter; @@ -341,6 +342,7 @@ - (void) removeObservers { [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; [repository removeObserver:self forKeyPath:@"hasChanged"]; if (currentRevList) { diff --git a/PBGitLane.h b/PBGitLane.h index 57d59c8..94b59a2 100644 --- a/PBGitLane.h +++ b/PBGitLane.h @@ -33,9 +33,9 @@ public: d_index = s_colorIndex++; } - bool isCommit(git_oid *sha) const + bool isCommit(git_oid sha) const { - return !git_oid_cmp(&d_sha, sha); + return !git_oid_cmp(&d_sha, &sha); } void setSha(git_oid sha); diff --git a/PBGitRepository.h b/PBGitRepository.h index 0236a06..25176cd 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -38,6 +38,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { @class PBGitWindowController; @class PBGitCommit; +@class PBGitSHA; @interface PBGitRepository : NSDocument { PBGitHistoryList* revisionList; @@ -50,7 +51,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { NSMutableDictionary *refs; PBGitRevSpecifier *_headRef; // Caching - NSString* _headSha; + PBGitSHA* _headSha; } - (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare; @@ -92,17 +93,17 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { - (void) reloadRefs; - (void) addRef:(PBGitRef *)ref fromParameters:(NSArray *)params; - (void) lazyReload; -- (PBGitRevSpecifier*) headRef; -- (NSString *) headSHA; -- (PBGitCommit *) headCommit; -- (NSString *) shaForRef:(PBGitRef *)ref; -- (PBGitCommit *) commitForRef:(PBGitRef *)ref; -- (PBGitCommit *) commitForSHA:(NSString *)sha; -- (BOOL) isOnSameBranch:(NSString *)baseSHA asSHA:(NSString *)testSHA; -- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA; -- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef; -- (BOOL) checkRefFormat:(NSString *)refName; -- (BOOL) refExists:(PBGitRef *)ref; +- (PBGitRevSpecifier*)headRef; +- (PBGitSHA *)headSHA; +- (PBGitCommit *)headCommit; +- (PBGitSHA *)shaForRef:(PBGitRef *)ref; +- (PBGitCommit *)commitForRef:(PBGitRef *)ref; +- (PBGitCommit *)commitForSHA:(PBGitSHA *)sha; +- (BOOL)isOnSameBranch:(PBGitSHA *)baseSHA asSHA:(PBGitSHA *)testSHA; +- (BOOL)isSHAOnHeadBranch:(PBGitSHA *)testSHA; +- (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef; +- (BOOL)checkRefFormat:(NSString *)refName; +- (BOOL)refExists:(PBGitRef *)ref; - (NSArray *) remotes; - (BOOL) hasRemotes; diff --git a/PBGitRepository.m b/PBGitRepository.m index f401aa6..f9f9175 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -218,11 +218,11 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; { NSString* type = [components objectAtIndex:1]; - NSString* sha; + PBGitSHA *sha; if ([type isEqualToString:@"tag"] && [components count] == 4) - sha = [components objectAtIndex:3]; + sha = [PBGitSHA shaWithString:[components objectAtIndex:3]]; else - sha = [components objectAtIndex:2]; + sha = [PBGitSHA shaWithString:[components objectAtIndex:2]]; NSMutableArray* curRefs; if (curRefs = [refs objectForKey:sha]) @@ -293,7 +293,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return _headRef; } -- (NSString *) headSHA +- (PBGitSHA *)headSHA { if (! _headSha) [self headRef]; @@ -301,17 +301,17 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return _headSha; } -- (PBGitCommit *) headCommit +- (PBGitCommit *)headCommit { return [self commitForSHA:[self headSHA]]; } -- (NSString *) shaForRef:(PBGitRef *)ref +- (PBGitSHA *)shaForRef:(PBGitRef *)ref { if (!ref) return nil; - for (NSString *sha in refs) + for (PBGitSHA *sha in refs) for (PBGitRef *existingRef in [refs objectForKey:sha]) if ([existingRef isEqualToRef:ref]) return sha; @@ -322,10 +322,10 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; if (retValue || [shaForRef isEqualToString:@""]) return nil; - return shaForRef; + return [PBGitSHA shaWithString:shaForRef]; } -- (PBGitCommit *) commitForRef:(PBGitRef *)ref +- (PBGitCommit *)commitForRef:(PBGitRef *)ref { if (!ref) return nil; @@ -333,7 +333,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [self commitForSHA:[self shaForRef:ref]]; } -- (PBGitCommit *) commitForSHA:(NSString *)sha +- (PBGitCommit *)commitForSHA:(PBGitSHA *)sha { if (!sha) return nil; @@ -344,18 +344,18 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; revList = revisionList.projectCommits; } for (PBGitCommit *commit in revList) - if ([[commit realSha] isEqualToString:sha]) + if ([[commit sha] isEqual:sha]) return commit; return nil; } -- (BOOL) isOnSameBranch:(NSString *)branchSHA asSHA:(NSString *)testSHA +- (BOOL)isOnSameBranch:(PBGitSHA *)branchSHA asSHA:(PBGitSHA *)testSHA { if (!branchSHA || !testSHA) return NO; - if ([testSHA isEqualToString:branchSHA]) + if ([testSHA isEqual:branchSHA]) return YES; NSArray *revList = revisionList.projectCommits; @@ -363,34 +363,34 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; NSMutableSet *searchSHAs = [NSMutableSet setWithObject:branchSHA]; for (PBGitCommit *commit in revList) { - NSString *commitSHA = [commit realSha]; + PBGitSHA *commitSHA = [commit sha]; if ([searchSHAs containsObject:commitSHA]) { - if ([testSHA isEqualToString:commitSHA]) + if ([testSHA isEqual:commitSHA]) return YES; [searchSHAs removeObject:commitSHA]; [searchSHAs addObjectsFromArray:commit.parents]; } - else if ([testSHA isEqualToString:commitSHA]) + else if ([testSHA isEqual:commitSHA]) return NO; } return NO; } -- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA +- (BOOL)isSHAOnHeadBranch:(PBGitSHA *)testSHA { if (!testSHA) return NO; - NSString *headSHA = [self headSHA]; + PBGitSHA *headSHA = [self headSHA]; - if ([testSHA isEqualToString:headSHA]) + if ([testSHA isEqual:headSHA]) return YES; return [self isOnSameBranch:headSHA asSHA:testSHA]; } -- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef +- (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef { if (!testRef) return NO; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 4a033fb..ea0933d 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -12,7 +12,6 @@ #import "PBGitGrapher.h" #import "PBGitRevSpecifier.h" -#include "git/oid.h" #include #include #include @@ -140,7 +139,7 @@ using namespace std; git_oid oid; git_oid_mkstr(&oid, sha.c_str()); - PBGitCommit* newCommit = [[PBGitCommit alloc] initWithRepository:repository andSha:oid]; + PBGitCommit *newCommit = [PBGitCommit commitWithRepository:repository andSha:[PBGitSHA shaWithOID:oid]]; string author; getline(stream, author, '\1'); @@ -160,13 +159,12 @@ using namespace std; continue; } int nParents = (parentString.size() + 1) / 41; - git_oid *parents = (git_oid *)malloc(sizeof(git_oid) * nParents); + NSMutableArray *parents = [NSMutableArray arrayWithCapacity:nParents]; int parentIndex; for (parentIndex = 0; parentIndex < nParents; ++parentIndex) - git_oid_mkstr(parents + parentIndex, parentString.substr(parentIndex * 41, 40).c_str()); - - newCommit.parentShas = parents; - newCommit.nParents = nParents; + [parents addObject:[PBGitSHA shaWithCString:parentString.substr(parentIndex * 41, 40).c_str()]]; + + [newCommit setParents:parents]; } int time; diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index abbf29c..17e5b16 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -59,12 +59,12 @@ - (BOOL) isCurrentCommit { - NSString* thisSha = [self.objectValue realSha]; + PBGitSHA *thisSha = [self.objectValue sha]; PBGitRepository* repository = [self.objectValue repository]; - NSString* currentSha = [repository headSHA]; + PBGitSHA *currentSha = [repository headSHA]; - return [ currentSha isEqualToString : thisSha ]; + return [currentSha isEqual:thisSha]; } - (void) drawCircleInRect: (NSRect) r diff --git a/PBGitSHA.h b/PBGitSHA.h new file mode 100644 index 0000000..f222911 --- /dev/null +++ b/PBGitSHA.h @@ -0,0 +1,28 @@ +// +// PBGitSHA.h +// GitX +// +// Created by BrotherBard on 3/28/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import +#include "git/oid.h" + + +@interface PBGitSHA : NSObject { + git_oid oid; + NSString *string; +} + + ++ (PBGitSHA *)shaWithOID:(git_oid)oid; ++ (PBGitSHA *)shaWithString:(NSString *)shaString; ++ (PBGitSHA *)shaWithCString:(const char *)shaCString; + +- (BOOL)isEqualToOID:(git_oid)other_oid; + +@property (readonly) git_oid oid; +@property (readonly) NSString *string; + +@end diff --git a/PBGitSHA.m b/PBGitSHA.m new file mode 100644 index 0000000..6aff86f --- /dev/null +++ b/PBGitSHA.m @@ -0,0 +1,139 @@ +// +// PBGitSHA.m +// GitX +// +// Created by BrotherBard on 3/28/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import "PBGitSHA.h" + + +@interface PBGitSHA () + +- (id)initWithOID:(git_oid)g_oid; + +@end + + +@implementation PBGitSHA + + +@synthesize oid; +@synthesize string; + + ++ (PBGitSHA *)shaWithOID:(git_oid)oid +{ + return [[PBGitSHA alloc] initWithOID:oid]; +} + + ++ (PBGitSHA *)shaWithString:(NSString *)shaString +{ + git_oid oid; + int err = git_oid_mkstr(&oid, [shaString UTF8String]); + if (err == GIT_ENOTOID) + return nil; + + return [self shaWithOID:oid]; +} + + ++ (PBGitSHA *)shaWithCString:(const char *)shaCString +{ + git_oid oid; + int err = git_oid_mkstr(&oid, shaCString); + if (err == GIT_ENOTOID) + return nil; + + return [self shaWithOID:oid]; +} + + ++ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector +{ + return NO; +} + + ++ (BOOL)isKeyExcludedFromWebScript:(const char *)name +{ + return NO; +} + + + +#pragma mark - +#pragma mark PBGitSHA + +- (id)initWithOID:(git_oid)g_oid +{ + self = [super init]; + if (!self) + return nil; + + oid = g_oid; + + return self; +} + + +- (NSString *)string +{ + if (!string) { + char *hex = git_oid_mkhex(&oid); + if (hex == NULL) + return nil; + string = [NSString stringWithUTF8String:hex]; + free(hex); + } + + return string; +} + + +- (BOOL)isEqual:(id)otherSHA +{ + if (self == otherSHA) + return YES; + + git_oid other_oid = [(PBGitSHA *)otherSHA oid]; + return git_oid_cmp(&oid, &other_oid) == 0; +} + + +- (BOOL)isEqualToOID:(git_oid)other_oid +{ + return git_oid_cmp(&oid, &other_oid) == 0; +} + + +- (NSUInteger)hash +{ + NSUInteger hash; + memcpy(&hash, &(oid.id), sizeof(NSUInteger)); + + return hash; +} + + +- (NSString *)description +{ + return [self string]; +} + + + +#pragma mark + +- (id)copyWithZone:(NSZone *)zone +{ + git_oid oidCopy; + git_oid_cpy(&oidCopy, &oid); + PBGitSHA *copy = [[[self class] allocWithZone:zone] initWithOID:oidCopy]; + + return copy; +} + +@end diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 8a571d5..e7b7c0b 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -145,7 +145,7 @@ NSString *headBranchName = [[[commit.repository headRef] ref] shortName]; BOOL isOnHeadBranch = [commit isOnHeadBranch]; - BOOL isHead = [[commit realSha] isEqualToString:[commit.repository headSHA]]; + BOOL isHead = [[commit sha] isEqual:[commit.repository headSHA]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; diff --git a/PBWebHistoryController.h b/PBWebHistoryController.h index 749725a..f42a42e 100644 --- a/PBWebHistoryController.h +++ b/PBWebHistoryController.h @@ -13,11 +13,15 @@ #import "PBGitHistoryController.h" #import "PBRefContextDelegate.h" + +@class PBGitSHA; + + @interface PBWebHistoryController : PBWebController { IBOutlet PBGitHistoryController* historyController; IBOutlet id contextMenuDelegate; - NSString* currentSha; + PBGitSHA* currentSha; NSString* diff; } diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 08279cf..f0c533d 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -8,6 +8,7 @@ #import "PBWebHistoryController.h" #import "PBGitDefaults.h" +#import "PBGitSHA.h" @implementation PBWebHistoryController @@ -23,7 +24,7 @@ - (void) didLoad { - currentSha = @""; + currentSha = nil; [self changeContentTo: historyController.webCommit]; } @@ -41,7 +42,7 @@ return; // The sha is the same, but refs may have changed.. reload it lazy - if ([currentSha isEqualToString: [content realSha]]) + if ([currentSha isEqual:[content sha]]) { [[self script] callWebScriptMethod:@"reload" withArguments: nil]; return; @@ -54,13 +55,13 @@ [self performSelector:_cmd withObject:content afterDelay:0.05]; return; } - currentSha = [content realSha]; + currentSha = [content sha]; // Now we load the extended details. We used to do this in a separate thread, // but this caused some funny behaviour because NSTask's and NSThread's don't really // like each other. Instead, just do it async. - NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", currentSha, nil]; + NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", [currentSha string], nil]; if (![PBGitDefaults showWhitespaceDifferences]) [taskArguments insertObject:@"-w" atIndex:1]; @@ -90,9 +91,9 @@ [[view windowScriptObject] callWebScriptMethod:@"loadCommitDetails" withArguments:[NSArray arrayWithObject:details]]; } -- (void) selectCommit: (NSString*) sha +- (void)selectCommit:(NSString *)sha { - [historyController selectCommit:sha]; + [historyController selectCommit:[PBGitSHA shaWithString:sha]]; } - (void) sendKey: (NSString*) key diff --git a/html/views/history/history.js b/html/views/history/history.js index 4c9db52..c90c0c2 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -209,7 +209,7 @@ var loadCommit = function(commitObject, currentRef) { var newRow = $("commit_header").insertRow(-1); newRow.innerHTML = "Parent:" + "" + - commit.parents[i] + ""; + commit.parents[i].string + ""; } commit.notificationID = setTimeout(function() { From a849424a469a576bfee00c6ee1f5297486ca4bf6 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:35:04 -0600 Subject: [PATCH 038/110] Add a cleanup method to the history list. The cleanup method cancels any background threads and removes KV observers when the repository document is closed. Also removed KV observers that are no longer needed. --- PBGitHistoryGrapher.m | 3 +++ PBGitHistoryList.h | 1 + PBGitHistoryList.m | 45 +++++++++++++++---------------------------- PBGitRepository.m | 7 +++++++ PBGitRevList.h | 1 + PBGitRevList.mm | 7 +++++++ 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index 891d342..65d2311 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -38,10 +38,13 @@ if (!revList || [revList count] == 0) return; + NSThread *currentThread = [NSThread currentThread]; NSMutableArray *commits = [NSMutableArray array]; NSInteger counter = 0; for (PBGitCommit *commit in revList) { + if ([currentThread isCancelled]) + return; PBGitSHA *commitSHA = [commit sha]; if (viewAllBranches || [searchSHAs containsObject:commitSHA]) { [grapher decorateCommit:commit]; diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index 9f00a66..2b07007 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -40,6 +40,7 @@ - (id) initWithRepository:(PBGitRepository *)repo; - (void) forceUpdate; - (void) updateHistory; +- (void)cleanup; - (void) updateCommitsFromGrapher:(NSDictionary *)commitData; diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index 017a757..a121ad1 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -82,6 +82,20 @@ } +- (void)cleanup +{ + if (currentRevList) { + [currentRevList removeObserver:self forKeyPath:@"commits"]; + [currentRevList cancel]; + } + [graphQueue cancelAllOperations]; + + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; + [repository removeObserver:self forKeyPath:@"hasChanged"]; +} + + - (NSArray *) projectCommits { return [projectRevList.commits copy]; @@ -137,12 +151,9 @@ resetCommits = YES; self.isUpdating = YES; - [graphQueue setSuspended:YES]; - if (graphQueue) - [graphQueue removeObserver:self forKeyPath:@"operations"]; + [graphQueue cancelAllOperations]; graphQueue = [[NSOperationQueue alloc] init]; [graphQueue setMaxConcurrentOperationCount:1]; - [graphQueue addObserver:self forKeyPath:@"operations" options:0 context:@"operations"]; grapher = [self grapher]; } @@ -223,15 +234,12 @@ if (currentRevList == parser) return; - if (currentRevList) { + if (currentRevList) [currentRevList removeObserver:self forKeyPath:@"commits"]; - [currentRevList removeObserver:self forKeyPath:@"isParsing"]; - } currentRevList = parser; [currentRevList addObserver:self forKeyPath:@"commits" options:NSKeyValueObservingOptionNew context:@"commitsUpdated"]; - [currentRevList addObserver:self forKeyPath:@"isParsing" options:0 context:@"revListParsing"]; } @@ -339,22 +347,6 @@ #pragma mark - #pragma mark Key Value Observing -- (void) removeObservers -{ - [repository removeObserver:self forKeyPath:@"currentBranch"]; - [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; - [repository removeObserver:self forKeyPath:@"hasChanged"]; - - if (currentRevList) { - [currentRevList removeObserver:self forKeyPath:@"commits"]; - [currentRevList removeObserver:self forKeyPath:@"isParsing"]; - } - - if (graphQueue) - [graphQueue removeObserver:self forKeyPath:@"operations"]; -} - - - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([@"currentBranch" isEqualToString:context]) { @@ -379,11 +371,6 @@ return; } - if ([@"revListParsing" isEqualToString:context] || [@"operations" isEqualToString:context]) { - [self finishedGraphing]; - return; - } - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } diff --git a/PBGitRepository.m b/PBGitRepository.m index f9f9175..5b77b23 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -128,6 +128,13 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; revisionList = [[PBGitHistoryList alloc] initWithRepository:self]; } +- (void)close +{ + [revisionList cleanup]; + + [super close]; +} + - (id) initWithURL: (NSURL*) path { if (![PBGitBinary path]) diff --git a/PBGitRevList.h b/PBGitRevList.h index 7370711..0fe216d 100644 --- a/PBGitRevList.h +++ b/PBGitRevList.h @@ -25,6 +25,7 @@ - (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph; - (void) loadRevisons; +- (void)cancel; @property (retain) NSMutableArray *commits; @property (readonly) BOOL isParsing; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index ea0933d..00a1920 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -58,6 +58,12 @@ using namespace std; } +- (void)cancel +{ + [parseThread cancel]; +} + + - (void) finishedParsing { self.isParsing = NO; @@ -217,6 +223,7 @@ using namespace std; NSLog(@"[%@ %s] thread has been canceled", [self class], _cmd); } + [task terminate]; [task waitUntilExit]; } From 53d92fb73e8224b474f4891358c089658f26a23e Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:35:29 -0600 Subject: [PATCH 039/110] Cleanup the views when the repository window closes and stop memory leaks. - make sure to remove themselves from KV and notification center observers - add the PBWebHistoryController to PBHistoryController so it can be told to close - replaced the -removeView methods with -closeView (-removeView was not being used) - clear any obj-c objects set in web scripting objects This last item seems to be the reason that the web controllers and the current commit did not get collected which then held the repository document from being collected as well. --- PBGitCommitController.m | 2 +- PBGitHistoryController.h | 2 + PBGitHistoryController.m | 22 +++++-- PBGitHistoryView.xib | 129 +++++++++++++++------------------------ PBGitSidebarController.m | 11 ++++ PBGitWindowController.m | 5 +- PBGraphCellInfo.m | 6 ++ PBViewController.h | 6 +- PBViewController.m | 2 +- PBWebChangesController.m | 9 +++ PBWebController.m | 8 ++- PBWebDiffController.m | 8 +++ PBWebHistoryController.m | 11 +++- 13 files changed, 123 insertions(+), 98 deletions(-) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 18cfd55..02d74e1 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -64,7 +64,7 @@ [unstagedFilesController setAutomaticallyRearrangesObjects:NO]; } -- (void)removeView +- (void)closeView { [webController closeView]; } diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 6489930..8bc0388 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -13,6 +13,7 @@ #import "PBCollapsibleSplitView.h" @class PBGitSidebarController; +@class PBWebHistoryController; @class PBGitGradientBarView; @class PBRefController; @class QLPreviewPanel; @@ -28,6 +29,7 @@ NSArray *currentFileBrowserSelectionPath; IBOutlet PBCommitList* commitList; IBOutlet PBCollapsibleSplitView *historySplitView; + IBOutlet PBWebHistoryController *webHistoryController; QLPreviewPanel* previewPanel; IBOutlet PBGitGradientBarView *upperToolbarView; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 9d5a428..1bfd64a 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -7,6 +7,7 @@ // #import "PBGitHistoryController.h" +#import "PBWebHistoryController.h" #import "CWQuickLook.h" #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" @@ -415,17 +416,26 @@ return [commitController filterPredicate] || [[commitController sortDescriptors] count] > 0; } -- (void) removeView +- (void)closeView { float position = [[[historySplitView subviews] objectAtIndex:0] frame].size.height; [[NSUserDefaults standardUserDefaults] setFloat:position forKey:@"PBGitSplitViewPosition"]; [[NSUserDefaults standardUserDefaults] synchronize]; - [webView close]; - [commitController removeObserver:self forKeyPath:@"selection"]; - [treeController removeObserver:self forKeyPath:@"selection"]; - [repository removeObserver:self forKeyPath:@"currentBranch"]; - [super removeView]; + if (commitController) { + [commitController removeObserver:self forKeyPath:@"selection"]; + [commitController removeObserver:self forKeyPath:@"arrangedObjects.@count"]; + [treeController removeObserver:self forKeyPath:@"selection"]; + + [repository.revisionList removeObserver:self forKeyPath:@"isUpdating"]; + [repository.revisionList removeObserver:self forKeyPath:@"updatedGraph"]; + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"refs"]; + } + + [webHistoryController closeView]; + + [super closeView]; } #pragma mark Table Column Methods diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 0f486eb..97cbb0a 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -2,10 +2,10 @@ 1050 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 762 + 1038.29 + 461.00 YES @@ -15,8 +15,8 @@ YES - 740 - 740 + 762 + 762 @@ -25,8 +25,8 @@ YES - com.apple.WebKitIBPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES @@ -436,7 +436,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -1906,6 +1906,14 @@ 398 + + + webHistoryController + + + + 402 + @@ -2686,7 +2694,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{463, 486}, {852, 432}} + {{9, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2722,7 +2730,7 @@ - 398 + 402 @@ -2842,6 +2850,7 @@ selectedBranchFilterItem treeController upperToolbarView + webHistoryController webView @@ -2849,7 +2858,7 @@ NSButton NSButton NSArrayController - NSTableView + PBCommitList NSOutlineView PBCollapsibleSplitView NSButton @@ -2861,6 +2870,7 @@ NSButton NSTreeController PBGitGradientBarView + PBWebHistoryController id @@ -2980,9 +2990,6 @@ commitController commitList historyController - pullItem - pushItem - rebaseItem YES @@ -2990,9 +2997,6 @@ NSArrayController PBCommitList PBGitHistoryController - KBPopUpToolbarItem - KBPopUpToolbarItem - KBPopUpToolbarItem @@ -3476,69 +3480,6 @@ Foundation.framework/Headers/NSURLDownload.h - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKSaveOptions.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - - - NSObject - - IBFrameworkSource - QuickLookUI.framework/Headers/QLPreviewPanel.h - - NSObject @@ -3869,13 +3810,14 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.macosx - + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 @@ -3884,5 +3826,30 @@ YES GitX.xcodeproj 3 + + YES + + YES + AddBranchTemplate + AddLabelTemplate + CherryPickTemplate + DetailViewTemplate + MergeTemplate + NSPathTemplate + NSQuickLookTemplate + RebaseTemplate + + + YES + {20, 12} + {23, 12} + {18.5143, 12.3429} + {17, 17} + {16.4571, 12.3429} + {16, 9} + {19, 11} + {16.4571, 13.3714} + + diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 4da2d8c..a1de7b4 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -59,6 +59,17 @@ [self selectCurrentBranch]; } +- (void)closeView +{ + [historyViewController closeView]; + [commitViewController closeView]; + + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"branches"]; + + [super closeView]; +} + - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([@"currentBranchChange" isEqualToString:context]) { diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 55b34b4..a583ab2 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -33,7 +33,10 @@ NSLog(@"Window will close!"); if (sidebarController) - [sidebarController removeView]; + [sidebarController closeView]; + + if (contentController) + [contentController removeObserver:self forKeyPath:@"status"]; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem diff --git a/PBGraphCellInfo.m b/PBGraphCellInfo.m index e5002cf..2a417e6 100644 --- a/PBGraphCellInfo.m +++ b/PBGraphCellInfo.m @@ -19,6 +19,12 @@ return self; } +- (void)setLines:(struct PBGitGraphLine *)l +{ + free(lines); + lines = l; +} + -(void) finalize { free(lines); diff --git a/PBViewController.h b/PBViewController.h index 6dae8af..c523de7 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -25,10 +25,8 @@ - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; -/* removeView is called whenever the view is removed, either to be swapped - * with a different view, or when the repository window will be destroyed - */ -- (void) removeView; +/* closeView is called when the repository window will be closed */ +- (void)closeView; /* Updateview is called every time it is loaded into the main view */ - (void) updateView; diff --git a/PBViewController.m b/PBViewController.m index 717912e..82f6f7c 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -27,7 +27,7 @@ return self; } -- (void)removeView +- (void)closeView { [self unbind:@"repository"]; if (hasViewLoaded) diff --git a/PBWebChangesController.m b/PBWebChangesController.m index 3216725..1d1bfd7 100644 --- a/PBWebChangesController.m +++ b/PBWebChangesController.m @@ -24,6 +24,15 @@ [cachedFilesController addObserver:self forKeyPath:@"selection" options:0 context:@"cachedFileSelected"]; } +- (void)closeView +{ + [[self script] removeWebScriptKey:@"Index"]; + [unstagedFilesController removeObserver:self forKeyPath:@"selection"]; + [cachedFilesController removeObserver:self forKeyPath:@"selection"]; + + [super closeView]; +} + - (void) didLoad { [[self script] setValue:controller.index forKey:@"Index"]; diff --git a/PBWebController.m b/PBWebController.m index 27b672c..ab890fb 100644 --- a/PBWebController.m +++ b/PBWebController.m @@ -46,10 +46,14 @@ return [view windowScriptObject]; } -- (void) closeView +- (void)closeView { - if (view) + if (view) { + [[self script] setValue:nil forKey:@"Controller"]; [view close]; + } + + [[NSNotificationCenter defaultCenter] removeObserver:self]; } # pragma mark Delegate methods diff --git a/PBWebDiffController.m b/PBWebDiffController.m index 0e820b3..01efde7 100644 --- a/PBWebDiffController.m +++ b/PBWebDiffController.m @@ -18,6 +18,14 @@ [diffController addObserver:self forKeyPath:@"diff" options:0 context:@"ChangedDiff"]; } +- (void)closeView +{ + [diffController removeObserver:self forKeyPath:@"diff"]; + + [super closeView]; +} + + - (void) didLoad { [self showDiff:diffController.diff]; diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index f0c533d..6c4a486 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -22,6 +22,14 @@ [historyController addObserver:self forKeyPath:@"webCommit" options:0 context:@"ChangedCommit"]; } +- (void)closeView +{ + [[self script] setValue:nil forKey:@"commit"]; + [historyController removeObserver:self forKeyPath:@"webCommit"]; + + [super closeView]; +} + - (void) didLoad { currentSha = nil; @@ -161,9 +169,8 @@ contextMenuItemsForElement:(NSDictionary *)element return [historyController valueForKeyPath:[@"repository.config." stringByAppendingString:config]]; } -- (void) finalize +- (void)finalize { - [historyController removeObserver:self forKeyPath:@"webCommit"]; [super finalize]; } From 7c62337ab9a8a2e8448fa9e7531d5659e0bb2ff5 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:36:03 -0600 Subject: [PATCH 040/110] Update commits every 0.1 sec instead of every 1000 commits Slower machines will update more often and faster ones will do more work in each update. --- PBGitHistoryGrapher.m | 13 ++++++++++--- PBGitRevList.mm | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m index 65d2311..ab9760d 100644 --- a/PBGitHistoryGrapher.m +++ b/PBGitHistoryGrapher.m @@ -38,7 +38,9 @@ if (!revList || [revList count] == 0) return; + //NSDate *start = [NSDate date]; NSThread *currentThread = [NSThread currentThread]; + NSDate *lastUpdate = [NSDate date]; NSMutableArray *commits = [NSMutableArray array]; NSInteger counter = 0; @@ -54,11 +56,16 @@ [searchSHAs addObjectsFromArray:[commit parents]]; } } - if (++counter % 2000 == 0) { - [self sendCommits:commits]; - commits = [NSMutableArray array]; + if (++counter % 100 == 0) { + if ([[NSDate date] timeIntervalSinceDate:lastUpdate] > 0.1) { + [self sendCommits:commits]; + commits = [NSMutableArray array]; + lastUpdate = [NSDate date]; + } } } + //NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; + //NSLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration); [self sendCommits:commits]; [delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO]; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 00a1920..b3e4ef7 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -96,6 +96,7 @@ using namespace std; - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev { NSDate *start = [NSDate date]; + NSDate *lastUpdate = [NSDate date]; NSMutableArray *revisions = [NSMutableArray array]; PBGitGrapher *g = [[PBGitGrapher alloc] initWithRepository:repository]; std::map encodingMap; @@ -125,6 +126,9 @@ using namespace std; int num = 0; while (true) { + if ([currentThread isCancelled]) + break; + string sha; if (!getline(stream, sha, '\1')) break; @@ -200,18 +204,19 @@ using namespace std; if (isGraphing) [g decorateCommit:newCommit]; - if (++num % 1000 == 0) { - if ([currentThread isCancelled]) - break; - NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; - [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; - revisions = [NSMutableArray array]; + if (++num % 100 == 0) { + if ([[NSDate date] timeIntervalSinceDate:lastUpdate] > 0.1) { + NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; + [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; + revisions = [NSMutableArray array]; + lastUpdate = [NSDate date]; + } } } if (![currentThread isCancelled]) { NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; - NSLog(@"Loaded %i commits in %f seconds", num, duration); + NSLog(@"Loaded %i commits in %f seconds (%f/sec)", num, duration, num/duration); // Make sure the commits are stored before exiting. NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; From 69827e920e904cd8634367bcb022d6ba837b4dda Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:50:09 -0600 Subject: [PATCH 041/110] Performance improvements for graphing commits The big improvement is reusing the PBGraphCellInfo (~8-10%) --- PBGitCommit.m | 3 +++ PBGitGrapher.mm | 12 ++++++++++-- PBGraphCellInfo.h | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/PBGitCommit.m b/PBGitCommit.m index ac2bd1f..067d6f4 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -74,6 +74,9 @@ NSString * const kGitXCommitType = @"commit"; - (BOOL)isEqual:(id)otherCommit { + if (self == otherCommit) + return YES; + if (![otherCommit isMemberOfClass:[PBGitCommit class]]) return NO; diff --git a/PBGitGrapher.mm b/PBGitGrapher.mm index abd6327..41401d6 100644 --- a/PBGitGrapher.mm +++ b/PBGitGrapher.mm @@ -48,6 +48,7 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in PBGitLane *currentLane = NULL; BOOL didFirst = NO; + git_oid commit_oid = [[commit sha] oid]; // First, iterate over earlier columns and pass through any that don't want this commit if (previous != nil) { @@ -57,7 +58,7 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in i++; // This is our commit! We should do a "merge": move the line from // our upperMapping to their lowerMapping - if ((*it)->isCommit([[commit sha] oid])) { + if ((*it)->isCommit(commit_oid)) { if (!didFirst) { didFirst = YES; currentLanes->push_back(*it); @@ -127,7 +128,14 @@ void add_line(struct PBGitGraphLine *lines, int *nLines, int upper, int from, in add_line(lines, ¤tLine, 0, currentLanes->size(), newPos, newLane->index()); } - previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines]; + if (commit.lineInfo) { + previous = commit.lineInfo; + previous.position = newPos; + previous.lines = lines; + } + else + previous = [[PBGraphCellInfo alloc] initWithPosition:newPos andLines:lines]; + if (currentLine > maxLines) NSLog(@"Number of lines: %i vs allocated: %i", currentLine, maxLines); diff --git a/PBGraphCellInfo.h b/PBGraphCellInfo.h index 5948e0f..e959061 100644 --- a/PBGraphCellInfo.h +++ b/PBGraphCellInfo.h @@ -18,7 +18,7 @@ char sign; } -@property(readonly) struct PBGitGraphLine *lines; +@property(assign) struct PBGitGraphLine *lines; @property(assign) int nLines; @property(assign) int position, numColumns; @property(assign) char sign; From 81d7e78e7dd52eab4a1a6f26bff1e6edc0d7e396 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:54:22 -0600 Subject: [PATCH 042/110] Select the commit as soon as it is available when updating the commit list This is important for large repositories as the commit will be selected when it is added instead of waiting for all the commits to be loaded. Stop attempts to select the current commit again if it's already selected. No longer need the updatedGraph property on the history list. --- PBGitHistoryController.m | 46 ++++++++++++++++++++++++---------------- PBGitHistoryList.h | 2 -- PBGitHistoryList.m | 3 --- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 1bfd64a..484e6b8 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -48,7 +48,6 @@ [treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeChange"]; [repository.revisionList addObserver:self forKeyPath:@"isUpdating" options:0 context:@"revisionListUpdating"]; - [repository.revisionList addObserver:self forKeyPath:@"updatedGraph" options:0 context:@"revisionListUpdatedGraph"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"]; [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; @@ -83,26 +82,34 @@ [super awakeFromNib]; } -- (void) updateKeys +- (void)updateKeys { - // Remove any references in the QLPanel - //[[QLPreviewPanel sharedPreviewPanel] setURLs:[NSArray array] currentIndex:0 preservingDisplayState:YES]; - // We have to do this manually, as NSTreeController leaks memory? - //[treeController setSelectionIndexPaths:[NSArray array]]; + PBGitCommit *lastObject = [[commitController selectedObjects] lastObject]; + if (lastObject) { + if (![selectedCommit isEqual:lastObject]) { + selectedCommit = lastObject; - selectedCommit = [[commitController selectedObjects] lastObject]; + BOOL isOnHeadBranch = [selectedCommit isOnHeadBranch]; + [mergeButton setEnabled:!isOnHeadBranch]; + [cherryPickButton setEnabled:!isOnHeadBranch]; + [rebaseButton setEnabled:!isOnHeadBranch]; + } + } + else { + [mergeButton setEnabled:NO]; + [cherryPickButton setEnabled:NO]; + [rebaseButton setEnabled:NO]; + } if (self.selectedCommitDetailsIndex == kHistoryTreeViewIndex) { self.gitTree = selectedCommit.tree; [self restoreFileBrowserSelection]; } - else // kHistoryDetailViewIndex + else { + // kHistoryDetailViewIndex + if (![self.webCommit isEqual:selectedCommit]) self.webCommit = selectedCommit; - - BOOL isOnHeadBranch = [selectedCommit isOnHeadBranch]; - [mergeButton setEnabled:!isOnHeadBranch]; - [cherryPickButton setEnabled:!isOnHeadBranch]; - [rebaseButton setEnabled:!isOnHeadBranch]; + } } - (void) updateBranchFilterMatrix @@ -141,6 +148,11 @@ return nil; } +- (BOOL)isCommitSelected +{ + return [selectedCommit isEqual:[[commitController selectedObjects] lastObject]]; +} + - (void) setSelectedCommitDetailsIndex:(int)detailsIndex { if (selectedCommitDetailsIndex == detailsIndex) @@ -230,10 +242,7 @@ if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { [self updateStatus]; - return; - } - if([(NSString *)context isEqualToString:@"revisionListUpdatedGraph"]) { if ([repository.currentBranch isSimpleRef]) [self selectCommit:[repository shaForRef:[repository.currentBranch ref]]]; else @@ -399,7 +408,7 @@ - (void)selectCommit:(PBGitSHA *)commitSHA { - if (!forceSelectionUpdate && [[selectedCommit sha] isEqual:commitSHA]) + if (!forceSelectionUpdate && [[[[commitController selectedObjects] lastObject] sha] isEqual:commitSHA]) return; NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; @@ -409,6 +418,8 @@ if (repository.currentBranchFilter != kGitXSelectedBranchFilter) [self scrollSelectionToTopOfViewFrom:oldIndex]; + + forceSelectionUpdate = NO; } - (BOOL) hasNonlinearPath @@ -428,7 +439,6 @@ [treeController removeObserver:self forKeyPath:@"selection"]; [repository.revisionList removeObserver:self forKeyPath:@"isUpdating"]; - [repository.revisionList removeObserver:self forKeyPath:@"updatedGraph"]; [repository removeObserver:self forKeyPath:@"currentBranch"]; [repository removeObserver:self forKeyPath:@"refs"]; } diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h index 2b07007..75e1c6c 100644 --- a/PBGitHistoryList.h +++ b/PBGitHistoryList.h @@ -28,7 +28,6 @@ PBGitRef *lastRemoteRef; BOOL resetCommits; BOOL shouldReloadProjectHistory; - NSDate *updatedGraph; PBGitHistoryGrapher *grapher; NSOperationQueue *graphQueue; @@ -49,6 +48,5 @@ @property (retain) NSMutableArray *commits; @property (readonly) NSArray *projectCommits; @property (assign) BOOL isUpdating; -@property (retain) NSDate *updatedGraph; @end diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m index a121ad1..0a4433f 100644 --- a/PBGitHistoryList.m +++ b/PBGitHistoryList.m @@ -36,7 +36,6 @@ @synthesize projectRevList; @synthesize commits; @synthesize isUpdating; -@synthesize updatedGraph; @dynamic projectCommits; @@ -137,7 +136,6 @@ { if (!currentRevList.isParsing && ([[graphQueue operations] count] == 0)) { self.isUpdating = NO; - [self performSelector:@selector(setUpdatedGraph:) withObject:[NSDate date] afterDelay:0]; } } @@ -272,7 +270,6 @@ lastRemoteRef = [[rev ref] remoteRef]; lastSHA = nil; self.isUpdating = NO; - self.updatedGraph = [NSDate date]; return NO; } From d81645e4117afdb23ea991cb1bb52285269e00eb Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:54:58 -0600 Subject: [PATCH 043/110] Include the DSYM file while compiling the release build --- GitX.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 331d554..53a5ea6 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -1363,7 +1363,7 @@ 26FC0A860875C7B200E6366F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", From de7d74cac88ae5535161e4d13041557b3b9893ad Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 18:55:21 -0600 Subject: [PATCH 044/110] Update build settings to include x86_64 arch Set the debug configuration to NATIVE_ARCH_ACTUAL because NATIVE_ARCH will always be i386 Move the "compile libgit2" script build phase to it's own target. By setting the script to run in it's own target we get the ability to clean it durning the clean phase (normal build phase scripts don't run during clean). This will be needed if someone has built GitX prior to this commit because the object files will be for the old architectures. Also give an error if there is no git repository. This is from several questions I've received after someone has downloaded the source from github instead of cloning the project. The problem is that there is no submodule setting to update. --- GitX.xcodeproj/project.pbxproj | 79 +++++++++++++++++++++++++++------- build_libgit2.sh | 52 ++++++++++++++++++++++ 2 files changed, 116 insertions(+), 15 deletions(-) create mode 100755 build_libgit2.sh diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 53a5ea6..6573d7f 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -189,6 +189,13 @@ remoteGlobalIDString = 913D5E480E55644600CECEA2; remoteInfo = "cli tool"; }; + D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = D8022B1411DFCE7F003C21F6; + remoteInfo = libgit2; + }; F5643A010F792B4900A579C2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -251,6 +258,7 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_libgit2.sh; sourceTree = ""; }; D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = ""; }; D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = ""; }; @@ -554,6 +562,7 @@ 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, F5E92A220E88569500056E75 /* new_file.png */, + D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */, ); name = "Other Sources"; sourceTree = ""; @@ -905,12 +914,27 @@ }; /* End PBXHeadersBuildPhase section */ +/* Begin PBXLegacyTarget section */ + D8022B1411DFCE7F003C21F6 /* libgit2 */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "\"${PROJECT_DIR}/build_libgit2.sh\""; + buildConfigurationList = D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */; + buildPhases = ( + ); + buildToolPath = /bin/sh; + dependencies = ( + ); + name = libgit2; + passBuildSettingsInEnvironment = 1; + productName = libgit2; + }; +/* End PBXLegacyTarget section */ + /* Begin PBXNativeTarget section */ 8D1107260486CEB800E47090 /* GitX */ = { isa = PBXNativeTarget; buildConfigurationList = 26FC0A840875C7B200E6366F /* Build configuration list for PBXNativeTarget "GitX" */; buildPhases = ( - F5792DFB0EDB570C001B0C31 /* Compile libgit2 */, 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, @@ -922,6 +946,7 @@ dependencies = ( 913D5E5A0E5564F400CECEA2 /* PBXTargetDependency */, F5643A020F792B4900A579C2 /* PBXTargetDependency */, + D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */, ); name = GitX; productInstallPath = "$(HOME)/Applications"; @@ -996,6 +1021,7 @@ F5886A0F0ED5D33D0066E74C /* SpeedTest */, F56439F70F792B2100A579C2 /* Generate PList Prefix */, F567CC38106E6B910059BB9D /* GitXTesting */, + D8022B1411DFCE7F003C21F6 /* libgit2 */, ); }; /* End PBXProject section */ @@ -1072,20 +1098,6 @@ shellPath = /bin/sh; shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\nVERSION=$(cd \"$PROJECT_DIR\";git describe)\nLONG_VERSION=$(echo $VERSION | sed -e \"s/\\-/\\./\" -e \"s/^v//\" -e \"s/-.*//\")\nSHORT_VERSION=$(echo $VERSION | sed -e \"s/\\-.*//\" -e \"s/^v//\")\n\necho -n \"#define LONG_VERSION $LONG_VERSION\n#define GIT_VERSION $VERSION\n#define SHORT_VERSION $SHORT_VERSION\" > \"$PROJECT_TEMP_DIR/revision\"\ntouch Info.plist"; }; - F5792DFB0EDB570C001B0C31 /* Compile libgit2 */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Compile libgit2"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a"; - }; F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1241,6 +1253,11 @@ target = 913D5E480E55644600CECEA2 /* cli tool */; targetProxy = 913D5E590E5564F400CECEA2 /* PBXContainerItemProxy */; }; + D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D8022B1411DFCE7F003C21F6 /* libgit2 */; + targetProxy = D8022C1911DFE8ED003C21F6 /* PBXContainerItemProxy */; + }; F5643A020F792B4900A579C2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F56439F70F792B2100A579C2 /* Generate PList Prefix */; @@ -1388,6 +1405,7 @@ 26FC0A890875C7B200E6366F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; GCC_ENABLE_OBJC_GC = required; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1404,6 +1422,7 @@ ARCHS = ( ppc, i386, + x86_64, ); GCC_ENABLE_OBJC_GC = required; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -1462,6 +1481,27 @@ }; name = Release; }; + D8022B1511DFCE7F003C21F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = libgit2; + }; + name = Debug; + }; + D8022B1611DFCE7F003C21F6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PRODUCT_NAME = libgit2; + ZERO_LINK = NO; + }; + name = Release; + }; F56439F80F792B2100A579C2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1635,6 +1675,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D8022B1C11DFCE98003C21F6 /* Build configuration list for PBXLegacyTarget "libgit2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D8022B1511DFCE7F003C21F6 /* Debug */, + D8022B1611DFCE7F003C21F6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; F56439FD0F792B3600A579C2 /* Build configuration list for PBXAggregateTarget "Generate PList Prefix" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/build_libgit2.sh b/build_libgit2.sh new file mode 100755 index 0000000..a94257d --- /dev/null +++ b/build_libgit2.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# build_libgit2.sh +# GitX +# +# Created by BrotherBard on 7/3/10. +# Copyright 2010 BrotherBard. All rights reserved. +# +# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode + +buildAction () { + echo "Building libgit2..." + if [[ -d .git ]] + then + export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path` + git submodule init + git submodule update + cd libgit2 + rm -f libgit2.a + make CFLAGS="-arch i386 -arch ppc -arch x86_64" + ranlib libgit2.a + else + echo "error: Not a git repository." + echo "error: clone GitX first so that the libgit2 submodule can be updated" + exit 1 + fi +} + +cleanAction () { + echo "Cleaning libgit2..." + cd libgit2 + make clean +} + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# MAIN + +#echo "Running with ACTION=${ACTION}" + +case $ACTION in + # NOTE: it gets set to "" rather than "build" when doing a build. + "") + buildAction + ;; + + "clean") + cleanAction + ;; +esac + +exit 0 + From a6b5705a5fe95034e7537566763ce23c2267685e Mon Sep 17 00:00:00 2001 From: Uli Kusterer Date: Fri, 19 Feb 2010 23:03:20 +0100 Subject: [PATCH 045/110] First stab at an executable that can be put into the SSH_ASKPASS environment variable to make GitX ask for passwords. Set the environment variables for our tool. We have a rudimentary but working password panel now. Prettification later. Label on password window so it's less cryptic. --- ApplicationController.m | 5 ++ GitX.xcodeproj/project.pbxproj | 136 ++++++++++++++++++++++++++++ gitx_askpasswd_main.m | 159 +++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 gitx_askpasswd_main.m diff --git a/ApplicationController.m b/ApplicationController.m index c6a4ba1..2a3d2ae 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -67,6 +67,11 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification { [[SUUpdater sharedUpdater] setSendsSystemProfile:YES]; + + // Make sure Git's SSH password requests get forwarded to our little UI tool: + setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 ); + setenv( "DISPLAY", "localhost:0", 1 ); + [self registerServices]; BOOL hasOpenedDocuments = NO; diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 6573d7f..750f75f 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -29,6 +29,8 @@ 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDB680E94EF6500671A1E /* Preferences.xib */; }; 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */ = {isa = PBXBuildFile; fileRef = 47DBDBB00E94F6CA00671A1E /* Updates.png */; }; 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */; }; + 551BF11E112F376C00265053 /* gitx_askpasswd_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */; }; + 551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */ = {isa = PBXBuildFile; fileRef = 551BF111112F371800265053 /* gitx_askpasswd */; }; 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 */; }; @@ -182,6 +184,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 551BF174112F3F3500265053 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 551BF110112F371800265053; + remoteInfo = gitx_askpasswd; + }; 913D5E590E5564F400CECEA2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -236,6 +245,8 @@ 47DBDBB00E94F6CA00671A1E /* Updates.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Updates.png; path = Images/Preferences/Updates.png; sourceTree = ""; }; 47DBDBC80E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBNSURLPathUserDefaultsTransfomer.h; sourceTree = ""; }; 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBNSURLPathUserDefaultsTransfomer.m; sourceTree = ""; }; + 551BF111112F371800265053 /* gitx_askpasswd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gitx_askpasswd; sourceTree = BUILT_PRODUCTS_DIR; }; + 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gitx_askpasswd_main.m; sourceTree = ""; }; 770B37EC0679A11B001EADE2 /* GitTest_DataModel.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = GitTest_DataModel.xcdatamodel; sourceTree = ""; }; 77C82804067257F0000B614F /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 77C8280B06725ACE000B614F /* ApplicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationController.h; sourceTree = ""; }; @@ -434,6 +445,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 551BF10F112F371800265053 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -512,6 +530,7 @@ 913D5E490E55644600CECEA2 /* gitx */, F5886A100ED5D33D0066E74C /* SpeedTest.app */, F567CC39106E6B910059BB9D /* GitXTesting.framework */, + 551BF111112F371800265053 /* gitx_askpasswd */, ); name = Products; sourceTree = ""; @@ -528,6 +547,7 @@ 7756732906782D8800D1FEB8 /* Models */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, + 551BF118112F373E00265053 /* gitx_asskpasswd */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, @@ -612,6 +632,14 @@ name = "Preference Icons"; sourceTree = ""; }; + 551BF118112F373E00265053 /* gitx_asskpasswd */ = { + isa = PBXGroup; + children = ( + 551BF11D112F376C00265053 /* gitx_askpasswd_main.m */, + ); + name = gitx_asskpasswd; + sourceTree = ""; + }; 7756732906782D8800D1FEB8 /* Models */ = { isa = PBXGroup; children = ( @@ -931,6 +959,22 @@ /* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ + 551BF110112F371800265053 /* gitx_askpasswd */ = { + isa = PBXNativeTarget; + buildConfigurationList = 551BF119112F373E00265053 /* Build configuration list for PBXNativeTarget "gitx_askpasswd" */; + buildPhases = ( + 551BF10E112F371800265053 /* Sources */, + 551BF10F112F371800265053 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = gitx_askpasswd; + productName = gitx_askpasswd; + productReference = 551BF111112F371800265053 /* gitx_askpasswd */; + productType = "com.apple.product-type.tool"; + }; 8D1107260486CEB800E47090 /* GitX */ = { isa = PBXNativeTarget; buildConfigurationList = 26FC0A840875C7B200E6366F /* Build configuration list for PBXNativeTarget "GitX" */; @@ -944,6 +988,7 @@ buildRules = ( ); dependencies = ( + 551BF175112F3F3500265053 /* PBXTargetDependency */, 913D5E5A0E5564F400CECEA2 /* PBXTargetDependency */, F5643A020F792B4900A579C2 /* PBXTargetDependency */, D8022C1A11DFE8ED003C21F6 /* PBXTargetDependency */, @@ -1022,6 +1067,7 @@ F56439F70F792B2100A579C2 /* Generate PList Prefix */, F567CC38106E6B910059BB9D /* GitXTesting */, D8022B1411DFCE7F003C21F6 /* libgit2 */, + 551BF110112F371800265053 /* gitx_askpasswd */, ); }; /* End PBXProject section */ @@ -1033,6 +1079,7 @@ files = ( F5E92A1B0E88550E00056E75 /* empty_file.png in Resources */, 913D5E500E55645900CECEA2 /* gitx in Resources */, + 551BF176112F3F4B00265053 /* gitx_askpasswd in Resources */, 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */, 911111E20E58BD5A00BF76B4 /* RepositoryWindow.xib in Resources */, @@ -1116,6 +1163,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 551BF10E112F371800265053 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 551BF11E112F376C00265053 /* gitx_askpasswd_main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1248,6 +1303,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 551BF175112F3F3500265053 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 551BF110112F371800265053 /* gitx_askpasswd */; + targetProxy = 551BF174112F3F3500265053 /* PBXContainerItemProxy */; + }; 913D5E5A0E5564F400CECEA2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 913D5E480E55644600CECEA2 /* cli tool */; @@ -1434,6 +1494,72 @@ }; name = Release; }; + 551BF113112F371800265053 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + INSTALL_PATH = /usr/local/bin; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = gitx_askpasswd; + }; + name = Debug; + }; + 551BF114112F371800265053 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + INSTALL_PATH = /usr/local/bin; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = gitx_askpasswd; + ZERO_LINK = NO; + }; + name = Release; + }; + 551BF115112F371800265053 /* Install */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + INSTALL_PATH = /usr/local/bin; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = gitx_askpasswd; + }; + name = Install; + }; 913D5E4B0E55644600CECEA2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1666,6 +1792,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 551BF119112F373E00265053 /* Build configuration list for PBXNativeTarget "gitx_askpasswd" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 551BF113112F371800265053 /* Debug */, + 551BF114112F371800265053 /* Release */, + 551BF115112F371800265053 /* Install */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 913D5E570E55646100CECEA2 /* Build configuration list for PBXNativeTarget "cli tool" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/gitx_askpasswd_main.m b/gitx_askpasswd_main.m new file mode 100644 index 0000000..120df22 --- /dev/null +++ b/gitx_askpasswd_main.m @@ -0,0 +1,159 @@ +/* + * gitx_askpasswd_main.m + * GitX + * + * Created by Uli Kusterer on 19.02.10. + * Copyright 2010 The Void Software. All rights reserved. + * + */ + +#include +#import + +#define OKBUTTONWIDTH 100.0 +#define OKBUTTONHEIGHT 24.0 +#define CANCELBUTTONWIDTH 100.0 +#define CANCELBUTTONHEIGHT 24.0 +#define PASSHEIGHT 22.0 +#define PASSLABELHEIGHT 16.0 + + +@interface GAPAppDelegate : NSObject +{ + NSPanel* mPasswordPanel; + NSSecureTextField* mPasswordField; +} + +-(NSPanel*) passwordPanel; + +-(IBAction) doOKButton: (id)sender; +-(IBAction) doCancelButton: (id)sender; + +@end + + +@implementation GAPAppDelegate + +-(void) dealloc +{ + [mPasswordPanel release]; + mPasswordPanel = nil; + + [mPasswordField release]; + mPasswordField = nil; + + [super dealloc]; +} + +-(NSPanel*) passwordPanel +{ + if( !mPasswordPanel ) + { + NSRect box = NSMakeRect( 100, 100, 250, 100 ); + mPasswordPanel = [[NSPanel alloc] initWithContentRect: box + styleMask: NSTitledWindowMask + backing: NSBackingStoreBuffered defer: NO]; + [mPasswordPanel setHidesOnDeactivate: NO]; + [mPasswordPanel setLevel: NSFloatingWindowLevel]; + [mPasswordPanel center]; + + box.origin = NSZeroPoint; // Only need local coords from now on. + + // OK: + NSRect okBox = box; + okBox.origin.x = NSMaxX( box ) -OKBUTTONWIDTH -10; + okBox.size.width = OKBUTTONWIDTH; + okBox.origin.y += 10; + okBox.size.height = OKBUTTONHEIGHT; + NSButton* okButton = [[[NSButton alloc] initWithFrame: okBox] autorelease]; + [okButton setTarget: self]; + [okButton setAction: @selector(doOKButton:)]; + [okButton setTitle: @"OK"]; // +++ Localize. + [okButton setKeyEquivalent: @"\r"]; + [okButton setBordered: YES]; + [okButton setBezelStyle: NSRoundedBezelStyle]; + [[mPasswordPanel contentView] addSubview: okButton]; + + // Cancel: + NSRect cancelBox = box; + cancelBox.origin.x = NSMinX( okBox ) -CANCELBUTTONWIDTH -6; + cancelBox.size.width = CANCELBUTTONWIDTH; + cancelBox.origin.y += 10; + cancelBox.size.height = CANCELBUTTONHEIGHT; + okButton = [[[NSButton alloc] initWithFrame: cancelBox] autorelease]; + [okButton setTarget: self]; + [okButton setAction: @selector(doCancelButton:)]; + [okButton setTitle: @"Cancel"]; // +++ Localize. + [okButton setBordered: YES]; + [okButton setBezelStyle: NSRoundedBezelStyle]; + [[mPasswordPanel contentView] addSubview: okButton]; + + // Password field: + NSRect passBox = box; + passBox.origin.y = NSMaxY(okBox) + 12; + passBox.size.height = PASSHEIGHT; + passBox.origin.x += 12; + passBox.size.width -= 12 * 2; + mPasswordField = [[NSSecureTextField alloc] initWithFrame: passBox]; + [mPasswordField setSelectable: YES]; + [mPasswordField setEditable: YES]; + [mPasswordField setBordered: YES]; + [mPasswordField setBezeled: YES]; + [mPasswordField setBezelStyle: NSTextFieldSquareBezel]; + [mPasswordField selectText: self]; + [[mPasswordPanel contentView] addSubview: mPasswordField]; + + // Password label: + NSRect passLabelBox = box; + passLabelBox.origin.y = NSMaxY(passBox) + 6; + passLabelBox.size.height = PASSLABELHEIGHT; + passLabelBox.origin.x += 12; + passLabelBox.size.width -= 12 * 2; + NSTextField* passwordLabel = [[[NSTextField alloc] initWithFrame: passLabelBox] autorelease]; + [passwordLabel setSelectable: YES]; + [passwordLabel setEditable: NO]; + [passwordLabel setBordered: NO]; + [passwordLabel setBezeled: NO]; + [passwordLabel setDrawsBackground: NO]; + [passwordLabel setStringValue: @"Please enter your password:"]; // +++ Localize. + [[mPasswordPanel contentView] addSubview: passwordLabel]; + } + + return mPasswordPanel; +} + + +-(IBAction) doOKButton: (id)sender +{ + printf( "%s\n", [[mPasswordField stringValue] UTF8String] ); + [[NSApplication sharedApplication] terminate: self]; +} + + +-(IBAction) doCancelButton: (id)sender +{ + printf("\n"); + [[NSApplication sharedApplication] terminate: self]; +} + +@end + + + +int main( int argc, const char** argv ) +{ + ProcessSerialNumber myPSN = { 0, kCurrentProcess }; + TransformProcessType( &myPSN, kProcessTransformToForegroundApplication ); + + NSApplication * app = [NSApplication sharedApplication]; + GAPAppDelegate * appDel = [[GAPAppDelegate alloc] init]; + [app setDelegate: appDel]; + NSWindow* passPanel = [appDel passwordPanel]; + + [app activateIgnoringOtherApps: YES]; + [passPanel makeKeyAndOrderFront: nil]; + [app runModalForWindow: passPanel]; + + return 0; +} + From 6809ac31c636d7696c0bc920cdb261d1b4eb9603 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 3 Jul 2010 23:03:03 -0600 Subject: [PATCH 046/110] Prettify the SSH password window - use something close to the standard HIG spacing - add the app's icon and a title so people know what app is asking for a password - save the position of the window and only center the window if the user hasn't moved it before - the NSSecureTextField spews some garbage to STDERR which GitX would show in the success/failure sheet so close STDERR --- gitx_askpasswd_main.m | 106 ++++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/gitx_askpasswd_main.m b/gitx_askpasswd_main.m index 120df22..6c8c2af 100644 --- a/gitx_askpasswd_main.m +++ b/gitx_askpasswd_main.m @@ -16,9 +16,10 @@ #define CANCELBUTTONHEIGHT 24.0 #define PASSHEIGHT 22.0 #define PASSLABELHEIGHT 16.0 +#define WINDOWAUTOSAVENAME @"GitXAskPasswordWindowFrame" -@interface GAPAppDelegate : NSObject +@interface GAPAppDelegate : NSObject { NSPanel* mPasswordPanel; NSSecureTextField* mPasswordField; @@ -34,38 +35,31 @@ @implementation GAPAppDelegate --(void) dealloc -{ - [mPasswordPanel release]; - mPasswordPanel = nil; - - [mPasswordField release]; - mPasswordField = nil; - - [super dealloc]; -} - -(NSPanel*) passwordPanel { if( !mPasswordPanel ) { - NSRect box = NSMakeRect( 100, 100, 250, 100 ); + NSRect box = NSMakeRect( 100, 100, 400, 134 ); mPasswordPanel = [[NSPanel alloc] initWithContentRect: box - styleMask: NSTitledWindowMask - backing: NSBackingStoreBuffered defer: NO]; + styleMask: NSTitledWindowMask + backing: NSBackingStoreBuffered defer: NO]; [mPasswordPanel setHidesOnDeactivate: NO]; [mPasswordPanel setLevel: NSFloatingWindowLevel]; - [mPasswordPanel center]; + [mPasswordPanel setTitle: @"GitX SSH Remote Login"]; + if (![mPasswordPanel setFrameUsingName: WINDOWAUTOSAVENAME]) { + [mPasswordPanel center]; + [mPasswordPanel setFrameAutosaveName: WINDOWAUTOSAVENAME]; + } box.origin = NSZeroPoint; // Only need local coords from now on. // OK: - NSRect okBox = box; - okBox.origin.x = NSMaxX( box ) -OKBUTTONWIDTH -10; + NSRect okBox = box; + okBox.origin.x = NSMaxX( box ) -OKBUTTONWIDTH -20; okBox.size.width = OKBUTTONWIDTH; - okBox.origin.y += 10; + okBox.origin.y += 20; okBox.size.height = OKBUTTONHEIGHT; - NSButton* okButton = [[[NSButton alloc] initWithFrame: okBox] autorelease]; + NSButton *okButton = [[NSButton alloc] initWithFrame: okBox]; [okButton setTarget: self]; [okButton setAction: @selector(doOKButton:)]; [okButton setTitle: @"OK"]; // +++ Localize. @@ -78,22 +72,22 @@ NSRect cancelBox = box; cancelBox.origin.x = NSMinX( okBox ) -CANCELBUTTONWIDTH -6; cancelBox.size.width = CANCELBUTTONWIDTH; - cancelBox.origin.y += 10; + cancelBox.origin.y += 20; cancelBox.size.height = CANCELBUTTONHEIGHT; - okButton = [[[NSButton alloc] initWithFrame: cancelBox] autorelease]; - [okButton setTarget: self]; - [okButton setAction: @selector(doCancelButton:)]; - [okButton setTitle: @"Cancel"]; // +++ Localize. - [okButton setBordered: YES]; - [okButton setBezelStyle: NSRoundedBezelStyle]; - [[mPasswordPanel contentView] addSubview: okButton]; + NSButton *cancleButton = [[NSButton alloc] initWithFrame: cancelBox]; + [cancleButton setTarget: self]; + [cancleButton setAction: @selector(doCancelButton:)]; + [cancleButton setTitle: @"Cancel"]; // +++ Localize. + [cancleButton setBordered: YES]; + [cancleButton setBezelStyle: NSRoundedBezelStyle]; + [[mPasswordPanel contentView] addSubview: cancleButton]; // Password field: - NSRect passBox = box; - passBox.origin.y = NSMaxY(okBox) + 12; + NSRect passBox = box; + passBox.origin.y = NSMaxY(okBox) + 24; passBox.size.height = PASSHEIGHT; - passBox.origin.x += 12; - passBox.size.width -= 12 * 2; + passBox.origin.x += 104; + passBox.size.width -= 104 + 20; mPasswordField = [[NSSecureTextField alloc] initWithFrame: passBox]; [mPasswordField setSelectable: YES]; [mPasswordField setEditable: YES]; @@ -104,12 +98,12 @@ [[mPasswordPanel contentView] addSubview: mPasswordField]; // Password label: - NSRect passLabelBox = box; - passLabelBox.origin.y = NSMaxY(passBox) + 6; + NSRect passLabelBox = box; + passLabelBox.origin.y = NSMaxY(passBox) + 8; passLabelBox.size.height = PASSLABELHEIGHT; - passLabelBox.origin.x += 12; - passLabelBox.size.width -= 12 * 2; - NSTextField* passwordLabel = [[[NSTextField alloc] initWithFrame: passLabelBox] autorelease]; + passLabelBox.origin.x += 100; + passLabelBox.size.width -= 100 + 20; + NSTextField *passwordLabel = [[NSTextField alloc] initWithFrame: passLabelBox]; [passwordLabel setSelectable: YES]; [passwordLabel setEditable: NO]; [passwordLabel setBordered: NO]; @@ -117,6 +111,19 @@ [passwordLabel setDrawsBackground: NO]; [passwordLabel setStringValue: @"Please enter your password:"]; // +++ Localize. [[mPasswordPanel contentView] addSubview: passwordLabel]; + + // GitX icon: + NSRect gitxIconBox = box; + gitxIconBox.origin.y = NSMaxY(box) - 78; + gitxIconBox.size.height = 64; + gitxIconBox.origin.x += 20; + gitxIconBox.size.width = 64; + NSImageView *gitxIconView = [[NSImageView alloc] initWithFrame: gitxIconBox]; + [gitxIconView setEditable: NO]; + NSString *gitxIconPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"gitx.icns"]; + NSImage *gitxIcon = [[NSImage alloc] initWithContentsOfFile: gitxIconPath]; + [gitxIconView setImage: gitxIcon]; + [[mPasswordPanel contentView] addSubview: gitxIconView]; } return mPasswordPanel; @@ -126,14 +133,16 @@ -(IBAction) doOKButton: (id)sender { printf( "%s\n", [[mPasswordField stringValue] UTF8String] ); - [[NSApplication sharedApplication] terminate: self]; + [[NSApplication sharedApplication] stopModalWithCode: 0]; } +// TODO: Need to find out how to get SSH to cancel. +// When the user cancels the window it is opened again for however +// many times the remote server allows failed attempts. -(IBAction) doCancelButton: (id)sender { - printf("\n"); - [[NSApplication sharedApplication] terminate: self]; + [[NSApplication sharedApplication] stopModalWithCode: 1]; } @end @@ -142,18 +151,25 @@ int main( int argc, const char** argv ) { + // close stderr to stop cocoa log messages from being picked up by GitX + close(STDERR_FILENO); + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + ProcessSerialNumber myPSN = { 0, kCurrentProcess }; TransformProcessType( &myPSN, kProcessTransformToForegroundApplication ); - NSApplication * app = [NSApplication sharedApplication]; - GAPAppDelegate * appDel = [[GAPAppDelegate alloc] init]; + NSApplication *app = [NSApplication sharedApplication]; + GAPAppDelegate *appDel = [[GAPAppDelegate alloc] init]; [app setDelegate: appDel]; - NSWindow* passPanel = [appDel passwordPanel]; + NSWindow *passPanel = [appDel passwordPanel]; [app activateIgnoringOtherApps: YES]; [passPanel makeKeyAndOrderFront: nil]; - [app runModalForWindow: passPanel]; + NSInteger code = [app runModalForWindow: passPanel]; - return 0; + [defaults synchronize]; + + return code; } From 66e260fa69feaef514f49b19cf067807de34b1da Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 4 Jul 2010 12:02:44 -0600 Subject: [PATCH 047/110] Resize the remote progress sheet if the description is larger than the text field --- English.lproj/PBRemoteProgressSheet.xib | 55 ++++++++++++++++++------- PBRemoteProgressSheet.m | 14 +++++++ 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/English.lproj/PBRemoteProgressSheet.xib b/English.lproj/PBRemoteProgressSheet.xib index ca616cf..bf780a8 100644 --- a/English.lproj/PBRemoteProgressSheet.xib +++ b/English.lproj/PBRemoteProgressSheet.xib @@ -2,13 +2,13 @@ 1050 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 788 + 1038.29 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 788 YES @@ -41,12 +41,12 @@ 1 2 - {{196, 408}, {397, 102}} + {{196, 417}, {397, 93}} 544736256 Window NSWindow - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} 274 @@ -56,7 +56,7 @@ 1314 - {{23, 24}, {351, 20}} + {{18, 16}, {361, 20}} 16394 100 @@ -64,7 +64,7 @@ 274 - {{17, 52}, {363, 30}} + {{17, 56}, {363, 17}} YES @@ -83,7 +83,7 @@ controlColor 3 - MC42NjY2NjY2ODY1AA + MC42NjY2NjY2NjY3AA @@ -98,11 +98,11 @@ - {397, 102} + {397, 93} {{0, 0}, {1680, 1028}} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} @@ -220,9 +220,9 @@ YES - {{814, 826}, {397, 102}} + {{814, 835}, {397, 93}} com.apple.InterfaceBuilder.CocoaPlugin - {{814, 826}, {397, 102}} + {{814, 835}, {397, 93}} {196, 240} {{202, 428}, {480, 270}} @@ -271,6 +271,25 @@ NSProgressIndicator + + YES + + YES + progressDescription + progressIndicator + + + YES + + progressDescription + NSTextField + + + progressIndicator + NSProgressIndicator + + + IBProjectSource PBRemoteProgressSheet.h @@ -833,6 +852,13 @@ showWindow: id + + showWindow: + + showWindow: + id + + IBFrameworkSource AppKit.framework/Headers/NSWindowController.h @@ -841,6 +867,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m index 77b250e..74866f2 100644 --- a/PBRemoteProgressSheet.m +++ b/PBRemoteProgressSheet.m @@ -73,7 +73,21 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; description = theDescription; [self window]; // loads the window (if it wasn't already) + + // resize window if the description is larger than the default text field + NSRect originalFrame = [self.progressDescription frame]; [self.progressDescription setStringValue:[self progressTitle]]; + NSAttributedString *attributedTitle = [self.progressDescription attributedStringValue]; + NSSize boundingSize = originalFrame.size; + boundingSize.height = 0.0f; + NSRect boundingRect = [attributedTitle boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + CGFloat heightDelta = boundingRect.size.height - originalFrame.size.height; + if (heightDelta > 0.0f) { + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + [self.progressIndicator startAnimation:nil]; [NSApp beginSheet:[self window] modalForWindow:[controller window] modalDelegate:self didEndSelector:nil contextInfo:nil]; From 549f2c1d6a5459c92aefe6e3a98798f3fa31b9da Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 4 Jul 2010 20:18:35 -0600 Subject: [PATCH 048/110] Show long messages and errors in a scroll view This stops really long sheets when the output from git is very long. --- GitX.xcodeproj/project.pbxproj | 10 + PBGitWindowController.m | 12 +- PBGitXMessageSheet.h | 32 + PBGitXMessageSheet.m | 124 ++++ PBGitXMessageSheet.xib | 1222 ++++++++++++++++++++++++++++++++ 5 files changed, 1394 insertions(+), 6 deletions(-) create mode 100644 PBGitXMessageSheet.h create mode 100644 PBGitXMessageSheet.m create mode 100644 PBGitXMessageSheet.xib diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 750f75f..83770ec 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -46,6 +46,8 @@ 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; + D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */; }; + D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */; }; D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */; }; D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083C43111F106800337480 /* PBAddRemoteSheet.m */; }; D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083C45111F136400337480 /* PBAddRemoteSheet.xib */; }; @@ -270,6 +272,9 @@ 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_libgit2.sh; sourceTree = ""; }; + D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PBGitXMessageSheet.xib; path = ../GitX/PBGitXMessageSheet.xib; sourceTree = SOURCE_ROOT; }; + D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitXMessageSheet.h; sourceTree = ""; }; + D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitXMessageSheet.m; sourceTree = ""; }; D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = ""; }; D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = ""; }; @@ -610,6 +615,7 @@ 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */, + D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */, ); name = Resources; sourceTree = ""; @@ -673,6 +679,8 @@ D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */, D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */, D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */, + D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */, + D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */, ); name = Sheets; sourceTree = ""; @@ -1119,6 +1127,7 @@ D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, + D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1248,6 +1257,7 @@ D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */, D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */, + D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index a583ab2..8df3139 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -11,6 +11,7 @@ #import "PBGitCommitController.h" #import "Terminal.h" #import "PBCloneRepsitoryToSheet.h" +#import "PBGitXMessageSheet.h" #import "PBGitSidebarController.h" @implementation PBGitWindowController @@ -110,16 +111,15 @@ - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText { - [[NSAlert alertWithMessageText:messageText - defaultButton:nil - alternateButton:nil - otherButton:nil - informativeTextWithFormat:infoText] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; + [PBGitXMessageSheet beginMessageSheetForWindow:[self window] withMessageText:messageText infoText:infoText]; } - (void)showErrorSheet:(NSError *)error { - [[NSAlert alertWithError:error] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; + if ([[error domain] isEqualToString:PBGitRepositoryErrorDomain]) + [PBGitXMessageSheet beginMessageSheetForWindow:[self window] withError:error]; + else + [[NSAlert alertWithError:error] beginSheetModalForWindow:[self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; } - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output diff --git a/PBGitXMessageSheet.h b/PBGitXMessageSheet.h new file mode 100644 index 0000000..440cf01 --- /dev/null +++ b/PBGitXMessageSheet.h @@ -0,0 +1,32 @@ +// +// PBGitXMessageSheet.h +// GitX +// +// Created by BrotherBard on 7/4/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import + + +@interface PBGitXMessageSheet : NSWindowController +{ + NSImageView *iconView; + NSTextField *messageField; + NSTextView *infoView; + NSScrollView *scrollView; +} + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withError:(NSError *)error; + + +- (IBAction)closeMessageSheet:(id)sender; + + +@property (assign) IBOutlet NSImageView *iconView; +@property (assign) IBOutlet NSTextField *messageField; +@property (assign) IBOutlet NSTextView *infoView; +@property (assign) IBOutlet NSScrollView *scrollView; + +@end diff --git a/PBGitXMessageSheet.m b/PBGitXMessageSheet.m new file mode 100644 index 0000000..5c8441c --- /dev/null +++ b/PBGitXMessageSheet.m @@ -0,0 +1,124 @@ +// +// PBGitXMessageSheet.m +// GitX +// +// Created by BrotherBard on 7/4/10. +// Copyright 2010 BrotherBard. All rights reserved. +// + +#import "PBGitXMessageSheet.h" + + +#define MaxScrollViewHeight 125.0f + + +@interface PBGitXMessageSheet () + +- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; + +- (void)setInfoString:(NSString *)info; +- (void)resizeWindow; + +@end + + + +@implementation PBGitXMessageSheet + + +@synthesize iconView; +@synthesize messageField; +@synthesize infoView; +@synthesize scrollView; + + +#pragma mark - +#pragma mark PBGitXMessageSheet + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info +{ + PBGitXMessageSheet *sheet = [[self alloc] initWithWindowNibName:@"PBGitXMessageSheet"]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:message infoText:info]; +} + + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withError:(NSError *)error +{ + PBGitXMessageSheet *sheet = [[self alloc] initWithWindowNibName:@"PBGitXMessageSheet"]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:[error localizedDescription] infoText:[error localizedRecoverySuggestion]]; +} + + +- (IBAction)closeMessageSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +#pragma mark Private + +- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; +{ + [self window]; + + [self.messageField setStringValue:message]; + [self setInfoString:info]; + [self resizeWindow]; + + [NSApp beginSheet:[self window] modalForWindow:parentWindow modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + +- (void)setInfoString:(NSString *)info +{ + NSDictionary *attributes = [NSDictionary dictionaryWithObject:[NSFont labelFontOfSize:[NSFont smallSystemFontSize]] + forKey:NSFontAttributeName]; + NSAttributedString *attributedInfoString = [[NSAttributedString alloc] initWithString:info attributes:attributes]; + [[self.infoView textStorage] setAttributedString:attributedInfoString]; +} + + +- (void)resizeWindow +{ + // resize for message text + NSRect messageFrame = [self.messageField frame]; + NSSize boundingSize = messageFrame.size; + boundingSize.height = 0.0f; + NSAttributedString *attributedTitle = [self.messageField attributedStringValue]; + NSRect boundingRect = [attributedTitle boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + CGFloat heightDelta = boundingRect.size.height - messageFrame.size.height; + if (heightDelta > 0.0f) { + messageFrame.size.height += heightDelta; + messageFrame.origin.y -= heightDelta; + [self.messageField setFrame:messageFrame]; + + NSRect scrollFrame = [self.scrollView frame]; + scrollFrame.size.height -= heightDelta; + [self.scrollView setFrame:scrollFrame]; + + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + + // resize for info text + NSRect scrollFrame = [self.scrollView frame]; + boundingSize = [self.scrollView bounds].size; + boundingSize.height = 0.0f; + NSAttributedString *attributedInfo = [[self.infoView layoutManager] attributedString]; + boundingRect = [attributedInfo boundingRectWithSize:boundingSize options:NSStringDrawingUsesLineFragmentOrigin]; + heightDelta = boundingRect.size.height - scrollFrame.size.height; + if (heightDelta > MaxScrollViewHeight) + heightDelta = MaxScrollViewHeight; + if (heightDelta > 0.0f) { + NSRect windowFrame = [[self window] frame]; + windowFrame.size.height += heightDelta; + [[self window] setFrame:windowFrame display:NO]; + } + [self.infoView scrollRangeToVisible:NSMakeRange(0, 0)]; +} + + +@end diff --git a/PBGitXMessageSheet.xib b/PBGitXMessageSheet.xib new file mode 100644 index 0000000..906c98f --- /dev/null +++ b/PBGitXMessageSheet.xib @@ -0,0 +1,1222 @@ + + + + 1050 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBGitXMessageSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 331}, {540, 179}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 289 + {{430, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{17, 98}, {64, 64}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 0 + 0 + NO + + YES + + + + 266 + {{99, 142}, {424, 17}} + + YES + + 67239424 + 272629760 + <message> + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {423, 55} + + + + + + PGluZm8+A + + + YES + + YES + NSFont + NSParagraphStyle + + + YES + + Helvetica + 12 + 16 + + + 4 + + + + + + + + YES + + + 134 + + + + 423 + 1 + + + 2049 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {423, 1e+07} + {223, 0} + + + + {422, 72} + + + + + + {4, -5} + 1 + + 2 + + + + -2147483392 + {{386, 1}, {15, 163}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + YES + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{98, 60}, {422, 72}} + + + 656 + + + + + + {540, 179} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + iconView + + + + 15 + + + + infoView + + + + 16 + + + + messageField + + + + 17 + + + + window + + + + 18 + + + + closeMessageSheet: + + + + 19 + + + + scrollView + + + + 20 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + YES + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 2.IBPluginDependency + 2.IBUserGuides + 3.IBPluginDependency + 4.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{663, 521}, {540, 179}} + com.apple.InterfaceBuilder.CocoaPlugin + {{663, 521}, {540, 179}} + + {196, 240} + {{357, 418}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + + 103 + 0 + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 20 + + + + YES + + PBGitXMessageSheet + NSWindowController + + closeMessageSheet: + id + + + closeMessageSheet: + + closeMessageSheet: + id + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + NSImageView + NSTextView + NSTextField + NSScrollView + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + + iconView + NSImageView + + + infoView + NSTextView + + + messageField + NSTextField + + + scrollView + NSScrollView + + + + + IBProjectSource + PBGitXMessageSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../gitx/GitX.xcodeproj + 3 + + NSApplicationIcon + {128, 128} + + + From 282cc7cd250b1973d82d32485838e6f3f39afc86 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 15 Jul 2010 05:26:41 -0600 Subject: [PATCH 049/110] Bugfix: fix incorrect path to PBGitXMessageSheet.xib --- GitX.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 83770ec..162d13d 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -272,7 +272,7 @@ 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; D8022A3411DFCCA5003C21F6 /* build_libgit2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_libgit2.sh; sourceTree = ""; }; - D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PBGitXMessageSheet.xib; path = ../GitX/PBGitXMessageSheet.xib; sourceTree = SOURCE_ROOT; }; + D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitXMessageSheet.xib; sourceTree = ""; }; D8022FEB11E124C8003C21F6 /* PBGitXMessageSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitXMessageSheet.h; sourceTree = ""; }; D8022FEC11E124C8003C21F6 /* PBGitXMessageSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitXMessageSheet.m; sourceTree = ""; }; D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; From f254fd15649ee00544694ce81ae7a34f1a296f91 Mon Sep 17 00:00:00 2001 From: Michael Dippery Date: Tue, 13 Jul 2010 18:09:58 -0400 Subject: [PATCH 050/110] .gitignore: Ignore everything but Xcode project settings --- .gitignore | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3367a4e..94061ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ build build/revision -*.xcodeproj/*.pbxuser -*.xcodeproj/*.perspectivev3 -*.xcodeproj/*.mode1v3 -*.xcodeproj/*.tm_build_errors -*.tmproj +*.xcodeproj/ +!*.xcodeproj/project.pbxproj Nightly.app.zip From 07651211fd8e58742984c9aa15aad5fbc08208c1 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 24 Jul 2010 18:06:20 -0600 Subject: [PATCH 051/110] Fix "Duplicate declaration of method" error when using LLVM The class method and the instance method had different types for the window controller. The instance method should be using the NSWindowController since the sheet can be shown in a non PBGitWindowController window (the PBCloneRepositoryPanel). --- PBRemoteProgressSheet.h | 5 ++--- PBRemoteProgressSheet.m | 14 ++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/PBRemoteProgressSheet.h b/PBRemoteProgressSheet.h index 71a52b9..e8eca0b 100644 --- a/PBRemoteProgressSheet.h +++ b/PBRemoteProgressSheet.h @@ -17,10 +17,9 @@ extern NSString * const kGitXProgressErrorInfo; @class PBGitRepository; -@class PBGitWindowController; @interface PBRemoteProgressSheet : NSWindowController { - PBGitWindowController *controller; + NSWindowController *controller; NSArray *arguments; NSString *title; @@ -37,7 +36,7 @@ extern NSString * const kGitXProgressErrorInfo; + (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController; -+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo; ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo; @property (assign) IBOutlet NSTextField *progressDescription; diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m index 74866f2..fda9ee0 100644 --- a/PBRemoteProgressSheet.m +++ b/PBRemoteProgressSheet.m @@ -24,7 +24,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; @interface PBRemoteProgressSheet () -- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)controller; +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController; - (void) showSuccessMessage; - (void) showErrorMessage; @@ -52,7 +52,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; #pragma mark - #pragma mark PBRemoteProgressSheet -+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController { PBRemoteProgressSheet *sheet = [[self alloc] initWithWindowNibName:@"PBRemoteProgressSheet"]; [sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:dir windowController:windowController]; @@ -65,7 +65,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; } -- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController { controller = windowController; arguments = args; @@ -120,7 +120,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; [self showSuccessMessage]; if ([controller respondsToSelector:@selector(repository)]) - [controller.repository reloadRefs]; + [[(PBGitWindowController *)controller repository] reloadRefs]; } @@ -146,7 +146,8 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; [info appendString:[self commandDescription]]; [info appendString:[self standardOutputDescription]]; - [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info]; + if ([controller respondsToSelector:@selector(showMessageSheet:infoText:)]) + [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info]; } @@ -164,7 +165,8 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; nil]; NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:errorUserInfo]; - [(PBGitWindowController *)controller showErrorSheet:error]; + if ([controller respondsToSelector:@selector(showErrorSheet:)]) + [(PBGitWindowController *)controller showErrorSheet:error]; } From 28f4c49b489226dd666a1d7d3c47c39cbc12b6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wei=C3=9F?= Date: Fri, 6 Aug 2010 22:32:09 +0200 Subject: [PATCH 052/110] Fixing compiler warnings. --- PBEasyPipe.m | 2 +- PBGitHistoryController.m | 2 +- PBGitRepository.m | 2 +- PBGitRevList.mm | 4 ++-- PBGitSidebarController.m | 6 +++--- PBGitTree.m | 6 ++++-- PBRemoteProgressSheet.m | 2 +- PBSourceViewItem.m | 2 +- gitx.m | 2 +- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/PBEasyPipe.m b/PBEasyPipe.m index f2d49fa..8506daf 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -120,7 +120,7 @@ data = [handle readDataToEndOfFile]; } @catch (NSException * e) { - NSLog(@"Got a bad file descriptor in %s!", _cmd); + NSLog(@"Got a bad file descriptor in %@!", NSStringFromSelector(_cmd)); if ([NSThread currentThread] != [NSThread mainThread]) [task waitUntilExit]; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 484e6b8..6db7c75 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -676,7 +676,7 @@ PBGitTree *treeItem = (PBGitTree *)[[treeController selectedObjects] objectAtIndex:index]; NSURL *previewURL = [NSURL fileURLWithPath:[treeItem tmpFileNameForContents]]; - return ()previewURL; + return (id )previewURL; } #pragma mark diff --git a/PBGitRepository.m b/PBGitRepository.m index 5b77b23..5c1170c 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -232,7 +232,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; sha = [PBGitSHA shaWithString:[components objectAtIndex:2]]; NSMutableArray* curRefs; - if (curRefs = [refs objectForKey:sha]) + if ( (curRefs = [refs objectForKey:sha]) != nil ) [curRefs addObject:ref]; else [refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha]; diff --git a/PBGitRevList.mm b/PBGitRevList.mm index b3e4ef7..851d6ed 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -165,7 +165,7 @@ using namespace std; if (parentString.size() != 0) { if (((parentString.size() + 1) % 41) != 0) { - NSLog(@"invalid parents: %i", parentString.size()); + NSLog(@"invalid parents: %zu", parentString.size()); continue; } int nParents = (parentString.size() + 1) / 41; @@ -225,7 +225,7 @@ using namespace std; [self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO]; } else { - NSLog(@"[%@ %s] thread has been canceled", [self class], _cmd); + NSLog(@"[%@ %s] thread has been canceled", [self class], NSStringFromSelector(_cmd)); } [task terminate]; diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index a1de7b4..03167bd 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -125,7 +125,7 @@ PBSourceViewItem *item = nil; for (PBSourceViewItem *it in items) - if (item = [it findRev:rev]) + if ( (item = [it findRev:rev]) != nil ) break; if (!item) { @@ -133,7 +133,7 @@ // Try to find the just added item again. // TODO: refactor with above. for (PBSourceViewItem *it in items) - if (item = [it findRev:rev]) + if ( (item = [it findRev:rev]) != nil ) break; } @@ -147,7 +147,7 @@ { PBSourceViewItem *foundItem = nil; for (PBSourceViewItem *item in items) - if (foundItem = [item findRev:rev]) + if ( (foundItem = [item findRev:rev]) != nil ) return foundItem; return nil; } diff --git a/PBGitTree.m b/PBGitTree.m index c8003d1..1a5f838 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -65,10 +65,12 @@ - (BOOL)hasBinaryHeader:(NSString*)contents { - if(!contents) + if (!contents) return NO; - return [contents rangeOfString:@"\0" options:0 range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound; + return [contents rangeOfString:@"\0" + options:0 + range:NSMakeRange(0, ([contents length] >= 8000) ? 7999 : [contents length])].location != NSNotFound; } - (BOOL)hasBinaryAttributes diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m index fda9ee0..0160431 100644 --- a/PBRemoteProgressSheet.m +++ b/PBRemoteProgressSheet.m @@ -130,7 +130,7 @@ NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; - (void) checkTask:(NSTimer *)timer { if (![gitTask isRunning]) { - NSLog(@"[%@ %s] gitTask terminated without notification", [self class], _cmd); + NSLog(@"[%@ %@] gitTask terminated without notification", [self class], NSStringFromSelector(_cmd)); [self taskCompleted:nil]; } } diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index 5e81501..5d450fb 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -103,7 +103,7 @@ PBSourceViewItem *item = nil; for (PBSourceViewItem *child in children) - if (item = [child findRev:rev]) + if ( (item = [child findRev:rev]) != nil ) return item; return nil; diff --git a/gitx.m b/gitx.m index 6449556..eea2892 100644 --- a/gitx.m +++ b/gitx.m @@ -33,7 +33,7 @@ NSDistantObject *createProxy() // Now attempt to connect, allowing the app time to startup int attempt; for (attempt = 0; proxy == nil && attempt < 50; ++attempt) { - if (proxy = connect()) + if ( (proxy = connect()) != nil ) return proxy; usleep(15000); From 9e3e2725c0f3a575d6dc6e569bfcb20be9caf525 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 24 Jul 2010 20:02:07 -0600 Subject: [PATCH 053/110] Fix issues reported by Xcode's build and analyze Using the LLVM GCC 4.2 compiler. --- DBPrefsWindowController.m | 2 +- PBGitRevisionCell.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DBPrefsWindowController.m b/DBPrefsWindowController.m index 3111311..8ec45bf 100644 --- a/DBPrefsWindowController.m +++ b/DBPrefsWindowController.m @@ -370,7 +370,7 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil; NSEnumerator *subviewsEnum = [[contentSubview subviews] reverseObjectEnumerator]; // This is our visible view. Just get past it. - subview = [subviewsEnum nextObject]; + [subviewsEnum nextObject]; // Remove everything else. There should be just one, but // if the user does a lot of fast clicking, we might have diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 17e5b16..0e77c22 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -208,7 +208,7 @@ { [[NSColor blackColor] setStroke]; - NSRect lastRect; + NSRect lastRect = NSMakeRect(0, 0, 0, 0); int index = 0; for (NSValue *rectValue in [self rectsForRefsinRect:*refRect]) { From 11c68b728df884cbb0eaf9a371b84d974e522f02 Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Fri, 2 Jul 2010 19:06:21 -0400 Subject: [PATCH 054/110] Fix vertical alignment of multiline Subjects in history. --- html/views/history/history.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html/views/history/history.css b/html/views/history/history.css index dbad36d..21e939c 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -9,6 +9,10 @@ body { padding-right: 5px; } +#commit_header tr { + vertical-align: top; +} + #authorTable { margin: -4px; } From 7f17378a864472fd0507431e1e843dbf67989ec1 Mon Sep 17 00:00:00 2001 From: Nicholas Riley Date: Fri, 25 Jun 2010 20:27:23 -0400 Subject: [PATCH 055/110] Don't remove a file from "Unstaged Changes" when attempting to discard changes if it is a new file; it'll just reappear when you refresh. --- PBGitIndex.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index 4265766..af758af 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -327,7 +327,8 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; } for (PBChangedFile *file in discardFiles) - file.hasUnstagedChanges = NO; + if (file.status != NEW) + file.hasUnstagedChanges = NO; [self postIndexChange]; } From d968f8f0c7f09d8ad333b36fd1d3aa0b8ce0cd93 Mon Sep 17 00:00:00 2001 From: Mikhail Emelchenkov Date: Sun, 20 Jun 2010 18:40:55 +0400 Subject: [PATCH 056/110] Fix a freeze when staging/unstaging thousands of files --- PBGitIndex.m | 137 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 42 deletions(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index af758af..4f0da98 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -251,30 +251,57 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (BOOL)stageFiles:(NSArray *)stageFiles { - // Input string for update-index - // This will be a list of filenames that - // should be updated. It's similar to - // "git add -- - NSMutableString *input = [NSMutableString string]; - - for (PBChangedFile *file in stageFiles) { - [input appendFormat:@"%@\0", file.path]; - } + // Do staging files by chunks of 1000 files each, to prevent program freeze (because NSPipe has limited capacity) - int ret = 1; - [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"--add", @"--remove", @"-z", @"--stdin", nil] - inputString:input - retValue:&ret]; + int filesCount = [stageFiles count]; + + // Prepare first iteration + int loopFrom = 0; + int loopTo = 1000; + if (loopTo > filesCount) + loopTo = filesCount; + int loopCount = 0; + int i = 0; + + // Staging + while (loopCount < filesCount) { + // Input string for update-index + // This will be a list of filenames that + // should be updated. It's similar to + // "git add -- + NSMutableString *input = [NSMutableString string]; - if (ret) { - [self postOperationFailed:[NSString stringWithFormat:@"Error in staging files. Return value: %i", ret]]; - return NO; - } + for (i = loopFrom; i < loopTo; i++) { + loopCount++; + + PBChangedFile *file = [stageFiles objectAtIndex:i]; + + [input appendFormat:@"%@\0", file.path]; + } + + + int ret = 1; + [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"--add", @"--remove", @"-z", @"--stdin", nil] + inputString:input + retValue:&ret]; - for (PBChangedFile *file in stageFiles) - { - file.hasUnstagedChanges = NO; - file.hasStagedChanges = YES; + if (ret) { + [self postOperationFailed:[NSString stringWithFormat:@"Error in staging files. Return value: %i", ret]]; + return NO; + } + + for (i = loopFrom; i < loopTo; i++) { + PBChangedFile *file = [stageFiles objectAtIndex:i]; + + file.hasUnstagedChanges = NO; + file.hasStagedChanges = YES; + } + + // Prepare next iteration + loopFrom = loopCount; + loopTo = loopFrom + 1000; + if (loopTo > filesCount) + loopTo = filesCount; } [self postIndexChange]; @@ -284,27 +311,53 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; // TODO: Refactor with above. What's a better name for this? - (BOOL)unstageFiles:(NSArray *)unstageFiles { - NSMutableString *input = [NSMutableString string]; - - for (PBChangedFile *file in unstageFiles) { - [input appendString:[file indexInfo]]; - } - - int ret = 1; - [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"-z", @"--index-info", nil] - inputString:input - retValue:&ret]; - - if (ret) - { - [self postOperationFailed:[NSString stringWithFormat:@"Error in unstaging files. Return value: %i", ret]]; - return NO; - } - - for (PBChangedFile *file in unstageFiles) - { - file.hasUnstagedChanges = YES; - file.hasStagedChanges = NO; + // Do unstaging files by chunks of 1000 files each, to prevent program freeze (because NSPipe has limited capacity) + + int filesCount = [unstageFiles count]; + + // Prepare first iteration + int loopFrom = 0; + int loopTo = 1000; + if (loopTo > filesCount) + loopTo = filesCount; + int loopCount = 0; + int i = 0; + + // Unstaging + while (loopCount < filesCount) { + NSMutableString *input = [NSMutableString string]; + + for (i = loopFrom; i < loopTo; i++) { + loopCount++; + + PBChangedFile *file = [unstageFiles objectAtIndex:i]; + + [input appendString:[file indexInfo]]; + } + + int ret = 1; + [repository outputForArguments:[NSArray arrayWithObjects:@"update-index", @"-z", @"--index-info", nil] + inputString:input + retValue:&ret]; + + if (ret) + { + [self postOperationFailed:[NSString stringWithFormat:@"Error in unstaging files. Return value: %i", ret]]; + return NO; + } + + for (i = loopFrom; i < loopTo; i++) { + PBChangedFile *file = [unstageFiles objectAtIndex:i]; + + file.hasUnstagedChanges = YES; + file.hasStagedChanges = NO; + } + + // Prepare next iteration + loopFrom = loopCount; + loopTo = loopFrom + 1000; + if (loopTo > filesCount) + loopTo = filesCount; } [self postIndexChange]; From 92a44542ae8990b1fb69a270bf2884c760d12dc7 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 25 Jul 2010 23:43:31 -0600 Subject: [PATCH 057/110] Fix crashes from NSInvalidArgumentException This happens when running the gitx cli tool from a directory that does not contain a git repository. --- PBGitRepository.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PBGitRepository.m b/PBGitRepository.m index 5c1170c..55bfa30 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -41,7 +41,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [[PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--is-bare-repository", nil] inDir:path] isEqualToString:@"true"]; } -+ (NSURL*)gitDirForURL:(NSURL*)repositoryURL; ++ (NSURL *)gitDirForURL:(NSURL *)repositoryURL; { if (![PBGitBinary path]) return nil; @@ -51,9 +51,14 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; if ([self isBareRepository:repositoryPath]) return repositoryURL; - // Use rev-parse to find the .git dir for the repository being opened - NSString* newPath = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--git-dir", nil] inDir:repositoryPath]; + int retValue = 1; + NSString *newPath = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"rev-parse", @"--git-dir", nil] inDir:repositoryPath retValue:&retValue]; + if (retValue) { + // The current directory does not contain a git repository + return nil; + } + if ([newPath isEqualToString:@".git"]) return [NSURL fileURLWithPath:[repositoryPath stringByAppendingPathComponent:@".git"]]; if ([newPath length] > 0) From 7b17eec47625be56e7f9b90c66b9cd0b0d66f37c Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 15 Aug 2010 18:45:58 -0600 Subject: [PATCH 058/110] Fix spelling error --- html/views/history/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/history/index.html b/html/views/history/index.html index 11aec3f..20b3cd5 100644 --- a/html/views/history/index.html +++ b/html/views/history/index.html @@ -37,7 +37,7 @@ - Commiter: + Committer: From 2529c028140d683671de28fbdcbb050865b97734 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 15 Aug 2010 19:43:01 -0600 Subject: [PATCH 059/110] Fix getting the correct git directory If the path already includes the .git directory then rev-parse will return "." to mean the current directory. --- PBGitRepository.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PBGitRepository.m b/PBGitRepository.m index 55bfa30..6f93a71 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -61,6 +61,8 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; if ([newPath isEqualToString:@".git"]) return [NSURL fileURLWithPath:[repositoryPath stringByAppendingPathComponent:@".git"]]; + if ([newPath isEqualToString:@"."]) + return [NSURL fileURLWithPath:repositoryPath]; if ([newPath length] > 0) return [NSURL fileURLWithPath:newPath]; From caa6ed01f9e48f01c4f591467eac78d1b1d48905 Mon Sep 17 00:00:00 2001 From: Sebastian Staudt Date: Mon, 2 Aug 2010 16:53:16 +0200 Subject: [PATCH 060/110] Don't follow symlinks when setting Git path This allows using /usr/local/bin/git (using Homebrew) to work across updates --- PBPrefsWindowController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/PBPrefsWindowController.m b/PBPrefsWindowController.m index 418f5f0..aefec82 100644 --- a/PBPrefsWindowController.m +++ b/PBPrefsWindowController.m @@ -62,6 +62,7 @@ [openPanel setAllowsMultipleSelection:NO]; [openPanel setTreatsFilePackagesAsDirectories:YES]; [openPanel setAccessoryView:gitPathOpenAccessory]; + [openPanel setResolvesAliases:NO]; //[[openPanel _navView] setShowsHiddenFiles:YES]; gitPathOpenPanel = openPanel; From d4cb11bb8b14707c87475e7e7fd4a98ef267f5a0 Mon Sep 17 00:00:00 2001 From: Marc Liyanage Date: Wed, 11 Aug 2010 23:42:37 -0700 Subject: [PATCH 061/110] Add "Copy SHA" alternate menu item to main menu, with default binding Cmd-Option-C. It copies just the leading 7 characters of the SHA instead of the whole commit info. --- English.lproj/MainMenu.xib | 1232 +++++++++++++++++++++++++++++++----- PBCommitList.m | 5 + PBGitHistoryController.h | 1 + PBGitHistoryController.m | 13 + 4 files changed, 1094 insertions(+), 157 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index a70e278..df9ae8e 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -2,30 +2,25 @@ 1050 - 10C540 - 740 - 1038.25 - 458.00 + 10F569 + 804 + 1038.29 + 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 740 + 804 YES - + YES com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -423,6 +418,16 @@ + + + YES + Copy SHA + c + 1572864 + 2147483647 + + + Paste @@ -1355,13 +1360,23 @@ 963 + + + copySHA: + + + + 966 + YES 0 - + + YES + @@ -1646,6 +1661,7 @@ + @@ -2058,6 +2074,11 @@ + + 964 + + + @@ -2258,6 +2279,8 @@ 951.IBPluginDependency 954.IBPluginDependency 956.IBPluginDependency + 964.IBPluginDependency + 964.ImportedFromIB2 YES @@ -2326,7 +2349,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{522, 787}, {240, 243}} + {{522, 767}, {240, 263}} com.apple.InterfaceBuilder.CocoaPlugin {{455, 493}, {243, 243}} @@ -2455,6 +2478,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + @@ -2473,7 +2498,7 @@ - 963 + 966 @@ -2502,6 +2527,45 @@ id + + YES + + YES + installCliTool: + openPreferencesWindow: + saveAction: + showAboutPanel: + showCloneRepository: + showHelp: + + + YES + + installCliTool: + id + + + openPreferencesWindow: + id + + + saveAction: + id + + + showAboutPanel: + id + + + showCloneRepository: + id + + + showHelp: + id + + + YES @@ -2515,6 +2579,25 @@ NSWindow + + YES + + YES + firstResponder + window + + + YES + + firstResponder + id + + + window + NSWindow + + + IBProjectSource ApplicationController.h @@ -2535,6 +2618,7 @@ YES YES + copySHA: setDetailedView: setRawView: setTreeView: @@ -2544,6 +2628,36 @@ id id id + id + + + + YES + + YES + copySHA: + setDetailedView: + setRawView: + setTreeView: + + + YES + + copySHA: + id + + + setDetailedView: + id + + + setRawView: + id + + + setTreeView: + id + @@ -2584,6 +2698,30 @@ WebView + + YES + + YES + controller + webController + webView + + + YES + + controller + PBGitHistoryController + + + webController + PBWebHistoryController + + + webView + WebView + + + IBProjectSource PBCommitList.h @@ -2605,6 +2743,25 @@ id + + YES + + YES + closeCreateBranchSheet: + createBranch: + + + YES + + closeCreateBranchSheet: + id + + + createBranch: + id + + + YES @@ -2620,6 +2777,30 @@ id + + YES + + YES + branchNameField + errorMessageField + startRefish + + + YES + + branchNameField + NSTextField + + + errorMessageField + NSTextField + + + startRefish + id + + + IBProjectSource PBCreateBranchSheet.h @@ -2641,6 +2822,25 @@ id + + YES + + YES + closeCreateTagSheet: + createTag: + + + YES + + closeCreateTagSheet: + id + + + createTag: + id + + + YES @@ -2658,6 +2858,35 @@ id + + YES + + YES + errorMessageField + tagMessageText + tagNameField + targetRefish + + + YES + + errorMessageField + NSTextField + + + tagMessageText + NSTextView + + + tagNameField + NSTextField + + + targetRefish + id + + + IBProjectSource PBCreateTagSheet.h @@ -2681,6 +2910,30 @@ id + + YES + + YES + commit: + refresh: + signOff: + + + YES + + commit: + id + + + refresh: + id + + + signOff: + id + + + YES @@ -2702,6 +2955,45 @@ PBWebChangesController + + YES + + YES + cachedFilesController + commitButton + commitMessageView + indexController + unstagedFilesController + webController + + + YES + + cachedFilesController + NSArrayController + + + commitButton + NSButton + + + commitMessageView + NSTextView + + + indexController + PBGitIndexController + + + unstagedFilesController + NSArrayController + + + webController + PBWebChangesController + + + IBProjectSource PBGitCommitController.h @@ -2757,6 +3049,90 @@ id + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openFilesAction: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + showCommitsFromTree: + id + + + showInFinderAction: + id + + + toggleQLPreviewPanel: + id + + + YES @@ -2776,6 +3152,7 @@ selectedBranchFilterItem treeController upperToolbarView + webHistoryController webView @@ -2783,7 +3160,7 @@ NSButton NSButton NSArrayController - NSTableView + PBCommitList NSOutlineView PBCollapsibleSplitView NSButton @@ -2795,9 +3172,104 @@ NSButton NSTreeController PBGitGradientBarView + PBWebHistoryController id + + YES + + YES + allBranchesFilterItem + cherryPickButton + commitController + commitList + fileBrowser + historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView + searchField + selectedBranchFilterItem + treeController + upperToolbarView + webHistoryController + webView + + + YES + + allBranchesFilterItem + NSButton + + + cherryPickButton + NSButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + fileBrowser + NSOutlineView + + + historySplitView + PBCollapsibleSplitView + + + localRemoteBranchesFilterItem + NSButton + + + mergeButton + NSButton + + + rebaseButton + NSButton + + + refController + PBRefController + + + scopeBarView + PBGitGradientBarView + + + searchField + NSSearchField + + + selectedBranchFilterItem + NSButton + + + treeController + NSTreeController + + + upperToolbarView + PBGitGradientBarView + + + webHistoryController + PBWebHistoryController + + + webView + id + + + IBProjectSource PBGitHistoryController.h @@ -2819,6 +3291,25 @@ NSTableView + + YES + + YES + rowClicked: + tableClicked: + + + YES + + rowClicked: + NSCell + + + tableClicked: + NSTableView + + + YES @@ -2838,6 +3329,40 @@ NSTableView + + YES + + YES + commitController + stagedFilesController + stagedTable + unstagedFilesController + unstagedTable + + + YES + + commitController + PBGitCommitController + + + stagedFilesController + NSArrayController + + + stagedTable + NSTableView + + + unstagedFilesController + NSArrayController + + + unstagedTable + NSTableView + + + IBProjectSource PBGitIndexController.h @@ -2867,6 +3392,45 @@ id + + YES + + YES + cloneTo: + openInTerminal: + refresh: + revealInFinder: + showCommitView: + showHistoryView: + + + YES + + cloneTo: + id + + + openInTerminal: + id + + + refresh: + id + + + revealInFinder: + id + + + showCommitView: + id + + + showHistoryView: + id + + + YES @@ -2892,6 +3456,55 @@ NSToolbarItem + + YES + + YES + contentSplitView + finderItem + progressIndicator + sourceListControlsView + sourceSplitView + splitView + statusField + terminalItem + + + YES + + contentSplitView + NSView + + + finderItem + NSToolbarItem + + + progressIndicator + NSProgressIndicator + + + sourceListControlsView + NSView + + + sourceSplitView + NSView + + + splitView + NSSplitView + + + statusField + NSTextField + + + terminalItem + NSToolbarItem + + + IBProjectSource PBGitWindowController.h @@ -2919,6 +3532,40 @@ id + + YES + + YES + openSelectedFile: + setDetailedView: + setRawView: + setTreeView: + toggleQuickView: + + + YES + + openSelectedFile: + id + + + setDetailedView: + id + + + setRawView: + id + + + setTreeView: + id + + + toggleQuickView: + id + + + YES @@ -2936,6 +3583,35 @@ NSTreeController + + YES + + YES + commitController + commitList + fileBrowser + treeController + + + YES + + commitController + NSArrayController + + + commitList + NSTableView + + + fileBrowser + NSOutlineView + + + treeController + NSTreeController + + + IBUserSource @@ -2991,6 +3667,90 @@ PBRefMenuItem + + YES + + YES + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + diffWithHEAD: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseHeadBranch: + showTagInfoSheet: + + + YES + + checkout: + PBRefMenuItem + + + cherryPick: + PBRefMenuItem + + + copyPatch: + PBRefMenuItem + + + copySHA: + PBRefMenuItem + + + createBranch: + PBRefMenuItem + + + createTag: + PBRefMenuItem + + + diffWithHEAD: + PBRefMenuItem + + + fetchRemote: + PBRefMenuItem + + + merge: + PBRefMenuItem + + + pullRemote: + PBRefMenuItem + + + pushDefaultRemoteForRef: + PBRefMenuItem + + + pushToRemote: + PBRefMenuItem + + + pushUpdatesToRemote: + PBRefMenuItem + + + rebaseHeadBranch: + PBRefMenuItem + + + showTagInfoSheet: + PBRefMenuItem + + + YES @@ -2999,9 +3759,6 @@ commitController commitList historyController - pullItem - pushItem - rebaseItem YES @@ -3009,9 +3766,35 @@ NSArrayController PBCommitList PBGitHistoryController - KBPopUpToolbarItem - KBPopUpToolbarItem - KBPopUpToolbarItem + + + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + + branchPopUp + NSPopUpButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + historyController + PBGitHistoryController + @@ -3026,6 +3809,13 @@ refish id + + refish + + refish + id + + IBProjectSource PBRefMenuItem.h @@ -3034,34 +3824,6 @@ PBRepositoryDocumentController NSDocumentController - - YES - - YES - cloneURL: - hideClone: - showClone: - - - YES - id - id - id - - - - YES - - YES - cloneURLField - cloneWindow - - - YES - NSTextField - NSWindow - - IBProjectSource PBRepositoryDocumentController.h @@ -3082,6 +3844,13 @@ refresh: id + + refresh: + + refresh: + id + + IBProjectSource PBViewController.h @@ -3107,6 +3876,35 @@ NSArrayController + + YES + + YES + cachedFilesController + controller + indexController + unstagedFilesController + + + YES + + cachedFilesController + NSArrayController + + + controller + PBGitCommitController + + + indexController + PBGitIndexController + + + unstagedFilesController + NSArrayController + + + IBProjectSource PBWebChangesController.h @@ -3128,6 +3926,25 @@ WebView + + YES + + YES + repository + view + + + YES + + repository + id + + + view + WebView + + + IBProjectSource PBWebController.h @@ -3149,6 +3966,25 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + IBProjectSource PBWebHistoryController.h @@ -3171,10 +4007,24 @@ checkForUpdates: id + + checkForUpdates: + + checkForUpdates: + id + + delegate id + + delegate + + delegate + id + + @@ -3295,6 +4145,45 @@ id + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + + printDocument: + id + + + revertDocumentToSaved: + id + + + runPageLayout: + id + + + saveDocument: + id + + + saveDocumentAs: + id + + + saveDocumentTo: + id + + + IBFrameworkSource AppKit.framework/Headers/NSDocument.h @@ -3327,6 +4216,35 @@ id + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + + clearRecentDocuments: + id + + + newDocument: + id + + + openDocument: + id + + + saveAllDocuments: + id + + + IBFrameworkSource AppKit.framework/Headers/NSDocumentController.h @@ -3624,55 +4542,6 @@ Foundation.framework/Headers/NSURLDownload.h - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/IKImageBrowserView.h - - - - NSObject - - IBFrameworkSource - ImageKit.framework/Headers/ImageKitDeprecated.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFDocument.h - - - - NSObject - - IBFrameworkSource - PDFKit.framework/Headers/PDFView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionParameterView.h - - - - NSObject - - IBFrameworkSource - QuartzComposer.framework/Headers/QCCompositionPickerView.h - - - - NSObject - - IBFrameworkSource - QuartzFilters.framework/Headers/QuartzFilterManager.h - - NSObject @@ -3897,6 +4766,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h @@ -3931,68 +4807,18 @@ showWindow: id + + showWindow: + + showWindow: + id + + IBFrameworkSource AppKit.framework/Headers/NSWindowController.h - - PDFView - NSView - - YES - - YES - goBack: - goForward: - goToFirstPage: - goToLastPage: - goToNextPage: - goToPreviousPage: - selectAll: - takeBackgroundColorFrom: - zoomIn: - zoomOut: - - - YES - id - id - id - id - id - id - id - id - id - id - - - - - - QCView - NSView - - YES - - YES - play: - start: - stop: - - - YES - id - id - id - - - - IBFrameworkSource - QuartzComposer.framework/Headers/QCView.h - - SUUpdater NSObject @@ -4000,10 +4826,24 @@ checkForUpdates: id + + checkForUpdates: + + checkForUpdates: + id + + delegate id + + delegate + + delegate + id + + @@ -4040,6 +4880,70 @@ id + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + IBFrameworkSource WebKit.framework/Headers/WebView.h @@ -4048,6 +4952,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -4063,5 +4968,18 @@ YES ../GitX.xcodeproj 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + diff --git a/PBCommitList.m b/PBCommitList.m index 0060a07..d5ea35d 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -51,6 +51,11 @@ [controller copyCommitInfo]; } +- (void) copySHA:(id)sender +{ + [controller copyCommitSHA]; +} + // !!! Andre Berg 20100330: Used from -scrollSelectionToTopOfViewFrom: of PBGitHistoryController // so that when the history controller udpates the branch filter the origin of the superview gets // shifted into multiples of the row height. Otherwise the top selected row will always be off by diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 8bc0388..f848c4c 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -83,6 +83,7 @@ - (IBAction) rebase:(id)sender; - (void) copyCommitInfo; +- (void) copyCommitSHA; - (BOOL) hasNonlinearPath; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 6db7c75..640c892 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -304,6 +304,19 @@ } +- (void) copyCommitSHA +{ + PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0]; + if (!commit) + return; + NSString *info = [[commit realSha] substringWithRange:NSMakeRange(0, 7)]; + + NSPasteboard *a =[NSPasteboard generalPasteboard]; + [a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [a setString:info forType: NSStringPboardType]; + +} + - (IBAction) toggleQLPreviewPanel:(id)sender { if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { From c077f234ea0817130f804c18769e633371db2fce Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Sun, 11 Apr 2010 19:46:39 -0400 Subject: [PATCH 062/110] Allow zero lines of context Hunk/line patches don't generally have context Before this, every attempt to stage a hunk or line was met with "patch failed" using git 1.6.6 --- PBGitIndex.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index 4f0da98..ae954fa 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -388,7 +388,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (BOOL)applyPatch:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse; { - NSMutableArray *array = [NSMutableArray arrayWithObjects:@"apply", nil]; + NSMutableArray *array = [NSMutableArray arrayWithObjects:@"apply", @"--unidiff-zero", nil]; if (stage) [array addObject:@"--cached"]; if (reverse) From 986f49f70a7890128c0c250a4d1cacbb04f700d1 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 22 Aug 2010 14:14:49 -0600 Subject: [PATCH 063/110] Don't allow drag-n-drop for the checked out branch. Moving the checked out branch would cause odd things to happen to git's index. --- PBRefController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PBRefController.m b/PBRefController.m index c609b2a..ca560a1 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -294,6 +294,10 @@ if (index == -1) return NO; + + PBGitRef *ref = [[[cell objectValue] refs] objectAtIndex:index]; + if ([[[historyController.repository headRef] ref] isEqualToRef:ref]) + return NO; NSData *data = [NSKeyedArchiver archivedDataWithRootObject:[NSArray arrayWithObjects:[NSNumber numberWithInt:row], [NSNumber numberWithInt:index], NULL]]; [pboard declareTypes:[NSArray arrayWithObject:@"PBGitRef"] owner:self]; From e281c983d6d46b380fa333b7020bd18b13b38711 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 22 Aug 2010 16:12:57 -0600 Subject: [PATCH 064/110] Add a relative date column to the commits list table view Shows a relative time ("x minutes ago", "Yesterday", "x days ago", "x years ago"). - Sort the column on the commit's date and not on the string value - Use a custom formatter connected to the cell in the XIB - Show or hide using the contextual menu for the table header --- GitX.xcodeproj/project.pbxproj | 6 + GitXRelativeDateFormatter.h | 16 + GitXRelativeDateFormatter.m | 93 +++++ PBGitHistoryView.xib | 680 +++++++++++++++++++++++++++++++-- 4 files changed, 768 insertions(+), 27 deletions(-) create mode 100644 GitXRelativeDateFormatter.h create mode 100644 GitXRelativeDateFormatter.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 162d13d..469427b 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -77,6 +77,7 @@ D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E105461157C18200FC28A4 /* PBQLTextView.m */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; + D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */; }; D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FBCF18115FA20C0098676A /* PBGitSHA.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; @@ -318,6 +319,8 @@ D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; + D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXRelativeDateFormatter.h; sourceTree = ""; }; + D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXRelativeDateFormatter.m; sourceTree = ""; }; D8FBCF17115FA20C0098676A /* PBGitSHA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSHA.h; sourceTree = ""; }; D8FBCF18115FA20C0098676A /* PBGitSHA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSHA.m; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; @@ -801,6 +804,8 @@ F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */, D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */, D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */, + D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */, + D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */, ); name = Aux; sourceTree = ""; @@ -1258,6 +1263,7 @@ D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */, D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */, + D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/GitXRelativeDateFormatter.h b/GitXRelativeDateFormatter.h new file mode 100644 index 0000000..b5f1244 --- /dev/null +++ b/GitXRelativeDateFormatter.h @@ -0,0 +1,16 @@ +// +// GitXRelativeDateFormatter.h +// GitX +// +// Created by Nathan Kinsinger on 9/1/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface GitXRelativeDateFormatter : NSFormatter { + +} + +@end diff --git a/GitXRelativeDateFormatter.m b/GitXRelativeDateFormatter.m new file mode 100644 index 0000000..7107548 --- /dev/null +++ b/GitXRelativeDateFormatter.m @@ -0,0 +1,93 @@ +// +// GitXRelativeDateFormatter.m +// GitX +// +// Created by Nathan Kinsinger on 9/1/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "GitXRelativeDateFormatter.h" + + +#define MINUTE 60 +#define HOUR (60 * MINUTE) + +#define WEEK 7 + + +@implementation GitXRelativeDateFormatter + +- (NSString *)stringForObjectValue:(id)date +{ + if (![date isKindOfClass:[NSDate class]]) + return nil; + + NSDate *now = [NSDate date]; + + NSInteger secondsAgo = lround([now timeIntervalSinceDate:date]); + + if (secondsAgo < 0) + return @"In the future!"; + + if (secondsAgo < MINUTE) + return @"seconds ago"; + + if (secondsAgo < (2 * MINUTE)) + return @"1 minute ago"; + + if (secondsAgo < HOUR) + return [NSString stringWithFormat:@"%d minutes ago", (secondsAgo / MINUTE)]; + + if (secondsAgo < (2 * HOUR)) + return @"1 hour ago"; + + // figure out # of days ago based on calender days (so yesterday is the day before today not 24 hours ago) + NSDateFormatter *midnightFormmatter = [[NSDateFormatter alloc] init]; + [midnightFormmatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *midnightOnTargetDate = [midnightFormmatter dateFromString:[midnightFormmatter stringFromDate:date]]; + NSDate *midnightToday = [midnightFormmatter dateFromString:[midnightFormmatter stringFromDate:now]]; + + // use NSCalendar so it will handle things like leap years correctly + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:midnightOnTargetDate + toDate:midnightToday + options:0]; + NSInteger yearsAgo = [components year]; + NSInteger monthsAgo = [components month]; + NSInteger daysAgo = [components day]; + + if (yearsAgo == 0) { + if (monthsAgo == 0) { + // return "hours ago" if it's still today, but "Yesterday" only if more than 6 hours ago + // gives people a little time to get used to the idea that yesterday is over :) + if ((daysAgo == 0) || (secondsAgo < (6 * HOUR))) + return [NSString stringWithFormat:@"%d hours ago", (secondsAgo / HOUR)]; + if (daysAgo == 1) + return @"Yesterday"; + + if (daysAgo >= (2 * WEEK)) + return [NSString stringWithFormat:@"%d weeks ago", (daysAgo / WEEK)]; + + return [NSString stringWithFormat:@"%d days ago", daysAgo]; + } + + if (monthsAgo == 1) + return @"1 month ago"; + + return [NSString stringWithFormat:@"%d months ago", monthsAgo]; + } + + if (yearsAgo == 1) { + if (monthsAgo == 0) + return @"1 year ago"; + + if (monthsAgo == 1) + return @"1 year 1 month ago"; + + return [NSString stringWithFormat:@"1 year %d months ago", monthsAgo]; + } + + return [NSString stringWithFormat:@"%d years ago", yearsAgo]; +} + +@end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 97cbb0a..20edb6f 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -3,7 +3,7 @@ 1050 10F569 - 762 + 788 1038.29 461.00 @@ -15,13 +15,13 @@ YES - 762 - 762 + 788 + 788 YES - + YES @@ -88,6 +88,7 @@ dateString arran realSha + relativeDateString PBGitCommit @@ -496,9 +497,28 @@ 337772096 - 2048 + -2147481600 Text Cell + + + YES + + YES + dateStyle + formatterBehavior + timeStyle + + + YES + + + + + + MMMM d, yyyy h:mm a + NO + @@ -506,6 +526,11 @@ 3 YES + + date + YES + compare: + SHAColumn @@ -534,6 +559,38 @@ YES + + RelativeDateColumn + 30 + 10 + 3.4028230607370965e+38 + + 75628096 + 2048 + Relative Date + + + + + + 338820672 + 1024 + + + + + + + 3 + YES + + + date + YES + compare: + + YES + 3 2 @@ -1240,6 +1297,9 @@ PBRefController + + GitXRelativeDateFormatter + @@ -1472,26 +1532,6 @@ 96 - - - value: arrangedObjects.dateString - - - - - - value: arrangedObjects.dateString - value - arrangedObjects.dateString - - NSConditionallySetsEditable - - - 2 - - - 98 - delegate @@ -1914,6 +1954,54 @@ 402 + + + value: arrangedObjects.date + + + + + + value: arrangedObjects.date + value + arrangedObjects.date + + NSConditionallySetsEditable + + + 2 + + + 404 + + + + formatter + + + + 416 + + + + value: arrangedObjects.date + + + + + + value: arrangedObjects.date + value + arrangedObjects.date + + NSConditionallySetsEditable + + + 2 + + + 417 + @@ -1990,9 +2078,9 @@ YES - + Commits Split View @@ -2044,6 +2132,7 @@ + Commit List @@ -2097,6 +2186,10 @@ 34 + + YES + + @@ -2434,6 +2527,30 @@ + + 407 + + + + + 409 + + + YES + + + + + + 410 + + + + + 414 + + + @@ -2526,6 +2643,10 @@ 39.ImportedFromIB2 4.IBAttributePlaceholdersKey 4.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 414.IBDateFormatterBehaviorMetadataKey + 414.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 48.IBPluginDependency @@ -2694,6 +2815,10 @@ com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin {{9, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2730,11 +2855,19 @@ - 402 + 417 YES + + GitXRelativeDateFormatter + NSFormatter + + IBProjectSource + GitXRelativeDateFormatter.h + + NSOutlineView @@ -2768,6 +2901,30 @@ WebView + + YES + + YES + controller + webController + webView + + + YES + + controller + PBGitHistoryController + + + webController + PBWebHistoryController + + + webView + WebView + + + IBProjectSource PBCommitList.h @@ -2831,6 +2988,90 @@ id + + YES + + YES + cherryPick: + createBranch: + createTag: + merge: + openFilesAction: + openSelectedFile: + rebase: + refresh: + setBranchFilter: + setDetailedView: + setTreeView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: + + + YES + + cherryPick: + id + + + createBranch: + id + + + createTag: + id + + + merge: + id + + + openFilesAction: + id + + + openSelectedFile: + id + + + rebase: + id + + + refresh: + id + + + setBranchFilter: + id + + + setDetailedView: + id + + + setTreeView: + id + + + showAddRemoteSheet: + id + + + showCommitsFromTree: + id + + + showInFinderAction: + id + + + toggleQLPreviewPanel: + id + + + YES @@ -2874,6 +3115,100 @@ id + + YES + + YES + allBranchesFilterItem + cherryPickButton + commitController + commitList + fileBrowser + historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView + searchField + selectedBranchFilterItem + treeController + upperToolbarView + webHistoryController + webView + + + YES + + allBranchesFilterItem + NSButton + + + cherryPickButton + NSButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + fileBrowser + NSOutlineView + + + historySplitView + PBCollapsibleSplitView + + + localRemoteBranchesFilterItem + NSButton + + + mergeButton + NSButton + + + rebaseButton + NSButton + + + refController + PBRefController + + + scopeBarView + PBGitGradientBarView + + + searchField + NSSearchField + + + selectedBranchFilterItem + NSButton + + + treeController + NSTreeController + + + upperToolbarView + PBGitGradientBarView + + + webHistoryController + PBWebHistoryController + + + webView + id + + + IBProjectSource PBGitHistoryController.h @@ -2903,6 +3238,25 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + controller + + + YES + + contextMenuDelegate + id + + + controller + PBGitHistoryController + + + IBProjectSource PBGitRevisionCell.h @@ -2923,6 +3277,13 @@ controller PBGitHistoryController + + controller + + controller + PBGitHistoryController + + IBProjectSource PBQLOutlineView.h @@ -2935,6 +3296,13 @@ controller PBGitHistoryController + + controller + + controller + PBGitHistoryController + + IBProjectSource PBQLTextView.h @@ -2982,6 +3350,90 @@ PBRefMenuItem + + YES + + YES + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + diffWithHEAD: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseHeadBranch: + showTagInfoSheet: + + + YES + + checkout: + PBRefMenuItem + + + cherryPick: + PBRefMenuItem + + + copyPatch: + PBRefMenuItem + + + copySHA: + PBRefMenuItem + + + createBranch: + PBRefMenuItem + + + createTag: + PBRefMenuItem + + + diffWithHEAD: + PBRefMenuItem + + + fetchRemote: + PBRefMenuItem + + + merge: + PBRefMenuItem + + + pullRemote: + PBRefMenuItem + + + pushDefaultRemoteForRef: + PBRefMenuItem + + + pushToRemote: + PBRefMenuItem + + + pushUpdatesToRemote: + PBRefMenuItem + + + rebaseHeadBranch: + PBRefMenuItem + + + showTagInfoSheet: + PBRefMenuItem + + + YES @@ -2999,6 +3451,35 @@ PBGitHistoryController + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + + branchPopUp + NSPopUpButton + + + commitController + NSArrayController + + + commitList + PBCommitList + + + historyController + PBGitHistoryController + + + IBProjectSource PBRefController.h @@ -3011,6 +3492,13 @@ refish id + + refish + + refish + id + + IBProjectSource PBRefMenuItem.h @@ -3023,6 +3511,13 @@ controller NSArrayController + + controller + + controller + NSArrayController + + IBProjectSource PBUnsortableTableHeader.h @@ -3035,6 +3530,13 @@ refresh: id + + refresh: + + refresh: + id + + IBProjectSource PBViewController.h @@ -3056,6 +3558,25 @@ WebView + + YES + + YES + repository + view + + + YES + + repository + id + + + view + WebView + + + IBProjectSource PBWebController.h @@ -3077,6 +3598,25 @@ PBGitHistoryController + + YES + + YES + contextMenuDelegate + historyController + + + YES + + contextMenuDelegate + id + + + historyController + PBGitHistoryController + + + IBProjectSource PBWebHistoryController.h @@ -3089,6 +3629,13 @@ view WebView + + view + + view + WebView + + IBUserSource @@ -3204,6 +3751,14 @@ AppKit.framework/Headers/NSController.h + + NSDateFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSDateFormatter.h + + NSFormatter NSObject @@ -3763,6 +4318,13 @@ view NSView + + view + + view + NSView + + IBFrameworkSource AppKit.framework/Headers/NSViewController.h @@ -3802,6 +4364,70 @@ id + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + + goBack: + id + + + goForward: + id + + + makeTextLarger: + id + + + makeTextSmaller: + id + + + makeTextStandardSize: + id + + + reload: + id + + + reloadFromOrigin: + id + + + stopLoading: + id + + + takeStringURLFrom: + id + + + toggleContinuousSpellChecking: + id + + + toggleSmartInsertDelete: + id + + + IBFrameworkSource WebKit.framework/Headers/WebView.h From f8e63e2c9c75442aae7e7b74da17003e231738b3 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Wed, 1 Sep 2010 23:06:56 -0600 Subject: [PATCH 065/110] Remove the isReachable test for gravatar.com If there is no network connection then the reachability test will take the system default time (90 seconds I think?) to time out. During this time the UI is blocked (spinning beach ball). The test was being done even if gravatar use was turned off. It doesn't really matter if the site is unreachable, the image will not load but that's not a big deal. --- html/views/history/history.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/html/views/history/history.js b/html/views/history/history.js index c90c0c2..ca970fb 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -129,9 +129,6 @@ var gistie = function() { } var setGravatar = function(email, image) { - if (Controller && !Controller.isReachable_("www.gravatar.com")) - return; - if(Controller && !Controller.isFeatureEnabled_("gravatar")) { image.src = ""; return; From 2bdfaa096b9a1a982fd18a706ec3e2057f9a8f81 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 22 Aug 2010 18:44:00 -0600 Subject: [PATCH 066/110] Fix sorting of the subject column. Was broken back in 4e4ffcc. --- PBGitHistoryController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 640c892..89cd1ab 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -67,7 +67,7 @@ // Set a sort descriptor for the subject column in the history list, as // It can't be sorted by default (because it's bound to a PBGitCommit) - [[commitList tableColumnWithIdentifier:@"subject"] setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]]; + [[commitList tableColumnWithIdentifier:@"SubjectColumn"] setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]]; // Add a menu that allows a user to select which columns to view [[commitList headerView] setMenu:[self tableColumnMenu]]; [historySplitView setTopMin:58.0 andBottomMin:100.0]; From 88b2983a4ccc79b86babb0941b1690adfa231973 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Wed, 1 Sep 2010 23:15:50 -0600 Subject: [PATCH 067/110] Add a Short SHA column to the commit list Shows only the first 10 characters of the full SHA hash so as to take up less room. Show or hide it using the contextual menu for the table header. --- PBGitHistoryView.xib | 119 +++++++++++++++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 26 deletions(-) diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 20edb6f..37d329e 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -89,6 +89,7 @@ arran realSha relativeDateString + shortName PBGitCommit @@ -481,7 +482,7 @@ DateColumn 165 10 - 3.4028230607370965e+38 + 1000 75628096 2048 @@ -500,7 +501,7 @@ -2147481600 Text Cell - + YES @@ -532,11 +533,43 @@ compare: + + RelativeDateColumn + 30 + 10 + 1000 + + 75628096 + 2048 + Relative Date + + + + + + 338820672 + 1024 + + + + + + + 3 + YES + + + date + YES + compare: + + YES + SHAColumn 30 10 - 3.4028230607370965e+38 + 1000 75628096 2048 @@ -559,20 +592,20 @@ YES - - RelativeDateColumn + + ShortSHAColumn 30 10 - 3.4028230607370965e+38 + 1000 75628096 2048 - Relative Date + Short SHA - + 338820672 1024 @@ -584,11 +617,6 @@ 3 YES - - date - YES - compare: - YES @@ -1977,7 +2005,7 @@ formatter - + 416 @@ -1985,10 +2013,10 @@ value: arrangedObjects.date - + - + value: arrangedObjects.date value @@ -2002,6 +2030,26 @@ 417 + + + value: arrangedObjects.shortName + + + + + + value: arrangedObjects.shortName + value + arrangedObjects.shortName + + NSConditionallySetsEditable + + + 2 + + + 422 + @@ -2128,11 +2176,12 @@ YES - - + + + Commit List @@ -2188,7 +2237,7 @@ YES - + @@ -2534,23 +2583,37 @@ 409 - + YES - + 410 - - + + 414 - + + + 418 + + + YES + + + + + + 419 + + + @@ -2647,6 +2710,8 @@ 410.IBPluginDependency 414.IBDateFormatterBehaviorMetadataKey 414.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 48.IBPluginDependency @@ -2819,6 +2884,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{9, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2855,7 +2922,7 @@ - 417 + 422 From beaa591b53230c714fe765448edfb77872381cfc Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 15 Aug 2010 22:45:42 -0600 Subject: [PATCH 068/110] Include the CFBundleGitVersion in the version command of the CLI CFBundleGitVersion has the git description information in it. --- gitx.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitx.m b/gitx.m index eea2892..464a5a0 100644 --- a/gitx.m +++ b/gitx.m @@ -67,7 +67,8 @@ void usage(char const *programName) void version_info() { NSString *version = [[[NSBundle bundleForClass:[PBGitBinary class]] infoDictionary] valueForKey:@"CFBundleVersion"]; - printf("This is GitX version %s\n", [version UTF8String]); + NSString *gitVersion = [[[NSBundle bundleForClass:[PBGitBinary class]] infoDictionary] valueForKey:@"CFBundleGitVersion"]; + printf("GitX version %s (%s)\n", [version UTF8String], [gitVersion UTF8String]); if ([PBGitBinary path]) printf("Using git found at %s, version %s\n", [[PBGitBinary path] UTF8String], [[PBGitBinary version] UTF8String]); else From e60bb3226cd2d4f7ffb05a22fc3010d062fb695d Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 19 Aug 2010 00:20:33 -0600 Subject: [PATCH 069/110] Refactor the gitx CLI to use apple events and the scripting bridge Sending the arguments with the openURL:... message allows the repository document to modify it's UI without the UI flashing between states as it opens. Covers all the existing functionality of the CLI, but modifies: - "--all" "--local" "--branch" change the branch filter - cleaned up the usage (help) text and added info on missing commands - looks up the full ref name of refs so the name of a branch or tag can be entered (the user can enter "master" instead of "refs/heads/master") Modified the History Controller to watch for and react to branch filter changes. The GitX.h file is generated by the 'sdp' tool in a run script build phase called 'Generate Scripting Bridge Header' based on the content of GitX.sdef. It is used by the Scripting Bridge so that other apps (in this case the gitx CLI) can call Applescript commands on GitX in objective-c. --- ApplicationController.h | 3 - ApplicationController.m | 13 +-- GitX.h | 69 +++++++++++ GitX.sdef | 166 ++++++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 49 +++++++- GitXScriptingConstants.h | 12 ++ Info.plist | 4 + NSApplication+GitXScripting.h | 16 +++ NSApplication+GitXScripting.m | 25 ++++ PBGitHistoryController.m | 8 ++ PBGitRepository.h | 1 + PBGitRepository.m | 133 +++++++++++++++++++++ gitx.m | 208 ++++++++++++++++++++------------- 13 files changed, 610 insertions(+), 97 deletions(-) create mode 100644 GitX.h create mode 100644 GitX.sdef create mode 100644 GitXScriptingConstants.h create mode 100644 NSApplication+GitXScripting.h create mode 100644 NSApplication+GitXScripting.m diff --git a/ApplicationController.h b/ApplicationController.h index 4305662..f368344 100644 --- a/ApplicationController.h +++ b/ApplicationController.h @@ -9,7 +9,6 @@ #import #import "PBGitRepository.h" -@class PBCLIProxy; @class PBCloneRepositoryPanel; @interface ApplicationController : NSObject @@ -20,10 +19,8 @@ NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; - PBCLIProxy *cliProxy; PBCloneRepositoryPanel *cloneRepositoryPanel; } -@property (retain) PBCLIProxy* cliProxy; - (NSPersistentStoreCoordinator *)persistentStoreCoordinator; - (NSManagedObjectModel *)managedObjectModel; diff --git a/ApplicationController.m b/ApplicationController.m index 2a3d2ae..c73b524 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -10,7 +10,6 @@ #import "PBGitRevisionCell.h" #import "PBGitWindowController.h" #import "PBRepositoryDocumentController.h" -#import "PBCLIProxy.h" #import "PBServicesController.h" #import "PBGitXProtocol.h" #import "PBPrefsWindowController.h" @@ -20,7 +19,6 @@ #import "Sparkle/SUUpdater.h" @implementation ApplicationController -@synthesize cliProxy; - (ApplicationController*)init { @@ -28,13 +26,12 @@ [NSApp activateIgnoringOtherApps:YES]; #endif - if(self = [super init]) { - if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load]) - if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) - NSLog(@"Could not load QuickLook"); + if(!(self = [super init])) + return nil; - self.cliProxy = [PBCLIProxy new]; - } + if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load]) + if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) + NSLog(@"Could not load QuickLook"); /* Value Transformers */ NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init]; diff --git a/GitX.h b/GitX.h new file mode 100644 index 0000000..edae903 --- /dev/null +++ b/GitX.h @@ -0,0 +1,69 @@ +/* + * GitX.h + */ + +#import +#import + + +@class GitXApplication, GitXDocument, GitXWindow; + + + +/* + * Standard Suite + */ + +// The application's top-level scripting object. +@interface GitXApplication : SBApplication + +- (SBElementArray *) documents; +- (SBElementArray *) windows; + +@property (copy, readonly) NSString *name; // The name of the application. +@property (readonly) BOOL frontmost; // Is this the active application? +@property (copy, readonly) NSString *version; // The version number of the application. + +- (void) open:(NSArray *)x; // Open a document. +- (void) quit; // Quit the application. +- (BOOL) exists:(id)x; // Verify that an object exists. +- (void) showDiff:(NSString *)x; // Show the supplied diff output in a GitX window. + +@end + +// A document. +@interface GitXDocument : SBObject + +@property (copy, readonly) NSString *name; // Its name. +@property (copy, readonly) NSURL *file; // Its location on disk, if it has one. + +- (void) close; // Close a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. +- (void) moveTo:(SBObject *)to; // Move an object to a new location. + +@end + +// A window. +@interface GitXWindow : SBObject + +@property (copy, readonly) NSString *name; // The title of the window. +- (NSInteger) id; // The unique identifier of the window. +@property NSInteger index; // The index of the window, ordered front to back. +@property NSRect bounds; // The bounding rectangle of the window. +@property (readonly) BOOL closeable; // Does the window have a close button? +@property (readonly) BOOL miniaturizable; // Does the window have a minimize button? +@property BOOL miniaturized; // Is the window minimized right now? +@property (readonly) BOOL resizable; // Can the window be resized? +@property BOOL visible; // Is the window visible right now? +@property (readonly) BOOL zoomable; // Does the window have a zoom button? +@property BOOL zoomed; // Is the window zoomed right now? +@property (copy, readonly) GitXDocument *document; // The document whose contents are displayed in the window. + +- (void) close; // Close a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. +- (void) moveTo:(SBObject *)to; // Move an object to a new location. + +@end + diff --git a/GitX.sdef b/GitX.sdef new file mode 100644 index 0000000..a0a0642 --- /dev/null +++ b/GitX.sdef @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 469427b..5cb9bd1 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -41,7 +41,6 @@ 911112370E5A097800BF76B4 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 911112360E5A097800BF76B4 /* Security.framework */; }; 913D5E4D0E55644E00CECEA2 /* gitx.m in Sources */ = {isa = PBXBuildFile; fileRef = 913D5E440E55640C00CECEA2 /* gitx.m */; }; 913D5E500E55645900CECEA2 /* gitx in Resources */ = {isa = PBXBuildFile; fileRef = 913D5E490E55644600CECEA2 /* gitx */; }; - 913D5E5F0E556A9300CECEA2 /* PBCLIProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */; }; 91B103CC0E898EC300C84364 /* PBIconAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 91B103CB0E898EC300C84364 /* PBIconAndTextCell.m */; }; 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; @@ -70,6 +69,7 @@ D858108511274D28007F254B /* Tag.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108211274D28007F254B /* Tag.png */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; + D89E9B141218BA260097A90B /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */; }; D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */; }; D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */; }; D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD051134AD2900E92D51 /* MergeTemplate.png */; }; @@ -78,6 +78,8 @@ D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */; }; + D8F01C4B12182F19007F729F /* GitX.sdef in Resources */ = {isa = PBXBuildFile; fileRef = D8F01C4A12182F19007F729F /* GitX.sdef */; }; + D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */; }; D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FBCF18115FA20C0098676A /* PBGitSHA.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; @@ -262,8 +264,6 @@ 911112360E5A097800BF76B4 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 913D5E440E55640C00CECEA2 /* gitx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gitx.m; sourceTree = ""; }; 913D5E490E55644600CECEA2 /* gitx */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gitx; sourceTree = BUILT_PRODUCTS_DIR; }; - 913D5E5D0E556A9300CECEA2 /* PBCLIProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCLIProxy.h; sourceTree = ""; }; - 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCLIProxy.m; sourceTree = ""; }; 91B103CA0E898EC300C84364 /* PBIconAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBIconAndTextCell.h; sourceTree = ""; }; 91B103CB0E898EC300C84364 /* PBIconAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBIconAndTextCell.m; sourceTree = ""; }; 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitDefaults.h; sourceTree = ""; }; @@ -307,6 +307,8 @@ D858108111274D28007F254B /* RemoteBranch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RemoteBranch.png; path = Images/RemoteBranch.png; sourceTree = ""; }; D858108211274D28007F254B /* Tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Tag.png; path = Images/Tag.png; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = System/Library/Frameworks/ScriptingBridge.framework; sourceTree = SDKROOT; }; + D89E9B4F1218C2750097A90B /* GitXScriptingConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXScriptingConstants.h; sourceTree = ""; }; D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitGradientBarView.h; sourceTree = ""; }; D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitGradientBarView.m; sourceTree = ""; }; D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CherryPickTemplate.png; path = Images/CherryPickTemplate.png; sourceTree = ""; }; @@ -321,6 +323,10 @@ D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXRelativeDateFormatter.h; sourceTree = ""; }; D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXRelativeDateFormatter.m; sourceTree = ""; }; + D8F01C4A12182F19007F729F /* GitX.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = GitX.sdef; sourceTree = ""; }; + D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+GitXScripting.h"; sourceTree = ""; }; + D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+GitXScripting.m"; sourceTree = ""; }; + D8F01D841218A406007F729F /* GitX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX.h; sourceTree = ""; }; D8FBCF17115FA20C0098676A /* PBGitSHA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSHA.h; sourceTree = ""; }; D8FBCF18115FA20C0098676A /* PBGitSHA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSHA.m; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; @@ -478,6 +484,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D89E9B141218BA260097A90B /* ScriptingBridge.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -548,6 +555,7 @@ children = ( F5886A080ED5D26B0066E74C /* SpeedTest */, 913D5E420E5563FD00CECEA2 /* cli */, + D89E9B4C1218C22A0097A90B /* GitXScripting */, F57CC43E0E05E472000472E2 /* Aux */, F57CC3850E05DDC1000472E2 /* Controllers */, F56174540E05887E001DCD79 /* Git */, @@ -561,6 +569,7 @@ 19C28FACFE9D520D11CA2CBB /* Products */, F5886A120ED5D33D0066E74C /* SpeedTest-Info.plist */, F567CC3A106E6B910059BB9D /* GitXTesting-Info.plist */, + D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */, ); name = GitTest; sourceTree = ""; @@ -604,6 +613,7 @@ D26DC6440E782C9000C777B2 /* gitx.icns */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + D8F01C4A12182F19007F729F /* GitX.sdef */, F5B721C20E05CF7E00AF29DC /* MainMenu.xib */, 911111E00E58BD5A00BF76B4 /* RepositoryWindow.xib */, F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, @@ -660,8 +670,6 @@ 913D5E420E5563FD00CECEA2 /* cli */ = { isa = PBXGroup; children = ( - 913D5E5D0E556A9300CECEA2 /* PBCLIProxy.h */, - 913D5E5E0E556A9300CECEA2 /* PBCLIProxy.m */, 913D5E440E55640C00CECEA2 /* gitx.m */, ); name = cli; @@ -688,6 +696,17 @@ name = Sheets; sourceTree = ""; }; + D89E9B4C1218C22A0097A90B /* GitXScripting */ = { + isa = PBXGroup; + children = ( + D8F01D841218A406007F729F /* GitX.h */, + D89E9B4F1218C2750097A90B /* GitXScriptingConstants.h */, + D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */, + D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */, + ); + name = GitXScripting; + sourceTree = ""; + }; D8FDDA58114335B0005647F6 /* Source View Items */ = { isa = PBXGroup; children = ( @@ -997,6 +1016,7 @@ 8D11072E0486CEB800E47090 /* Frameworks */, F580E6BD0E73329C009E2D3F /* CopyFiles */, F5CF04A20EAE696C00D75C81 /* Copy HTML files */, + D81E15ED121CE83D00269E61 /* Scripting Bridge Header Script */, ); buildRules = ( ); @@ -1133,6 +1153,7 @@ D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, + D8F01C4B12182F19007F729F /* GitX.sdef in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1146,6 +1167,22 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + D81E15ED121CE83D00269E61 /* Scripting Bridge Header Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/GitX.sdef", + ); + name = "Scripting Bridge Header Script "; + outputPaths = ( + "$(SRCROOT)/GitX.h", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Build the scripting bridge header GitX.h if the GitX.sdef file changes\nsdef $TARGET_BUILD_DIR/GitX.app | sdp -fh --basename GitX"; + }; F56439F60F792B2100A579C2 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1207,7 +1244,6 @@ F5FF4E180E0829C20006317A /* PBGitRevList.mm in Sources */, F5FF4E7A0E082E440006317A /* PBGitGrapher.mm in Sources */, 911111F80E594F3F00BF76B4 /* PBRepositoryDocumentController.m in Sources */, - 913D5E5F0E556A9300CECEA2 /* PBCLIProxy.m in Sources */, F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */, F5C6F68D0E65FF9300478D97 /* PBGitLane.mm in Sources */, F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */, @@ -1264,6 +1300,7 @@ D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */, D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */, D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */, + D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/GitXScriptingConstants.h b/GitXScriptingConstants.h new file mode 100644 index 0000000..cba0ce8 --- /dev/null +++ b/GitXScriptingConstants.h @@ -0,0 +1,12 @@ +// +// GitXScriptingConstants.h +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#define kGitXBundleIdentifier @"nl.frim.GitX" + + +#define kGitXAEKeyArgumentsList 'ARGS' \ No newline at end of file diff --git a/Info.plist b/Info.plist index b7a8de4..d7e5e5b 100644 --- a/Info.plist +++ b/Info.plist @@ -89,5 +89,9 @@ + NSAppleScriptEnabled + + OSAScriptingDefinition + GitX.sdef diff --git a/NSApplication+GitXScripting.h b/NSApplication+GitXScripting.h new file mode 100644 index 0000000..d5cab8c --- /dev/null +++ b/NSApplication+GitXScripting.h @@ -0,0 +1,16 @@ +// +// NSApplication+GitXScripting.h +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface NSApplication (GitXScripting) + +- (void)showDiffScriptCommand:(NSScriptCommand *)command; + +@end diff --git a/NSApplication+GitXScripting.m b/NSApplication+GitXScripting.m new file mode 100644 index 0000000..7c8489c --- /dev/null +++ b/NSApplication+GitXScripting.m @@ -0,0 +1,25 @@ +// +// NSApplication+GitXScripting.m +// GitX +// +// Created by Nathan Kinsinger on 8/15/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "NSApplication+GitXScripting.h" +#import "PBDiffWindowController.h" + + +@implementation NSApplication (GitXScripting) + +- (void)showDiffScriptCommand:(NSScriptCommand *)command +{ + NSString *diffText = [command directParameter]; + if (diffText) { + PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diffText]; + [diffController showWindow:nil]; + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; + } +} + +@end diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 89cd1ab..3f08f65 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -50,6 +50,7 @@ [repository.revisionList addObserver:self forKeyPath:@"isUpdating" options:0 context:@"revisionListUpdating"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"]; [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; + [repository addObserver:self forKeyPath:@"currentBranchFilter" options:0 context:@"branchFilterChange"]; forceSelectionUpdate = YES; NSSize cellSpacing = [commitList intercellSpacing]; @@ -240,6 +241,12 @@ return; } + if ([(NSString *)context isEqualToString:@"branchFilterChange"]) { + [PBGitDefaults setBranchFilter:repository.currentBranchFilter]; + [self updateBranchFilterMatrix]; + return; + } + if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { [self updateStatus]; @@ -454,6 +461,7 @@ [repository.revisionList removeObserver:self forKeyPath:@"isUpdating"]; [repository removeObserver:self forKeyPath:@"currentBranch"]; [repository removeObserver:self forKeyPath:@"refs"]; + [repository removeObserver:self forKeyPath:@"currentBranchFilter"]; } [webHistoryController closeView]; diff --git a/PBGitRepository.h b/PBGitRepository.h index 25176cd..86b094a 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -104,6 +104,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { - (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef; - (BOOL)checkRefFormat:(NSString *)refName; - (BOOL)refExists:(PBGitRef *)ref; +- (PBGitRef *)refForName:(NSString *)name; - (NSArray *) remotes; - (BOOL) hasRemotes; diff --git a/PBGitRepository.m b/PBGitRepository.m index 6f93a71..48a70f4 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -18,6 +18,7 @@ #import "PBRemoteProgressSheet.h" #import "PBGitRevList.h" #import "PBGitDefaults.h" +#import "GitXScriptingConstants.h" NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; @@ -429,6 +430,31 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return NO; return YES; } + +// useful for getting the full ref for a user entered name +// EX: name: master +// ref: refs/heads/master +- (PBGitRef *)refForName:(NSString *)name +{ + if (!name) + return nil; + + int retValue = 1; + NSString *output = [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"show-ref", name, nil] retValue:&retValue]; + if (retValue) + return nil; + + // the output is in the format: + // with potentially multiple lines if there are multiple matching refs (ex: refs/remotes/origin/master) + // here we only care about the first match + NSArray *refList = [output componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([refList count] > 1) { + NSString *refName = [refList objectAtIndex:1]; + return [PBGitRef refFromString:refName]; + } + + return nil; +} // Returns either this object, or an existing, equal object - (PBGitRevSpecifier*) addBranch:(PBGitRevSpecifier*)branch @@ -876,6 +902,113 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; } +#pragma mark GitX Scripting + +- (void)handleRevListArguments:(NSArray *)arguments +{ + if (![arguments count]) + return; + + PBGitRevSpecifier *revListSpecifier = nil; + + // the argument may be a branch or tag name but will probably not be the full reference + if ([arguments count] == 1) { + PBGitRef *refArgument = [self refForName:[arguments lastObject]]; + if (refArgument) + revListSpecifier = [[PBGitRevSpecifier alloc] initWithRef:refArgument]; + } + + if (!revListSpecifier) + revListSpecifier = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; + + self.currentBranch = [self addBranch:revListSpecifier]; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; +} + +- (void)handleBranchFilterEventForFilter:(PBGitXBranchFilterType)filter additionalArguments:(NSMutableArray *)arguments +{ + self.currentBranchFilter = filter; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; + + // treat any additional arguments as a rev-list specifier + if ([arguments count] > 1) { + [arguments removeObjectAtIndex:0]; + [self handleRevListArguments:arguments]; + } +} + +- (void)handleGitXScriptingArguments:(NSAppleEventDescriptor *)argumentsList +{ + NSMutableArray *arguments = [NSMutableArray array]; + uint argumentsIndex = 1; // AppleEvent list descriptor's are one based + while(1) { + NSAppleEventDescriptor *arg = [argumentsList descriptorAtIndex:argumentsIndex++]; + if (arg) + [arguments addObject:[arg stringValue]]; + else + break; + } + + if (![arguments count]) + return; + + NSString *firstArgument = [arguments objectAtIndex:0]; + + if ([firstArgument isEqualToString:@"-c"] || [firstArgument isEqualToString:@"--commit"]) { + [PBGitDefaults setShowStageView:YES]; + [self.windowController showCommitView:self]; + return; + } + + if ([firstArgument isEqualToString:@"--all"]) { + [self handleBranchFilterEventForFilter:kGitXAllBranchesFilter additionalArguments:arguments]; + return; + } + + if ([firstArgument isEqualToString:@"--local"]) { + [self handleBranchFilterEventForFilter:kGitXLocalRemoteBranchesFilter additionalArguments:arguments]; + return; + } + + if ([firstArgument isEqualToString:@"--branch"]) { + [self handleBranchFilterEventForFilter:kGitXSelectedBranchFilter additionalArguments:arguments]; + return; + } + + // if the argument is not a known command then treat it as a rev-list specifier + [self handleRevListArguments:arguments]; +} + +// see if the current appleEvent has the command line arguments from the gitx cli +// this could be from an openApplication or an openDocument apple event +// when opening a repository this is called before the sidebar controller gets it's awakeFromNib: message +// if the repository is already open then this is also a good place to catch the event as the window is about to be brought forward +- (void)showWindows +{ + NSAppleEventDescriptor *currentAppleEvent = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent]; + + if (currentAppleEvent) { + NSAppleEventDescriptor *eventRecord = [currentAppleEvent paramDescriptorForKeyword:keyAEPropData]; + + // on app launch there may be many repositories opening, so double check that this is the right repo + NSString *path = [[eventRecord paramDescriptorForKeyword:typeFileURL] stringValue]; + if (path) { + if ([[PBGitRepository gitDirForURL:[NSURL URLWithString:path]] isEqual:[self fileURL]]) { + NSAppleEventDescriptor *argumentsList = [eventRecord paramDescriptorForKeyword:kGitXAEKeyArgumentsList]; + [self handleGitXScriptingArguments:argumentsList]; + + // showWindows may be called more than once during app launch so remove the CLI data after we handle the event + [currentAppleEvent removeDescriptorWithKeyword:keyAEPropData]; + } + } + } + + [super showWindows]; +} + + #pragma mark low level - (int) returnValueForCommand:(NSString *)cmd diff --git a/gitx.m b/gitx.m index 464a5a0..8c3ef77 100644 --- a/gitx.m +++ b/gitx.m @@ -6,61 +6,52 @@ // Copyright 2008 __MyCompanyName__. All rights reserved. // -#import "PBCLIProxy.h" #import "PBGitBinary.h" #import "PBEasyPipe.h" +#import "GitXScriptingConstants.h" +#import "GitX.h" -NSDistantObject* connect() -{ - id proxy = [NSConnection rootProxyForConnectionWithRegisteredName:ConnectionName host:nil]; - [proxy setProtocolForProxy:@protocol(GitXCliToolProtocol)]; - return proxy; -} -NSDistantObject *createProxy() -{ - NSDistantObject *proxy = connect(); - if (proxy) - return proxy; - - // The connection failed, so try to launch the app - [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier: @"nl.frim.GitX" - options: NSWorkspaceLaunchWithoutActivation - additionalEventParamDescriptor: nil - launchIdentifier: nil]; - - // Now attempt to connect, allowing the app time to startup - int attempt; - for (attempt = 0; proxy == nil && attempt < 50; ++attempt) { - if ( (proxy = connect()) != nil ) - return proxy; - - usleep(15000); - } - - // not succesful! - fprintf(stderr, "Couldn't connect to app server!\n"); - exit(1); - return nil; -} +#pragma mark Commands handled locally void usage(char const *programName) { - printf("Usage: %s (--help|--version)\n", programName); - printf(" or: %s (--commit|-h)\n", programName); + printf("Usage: %s (--help|--version|--git-path)\n", programName); + printf(" or: %s (--commit)\n", programName); + printf(" or: %s (--all|--local|--branch) [branch/tag]\n", programName); printf(" or: %s \n", programName); + printf(" or: %s (--diff)\n", programName); printf("\n"); - printf("\t-h, --help print this help\n"); - printf("\t--commit, -c start GitX in commit mode\n"); + printf(" -h, --help print this help\n"); + printf(" -v, --version prints version info for both GitX and git\n"); + printf(" --git-path prints the path to the directory containing git\n"); + printf("\n"); + printf("Commit/Stage view\n"); + printf(" -c, --commit start GitX in commit/stage mode\n"); + printf("\n"); + printf("Branch filter options\n"); + printf(" Add an optional branch or tag name to select that branch using the given branch filter\n"); + printf("\n"); + printf(" --all [branch] view history for all branches\n"); + printf(" --local [branch] view history for local branches only\n"); + printf(" --branch [branch] view history for the selected branch only\n"); printf("\n"); printf("RevList options\n"); - printf("\tSee 'man git-log' and 'man git-rev-list' for options you can pass to gitx\n"); + printf(" See 'man git-log' and 'man git-rev-list' for options you can pass to gitx\n"); printf("\n"); - printf("\t--all show all branches\n"); - printf("\t show specific branch\n"); - printf("\t -- show commits touching paths\n"); + printf(" select specific branch or tag\n"); + printf(" -- show commits touching paths\n"); + printf(" -S show commits that introduce or remove an instance of \n"); + printf("\n"); + printf("Diff options\n"); + printf(" See 'man git-diff' for options you can pass to gitx --diff\n"); + printf("\n"); + printf(" -d, --diff [] {0,2} [--] [...]\n"); + printf(" shows the diff in a window in GitX\n"); + printf(" git diff [options] | gitx\n"); + printf(" use gitx to pipe diff output to a GitX window\n"); exit(1); } @@ -82,36 +73,107 @@ void git_path() exit(101); NSString *path = [[PBGitBinary path] stringByDeletingLastPathComponent]; - printf("%s", [path UTF8String]); + printf("%s\n", [path UTF8String]); exit(0); } -void handleSTDINDiff(id proxy) + +#pragma mark - +#pragma mark Commands sent to GitX + +void handleSTDINDiff() { NSFileHandle *handle = [NSFileHandle fileHandleWithStandardInput]; NSData *data = [handle readDataToEndOfFile]; - NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSString *diff = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - if (string && [string length] > 0) { - [proxy openDiffWindowWithDiff:string]; - exit(0); + if (diff && [diff length] > 0) { + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp showDiff:diff]; } + + exit(0); } -void handleDiffWithArguments(NSArray *arguments, NSString *directory, id proxy) +void handleDiffWithArguments(NSURL *repositoryURL, NSMutableArray *arguments) { - int ret; - arguments = [[NSArray arrayWithObject:@"diff"] arrayByAddingObjectsFromArray:arguments]; - NSString *diff = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:directory retValue:&ret]; - if (ret) { - printf("Invalid diff command\n"); + [arguments insertObject:@"diff" atIndex:0]; + + int retValue = 1; + NSString *diffOutput = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:[repositoryURL path] retValue:&retValue]; + if (retValue) { + // if there is an error diffOutput should have the error output from git + if (diffOutput) + printf("%s\n", [diffOutput UTF8String]); + else + printf("Invalid diff command [%d]\n", retValue); exit(3); } - [proxy openDiffWindowWithDiff:diff]; + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp showDiff:diffOutput]; + exit(0); } +void handleOpenRepository(NSURL *repositoryURL, NSMutableArray *arguments) +{ + // if there are command line arguments send them to GitX through an Apple Event + // the recordDescriptor will be stored in keyAEPropData inside the openDocument or openApplication event + NSAppleEventDescriptor *recordDescriptor = nil; + if ([arguments count]) { + recordDescriptor = [NSAppleEventDescriptor recordDescriptor]; + + NSAppleEventDescriptor *listDescriptor = [NSAppleEventDescriptor listDescriptor]; + uint listIndex = 1; // AppleEvent list descriptor's are one based + for (NSString *argument in arguments) + [listDescriptor insertDescriptor:[NSAppleEventDescriptor descriptorWithString:argument] atIndex:listIndex++]; + + [recordDescriptor setParamDescriptor:listDescriptor forKeyword:kGitXAEKeyArgumentsList]; + + // this is used as a double check in GitX + NSAppleEventDescriptor *url = [NSAppleEventDescriptor descriptorWithString:[repositoryURL absoluteString]]; + [recordDescriptor setParamDescriptor:url forKeyword:typeFileURL]; + } + + // use NSWorkspace to open GitX and send the arguments + // this allows the repository document to modify itself before it shows it's GUI + BOOL didOpenURLs = [[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObject:repositoryURL] + withAppBundleIdentifier:kGitXBundleIdentifier + options:0 + additionalEventParamDescriptor:recordDescriptor + launchIdentifiers:NULL]; + if (!didOpenURLs) { + printf("Unable to open GitX.app\n"); + exit(2); + } +} + + +#pragma mark - +#pragma mark main + +NSURL *workingDirectoryURL() +{ + NSString *path = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; + + NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES]; + if (!url) { + printf("Unable to create url to path: %s\n", [path UTF8String]); + exit(2); + } + + return url; +} + +NSMutableArray *argumentsArray() +{ + NSMutableArray *arguments = [[[NSProcessInfo processInfo] arguments] mutableCopy]; + [arguments removeObjectAtIndex:0]; // url to executable path is not needed + + return arguments; +} + int main(int argc, const char** argv) { if (argc >= 2 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h"))) @@ -121,42 +183,28 @@ int main(int argc, const char** argv) if (argc >= 2 && !strcmp(argv[1], "--git-path")) git_path(); + // From here on everything needs to access git, so make sure it's installed if (![PBGitBinary path]) { printf("%s\n", [[PBGitBinary notFoundError] cStringUsingEncoding:NSUTF8StringEncoding]); exit(2); } - // Attempt to connect to the app - id proxy = createProxy(); - - // Create arguments - argv++; argc--; - NSMutableArray* arguments = [NSMutableArray arrayWithCapacity:argc]; - int i = 0; - for (i = 0; i < argc; i++) - [arguments addObject: [NSString stringWithUTF8String:argv[i]]]; - + // gitx can be used to pipe diff output to be displayed in GitX if (!isatty(STDIN_FILENO) && fdopen(STDIN_FILENO, "r")) - handleSTDINDiff(proxy); + handleSTDINDiff(); - // From this point, we require a working directory - NSString *pwd = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; - if (!pwd) - exit(2); + // From this point, we require a working directory and the arguments + NSMutableArray *arguments = argumentsArray(); + NSURL *wdURL = workingDirectoryURL(); if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--diff"] || - [[arguments objectAtIndex:0] isEqualToString:@"-d"])) - handleDiffWithArguments([arguments subarrayWithRange:NSMakeRange(1, [arguments count] - 1)], pwd, proxy); - - // No diff, just open the current dir - NSURL* url = [NSURL fileURLWithPath:pwd]; - NSError* error = nil; - - if (![proxy openRepository:url arguments: arguments error:&error]) { - fprintf(stderr, "Error opening repository at %s\n", [[url path] UTF8String]); - if (error) - fprintf(stderr, "\t%s\n", [[error localizedFailureReason] UTF8String]); + [[arguments objectAtIndex:0] isEqualToString:@"-d"])) { + [arguments removeObjectAtIndex:0]; + handleDiffWithArguments(wdURL, arguments); } + // No commands handled by gitx, open the current dir in GitX with the arguments + handleOpenRepository(wdURL, arguments); + return 0; } From b9232721d0e23c3ae63aaf80e5ef19896de64ca5 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 19 Aug 2010 22:12:16 -0600 Subject: [PATCH 070/110] Add "--git-dir=" to gitx CLI Allows specifying a repository in a particular location for the gitx operation. --- gitx.m | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/gitx.m b/gitx.m index 8c3ef77..5f17138 100644 --- a/gitx.m +++ b/gitx.m @@ -28,6 +28,14 @@ void usage(char const *programName) printf(" -v, --version prints version info for both GitX and git\n"); printf(" --git-path prints the path to the directory containing git\n"); printf("\n"); + printf("Repository path\n"); + printf(" By default gitx opens the repository in the current directory.\n"); + printf(" Use --git-dir= to send commands to a repository somewhere else.\n"); + printf(" Note: This must be the first argument.\n"); + printf("\n"); + printf(" --git-dir= [gitx commands]\n"); + printf(" send the gitx commands to the repository located at \n"); + printf("\n"); printf("Commit/Stage view\n"); printf(" -c, --commit start GitX in commit/stage mode\n"); printf("\n"); @@ -153,9 +161,32 @@ void handleOpenRepository(NSURL *repositoryURL, NSMutableArray *arguments) #pragma mark - #pragma mark main -NSURL *workingDirectoryURL() + +#define kGitDirPrefix @"--git-dir=" + +NSURL *workingDirectoryURL(NSMutableArray *arguments) { - NSString *path = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; + NSString *path = nil; + + if ([arguments count] && [[arguments objectAtIndex:0] hasPrefix:kGitDirPrefix]) { + path = [[[arguments objectAtIndex:0] substringFromIndex:[kGitDirPrefix length]] stringByStandardizingPath]; + + // the path must exist and point to a directory + BOOL isDirectory = YES; + if (![[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory] || !isDirectory) { + if (!isDirectory) + printf("Fatal: --git-dir path does not point to a directory.\n"); + else + printf("Fatal: --git-dir path does not exist.\n"); + printf("Cannot open git repository at path: '%s'\n", [path UTF8String]); + exit(2); + } + + // remove the git-dir argument + [arguments removeObjectAtIndex:0]; + } else { + path = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; + } NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES]; if (!url) { @@ -195,7 +226,7 @@ int main(int argc, const char** argv) // From this point, we require a working directory and the arguments NSMutableArray *arguments = argumentsArray(); - NSURL *wdURL = workingDirectoryURL(); + NSURL *wdURL = workingDirectoryURL(arguments); if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--diff"] || [[arguments objectAtIndex:0] isEqualToString:@"-d"])) { From 17f50e3f7e62bb2f241fcc1a4b746349f5c885ce Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 21 Aug 2010 18:50:12 -0600 Subject: [PATCH 071/110] Add --init and --clone to gitx CLI and Applescript Allows creating repositories from the command line, Applescript, or the scripting bridge. These are basic commands, if you need to use commandline options then use git itself. --- GitX.h | 2 + GitX.sdef | 12 ++++++ GitXScriptingConstants.h | 5 ++- NSApplication+GitXScripting.h | 2 + NSApplication+GitXScripting.m | 24 ++++++++++++ PBCloneRepositoryPanel.h | 3 ++ PBCloneRepositoryPanel.m | 17 +++++++++ PBRepositoryDocumentController.h | 1 + PBRepositoryDocumentController.m | 21 ++++++----- gitx.m | 63 ++++++++++++++++++++++++++++++-- 10 files changed, 135 insertions(+), 15 deletions(-) diff --git a/GitX.h b/GitX.h index edae903..7825b7f 100644 --- a/GitX.h +++ b/GitX.h @@ -28,6 +28,8 @@ - (void) quit; // Quit the application. - (BOOL) exists:(id)x; // Verify that an object exists. - (void) showDiff:(NSString *)x; // Show the supplied diff output in a GitX window. +- (void) initRepository:(NSURL *)x; // Create a git repository at the given filesystem URL. +- (void) cloneRepository:(NSString *)x to:(NSURL *)to isBare:(BOOL)isBare; // Clone a repository. @end diff --git a/GitX.sdef b/GitX.sdef index a0a0642..db0348d 100644 --- a/GitX.sdef +++ b/GitX.sdef @@ -160,6 +160,18 @@ + + + + + + + + + + + + diff --git a/GitXScriptingConstants.h b/GitXScriptingConstants.h index cba0ce8..7a786a4 100644 --- a/GitXScriptingConstants.h +++ b/GitXScriptingConstants.h @@ -9,4 +9,7 @@ #define kGitXBundleIdentifier @"nl.frim.GitX" -#define kGitXAEKeyArgumentsList 'ARGS' \ No newline at end of file +#define kGitXAEKeyArgumentsList 'ARGS' + +#define kGitXCloneDestinationURLKey @"destinationURL" +#define kGitXCloneIsBareKey @"isBare" \ No newline at end of file diff --git a/NSApplication+GitXScripting.h b/NSApplication+GitXScripting.h index d5cab8c..fafab7e 100644 --- a/NSApplication+GitXScripting.h +++ b/NSApplication+GitXScripting.h @@ -12,5 +12,7 @@ @interface NSApplication (GitXScripting) - (void)showDiffScriptCommand:(NSScriptCommand *)command; +- (void)initRepositoryScriptCommand:(NSScriptCommand *)command; +- (void)cloneRepositoryScriptCommand:(NSScriptCommand *)command; @end diff --git a/NSApplication+GitXScripting.m b/NSApplication+GitXScripting.m index 7c8489c..f3bef65 100644 --- a/NSApplication+GitXScripting.m +++ b/NSApplication+GitXScripting.m @@ -7,7 +7,10 @@ // #import "NSApplication+GitXScripting.h" +#import "GitXScriptingConstants.h" #import "PBDiffWindowController.h" +#import "PBRepositoryDocumentController.h" +#import "PBCloneRepositoryPanel.h" @implementation NSApplication (GitXScripting) @@ -22,4 +25,25 @@ } } +- (void)initRepositoryScriptCommand:(NSScriptCommand *)command +{ + NSURL *repositoryURL = [command directParameter]; + if (repositoryURL) + [[PBRepositoryDocumentController sharedDocumentController] initNewRepositoryAtURL:repositoryURL]; +} + +- (void)cloneRepositoryScriptCommand:(NSScriptCommand *)command +{ + NSString *repository = [command directParameter]; + if (repository) { + NSDictionary *arguments = [command arguments]; + NSURL *destinationURL = [arguments objectForKey:kGitXCloneDestinationURLKey]; + if (destinationURL) { + BOOL isBare = [[arguments objectForKey:kGitXCloneIsBareKey] boolValue]; + + [PBCloneRepositoryPanel beginCloneRepository:repository toURL:destinationURL isBare:isBare]; + } + } +} + @end diff --git a/PBCloneRepositoryPanel.h b/PBCloneRepositoryPanel.h index 7c7d102..8b29551 100644 --- a/PBCloneRepositoryPanel.h +++ b/PBCloneRepositoryPanel.h @@ -23,6 +23,7 @@ } + (id) panel; ++ (void)beginCloneRepository:(NSString *)repository toURL:(NSURL *)targetURL isBare:(BOOL)bare; - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; @@ -38,4 +39,6 @@ @property (assign) IBOutlet NSTextField *errorMessage; @property (assign) IBOutlet NSView *repositoryAccessoryView; +@property (assign) BOOL isBare; + @end diff --git a/PBCloneRepositoryPanel.m b/PBCloneRepositoryPanel.m index 20baaa2..a2aaa51 100644 --- a/PBCloneRepositoryPanel.m +++ b/PBCloneRepositoryPanel.m @@ -21,6 +21,8 @@ @synthesize errorMessage; @synthesize repositoryAccessoryView; +@synthesize isBare; + #pragma mark - @@ -31,6 +33,21 @@ return [[self alloc] initWithWindowNibName:@"PBCloneRepositoryPanel"]; } ++ (void)beginCloneRepository:(NSString *)repository toURL:(NSURL *)targetURL isBare:(BOOL)bare +{ + if (!repository || [repository isEqualToString:@""] || !targetURL || [[targetURL path] isEqualToString:@""]) + return; + + PBCloneRepositoryPanel *clonePanel = [PBCloneRepositoryPanel panel]; + [clonePanel showWindow:self]; + + [clonePanel.repositoryURL setStringValue:repository]; + [clonePanel.destinationPath setStringValue:[targetURL path]]; + clonePanel.isBare = bare; + + [clonePanel clone:self]; +} + - (void) awakeFromNib { diff --git a/PBRepositoryDocumentController.h b/PBRepositoryDocumentController.h index d0660e2..1bbaab3 100644 --- a/PBRepositoryDocumentController.h +++ b/PBRepositoryDocumentController.h @@ -16,4 +16,5 @@ } - (id) documentForLocation:(NSURL*) url; +- (void)initNewRepositoryAtURL:(NSURL *)url; @end diff --git a/PBRepositoryDocumentController.m b/PBRepositoryDocumentController.m index 83bd887..cfaeac5 100644 --- a/PBRepositoryDocumentController.m +++ b/PBRepositoryDocumentController.m @@ -47,6 +47,16 @@ return document; } +- (void)initNewRepositoryAtURL:(NSURL *)url +{ + int terminationStatus; + NSString *result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"init", @"-q", nil] inDir:[url path] retValue:&terminationStatus]; + + if (terminationStatus == 0) + [self openDocumentWithContentsOfURL:url display:YES error:NULL]; + else + NSRunAlertPanel(@"Failed to create new Git repository", @"Git returned the following error when trying to create the repository: %@", nil, nil, nil, result); +} - (IBAction)newDocument:(id)sender { @@ -58,16 +68,7 @@ [op setMessage:@"Initialize a repository here:"]; [op setTitle:@"New Repository"]; if ([op runModal] == NSFileHandlingPanelOKButton) - { - NSString *path = [op filename]; - int terminationStatus; - NSString *result = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:[NSArray arrayWithObjects:@"init", @"-q", nil] inDir:path inputString:nil retValue:&terminationStatus]; - - if (terminationStatus == 0) - [self openDocumentWithContentsOfURL:[op URL] display:YES error:NULL]; - else - NSRunAlertPanel(@"Failed to create new Git repository", @"Git returned the following error when trying to create the repository: %@", nil, nil, nil, result); - } + [self initNewRepositoryAtURL:[op URL]]; } diff --git a/gitx.m b/gitx.m index 5f17138..ecb9a6f 100644 --- a/gitx.m +++ b/gitx.m @@ -23,6 +23,8 @@ void usage(char const *programName) printf(" or: %s (--all|--local|--branch) [branch/tag]\n", programName); printf(" or: %s \n", programName); printf(" or: %s (--diff)\n", programName); + printf(" or: %s (--init)\n", programName); + printf(" or: %s (--clone [destination])\n", programName); printf("\n"); printf(" -h, --help print this help\n"); printf(" -v, --version prints version info for both GitX and git\n"); @@ -60,6 +62,15 @@ void usage(char const *programName) printf(" shows the diff in a window in GitX\n"); printf(" git diff [options] | gitx\n"); printf(" use gitx to pipe diff output to a GitX window\n"); + printf("\n"); + printf("Creating repositories\n"); + printf(" These commands will create a git repository and then open it up in GitX\n"); + printf("\n"); + printf(" --init creates (or reinitializes) a git repository\n"); + printf(" --clone [destination path]\n"); + printf(" clones the repository (at the specified URL) into the current\n"); + printf(" directory or into the specified path\n"); + printf("\n"); exit(1); } @@ -157,6 +168,37 @@ void handleOpenRepository(NSURL *repositoryURL, NSMutableArray *arguments) } } +void handleInit(NSURL *repositoryURL) +{ + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp initRepository:repositoryURL]; + + exit(0); +} + +void handleClone(NSURL *repositoryURL, NSMutableArray *arguments) +{ + if ([arguments count]) { + NSString *repository = [arguments objectAtIndex:0]; + + if ([arguments count] > 1) { + NSURL *url = [NSURL fileURLWithPath:[arguments objectAtIndex:1]]; + if (url) + repositoryURL = url; + } + + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp cloneRepository:repository to:repositoryURL isBare:NO]; + } + else { + printf("Error: --clone needs the URL of the repository to clone.\n"); + exit(2); + } + + + exit(0); +} + #pragma mark - #pragma mark main @@ -228,10 +270,23 @@ int main(int argc, const char** argv) NSMutableArray *arguments = argumentsArray(); NSURL *wdURL = workingDirectoryURL(arguments); - if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--diff"] || - [[arguments objectAtIndex:0] isEqualToString:@"-d"])) { - [arguments removeObjectAtIndex:0]; - handleDiffWithArguments(wdURL, arguments); + if ([arguments count]) { + NSString *firstArgument = [arguments objectAtIndex:0]; + + if ([firstArgument isEqualToString:@"--diff"] || [firstArgument isEqualToString:@"-d"]) { + [arguments removeObjectAtIndex:0]; + handleDiffWithArguments(wdURL, arguments); + } + + if ([firstArgument isEqualToString:@"--init"]) { + [arguments removeObjectAtIndex:0]; + handleInit(wdURL); + } + + if ([firstArgument isEqualToString:@"--clone"]) { + [arguments removeObjectAtIndex:0]; + handleClone(wdURL, arguments); + } } // No commands handled by gitx, open the current dir in GitX with the arguments From 80596add94dedaabd7381b049895eeaa5d322110 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Mon, 23 Aug 2010 08:39:57 -0600 Subject: [PATCH 072/110] Improved sidebar icons for Branch, Remote Branch and Tags Icons by Thorsten Seitz --- Images/Branch.acorn | Bin 1849 -> 0 bytes Images/Branch.png | Bin 546 -> 1078 bytes Images/RemoteBranch.acorn | Bin 1810 -> 0 bytes Images/RemoteBranch.png | Bin 513 -> 1083 bytes Images/Tag.acorn | Bin 1794 -> 0 bytes Images/Tag.png | Bin 527 -> 1300 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Images/Branch.acorn delete mode 100644 Images/RemoteBranch.acorn delete mode 100644 Images/Tag.acorn diff --git a/Images/Branch.acorn b/Images/Branch.acorn deleted file mode 100644 index 6e6498df6eab81e4b3f55f82c173d3b2665f9111..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1849 zcmZ`)2~ZPf6#h56i3#T-r*g<8Dg;TO96FVBII3U{AgCO5;*u<|nq=edMvN3IlBTtc zI;AQGgPmdv*s8TUV5uVtwcdENouN8bgrU`GZ3pd)Iu%R*L}bF){{QUm+y8ywizCyM>k5-`4;9|4P=I&}gLpsS)I&=kL}t2S0w-mtMS|ScgQxHq66UsEHI=COKPQQ;z(&)oyrf{gn6VDD8B}Cr;mRx5cz+n&%fm;f~~F<$uL= zb5}sXeGpC>ToK!vfh%C()K?MuS0Fr_&8EU-|4lxmz*Uxz4L9Pgh!(T*Dk~cXuE;YR zU{+&X_n$(N)@z@ zT%pwyEUUo-rWreX4fG*Hv{8l6+vw1)3E{^Cj&~d@mBh8sA>J@t29Ppw6bDJts76 zmnTLCZ!Q-9usipep*K+3jU>oZ4;7d8ZPq;K^BM999>iv-JwsO)UXTedeVc(lJDR}t z4|J_*IQ(Agk^blvEzPHk+f8vhM+#=2*?-;JcgUvb_FE_4-jjG^XkFS{2`R$4=hut9 z`;s2_U#?lxxGwF)+`qs6v#+81gHW^2@Mx@Z)DJtm`KfgwTi!MyQ9k_q+1OrYMAYk~$oDB_%HomS|ai(Qdbt zNR#8EqElW=6_va^uvK`+Mn~5bg-5>xw+-JpU-wnw^8Ad{j;@M z>6iA_e0jQ%r}=I?;amy-?eIr~=DK;G9jd3Z{`o@iG_CK%nHo_q+N&B{GM2q{&Xzg; zcROTH9g7Q7%K16hq!@~}5X=Mf!UC}vOpHmf z94r@G&i|O-&hO-R^H1~7@(1}p@rMPC0=uA1&>`rAeGdoE`M+?Ej2DlWcfrAb0cI{$0YYwt_kRnN0t7t{kHvJJ|YYf{TwndO+GfCENHtX&twWWyU;?XMJMeU&n z|9~EP@MJGag<3@@-m55Lp%*Rj&2CJ#rRu=We)HZp?|pA}-+urNa?&*QfCS_X$5NsZ zX>5E#YW#=*j-m-cG$mEr>`o*GL4$Mod*|4C4}n`&!+ZO8vUjbT(zcohg#AF^N1E9x zu3rn}7Ut74&?PWBFvy`A)aPP5)V!Xd&78LdA?xQ(9m zjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7n6CX+@=AhmkT}X@VSsa5 zNKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4u2gC8Vs5ZNKg<(1Ywx4P(X$} z8Zk7oaz7)h1{;%mGIb0elo`y@REhV0!YX7mow*Kg`j6Yk{C^kZ_loDAC;~5R;K-S}ZBudY5TRwI zZgZ{z7r)Vc@V0JiqkcI21Xw()7Ohe>pCG&e9Cn9#9_T5U)0URaIZ}r#pOd=j%3@N? zP}@UNQr9KdWlI*bnN?!xcG#KI9c~<G)7`T49;*?vwM)`6G$ zZ-2nN{YAidi-`aL0B=xCR7L;)|2#ZAK|?-5Mn6MCLqkYEMn*gdKtVu3K|xb)I$V4|XN^T`YiodjfR>h)KtVr1K|n!4K|(@8Mr$N%p*n1$ zI(W4|fPjF4!bO6@Mxvskqobp{ySvWL&VQWeBPsv@02XvoPE!CL$;rvd$;ryf%F4>h z`}_R-{QUg<`bX(d0001HNkl delta 532 zcmV+v0_**@2%-d#8Gi-<001BJ|6u?C010qNS#tmY3ljhU3ljkVnw%H_00GoVL_t(I z5p9#PPZdEB#=qUY^X=We#{&rkL$FfqIYUV#xF5AOKp^fvR%&1PS(Gn+F-QGY|E!|h?d}jVOUS?_RtGxk^fK7iT6pgT z@gz!4qI*7>oYZ1#*r`wzsxQv(xFwY^r??u-;}o z?g(&LnS76zdw+Ad%=_59cvi*Z-1Nl`nQH(`Xweg4@z&e&z}nPDyxN<`?fY#M97;k4 zfkdZCqai$=c&*}qm8lPq-u&0#dVqJs_;mby0PyDL0=#RK5Y^y%KFHFG|R} zqje; WXzw0^L=7|m0000tZXAQGmd)~kvNjP|f%>$EB=b#$!PP(kZpYqc`gTdMsNkqKk_|FgSq-}~Ns`+xs? z|5h4xG|P#_R}mhH@dZA ziPor%1W6mJ%8VvPOY5jyf+I>v!myHH)$}T=WPyn`aQOx;Q{o28869IPEg-BgKmkly z!d5dDb}qD(u?E7(7BOzQ*p@C8#imQ`g;LyKh4&~FAO!#r2rmGF5CBm4MBoGn;wAGu zG6rq?5Y$UA7?pVt9|GKV=m~t0P%lixs0^)0q?dl;7#>5WcB$faOdSq35hdO5^w)bt2hLr!zpQ9^(mdI(?ODRpl~@E&xE6f~G3CX2N4)RWztib6ERI0t+H#!m8*NukGY7UZKg+Nv61f@EM;W$RGAWT)X zp`R4*oUW(q)XiqnZ`+e;y)wKYhoUPxC}b7O98uJ-nM9#f=JJ&!Tb zs~7`E=yX;&tOv?OX`rpmubf`t z77%b9gqsFW#;q;DlQ3fJs|ej25MDz=g9^|3Z}K4pp0b2&coFYJNX*I8YU}&X6lB)J zUCnCP7M3{UN_a%%#Hi>=lc!95D<(EBUN|jb$x51~;pUX++-0pK^i%~dEK=vtoSrax zN?p$AjV6j^DNVkfsPeSPe9BsZM~*{z8jR9$L>XC47^)~aV>WOVcrXdQ8J6bYmMRzx zwTRRaEL(wxk8^hS8jQJwad#tU^()FJ8G{O+UgIK{M)8FaBRjiF#084(Y9jF|<;04NCJCu+Y?RDyoYxp4 ze1-&D9^J=%7yB6ET zqFAvVN8aH2)rk?GHLGK}7uOPLN?iQRcV_t&zdngo_|6*F!7~c~V`9AF`n41G&a{8F z-My+09^5zBYWf&InP{^G+G<7J2k_}pc{hb|b?6L-_^jp%JK=(4fv&&lh<U`n zjMW2{s9XKZI@VSk!H-QMbJ9<3vg|)v$gB8iB=vYP|HG;GFPZJrx9@c@IWP7Ip2&Xq z>U)b{589&|o--`3i>ZwX8}S|4IJh(GiR<0MndTjlw{Mh<4BWBY4}J_>Ng{$0YYwt_kRnN0t7t{kHvJJ|YYf{TwndO+GfCENHtX&twWWyU;?XMJMeU&n z|9~EP@MJGag<3@@-m55Lp%*Rj&2CJ#rRu=We)HZp?|pA}-+urNa?&*QfCS_X$5NsZ zX>5E#YW#=*j-m-cG$mEr>`o*GL4$Mod*|4C4}n`&!+ZO8vUjbT(zcohg#AF^N1E9x zu3rn}7Ut74&?PWBFvy`A)aPP5)V!Xd&78LdA?xQ(9m zjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7n6CX+@=AhmkT}X@VSsa5 zNKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4u2gC8Vs5ZNKg<(1Ywx4P(X$} z8Zk7oaz7)h1{;%mGIb0elo`y@REhV0!YX7mow*Kg`j6Yk{C^kZ_loDAC;~5R;K-S}ZBudY5TRwI zZgZ{z7r)Vc@V0JiqkcI21Xw()7Ohe>pCG&e9Cn9#9_T5U)0URaIZ}r#pOd=j%3@N? zP}@UNQr9KdWlI*bnN?!xcG#KI9c~<G)7`T49;*?vwM)`6G$ zZ-2nN{YAidi-`aL0CG@FR7L;){~}(IJUl!qXq+r*oG)vgLqkJGMn*_TNGxfcFKV4I zYo0|#MMy|UN=iy8W|%5wnL$B8K83$ekHce}$!lwCfPjFOmX;}HnKXaBKtV!5K|w-7 zLSLxkV5sDCw(Wp`fQG^EqN1XsqocdKyMNBk&Pkh3n*aa+7<5ujQveh`}_O+{QUg<{05+d+yDRoW=TXrR2b7;kJk=>FbDvlYTbL*UC00bq9d9>@9{$5 z0JvF!A(GJ(R3z=$xK!llvE@|6&0b5uFmv$R5e-s6Sn1OKXPzsWUZ#|apqvYf3M%wF r3weh!I~48c)eY~Uzq}m`<6AB+cvc2O_Dqm&00000NkvXXu0mjf&$|oe delta 498 zcmVYD;{Lk*~x(Bypc6MiHemgUp3KEXy=L0Pkiy06K>V zCjqxmu{Zg74lwQmL4gxuBSZnU_t~NJ|4SxfQ;Vo;7@)BY= zwdyw5xM4a1L`p~ysPQ=YQ;B#)nT8C^vwjeRY oCXDY3>mSGm1V$TWf|1qG%eorP`4pVoPR{E4eado71;uiRa0E23`H zny3|HwurPiQRAOPT!!(_k}=&-!KraDwnd|3Y#N=Is8gnkO7~ikluX~t^}fFE_x-+m zzxREw+H9aXUM9PS2vAHY3JMla2nh|F7>-9oW@HdrGp)v>@>p_p9;2}sDHC5tu^i2q zs`M+R%%{1gyu7;W0!Ku)Zw7Cj7RK_XK<( z^XT+_A)Mv)X_+a~w9E!o1hNJT;dquJjlA7VX+ODxI*|7q4o8TR7}E)HID(ags=Aia z@L=N(=#5em#TK5dhT_s19_miAcHnS?Dv5yqpE(dZ*oTI}1P?{mBXDWfL?xkMc%Cs9 zldPULIY$vni?NzwAxV&uC?gFP3P5nO!-42pDhpjb)^eQu9q=T5{Angn?%mZvr2A#FZxxZ4uOJdXKgQn;fcO82^) z0dz}AxDV1NgFoZmoxq;`z>`&)8q%bvav6(>SL5Lt7|n1r50A8% z(Nd)v1Ick}eA2jJU#~&V<&3WzdAqn|iH0$$@cA~6X60nzJ`lYhdAL5MS<*ST?Xfz2 zI9D|LQkKOZ5MA+tCAGlAMxAriLk63FA>*9WS_HOpRx=(95o6N^U z27jjek32d2jUsYbdM?R@#??PpwHDWAF50srt?y~e`T5no2kLregdJOTD`$CAPoLO@ zxN=+*y`0wCetp%8t=aCrQyVuk+j~MX|7uw=>&XU1o4O{u_tc;3od%Y+zR-E=TAU%R zm$x6Tk4ro@6#ne*&DG-8D_3uRcdzz%s%yjf@9))irbf`#_G{i-zafbQD|>O|jhd#` z4+Ll`OM|7BK6jqD{M8Mt!rN?~~LmqQENEn#b;9;q|VoD3Zh45Y0MT6^Weq6cVK_?f0qxj>%w z{Bh71L~QMWqy35-io&PvF6GFeRXiAV>W!O&1rzMMB;!E>$O5@Q1uB6Sn1CHLf+o-m zT7U;xf#?J`(HUqmx(IzARiPGi8`^>%K|9b3XfN7_{)$CmahL>~j?KlgvBg*kR*F># rR}1aJO~UQM&xMDChlL%YGLcqf6tN->HZU9l-^K46SubC&entF$Po;Ds diff --git a/Images/Tag.png b/Images/Tag.png index 4d72ca61d5c8625b27d5775976203ae9851a5df6..6c5140758abbf7ede7056144d0952a906b7ada11 100644 GIT binary patch delta 1292 zcmV+n1@rok1e6Mp8Gi!+001a04^sdD0`6%;Lr_UWLm*IcZ)Rz1WdHzp0fki0YZE~f z{x)u@&>{$0YYwt_kRnN0t7t{kHvJJ|YYf{TwndO+GfCENHtX&twWWyU;?XMJMeU&n z|9~EP@MJGag<3@@-m55Lp%*Rj&2CJ#rRu=We)HZp?|pA}-+urNa?&*QfCS_X$5NsZ zX>5E#YW#=*j-m-cG$mEr>`o*GL4$Mod*|4C4}n`&!+ZO8vUjbT(zcohg#AF^N1E9x zu3rn}7Ut74&?PWBFvy`A)aPP5)V!Xd&78LdA?xQ(9m zjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7n6CX+@=AhmkT}X@VSsa5 zNKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4u2gC8Vs5ZNKg<(1Ywx4P(X$} z8Zk7oaz7)h1{;%mGIb0elo`y@REhV0!YX7mow*Kg`j6Yk{C^kZ_loDAC;~5R;K-S}ZBudY5TRwI zZgZ{z7r)Vc@V0JiqkcI21Xw()7Ohe>pCG&e9Cn9#9_T5U)0URaIZ}r#pOd=j%3@N? zP}@UNQr9KdWlI*bnN?!xcG#KI9c~<G)7`T49;*?vwM)`6G$ zZ-2nN{YAidi-`aL0Qpc%R7L;){{R30W@ctvTU%&oXl7<+Wo2b#WMpS&XO4t8j)pjD zYGiF`V{U3F?YieeHbXIL@ zWNm9>ZERz1Y-4V1V{>d?h;&YGYhr3@W`ApIW}1gWq=Y%TpDJi*XsLWNs*N_hh$g;| zCBT&=!IdP&p&`hqAj_^F&b1!UydBYy71P5U)uk2H$s5;_5Zjv%+nf;Iqz&Gr4&S5> z;j9eetqkI=4dSy4<+TguwhQRK3F*EG>Ani=#t7`k2<^uR@6QJC&j;|(2lLnk_J837 z_u&Nk=>q!d1Hr8dz-n+%F5B?<>lt)>Fe+D^Yrxe z^z`)f_4fAn`u(Cw)*Ju;0H;YrK~xwS1;IH^!%!3e!11EQNI~f!qM@PS795?k&^X8f zlnvzk_`k;t0D$Ic3(H3V^xIdB+<)K30`&5I9m`u73+ToAVw1Zt7U)%}W{b8(z&{QHX1qlIa>xJx002ovP6b4+LSTX= CzI(R- delta 512 zcmV+b0{{J#3XcSk8Gi-<001BJ|6u?C010qNS#tmY3ljhU3ljkVnw%H_00F^CL_t(I z5p7aEO9Md=o!x9q1Otj#q_Y(Zts ze1H2`t#X6)FcOODE{^0j$Wp#dX zxSe{j83XW)jP Date: Sun, 29 Aug 2010 00:00:34 -0600 Subject: [PATCH 073/110] Improve search UI Previously searching would filter the commits in the commit tableview to only show the commits that matched the search. However the context of where those commits exist in the history is lost. With this patch all the commits are shown but the commits that match the search are highlighted with a light blue background. In addition there is a forward/back button to step through the matches. A new search controller: - keeps track of the matching results - finds the next or previous result - displays the number of matches found or "Not found" - shows/hides the # of matches text and the next/last stepper button - shows a small bezel style window with a rewind icon indicating that the selection has cycled (pressing next when at the last match or previous when at the first) - sets up the search predicate which covers Subject, Author and SHA (previously this was three different searches) - stores search results in an NSIndexSet to make finding if a row is in the set faster (needed at drawing time) Highlighting of search result rows is done in PBCommitList -drawRow:clipRect: PBGitTextFieldCell is a subclass of NSTextFieldCell that disables the cell's selection highlighting. Supporting Find Next and Find Previous (cmd-g and cmd-shift-g) menu commands required changing the action method of the menu items because NSTextFields (seem to) actively disable items in the Find menu. rewindImage.pdf created by Nathan Kinsinger --- English.lproj/MainMenu.xib | 170 +++++++++-- GitX.xcodeproj/project.pbxproj | 20 ++ GitXTextFieldCell.h | 16 ++ GitXTextFieldCell.m | 20 ++ Images/rewindImage.pdf | Bin 0 -> 7819 bytes PBCommitList.h | 2 + PBCommitList.m | 63 ++++ PBGitHistoryController.h | 9 + PBGitHistoryController.m | 31 +- PBGitHistoryView.xib | 512 +++++++++++++++++++++++++-------- PBGitRevisionCell.m | 3 +- PBHistorySearchController.h | 46 +++ PBHistorySearchController.m | 313 ++++++++++++++++++++ 13 files changed, 1057 insertions(+), 148 deletions(-) create mode 100644 GitXTextFieldCell.h create mode 100644 GitXTextFieldCell.m create mode 100644 Images/rewindImage.pdf create mode 100644 PBHistorySearchController.h create mode 100644 PBHistorySearchController.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index df9ae8e..dd75fb2 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -3,16 +3,15 @@ 1050 10F569 - 804 + 788 1038.29 461.00 com.apple.InterfaceBuilder.CocoaPlugin - 804 + 788 YES - YES @@ -1104,22 +1103,6 @@ 199 - - - performFindPanelAction: - - - - 200 - - - - performFindPanelAction: - - - - 201 - performFindPanelAction: @@ -1368,6 +1351,22 @@ 966 + + + selectNext: + + + + 967 + + + + selectPrevious: + + + + 968 + @@ -2332,7 +2331,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{864, 473}, {238, 103}} + {{762, 747}, {238, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2498,7 +2497,7 @@ - 966 + 968 @@ -2665,6 +2664,13 @@ + + NSApplication + + IBProjectSource + NSApplication+GitXScripting.h + + NSOutlineView @@ -2688,12 +2694,14 @@ YES controller + searchController webController webView YES PBGitHistoryController + PBHistorySearchController PBWebHistoryController WebView @@ -2703,6 +2711,7 @@ YES controller + searchController webController webView @@ -2712,6 +2721,10 @@ controller PBGitHistoryController + + searchController + PBHistorySearchController + webController PBWebHistoryController @@ -3148,6 +3161,7 @@ rebaseButton refController scopeBarView + searchController searchField selectedBranchFilterItem treeController @@ -3168,6 +3182,7 @@ NSButton PBRefController PBGitGradientBarView + PBHistorySearchController NSSearchField NSButton NSTreeController @@ -3191,6 +3206,7 @@ rebaseButton refController scopeBarView + searchController searchField selectedBranchFilterItem treeController @@ -3244,6 +3260,10 @@ scopeBarView PBGitGradientBarView + + searchController + PBHistorySearchController + searchField NSSearchField @@ -3617,6 +3637,78 @@ + + PBHistorySearchController + NSObject + + stepperPressed: + id + + + stepperPressed: + + stepperPressed: + id + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + NSArrayController + PBGitHistoryController + NSTextField + NSSearchField + NSSegmentedControl + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + + commitController + NSArrayController + + + historyController + PBGitHistoryController + + + numberOfMatchesField + NSTextField + + + searchField + NSSearchField + + + stepper + NSSegmentedControl + + + + + IBProjectSource + PBHistorySearchController.h + + PBNiceSplitView NSSplitView @@ -4542,6 +4634,34 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CIImageProvider.h + + + + NSObject + + IBFrameworkSource + ScriptingBridge.framework/Headers/SBApplication.h + + NSObject @@ -4678,6 +4798,14 @@ AppKit.framework/Headers/NSSearchField.h + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + NSSplitView NSView diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 5cb9bd1..f95d9c4 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -68,18 +68,22 @@ D858108411274D28007F254B /* RemoteBranch.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108111274D28007F254B /* RemoteBranch.png */; }; D858108511274D28007F254B /* Tag.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108211274D28007F254B /* Tag.png */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; + D87127011229A21C00012334 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D87127001229A21C00012334 /* QuartzCore.framework */; }; + D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D87129FF122B14EC00012334 /* GitXTextFieldCell.m */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; D89E9B141218BA260097A90B /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */; }; D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */; }; D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */; }; D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD051134AD2900E92D51 /* MergeTemplate.png */; }; D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */; }; + D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */ = {isa = PBXBuildFile; fileRef = D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */; }; D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E105461157C18200FC28A4 /* PBQLTextView.m */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */; }; D8F01C4B12182F19007F729F /* GitX.sdef in Resources */ = {isa = PBXBuildFile; fileRef = D8F01C4A12182F19007F729F /* GitX.sdef */; }; D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */ = {isa = PBXBuildFile; fileRef = D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */; }; + D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */ = {isa = PBXBuildFile; fileRef = D8F4AB7812298CE200D6D53C /* rewindImage.pdf */; }; D8FBCF19115FA20C0098676A /* PBGitSHA.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FBCF18115FA20C0098676A /* PBGitSHA.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; @@ -307,6 +311,9 @@ D858108111274D28007F254B /* RemoteBranch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RemoteBranch.png; path = Images/RemoteBranch.png; sourceTree = ""; }; D858108211274D28007F254B /* Tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Tag.png; path = Images/Tag.png; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D87127001229A21C00012334 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + D87129FE122B14EC00012334 /* GitXTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXTextFieldCell.h; sourceTree = ""; }; + D87129FF122B14EC00012334 /* GitXTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXTextFieldCell.m; sourceTree = ""; }; D89E9AB21218A9DA0097A90B /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = System/Library/Frameworks/ScriptingBridge.framework; sourceTree = SDKROOT; }; D89E9B4F1218C2750097A90B /* GitXScriptingConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXScriptingConstants.h; sourceTree = ""; }; D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitGradientBarView.h; sourceTree = ""; }; @@ -314,6 +321,8 @@ D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CherryPickTemplate.png; path = Images/CherryPickTemplate.png; sourceTree = ""; }; D8A4BD051134AD2900E92D51 /* MergeTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = MergeTemplate.png; path = Images/MergeTemplate.png; sourceTree = ""; }; D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RebaseTemplate.png; path = Images/RebaseTemplate.png; sourceTree = ""; }; + D8B4DC551220D1E4004166D6 /* PBHistorySearchController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBHistorySearchController.h; sourceTree = ""; }; + D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBHistorySearchController.m; sourceTree = ""; }; D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E105451157C18200FC28A4 /* PBQLTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLTextView.h; sourceTree = ""; }; D8E105461157C18200FC28A4 /* PBQLTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBQLTextView.m; sourceTree = ""; }; @@ -327,6 +336,7 @@ D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+GitXScripting.h"; sourceTree = ""; }; D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+GitXScripting.m"; sourceTree = ""; }; D8F01D841218A406007F729F /* GitX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX.h; sourceTree = ""; }; + D8F4AB7812298CE200D6D53C /* rewindImage.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = rewindImage.pdf; path = Images/rewindImage.pdf; sourceTree = ""; }; D8FBCF17115FA20C0098676A /* PBGitSHA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSHA.h; sourceTree = ""; }; D8FBCF18115FA20C0098676A /* PBGitSHA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSHA.m; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; @@ -477,6 +487,7 @@ F5E4DBFB0EAB58D90013FAFC /* SystemConfiguration.framework in Frameworks */, F5C580E50EDA250900995434 /* libgit2.a in Frameworks */, D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */, + D87127011229A21C00012334 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -534,6 +545,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */, + D87127001229A21C00012334 /* QuartzCore.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -580,6 +592,7 @@ D858108011274D28007F254B /* Branch.png */, D858108111274D28007F254B /* RemoteBranch.png */, D858108211274D28007F254B /* Tag.png */, + D8F4AB7812298CE200D6D53C /* rewindImage.pdf */, D85810541127476E007F254B /* StageView.png */, D8FDDBF31143F318005647F6 /* AddRemote.png */, D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, @@ -825,6 +838,8 @@ D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */, D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */, D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */, + D87129FE122B14EC00012334 /* GitXTextFieldCell.h */, + D87129FF122B14EC00012334 /* GitXTextFieldCell.m */, ); name = Aux; sourceTree = ""; @@ -952,6 +967,8 @@ F52BCE060E84211300AA3741 /* PBGitHistoryController.m */, F574A2830EAE2EAC003F2CB1 /* PBRefController.h */, F574A2840EAE2EAC003F2CB1 /* PBRefController.m */, + D8B4DC551220D1E4004166D6 /* PBHistorySearchController.h */, + D8B4DC561220D1E4004166D6 /* PBHistorySearchController.m */, ); name = History; sourceTree = ""; @@ -1154,6 +1171,7 @@ D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, D8F01C4B12182F19007F729F /* GitX.sdef in Resources */, + D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1301,6 +1319,8 @@ D8022FED11E124C8003C21F6 /* PBGitXMessageSheet.m in Sources */, D8EB616A122F643E00FCCAF4 /* GitXRelativeDateFormatter.m in Sources */, D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */, + D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, + D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/GitXTextFieldCell.h b/GitXTextFieldCell.h new file mode 100644 index 0000000..4bd3ec7 --- /dev/null +++ b/GitXTextFieldCell.h @@ -0,0 +1,16 @@ +// +// GitXTextFieldCell.h +// GitX +// +// Created by Nathan Kinsinger on 8/27/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface GitXTextFieldCell : NSTextFieldCell { + +} + +@end diff --git a/GitXTextFieldCell.m b/GitXTextFieldCell.m new file mode 100644 index 0000000..bc95397 --- /dev/null +++ b/GitXTextFieldCell.m @@ -0,0 +1,20 @@ +// +// GitXTextFieldCell.m +// GitX +// +// Created by Nathan Kinsinger on 8/27/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "GitXTextFieldCell.h" + + +@implementation GitXTextFieldCell + +- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + // disables the cell's selection highlight + return nil; +} + +@end diff --git a/Images/rewindImage.pdf b/Images/rewindImage.pdf new file mode 100644 index 0000000000000000000000000000000000000000..40066caad4c3dc16c4d64cac03d1f4ab1a9a0166 GIT binary patch literal 7819 zcmeHMcT`hbvj?Pjks_edCDNn_NgxeGlrGXkF9HD)dICx4B7!tU6bl_hq)3rolqMob zFVaC2kR}L-fPgf83CO+P>wW86>#g@&X+(p6TK082{K3pGry zOwT`Aee|ZGksbm70dO`>^m1|lpe7n?Pjmo4Ng^ZwsOsoKMB_;rgSw>#~xESTD>8@LNnKTE+P@k6Lmpqg2us)x`$&jl8G zQuv6h7f&{bI_$BrgE*@z-dpa~sS)#OZ`zEF1Nbc7`}3!1*jYIik!Djp3CePeJ>xsO2|7d$Z^`Vp67_c!{pIpAu)ru z*M(1rZ^xI}=bTg!N&+*=P0Cb-v<_cTV?$?t(_YUw(};9PpXlo}W6MFEuUB!JuRCX5 z?tdfF4EmYLNUP#;ZfHEwkz_gf zHeDAm$)^42ZQ%l*4IK2oB?3+10VsY=tv~!qVY;NS2rA%j6C9B z^9mWqKl94s8!#mW1;wjJYdWrs%;6VMFRxJ^qGjL!S^vMCe31f~$x%@L?pkEH$OwX^ zAO{b6@2C9(Rq#)T`ai+?7l`ygWwfWGEm{qa^7$LwfPJ`sCSh}uQDCz7{O{<}|F2oQ z#&pig#+X%0xRrnVHXwq(>S++5N~Bo~(9A#H^FDKMXii&p&hGoBjK`Rg?wo^EZT$AB z9%`m1G3FjQqh4dXwVfL~o45d6sPvC*9Tv`4wV!#{2hP7tTcVr|O!IfW{c_fa|=>G=hP;f~*Ba0w*GZsZKKUc}wyP)6E}t)Z&kBIlj=0Mz$oF z2#(L5V~cbEi`+Hg*U#!ROSZ&;X4ho%%rc_X2fUx#-?cTd7Gl+yz7*MMEoJ@`#*>S# zx9f8@z>CtUrFyp-U?y%}5Q%9vG`rqnomOJJL6I_KLKJdRqf}Vm zi2*Yb(^kcHOWDh|Xb3BK>`MjDI%ArV=>70(>&KpPo^Y7cGzzmnU7a}8HMN4M&=g~d zpq3kfm00FQh12Bfr0Q`PQ}bsl+71ojmz39$6%%?D$h`iX=t(3vR$KYd$*|X1hA#~o z7e}yZ2r7-oefj3RFTPk-x*24{&6D+$w71jsM0xF4S!#RB^9?V(wwrtQ9#)TZ7nWMT)Z{i>{4ed(MT>7DgN1RZca1RzX#yS=6(T#MsqzU(`$Z zWBvCz^)*lxJ06!%N`I3o=nJC~YAVM~D&9u{V`NeeSGcH_-6D)2oo>Y` zXO9ex-auc9?5*Q?nt6ZO0Wn+e{_)%CabcxL(-V|WR0UYNyyg_qj@0{if zll(H@`j+YbX}dSsCs-*zhHAHri3fkMG!V54Va=$UxsiT{tA@opd1GV^DPQ)C`wz9p z%exDxY3e1b%a?C&pPpXGXWl#&TX?n$J3z(rlA51WuDrxJ%QH0mWT8`7d`PQS?d-9m1bXpM$f{m1h|-=(@6i4jj2BRu*R>YA4y>7UhHnvlf4 zby=5q0zcLTkW7o1j~!%J;;0M@=YrDr!Sne$CRqTv|yY4ReVzM-U z9?BKj=`g$!%(^)_V7)al)08;xUQlyS%9($<|iJ-Km>H#KS_HD%~^= zW4m*X(dRr!#8NpkOIp6Tx;iuSsoEU)>W|M_1{%>x5n{}$G)e%Y*{7c!XszNjPuFV; zv8P=VMLXz<)%f(Xg~lg$_jinJERBs?L~64<^lqLkd<X}Tr`5ximHT8MB1GjZ1}M-1{|ap$Y6DtM9y?iBl>fHF)%)Dmu#nj(6faQ|h+ zNQ=;Mb~ef|)9XWN6kaMfK z_`0l6W0tvi!)~JL6?%!w`KHgR>RYaxdF@Pe=%ifToR00{8(V$n_A$>uA?p@lIo(|H zUd|xzVay?GH&f`d`7%yj&NqXU<#UmlcM^8za=rKhHdjV)R`LPC8Q=O8q!x+_oX1OP zq~~JTOjZhg8efVHXN}|-1BC3Y zw&e+}IL3)BF!^iK^EfYSs#&HRRBQ043oe;(KKYK9qhp$W9v0n;j8fyB=&|MY_Kmuv z28INNf-h&{QS0 z*A+oZue%EqP0T5^S9Z77+U!kyjDW&Hos2ceS6ux&PWg`$C>d^_lBSHIm+9c)a5hs7 zrdZ~=TwAfbLzC^kJ>%OaWeQ*npAZokbA5})n={B62wL?`9^`xkyP zpN&?RdBZkQbZB`2j7D8nw??#Ygm|fyOOlpV&F+`pFt374djn$&i?&4cdDBV?BQuD; zz#(bjNRxb@w0PG1kGX?5%i2ng(o38x@@+*GcXfim?=OUIP0Hlx8V?%lr+Y|#4seS+3mOW9F(8%#pi8r~ z@dmA!E}B5_lk#Sl<;Tv$DpnL}ca1blia0s~6TT&znbNO6LLmFSDTJxG;CAOJ*Ry&$ z>!Ns$QJrF3WYtZ(n;iFEr}%ZB3B{!EODc{qn%EXQJm*dqW=P0$bkk+v(`T+$UJkT` zcOL4kQFgym^gYo=^and@ z9jl)KO~`{)b=YKXCgh&)qG)qlxkhK((0~+bT$FgiJ^3TXBbi&4&&RdVMcAV8x@Uaw z5f9>RP61&(2QAMhz@toIROuYh=W|nK+kKC^PF@m&Tzz(&Kj_f)?Fu6o!lLrVz3mp0 z=J`iPom50VS0>t`rumY0`AxL`p?XK|v#2rD5V%)8^WCC!Y)_W!B?`dhsJ92{?Pj+I znADTw8P*g+FClzdj+@;B-Ze-y$bP^Ka&w8lI3+qlmbYN5PL=w9LPol)sxLR^^$w zpPwq7r6|8O%p3#_8U1tvvzhw1Ba}YNFafPAp7nj?-G@F@O)uY99ml8jIEh1PL5+>P z3?7;;7pev$wiRNJhgkBTK<$QzzAok+N~`lE%G=c+Jx$98PBc_wbM!hvDN;JgGXslI zNPAfp)2m9SbSblMAyPPQYyP!h2hS>Z@i+`r54a#eKf~Le&;Dotp{eFS!ZBaU6=|fy zoqRFJBn=hb7%Ydm?Ewu2$4O9hYd96Zf(Ezos@pz2n_@Z6YQT)tt0nZ>z)(WZ=Dw}ggmmU4omXLc` z-e&U1(U&t%ZsiSMm8wYTJbs6p_f_RfvB#cK!LT&JD_6Q?3YPocu}ra=Kerz1aqSn+ zNaN3&;>!C>0qdcn6IipjCQtmqaLZM_eCOgdRrWS6GmW*X#rv4Fz-Wtt^N&?}NpGDo zCA!0L8lPK!_~}`XNVE2LUXU}!;vKGWuXp*@l*o^qL3KkGl6gL|J?P|!i>XX`0uwi_ zqkf}J=Q15~?)X`kU6oLHUxE!pHQ_(Bm_Fw;3{f-bOIxO$|xq>vf)1 zI*BdYcpme9xV7(;Fe0=(Oc@~~G#P~_3fp3}!cXy;VETS!_&S9)dZ@PZ%eozDK!)HK zr%DI;6thwYN7{`TRlp~R(r2(y=2#(s45Sob7PcjDqg|om?MqBq1mP_fnuErcU21#t z`j3FdneSGa!ofD#iq547xjF}aeMEXPuI6?gZu2PXS+1#aev_?NsIf2dbo5Swbqyv3 zT{7?_-ReSXI4OT-S3pC(SD^-cIdijhBVP^iKwWs<|VU7GK+T zyS-T&%~X+z0i|>DvAW7GTxe;9Z+^SF91*ngCXp(3}8tJn500Oo<#5MpOLFWB+AawgFr6D|E*5nt2#*x z1=$$VpCpuYi@ZFU;QL8vfd7RV1plN4wMh)hf8+;447!}z6pnp|VYA=xA2xGlD)x@z zS2xXdQ0as1ve-B?jPRAKMA=EJ4`5;QpM}dZ!lx#>#YR;YQ|W$OJL&ty4tOcVOhsfg zSHvcjU1GTdt684$>1F5D)lvA8KhATEf)U>XS-VC(#n^;=%;M;BMbT*|oZ|N5KNKKB zh9e8wg0u?P37dW&hkTg>&5i2)w!MnI@)CN=6X=3>FN~`t42u;mvAffovQmZ1jirh< z5f6_|4y`QQkeUg>yz{EhBOk8a>OVh$`j9@;5PFV> z1N!xw_3>w1+25eAj#(YmI{nzdeOQulIWB+KXysCnTNI+z4t0%Sc2Q?g6Z@?)jK*Jh zkgZ_C%Si8o&mA`V(Z2UfDsQO@Kuo+0Tnq_}7j=)SP^01sbuWa|MR7KKAb8xQgl6Dn86 z&%U0Hui!d4*xNiw(6YP|-RF7VSS{wMk8gFt0@wKk<5=)a5cEz1p>TUy!YaBwR`k}f z*OP{;pEQC!%)s!m6qkUr=O!e(B+CW}c{d{9Mv1ZZyG|FkKj&26pE2Cjv0Pi;vF~WG zoe%{Jd*1wb>PGBq$>n=P8o5U%tX-Q9Cr5{h_PE~N6709OPN-f3UOsQ`U85Snu%`Eb zv%SaQ#zw#^F*`_d1ru)T&PdY^`_#tGk0~NlK$r36_)1rO_obt$=nO0&pNhS<+y6^B z);aAeVu#v9F84$p5}E?2rsVMq^F28$8rK^W(;ozH5}~-q>Xc*;r_J+ z06t)g$(;QD)~$phqFiwH`|St9LEpg$jVCzbumB)wyZ&{@JxCTJS}0q9jy}MI#Jfwv zNOSZ&Pri+TMGta^)WOSyh_b8{h(yyPq!3^P6byx#fk3B8|9{RT^YaHk zozy?D^ROi~_rUwz2A~qDr$;22q)g)W0efqbyB|2aU$6gqHSorxG4vn+>6Hfb=LZ0T zLZzVq4B)2>4u+9Z82JOh9>_p&2nnLU%V09(^!Ile2qZ;9_a8F26v@_q$PlpK=7C8d z{Bs^yTKcznFc658uK&Islyvz|84LmcO)pp)N<#DR_d;ZTp9lRH44^WI-}J&jkl)sW zA)vqMg@Zu8h`tP>D!BW5IAmUMuE@=E-hgaXxm-Ku|PK?CiNY4DT8>EiK;7Fdm z*RfGoCi%7;goG?a8UnS2LO>9VjI^zkos2C?8f*(j!{Ih)j6D5+p0f8sNownmTzAi5 Q;8GANdLbbd9aZ}O0mYj=rT_o{ literal 0 HcmV?d00001 diff --git a/PBCommitList.h b/PBCommitList.h index d83dd80..3829a41 100644 --- a/PBCommitList.h +++ b/PBCommitList.h @@ -16,6 +16,8 @@ IBOutlet WebView* webView; IBOutlet PBWebHistoryController *webController; IBOutlet PBGitHistoryController *controller; + IBOutlet PBHistorySearchController *searchController; + BOOL useAdjustScroll; NSPoint mouseDownPoint; } diff --git a/PBCommitList.m b/PBCommitList.m index d5ea35d..dbf33b4 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -9,6 +9,7 @@ #import "PBCommitList.h" #import "PBGitRevisionCell.h" #import "PBWebHistoryController.h" +#import "PBHistorySearchController.h" @implementation PBCommitList @@ -122,4 +123,66 @@ return newImage; } + + +#pragma mark Row highlighting + +- (NSColor *)searchResultHighlightColorForRow:(NSInteger)rowIndex +{ + // if the row is selected use default colors + if ([self isRowSelected:rowIndex]) { + if ([[self window] isKeyWindow]) { + if ([[self window] firstResponder] == self) { + return [NSColor alternateSelectedControlColor]; + } + return [NSColor selectedControlColor]; + } + return [NSColor secondarySelectedControlColor]; + } + + // light blue color highlighting search results + return [NSColor colorWithCalibratedRed:0.751f green:0.831f blue:0.943f alpha:0.800f]; +} + +- (NSColor *)searchResultHighlightStrokeColorForRow:(NSInteger)rowIndex +{ + if ([self isRowSelected:rowIndex]) + return [NSColor colorWithCalibratedWhite:0.0f alpha:0.30f]; + + return [NSColor colorWithCalibratedWhite:0.0f alpha:0.05f]; +} + +- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)tableViewClipRect +{ + NSRect rowRect = [self rectOfRow:rowIndex]; + BOOL isRowVisible = NSIntersectsRect(rowRect, tableViewClipRect); + + // draw special highlighting if the row is part of search results + if (isRowVisible && [searchController isRowInSearchResults:rowIndex]) { + NSRect highlightRect = NSInsetRect(rowRect, 1.0f, 1.0f); + float radius = highlightRect.size.height / 2.0f; + + NSBezierPath *highlightPath = [NSBezierPath bezierPathWithRoundedRect:highlightRect xRadius:radius yRadius:radius]; + + [[self searchResultHighlightColorForRow:rowIndex] set]; + [highlightPath fill]; + + [[self searchResultHighlightStrokeColorForRow:rowIndex] set]; + [highlightPath stroke]; + } + + // draws the content inside the row + [super drawRow:rowIndex clipRect:tableViewClipRect]; +} + +- (void)highlightSelectionInClipRect:(NSRect)tableViewClipRect +{ + // disable highlighting if the selected row is part of search results + // instead do the highlighting in drawRow:clipRect: above + if ([searchController isRowInSearchResults:[self selectedRow]]) + return; + + [super highlightSelectionInClipRect:tableViewClipRect]; +} + @end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index f848c4c..8905277 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -20,6 +20,8 @@ @class PBCommitList; @class PBGitSHA; +@class PBHistorySearchController; + @interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; IBOutlet NSSearchField *searchField; @@ -31,6 +33,7 @@ IBOutlet PBCollapsibleSplitView *historySplitView; IBOutlet PBWebHistoryController *webHistoryController; QLPreviewPanel* previewPanel; + IBOutlet PBHistorySearchController *searchController; IBOutlet PBGitGradientBarView *upperToolbarView; IBOutlet NSButton *mergeButton; @@ -56,6 +59,8 @@ @property (retain) PBGitTree* gitTree; @property (readonly) NSArrayController *commitController; @property (readonly) PBRefController *refController; +@property (readonly) PBHistorySearchController *searchController; +@property (readonly) PBCommitList *commitList; - (IBAction) setDetailedView:(id)sender; - (IBAction) setTreeView:(id)sender; @@ -82,6 +87,10 @@ - (IBAction) cherryPick:(id)sender; - (IBAction) rebase:(id)sender; +// Find/Search methods +- (IBAction)selectNext:(id)sender; +- (IBAction)selectPrevious:(id)sender; + - (void) copyCommitInfo; - (void) copyCommitSHA; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 3f08f65..1de0764 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -20,7 +20,9 @@ #import "PBDiffWindowController.h" #import "PBGitDefaults.h" #import "PBGitRevList.h" +#import "PBHistorySearchController.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") +#import "PBQLTextView.h" #define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex" @@ -38,6 +40,8 @@ @implementation PBGitHistoryController @synthesize selectedCommitDetailsIndex, webCommit, gitTree, commitController, refController; +@synthesize searchController; +@synthesize commitList; - (void)awakeFromNib { @@ -298,6 +302,30 @@ [super keyDown: event]; } +// NSSearchField (actually textfields in general) prevent the normal Find operations from working. Setup custom actions for the +// next and previous menuitems (in MainMenu.nib) so they will work when the search field is active. When searching for text in +// a file make sure to call the Find panel's action method instead. +- (IBAction)selectNext:(id)sender +{ + NSResponder *firstResponder = [[[self view] window] firstResponder]; + if ([firstResponder isKindOfClass:[PBQLTextView class]]) { + [(PBQLTextView *)firstResponder performFindPanelAction:sender]; + return; + } + + [searchController selectNextResult]; +} +- (IBAction)selectPrevious:(id)sender +{ + NSResponder *firstResponder = [[[self view] window] firstResponder]; + if ([firstResponder isKindOfClass:[PBQLTextView class]]) { + [(PBQLTextView *)firstResponder performFindPanelAction:sender]; + return; + } + + [searchController selectPreviousResult]; +} + - (void) copyCommitInfo { PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0]; @@ -436,8 +464,7 @@ NSArray *selectedCommits = [self selectedObjectsForSHA:commitSHA]; [commitController setSelectedObjects:selectedCommits]; - if (repository.currentBranchFilter != kGitXSelectedBranchFilter) - [self scrollSelectionToTopOfViewFrom:oldIndex]; + [self scrollSelectionToTopOfViewFrom:oldIndex]; forceSelectionUpdate = NO; } diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 37d329e..4e83049 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -702,31 +702,6 @@ 266 YES - - - 268 - {{49, 2}, {57, 17}} - - 1 - YES - - 67239424 - 134348800 - Remote - - LucidaGrande-Bold - 11 - 16 - - - -1232846593 - 173 - - - 400 - 75 - - 265 @@ -737,7 +712,6 @@ 343014976 268567552 - Subject YES 1 @@ -788,6 +762,88 @@ 255 + + + 265 + {{611, 3}, {43, 18}} + + YES + + 67239424 + 131072 + + LucidaGrande + 9 + 16 + + + + YES + + 18 + + Previous search result + 0 + + + 18 + + Next search result + 1 + 0 + + + 1 + 2 + 3 + + + + + 265 + {{527, 5}, {80, 14}} + + YES + + 68288064 + 71435264 + # of matches + + + + 6 + System + controlColor + + + + + + + + 268 + {{49, 2}, {57, 17}} + + 1 + YES + + 67239424 + 134348800 + Remote + + LucidaGrande-Bold + 11 + 16 + + + -1232846593 + 173 + + + 400 + 75 + + 268 @@ -912,12 +968,7 @@ {852, 232} Details - - 6 - System - controlColor - - + @@ -1328,6 +1379,9 @@ GitXRelativeDateFormatter + + PBHistorySearchController + @@ -1709,95 +1763,6 @@ 291 - - - predicate: filterPredicate - - - - - - predicate: filterPredicate - predicate - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Subject - subject contains[c] $value - - - 2 - - - 301 - - - - predicate2: filterPredicate - - - - - - predicate2: filterPredicate - predicate2 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Author - author contains[c] $value - - - - 2 - - - 304 - - - - predicate3: filterPredicate - - - - - - predicate3: filterPredicate - predicate3 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - SHA - realSha contains[c] $value - - - - 2 - - - 308 - searchField @@ -2050,6 +2015,86 @@ 422 + + + commitController + + + + 424 + + + + historyController + + + + 425 + + + + searchField + + + + 426 + + + + stepper + + + + 429 + + + + numberOfMatchesField + + + + 432 + + + + delegate + + + + 433 + + + + updateSearch: + + + + 434 + + + + stepperPressed: + + + + 435 + + + + searchController + + + + 436 + + + + searchController + + + + 437 + @@ -2387,10 +2432,12 @@ YES - + + + Commits Scope Bar @@ -2614,6 +2661,39 @@ + + 423 + + + + + 427 + + + YES + + + + + + 428 + + + + + 430 + + + YES + + + + + + 431 + + + @@ -2650,6 +2730,7 @@ 28.IBPluginDependency 28.IBShouldRemoveOnLegacySave 287.IBPluginDependency + 288.CustomClassName 288.IBPluginDependency 29.IBPluginDependency 29.IBShouldRemoveOnLegacySave @@ -2680,6 +2761,7 @@ 337.IBAttributePlaceholdersKey 337.IBPluginDependency 338.IBPluginDependency + 34.CustomClassName 34.IBPluginDependency 340.IBAttributePlaceholdersKey 340.IBPluginDependency @@ -2695,6 +2777,7 @@ 356.IBPluginDependency 359.IBAttributePlaceholdersKey 359.IBPluginDependency + 36.CustomClassName 36.IBPluginDependency 36.ImportedFromIB2 360.IBPluginDependency @@ -2707,11 +2790,18 @@ 4.IBAttributePlaceholdersKey 4.IBPluginDependency 409.IBPluginDependency + 410.CustomClassName 410.IBPluginDependency 414.IBDateFormatterBehaviorMetadataKey 414.IBPluginDependency 418.IBPluginDependency + 419.CustomClassName 419.IBPluginDependency + 427.IBPluginDependency + 428.IBPluginDependency + 428.IBSegmentedControlInspectorSelectedSegmentMetadataKey + 430.IBPluginDependency + 431.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 48.IBPluginDependency @@ -2762,6 +2852,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2813,6 +2904,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2856,6 +2948,7 @@ com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2881,10 +2974,17 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + GitXTextFieldCell + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{9, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2922,7 +3022,7 @@ - 422 + 437 @@ -2935,6 +3035,21 @@ GitXRelativeDateFormatter.h + + GitXTextFieldCell + NSTextFieldCell + + IBProjectSource + GitXTextFieldCell.h + + + + NSApplication + + IBProjectSource + NSApplication+GitXScripting.h + + NSOutlineView @@ -2958,12 +3073,14 @@ YES controller + searchController webController webView YES PBGitHistoryController + PBHistorySearchController PBWebHistoryController WebView @@ -2973,6 +3090,7 @@ YES controller + searchController webController webView @@ -2982,6 +3100,10 @@ controller PBGitHistoryController + + searchController + PBHistorySearchController + webController PBWebHistoryController @@ -3028,6 +3150,8 @@ openSelectedFile: rebase: refresh: + selectNext: + selectPrevious: setBranchFilter: setDetailedView: setTreeView: @@ -3053,6 +3177,8 @@ id id id + id + id @@ -3067,6 +3193,8 @@ openSelectedFile: rebase: refresh: + selectNext: + selectPrevious: setBranchFilter: setDetailedView: setTreeView: @@ -3109,6 +3237,14 @@ refresh: id + + selectNext: + id + + + selectPrevious: + id + setBranchFilter: id @@ -3154,6 +3290,7 @@ rebaseButton refController scopeBarView + searchController searchField selectedBranchFilterItem treeController @@ -3174,6 +3311,7 @@ NSButton PBRefController PBGitGradientBarView + PBHistorySearchController NSSearchField NSButton NSTreeController @@ -3197,6 +3335,7 @@ rebaseButton refController scopeBarView + searchController searchField selectedBranchFilterItem treeController @@ -3250,6 +3389,10 @@ scopeBarView PBGitGradientBarView + + searchController + PBHistorySearchController + searchField NSSearchField @@ -3329,6 +3472,99 @@ PBGitRevisionCell.h + + PBHistorySearchController + NSObject + + YES + + YES + stepperPressed: + updateSearch: + + + YES + id + id + + + + YES + + YES + stepperPressed: + updateSearch: + + + YES + + stepperPressed: + id + + + updateSearch: + id + + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + NSArrayController + PBGitHistoryController + NSTextField + NSSearchField + NSSegmentedControl + + + + YES + + YES + commitController + historyController + numberOfMatchesField + searchField + stepper + + + YES + + commitController + NSArrayController + + + historyController + PBGitHistoryController + + + numberOfMatchesField + NSTextField + + + searchField + NSSearchField + + + stepper + NSSegmentedControl + + + + + IBProjectSource + PBHistorySearchController.h + + PBNiceSplitView NSSplitView @@ -4102,6 +4338,34 @@ Foundation.framework/Headers/NSURLDownload.h + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CAAnimation.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CALayer.h + + + + NSObject + + IBFrameworkSource + QuartzCore.framework/Headers/CIImageProvider.h + + + + NSObject + + IBFrameworkSource + ScriptingBridge.framework/Headers/SBApplication.h + + NSObject diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 0e77c22..65889a6 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -9,6 +9,7 @@ #import "PBGitRevisionCell.h" #import "PBGitRef.h" #import "RoundedRectangle.h" +#import "GitXTextFieldCell.h" @implementation PBGitRevisionCell @@ -16,7 +17,7 @@ - (id) initWithCoder: (id) coder { self = [super initWithCoder:coder]; - textCell = [[NSTextFieldCell alloc] initWithCoder:coder]; + textCell = [[GitXTextFieldCell alloc] initWithCoder:coder]; return self; } diff --git a/PBHistorySearchController.h b/PBHistorySearchController.h new file mode 100644 index 0000000..75bd250 --- /dev/null +++ b/PBHistorySearchController.h @@ -0,0 +1,46 @@ +// +// PBHistorySearchController.h +// GitX +// +// Created by Nathan Kinsinger on 8/21/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitHistoryController; + + +@interface PBHistorySearchController : NSObject { + PBGitHistoryController *historyController; + NSArrayController *commitController; + + NSIndexSet *results; + + NSSearchField *searchField; + NSSegmentedControl *stepper; + NSTextField *numberOfMatchesField; + + NSPanel *rewindPanel; +} + +@property (assign) IBOutlet PBGitHistoryController *historyController; +@property (assign) IBOutlet NSArrayController *commitController; + +@property (assign) IBOutlet NSSearchField *searchField; +@property (assign) IBOutlet NSSegmentedControl *stepper; +@property (assign) IBOutlet NSTextField *numberOfMatchesField; + + +- (BOOL)isRowInSearchResults:(NSInteger)rowIndex; +- (BOOL)hasSearchResults; + +- (void)selectNextResult; +- (void)selectPreviousResult; +- (IBAction)stepperPressed:(id)sender; + +- (void)clearSearch; +- (IBAction)updateSearch:(id)sender; + +@end diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m new file mode 100644 index 0000000..99ea7a8 --- /dev/null +++ b/PBHistorySearchController.m @@ -0,0 +1,313 @@ +// +// PBHistorySearchController.m +// GitX +// +// Created by Nathan Kinsinger on 8/21/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBHistorySearchController.h" +#import "PBGitHistoryController.h" +#import "PBGitRepository.h" +#import + + +@interface PBHistorySearchController () + +- (void)selectNextResultInDirection:(NSInteger)direction; + +- (void)updateUI; + +- (void)startBasicSearch; + +- (void)showSearchRewindPanelReverse:(BOOL)isReversed; + +@end + + +#define kGitXSearchDirectionNext 1 +#define kGitXSearchDirectionPrevious -1 + +#define kGitXBasicSearchLabel @"Subject, Author, SHA" + +#define kGitXSearchArrangedObjectsContext @"GitXSearchArrangedObjectsContext" + + +@implementation PBHistorySearchController + +@synthesize historyController; +@synthesize commitController; + +@synthesize searchField; +@synthesize stepper; +@synthesize numberOfMatchesField; + + + +#pragma mark - +#pragma mark Public methods + +- (BOOL)isRowInSearchResults:(NSInteger)rowIndex +{ + return [results containsIndex:rowIndex]; +} + +- (BOOL)hasSearchResults +{ + return ([results count] > 0); +} + +- (void)selectNextResult +{ + [self selectNextResultInDirection:kGitXSearchDirectionNext]; +} + +- (void)selectPreviousResult +{ + [self selectNextResultInDirection:kGitXSearchDirectionPrevious]; +} + +- (IBAction)stepperPressed:(id)sender +{ + NSInteger selectedSegment = [sender selectedSegment]; + + if (selectedSegment == 0) + [self selectPreviousResult]; + else + [self selectNextResult]; +} + +- (void)clearSearch +{ + [searchField setStringValue:@""]; + if (results) { + results = nil; + [historyController.commitList reloadData]; + } + [self updateUI]; +} + +- (IBAction)updateSearch:(id)sender +{ + [self startBasicSearch]; +} + +- (void)awakeFromNib +{ + [[searchField cell] setPlaceholderString:@"Subject, Author, SHA"]; + + [self updateUI]; + + [commitController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:kGitXSearchArrangedObjectsContext]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([(NSString *)context isEqualToString:kGitXSearchArrangedObjectsContext]) { + // the objects in the commitlist changed so the result indexes are no longer valid + [self clearSearch]; + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; +} + + + +#pragma mark - +#pragma mark Private methods + +- (void)selectIndex:(NSUInteger)index +{ + if ([[commitController arrangedObjects] count] > index) { + PBGitCommit *commit = [[commitController arrangedObjects] objectAtIndex:index]; + [historyController selectCommit:[commit sha]]; + } +} + +- (void)selectNextResultInDirection:(NSInteger)direction +{ + if (![results count]) + return; + + NSUInteger selectedRow = [historyController.commitList selectedRow]; + if (selectedRow == NSNotFound) { + [self selectIndex:[results firstIndex]]; + return; + } + + NSUInteger currentResult = NSNotFound; + if (direction == kGitXSearchDirectionNext) + currentResult = [results indexGreaterThanIndex:selectedRow]; + else + currentResult = [results indexLessThanIndex:selectedRow]; + + if (currentResult == NSNotFound) { + if (direction == kGitXSearchDirectionNext) + currentResult = [results firstIndex]; + else + currentResult = [results lastIndex]; + + [self showSearchRewindPanelReverse:(direction != kGitXSearchDirectionNext)]; + } + + [self selectIndex:currentResult]; +} + +- (NSString *)numberOfMatchesString +{ + NSUInteger numberOfMatches = [results count]; + + if (numberOfMatches == 0) + return @"Not found"; + + if (numberOfMatches == 1) + return @"1 match"; + + return [NSString stringWithFormat:@"%d matches", numberOfMatches]; +} + +- (void)updateUI +{ + if ([[searchField stringValue] isEqualToString:@""]) { + [numberOfMatchesField setHidden:YES]; + [stepper setHidden:YES]; + } + else { + [numberOfMatchesField setStringValue:[self numberOfMatchesString]]; + [numberOfMatchesField setHidden:NO]; + [stepper setHidden:NO]; + [historyController.commitList reloadData]; + } +} + +// changes the selection to the next match after the current selected row unless the current row is already a match +- (void)updateSelectedResult +{ + NSString *searchString = [searchField stringValue]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + if (![self isRowInSearchResults:[historyController.commitList selectedRow]]) + [self selectNextResult]; + + [self updateUI]; +} + + + +#pragma mark Basic Search + +- (void)startBasicSearch +{ + NSString *searchString = [searchField stringValue]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; + NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"subject CONTAINS[cd] %@ OR author CONTAINS[cd] %@ OR realSha BEGINSWITH[c] %@", searchString, searchString, searchString]; + + NSUInteger index = 0; + for (PBGitCommit *commit in [commitController arrangedObjects]) { + if ([searchPredicate evaluateWithObject:commit]) + [indexes addIndex:index]; + index++; + } + + results = indexes; + + [self updateSelectedResult]; +} + + + +#pragma mark - +#pragma mark Rewind Panel + +#define kRewindPanelSize 125.0f + +- (void)closeRewindPanel +{ + [[[historyController view] window] removeChildWindow:rewindPanel]; + [rewindPanel close]; + rewindPanel = nil; +} + +- (NSPanel *)rewindPanelReverse:(BOOL)isReversed +{ + NSRect windowFrame = [[[historyController view] window] frame]; + NSRect historyFrame = [[historyController view] convertRectToBase:[[historyController view] frame]]; + NSRect panelRect = NSMakeRect(0.0f, 0.0f, kRewindPanelSize, kRewindPanelSize); + panelRect.origin.x = windowFrame.origin.x + historyFrame.origin.x + ((historyFrame.size.width - kRewindPanelSize) / 2.0f); + panelRect.origin.y = windowFrame.origin.y + historyFrame.origin.y + ((historyFrame.size.height - kRewindPanelSize) / 2.0f); + + NSPanel *panel = [[NSPanel alloc] initWithContentRect:panelRect + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:YES]; + [panel setIgnoresMouseEvents:YES]; + [panel setOneShot:YES]; + [panel setOpaque:NO]; + [panel setBackgroundColor:[NSColor clearColor]]; + [panel setHasShadow:NO]; + [panel useOptimizedDrawing:YES]; + [panel setAlphaValue:0.0f]; + + NSBox *box = [[NSBox alloc] initWithFrame:[[panel contentView] frame]]; + [box setBoxType:NSBoxCustom]; + [box setBorderType:NSLineBorder]; + [box setFillColor:[NSColor colorWithCalibratedWhite:0.0f alpha:0.5f]]; + [box setBorderColor:[NSColor colorWithCalibratedWhite:0.5f alpha:0.5f]]; + [box setCornerRadius:12.0f]; + [[panel contentView] addSubview:box]; + + NSImage *rewindImage = [[NSImage imageNamed:@"rewindImage"] copy]; + [rewindImage setFlipped:isReversed]; + NSSize imageSize = [rewindImage size]; + NSRect imageViewFrame = NSMakeRect(21.0f, 5.0f, imageSize.width, imageSize.height); + NSImageView *rewindImageView = [[NSImageView alloc] initWithFrame:imageViewFrame]; + [rewindImageView setImage:rewindImage]; + [[box contentView] addSubview:rewindImageView]; + + return panel; +} + +- (CAKeyframeAnimation *)rewindPanelFadeOutAnimation +{ + CAKeyframeAnimation *animation = [CAKeyframeAnimation animation]; + animation.duration = 1.0f; + animation.values = [NSArray arrayWithObjects: + [NSNumber numberWithFloat:1.0f], + [NSNumber numberWithFloat:1.0f], + [NSNumber numberWithFloat:0.0f], + [NSNumber numberWithFloat:0.0f], nil]; + animation.keyTimes = [NSArray arrayWithObjects: + [NSNumber numberWithFloat:0.1f], + [NSNumber numberWithFloat:0.3f], + [NSNumber numberWithFloat:0.7f], + [NSNumber numberWithFloat:animation.duration], nil]; + + return animation; +} + +- (void)showSearchRewindPanelReverse:(BOOL)isReversed +{ + if (rewindPanel) + [self closeRewindPanel]; + + rewindPanel = [self rewindPanelReverse:isReversed]; + + [[[historyController view] window] addChildWindow:rewindPanel ordered:NSWindowAbove]; + + CAKeyframeAnimation *alphaAnimation = [self rewindPanelFadeOutAnimation]; + [rewindPanel setAnimations:[NSDictionary dictionaryWithObject:alphaAnimation forKey:@"alphaValue"]]; + [[rewindPanel animator] setAlphaValue:0.0f]; + + [self performSelector:@selector(closeRewindPanel) withObject:nil afterDelay:0.7f]; +} + +@end From 62aa99b7618f3cd27ac8f4d6b41fb8b0834ca9d1 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 4 Sep 2010 14:00:21 -0600 Subject: [PATCH 074/110] Add a recent searches menu to the search field --- PBGitHistoryView.xib | 1 + PBHistorySearchController.m | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 4e83049..b6bf807 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -759,6 +759,7 @@ 400 75 + Recent History Searches 255 diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m index 99ea7a8..1aa3313 100644 --- a/PBHistorySearchController.m +++ b/PBHistorySearchController.m @@ -17,6 +17,7 @@ - (void)selectNextResultInDirection:(NSInteger)direction; - (void)updateUI; +- (void)setupSearchMenuTemplate; - (void)startBasicSearch; @@ -94,6 +95,7 @@ - (void)awakeFromNib { + [self setupSearchMenuTemplate]; [[searchField cell] setPlaceholderString:@"Subject, Author, SHA"]; [self updateUI]; @@ -196,6 +198,34 @@ [self updateUI]; } +- (void)setupSearchMenuTemplate +{ + NSMenu *searchMenu = [[NSMenu alloc] initWithTitle:@"Search Menu"]; + NSMenuItem *item; + + item = [[NSMenuItem alloc] initWithTitle:@"Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldRecentsTitleMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"Recents" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldRecentsMenuItemTag]; + [searchMenu addItem:item]; + + item = [NSMenuItem separatorItem]; + [item setTag:NSSearchFieldRecentsTitleMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"Clear Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldClearRecentsMenuItemTag]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:@"No Recent Searches" action:NULL keyEquivalent:@""]; + [item setTag:NSSearchFieldNoRecentsMenuItemTag]; + [searchMenu addItem:item]; + + [[searchField cell] setSearchMenuTemplate:searchMenu]; +} + #pragma mark Basic Search From 71cdb0dbe05da0a37e0719241a3137f7c0126051 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Mon, 6 Sep 2010 15:22:51 -0600 Subject: [PATCH 075/110] Add search modes for git pickaxe Add two new search modes to search the commits for strings that were added or removed in a commit. - match by string or an extended POSIX regex (see man git-log -S and --pickaxe-regex) - include the modes in the search menu - store the current mode in user defaults - show progress indicator when search takes time --- PBGitDefaults.h | 2 + PBGitDefaults.m | 15 ++++ PBGitHistoryView.xib | 70 +++++++++++++-- PBHistorySearchController.h | 17 ++++ PBHistorySearchController.m | 172 +++++++++++++++++++++++++++++++++++- 5 files changed, 266 insertions(+), 10 deletions(-) diff --git a/PBGitDefaults.h b/PBGitDefaults.h index c7c494a..46b28b5 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -34,5 +34,7 @@ + (void) removePreviousDocumentPaths; + (NSInteger) branchFilter; + (void) setBranchFilter:(NSInteger)state; ++ (NSInteger)historySearchMode; ++ (void)setHistorySearchMode:(NSInteger)mode; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index 0e042a5..ccc2162 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -7,6 +7,7 @@ // #import "PBGitDefaults.h" +#import "PBHistorySearchController.h" #define kDefaultVerticalLineLength 50 #define kCommitMessageViewVerticalLineLength @"PBCommitMessageViewVerticalLineLength" @@ -25,6 +26,7 @@ #define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch" #define kPreviousDocumentPaths @"PBPreviousDocumentPaths" #define kBranchFilterState @"PBBranchFilter" +#define kHistorySearchMode @"PBHistorySearchMode" @implementation PBGitDefaults @@ -53,6 +55,8 @@ forKey:kShouldCheckoutBranch]; [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:kOpenPreviousDocumentsOnLaunch]; + [defaultValues setObject:[NSNumber numberWithInteger:kGitXBasicSeachMode] + forKey:kHistorySearchMode]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; } @@ -170,4 +174,15 @@ [[NSUserDefaults standardUserDefaults] setInteger:state forKey:kBranchFilterState]; } ++ (NSInteger)historySearchMode +{ + return [[NSUserDefaults standardUserDefaults] integerForKey:kHistorySearchMode]; +} + ++ (void)setHistorySearchMode:(NSInteger)mode +{ + [[NSUserDefaults standardUserDefaults] setInteger:mode forKey:kHistorySearchMode]; +} + + @end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index b6bf807..f9e2774 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -702,6 +702,15 @@ 266 YES + + + -2147482359 + + {{637, 3}, {16, 16}} + + 20746 + 100 + 265 @@ -2096,6 +2105,14 @@ 437 + + + progressIndicator + + + + 448 + @@ -2439,6 +2456,7 @@ + Commits Scope Bar @@ -2695,6 +2713,11 @@ + + 447 + + + @@ -2803,6 +2826,7 @@ 428.IBSegmentedControlInspectorSelectedSegmentMetadataKey 430.IBPluginDependency 431.IBPluginDependency + 447.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 48.IBPluginDependency @@ -2987,6 +3011,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{9, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3023,7 +3048,7 @@ - 437 + 448 @@ -3480,6 +3505,9 @@ YES YES + selectBasicSearch: + selectPickaxeSearch: + selectRegexSearch: stepperPressed: updateSearch: @@ -3487,17 +3515,35 @@ YES id id + id + id + id YES YES + selectBasicSearch: + selectPickaxeSearch: + selectRegexSearch: stepperPressed: updateSearch: YES + + selectBasicSearch: + id + + + selectPickaxeSearch: + id + + + selectRegexSearch: + id + stepperPressed: id @@ -3515,6 +3561,7 @@ commitController historyController numberOfMatchesField + progressIndicator searchField stepper @@ -3523,6 +3570,7 @@ NSArrayController PBGitHistoryController NSTextField + NSProgressIndicator NSSearchField NSSegmentedControl @@ -3534,6 +3582,7 @@ commitController historyController numberOfMatchesField + progressIndicator searchField stepper @@ -3551,6 +3600,10 @@ numberOfMatchesField NSTextField + + progressIndicator + NSProgressIndicator + searchField NSSearchField @@ -4360,13 +4413,6 @@ QuartzCore.framework/Headers/CIImageProvider.h - - NSObject - - IBFrameworkSource - ScriptingBridge.framework/Headers/SBApplication.h - - NSObject @@ -4472,6 +4518,14 @@ AppKit.framework/Headers/NSPopUpButton.h + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + NSResponder diff --git a/PBHistorySearchController.h b/PBHistorySearchController.h index 75bd250..e51ba47 100644 --- a/PBHistorySearchController.h +++ b/PBHistorySearchController.h @@ -9,6 +9,13 @@ #import +typedef enum historySearchModes { + kGitXBasicSeachMode = 1, + kGitXPickaxeSearchMode, + kGitXRegexSearchMode, + kGitXMaxSearchMode // always keep this item last +} PBHistorySearchMode; + @class PBGitHistoryController; @@ -16,11 +23,16 @@ PBGitHistoryController *historyController; NSArrayController *commitController; + PBHistorySearchMode searchMode; NSIndexSet *results; NSSearchField *searchField; NSSegmentedControl *stepper; NSTextField *numberOfMatchesField; + NSProgressIndicator *progressIndicator; + NSTimer *searchTimer; + + NSTask *backgroundSearchTask; NSPanel *rewindPanel; } @@ -31,11 +43,16 @@ @property (assign) IBOutlet NSSearchField *searchField; @property (assign) IBOutlet NSSegmentedControl *stepper; @property (assign) IBOutlet NSTextField *numberOfMatchesField; +@property (assign) IBOutlet NSProgressIndicator *progressIndicator; + +@property (assign) PBHistorySearchMode searchMode; - (BOOL)isRowInSearchResults:(NSInteger)rowIndex; - (BOOL)hasSearchResults; +- (void)selectSearchMode:(id)sender; + - (void)selectNextResult; - (void)selectPreviousResult; - (IBAction)stepperPressed:(id)sender; diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m index 1aa3313..8a48320 100644 --- a/PBHistorySearchController.m +++ b/PBHistorySearchController.m @@ -9,6 +9,7 @@ #import "PBHistorySearchController.h" #import "PBGitHistoryController.h" #import "PBGitRepository.h" +#import "PBGitDefaults.h" #import @@ -20,6 +21,8 @@ - (void)setupSearchMenuTemplate; - (void)startBasicSearch; +- (void)startBackgroundSearch; +- (void)clearProgressIndicator; - (void)showSearchRewindPanelReverse:(BOOL)isReversed; @@ -30,6 +33,8 @@ #define kGitXSearchDirectionPrevious -1 #define kGitXBasicSearchLabel @"Subject, Author, SHA" +#define kGitXPickaxeSearchLabel @"Commit (pickaxe)" +#define kGitXRegexSearchLabel @"Commit (pickaxe regex)" #define kGitXSearchArrangedObjectsContext @"GitXSearchArrangedObjectsContext" @@ -42,6 +47,9 @@ @synthesize searchField; @synthesize stepper; @synthesize numberOfMatchesField; +@synthesize progressIndicator; + +@synthesize searchMode; @@ -58,6 +66,12 @@ return ([results count] > 0); } +- (void)selectSearchMode:(id)sender +{ + self.searchMode = [sender tag]; + [self updateSearch:self]; +} + - (void)selectNextResult { [self selectNextResultInDirection:kGitXSearchDirectionNext]; @@ -90,13 +104,16 @@ - (IBAction)updateSearch:(id)sender { - [self startBasicSearch]; + if (self.searchMode == kGitXBasicSeachMode) + [self startBasicSearch]; + else + [self startBackgroundSearch]; } - (void)awakeFromNib { [self setupSearchMenuTemplate]; - [[searchField cell] setPlaceholderString:@"Subject, Author, SHA"]; + self.searchMode = [PBGitDefaults historySearchMode]; [self updateUI]; @@ -181,6 +198,7 @@ [stepper setHidden:NO]; [historyController.commitList reloadData]; } + [self clearProgressIndicator]; } // changes the selection to the next match after the current selected row unless the current row is already a match @@ -203,6 +221,24 @@ NSMenu *searchMenu = [[NSMenu alloc] initWithTitle:@"Search Menu"]; NSMenuItem *item; + item = [[NSMenuItem alloc] initWithTitle:kGitXBasicSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXBasicSeachMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXPickaxeSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXPickaxeSearchMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXRegexSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXRegexSearchMode]; + [searchMenu addItem:item]; + + item = [NSMenuItem separatorItem]; + [searchMenu addItem:item]; + item = [[NSMenuItem alloc] initWithTitle:@"Recent Searches" action:NULL keyEquivalent:@""]; [item setTag:NSSearchFieldRecentsTitleMenuItemTag]; [searchMenu addItem:item]; @@ -226,6 +262,77 @@ [[searchField cell] setSearchMenuTemplate:searchMenu]; } +- (void)updateSearchMenuState +{ + NSMenu *searchMenu = [[searchField cell] searchMenuTemplate]; + if (!searchMenu) + return; + + NSMenuItem *item; + + item = [searchMenu itemWithTag:kGitXBasicSeachMode]; + [item setState:(searchMode == kGitXBasicSeachMode) ? NSOnState : NSOffState]; + + item = [searchMenu itemWithTag:kGitXPickaxeSearchMode]; + [item setState:(searchMode == kGitXPickaxeSearchMode) ? NSOnState : NSOffState]; + + item = [searchMenu itemWithTag:kGitXRegexSearchMode]; + [item setState:(searchMode == kGitXRegexSearchMode) ? NSOnState : NSOffState]; + + [[searchField cell] setSearchMenuTemplate:searchMenu]; + + [PBGitDefaults setHistorySearchMode:searchMode]; +} + +- (void)updateSearchPlaceholderString +{ + switch (self.searchMode) { + case kGitXPickaxeSearchMode: + [[searchField cell] setPlaceholderString:kGitXPickaxeSearchLabel]; + break; + case kGitXRegexSearchMode: + [[searchField cell] setPlaceholderString:kGitXRegexSearchLabel]; + break; + default: + [[searchField cell] setPlaceholderString:kGitXBasicSearchLabel]; + break; + } +} + +- (void)setSearchMode:(PBHistorySearchMode)mode +{ + if ((mode < kGitXBasicSeachMode) || (mode >= kGitXMaxSearchMode)) + mode = kGitXBasicSeachMode; + + searchMode = mode; + [PBGitDefaults setHistorySearchMode:searchMode]; + + [self updateSearchMenuState]; + [self updateSearchPlaceholderString]; +} + +- (void)searchTimerFired:(NSTimer*)theTimer +{ + [self.progressIndicator setHidden:NO]; + [self.progressIndicator startAnimation:self]; +} + +- (void)clearProgressIndicator +{ + [searchTimer invalidate]; + searchTimer = nil; + [self.progressIndicator setHidden:YES]; + [self.progressIndicator stopAnimation:self]; +} + +- (void)startProgressIndicator +{ + [self clearProgressIndicator]; + [numberOfMatchesField setHidden:YES]; + [stepper setHidden:YES]; + searchTimer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(searchTimerFired:) userInfo:nil repeats:NO]; +} + #pragma mark Basic Search @@ -255,6 +362,67 @@ +#pragma mark Pickaxe/Regex Search + +- (void)startBackgroundSearch +{ + if (backgroundSearchTask) { + NSFileHandle *handle = [[backgroundSearchTask standardOutput] fileHandleForReading]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; + [backgroundSearchTask terminate]; + } + + NSString *searchString = [[searchField stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([searchString isEqualToString:@""]) { + [self clearSearch]; + return; + } + + results = nil; + + NSMutableArray *searchArguments = [NSMutableArray arrayWithObjects:@"log", @"--pretty=format:%H", [NSString stringWithFormat:@"-S%@", searchString], nil]; + if (self.searchMode == kGitXRegexSearchMode) + [searchArguments insertObject:@"--pickaxe-regex" atIndex:1]; + + backgroundSearchTask = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:searchArguments inDir:[[historyController.repository fileURL] path]]; + [backgroundSearchTask launch]; + + NSFileHandle *handle = [[backgroundSearchTask standardOutput] fileHandleForReading]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(parseBackgroundSearchResults:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle]; + [handle readToEndOfFileInBackgroundAndNotify]; + + [self startProgressIndicator]; +} + +- (void)parseBackgroundSearchResults:(NSNotification *)notification +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:[notification object]]; + backgroundSearchTask = nil; + + NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; + NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem]; + + NSString *resultsString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSArray *resultsArray = [resultsString componentsSeparatedByString:@"\n"]; + + for (NSString *resultSHA in resultsArray) { + NSUInteger index = 0; + for (PBGitCommit *commit in [commitController arrangedObjects]) { + if ([resultSHA isEqualToString:commit.sha.string]) { + [indexes addIndex:index]; + break; + } + index++; + } + } + + results = indexes; + [self clearProgressIndicator]; + [self updateSelectedResult]; +} + + + #pragma mark - #pragma mark Rewind Panel From e56ca103cacf77ee11a84f8b7ac51f3d8caf4d12 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Mon, 6 Sep 2010 19:50:04 -0600 Subject: [PATCH 076/110] Add search commands to the gitx cli -s or --search= for searching in subject, author or SHA -S or --Search= for git's pickaxe string matching -r or --regex= for git's pickaxe regex matching --- GitX.h | 13 ++++++ GitX.sdef | 17 ++++++++ GitXScriptingConstants.h | 5 ++- PBGitRepository.h | 4 ++ PBGitRepository.m | 14 +++++++ PBGitSidebarController.h | 2 + PBGitSidebarController.m | 6 +++ PBGitWindowController.h | 3 ++ PBGitWindowController.m | 5 +++ PBHistorySearchController.h | 2 + PBHistorySearchController.m | 10 +++++ gitx.m | 83 ++++++++++++++++++++++++++++++++++++- 12 files changed, 162 insertions(+), 2 deletions(-) diff --git a/GitX.h b/GitX.h index 7825b7f..a07c4b7 100644 --- a/GitX.h +++ b/GitX.h @@ -43,6 +43,7 @@ - (void) delete; // Delete an object. - (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. - (void) moveTo:(SBObject *)to; // Move an object to a new location. +- (void) searchString:(NSString *)string inMode:(NSInteger)inMode; // Highlight commits that match the given search string. @end @@ -66,6 +67,18 @@ - (void) delete; // Delete an object. - (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. - (void) moveTo:(SBObject *)to; // Move an object to a new location. +- (void) searchString:(NSString *)string inMode:(NSInteger)inMode; // Highlight commits that match the given search string. + +@end + + + +/* + * GitX Suite + */ + +// A document. +@interface GitXDocument (GitXSuite) @end diff --git a/GitX.sdef b/GitX.sdef index db0348d..55a6d04 100644 --- a/GitX.sdef +++ b/GitX.sdef @@ -173,6 +173,23 @@ + + + + + + + + + + + + + + + + + diff --git a/GitXScriptingConstants.h b/GitXScriptingConstants.h index 7a786a4..4f04f5b 100644 --- a/GitXScriptingConstants.h +++ b/GitXScriptingConstants.h @@ -12,4 +12,7 @@ #define kGitXAEKeyArgumentsList 'ARGS' #define kGitXCloneDestinationURLKey @"destinationURL" -#define kGitXCloneIsBareKey @"isBare" \ No newline at end of file +#define kGitXCloneIsBareKey @"isBare" + +#define kGitXFindSearchStringKey @"searchString" +#define kGitXFindInModeKey @"inMode" diff --git a/PBGitRepository.h b/PBGitRepository.h index 86b094a..7599c6c 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -125,6 +125,10 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) { - (void) setup; - (void) forceUpdateRevisions; +// for the scripting bridge +- (void)findInModeScriptCommand:(NSScriptCommand *)command; + + @property (assign) BOOL hasChanged; @property (readonly) PBGitWindowController *windowController; @property (readonly) PBGitConfig *config; diff --git a/PBGitRepository.m b/PBGitRepository.m index 48a70f4..9d7862c 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -19,6 +19,7 @@ #import "PBGitRevList.h" #import "PBGitDefaults.h" #import "GitXScriptingConstants.h" +#import "PBHistorySearchController.h" NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; @@ -1008,6 +1009,19 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [super showWindows]; } +// for the scripting bridge +- (void)findInModeScriptCommand:(NSScriptCommand *)command +{ + NSDictionary *arguments = [command arguments]; + NSString *searchString = [arguments objectForKey:kGitXFindSearchStringKey]; + if (searchString) { + NSInteger mode = [[arguments objectForKey:kGitXFindInModeKey] integerValue]; + [PBGitDefaults setShowStageView:NO]; + [self.windowController showHistoryView:self]; + [self.windowController setHistorySearch:searchString mode:mode]; + } +} + #pragma mark low level diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index ba4dd2f..e2f712f 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -38,6 +38,8 @@ - (IBAction) fetchPullPushAction:(id)sender; +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + @property(readonly) NSMutableArray *items; @property(readonly) NSView *sourceListControlsView; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 03167bd..efcf6f1 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -15,6 +15,7 @@ #import "NSOutlineViewExt.h" #import "PBAddRemoteSheet.h" #import "PBGitDefaults.h" +#import "PBHistorySearchController.h" @interface PBGitSidebarController () @@ -184,6 +185,11 @@ [sourceView reloadData]; } +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + [historyViewController.searchController setHistorySearch:searchString mode:mode]; +} + #pragma mark NSOutlineView delegate methods - (void)outlineViewSelectionDidChange:(NSNotification *)notification diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 1d9cac8..29f5245 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -47,4 +47,7 @@ - (IBAction) openInTerminal:(id)sender; - (IBAction) cloneTo:(id)sender; - (IBAction) refresh:(id)sender; + +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 8df3139..1968c48 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -191,6 +191,11 @@ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + [sidebarController setHistorySearch:searchString mode:mode]; +} + #pragma mark - diff --git a/PBHistorySearchController.h b/PBHistorySearchController.h index e51ba47..c3e6459 100644 --- a/PBHistorySearchController.h +++ b/PBHistorySearchController.h @@ -60,4 +60,6 @@ typedef enum historySearchModes { - (void)clearSearch; - (IBAction)updateSearch:(id)sender; +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; + @end diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m index 8a48320..2281da9 100644 --- a/PBHistorySearchController.m +++ b/PBHistorySearchController.m @@ -110,6 +110,16 @@ [self startBackgroundSearch]; } +- (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode +{ + if (searchString && ![searchString isEqualToString:@""]) { + self.searchMode = mode; + [searchField setStringValue:searchString]; + // use performClick: so that the search field will save it as a recent search + [searchField performClick:self]; + } +} + - (void)awakeFromNib { [self setupSearchMenuTemplate]; diff --git a/gitx.m b/gitx.m index ecb9a6f..f213977 100644 --- a/gitx.m +++ b/gitx.m @@ -10,6 +10,7 @@ #import "PBEasyPipe.h" #import "GitXScriptingConstants.h" #import "GitX.h" +#import "PBHistorySearchController.h" @@ -53,7 +54,6 @@ void usage(char const *programName) printf("\n"); printf(" select specific branch or tag\n"); printf(" -- show commits touching paths\n"); - printf(" -S show commits that introduce or remove an instance of \n"); printf("\n"); printf("Diff options\n"); printf(" See 'man git-diff' for options you can pass to gitx --diff\n"); @@ -63,6 +63,15 @@ void usage(char const *programName) printf(" git diff [options] | gitx\n"); printf(" use gitx to pipe diff output to a GitX window\n"); printf("\n"); + printf("Search\n"); + printf("\n"); + printf(" -s, --search=\n"); + printf(" search for string in Subject, Author or SHA\n"); + printf(" -S, --Search=\n"); + printf(" commits that introduce or remove an instance of \n"); + printf(" -r, --regex=\n"); + printf(" commits that introduce or remove strings that match \n"); + printf("\n"); printf("Creating repositories\n"); printf(" These commands will create a git repository and then open it up in GitX\n"); printf("\n"); @@ -199,6 +208,74 @@ void handleClone(NSURL *repositoryURL, NSMutableArray *arguments) exit(0); } +#define kShortBasicSearch @"-s" +#define kBasicSearch @"--search=" +#define kShortPickaxeSearch @"-S" +#define kPickaxeSearch @"--Search=" +#define kShortRegexSearch @"-r" +#define kRegexSearch @"--regex=" + +NSArray *commandLineSearchPrefixes() +{ + return [NSArray arrayWithObjects:kShortBasicSearch, kBasicSearch, kShortPickaxeSearch, kPickaxeSearch, kShortRegexSearch, kRegexSearch, nil]; +} + +PBHistorySearchMode searchModeForCommandLineArgument(NSString *argument) +{ + if ([argument hasPrefix:kShortBasicSearch] || [argument hasPrefix:kBasicSearch]) + return kGitXBasicSeachMode; + + if ([argument hasPrefix:kShortPickaxeSearch] || [argument hasPrefix:kPickaxeSearch]) + return kGitXPickaxeSearchMode; + + if ([argument hasPrefix:kShortRegexSearch] || [argument hasPrefix:kRegexSearch]) + return kGitXRegexSearchMode; + + return 0; +} + +GitXDocument *documentForURL(SBElementArray *documents, NSURL *URL) +{ + NSString *path = [URL path]; + + for (GitXDocument *document in documents) { + NSString *documentPath = [[document file] path]; + if ([[documentPath lastPathComponent] isEqualToString:@".git"]) + documentPath = [documentPath stringByDeletingLastPathComponent]; + + if ([documentPath isEqualToString:path]) + return document; + } + + return nil; +} + +void handleGitXSearch(NSURL *repositoryURL, NSMutableArray *arguments) +{ + NSString *searchString = [arguments componentsJoinedByString:@" "]; + NSInteger mode = searchModeForCommandLineArgument(searchString); + + // remove the prefix from search string before sending it + NSArray *prefixes = commandLineSearchPrefixes(); + for (NSString *prefix in prefixes) + if ([searchString hasPrefix:prefix]) { + searchString = [searchString substringFromIndex:[prefix length]]; + break; + } + + if ([searchString isEqualToString:@""]) + exit(0); + + GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; + [gitXApp open:[NSArray arrayWithObject:repositoryURL]]; + + // need to find the document after opening it + GitXDocument *repositoryDocument = documentForURL([gitXApp documents], repositoryURL); + [repositoryDocument searchString:searchString inMode:mode]; + + exit(0); +} + #pragma mark - #pragma mark main @@ -287,6 +364,10 @@ int main(int argc, const char** argv) [arguments removeObjectAtIndex:0]; handleClone(wdURL, arguments); } + + if (searchModeForCommandLineArgument(firstArgument)) { + handleGitXSearch(wdURL, arguments); + } } // No commands handled by gitx, open the current dir in GitX with the arguments From b28afa1644e149a36f10e19bc156093a9e3c6afa Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 4 Sep 2010 17:57:12 -0600 Subject: [PATCH 077/110] Add the contextual menu to the other columns of the commit list Now all the columns have the menu for the commit, not just the subject column. --- GitXTextFieldCell.h | 3 +- GitXTextFieldCell.m | 17 +++++++++ PBGitHistoryView.xib | 85 +++++++++++++++++++++++++++++++++--------- PBRefContextDelegate.h | 4 ++ PBRefController.h | 1 + PBRefController.m | 9 +++++ 6 files changed, 101 insertions(+), 18 deletions(-) diff --git a/GitXTextFieldCell.h b/GitXTextFieldCell.h index 4bd3ec7..1161dca 100644 --- a/GitXTextFieldCell.h +++ b/GitXTextFieldCell.h @@ -7,10 +7,11 @@ // #import +#import "PBRefContextDelegate.h" @interface GitXTextFieldCell : NSTextFieldCell { - + IBOutlet id contextMenuDelegate; } @end diff --git a/GitXTextFieldCell.m b/GitXTextFieldCell.m index bc95397..9e90193 100644 --- a/GitXTextFieldCell.m +++ b/GitXTextFieldCell.m @@ -7,6 +7,8 @@ // #import "GitXTextFieldCell.h" +#import "PBGitCommit.h" +#import "PBRefController.h" @implementation GitXTextFieldCell @@ -17,4 +19,19 @@ return nil; } +- (NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSTableView *)commitList +{ + NSInteger rowIndex = [commitList rowAtPoint:(cellFrame.origin)]; + NSArray *items = [contextMenuDelegate menuItemsForRow:rowIndex]; + if (!items) + return nil; + + NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; + for (NSMenuItem *item in items) + [menu addItem:item]; + + return menu; +} + @end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index f9e2774..4bda4c9 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -1616,14 +1616,6 @@ 95 - - - delegate - - - - 96 - delegate @@ -1696,14 +1688,6 @@ 234 - - - dataSource - - - - 235 - contextMenuDelegate @@ -2097,13 +2081,69 @@ 436 + + + contextMenuDelegate + + + + 438 + + + + contextMenuDelegate + + + + 439 + + + + contextMenuDelegate + + + + 440 + + + + contextMenuDelegate + + + + 441 + + + + contextMenuDelegate + + + + 442 + + + + delegate + + + + 444 + + + + dataSource + + + + 445 + searchController - 437 + 446 @@ -3064,6 +3104,17 @@ GitXTextFieldCell NSTextFieldCell + + contextMenuDelegate + id + + + contextMenuDelegate + + contextMenuDelegate + id + + IBProjectSource GitXTextFieldCell.h diff --git a/PBRefContextDelegate.h b/PBRefContextDelegate.h index 1b7a973..9112b8f 100644 --- a/PBRefContextDelegate.h +++ b/PBRefContextDelegate.h @@ -7,8 +7,12 @@ // +@class PBGitRef; +@class PBGitCommit; + @protocol PBRefContextDelegate - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex; @end diff --git a/PBRefController.h b/PBRefController.h index 76e5cd8..15df74b 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -43,6 +43,7 @@ - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex; @end diff --git a/PBRefController.m b/PBRefController.m index ca560a1..26dd6f2 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -275,6 +275,15 @@ return [PBRefMenuItem defaultMenuItemsForCommit:commit target:self]; } +- (NSArray *)menuItemsForRow:(NSInteger)rowIndex +{ + NSArray *commits = [commitController arrangedObjects]; + if ([commits count] <= rowIndex) + return nil; + + return [self menuItemsForCommit:[commits objectAtIndex:rowIndex]]; +} + # pragma mark Tableview delegate methods From 18725fdd6535ff0e78b3da5a687f1fdbcbe31645 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 4 Sep 2010 12:12:29 -0600 Subject: [PATCH 078/110] Prevent drag and drop of tags and remote branches Moving an annotated tag would convert it to a lightweight tag and lose the tags message. Given that tags are meant to represent a fixed point in the history and remote branches represent the state of the remote I'm disabling moving them. --- PBRefController.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PBRefController.m b/PBRefController.m index 26dd6f2..1b07f00 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -305,6 +305,9 @@ return NO; PBGitRef *ref = [[[cell objectValue] refs] objectAtIndex:index]; + if ([ref isTag] || [ref isRemoteBranch]) + return NO; + if ([[[historyController.repository headRef] ref] isEqualToRef:ref]) return NO; From d77d85b8073167249cfb8649b5612d6980276861 Mon Sep 17 00:00:00 2001 From: Felix Holmgren Date: Fri, 10 Sep 2010 03:31:21 +0500 Subject: [PATCH 079/110] Make the context slider work again --- html/views/commit/commit.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/views/commit/commit.js b/html/views/commit/commit.js index dfa9d34..849d9d5 100644 --- a/html/views/commit/commit.js +++ b/html/views/commit/commit.js @@ -1,7 +1,7 @@ /* Commit: Interface for selecting, staging, discarding, and unstaging hunks, individual lines, or ranges of lines. */ -var contextLines = 5; +var contextLines = 0; var showNewFile = function(file) { @@ -39,6 +39,7 @@ var setTitle = function(status) { var displayContext = function() { $("contextSize").style.display = ""; $("contextTitle").style.display = ""; + contextLines = $("contextSize").value; } var showFileChanges = function(file, cached) { @@ -51,7 +52,8 @@ var showFileChanges = function(file, cached) { hideState(); $("contextSize").oninput = function(element) { - contextSize = $("contextSize").value; + contextLines = $("contextSize").value; + Controller.refresh(); } if (file.status == 0) // New file? From c605b74476e023b8ad3c5dd9c11fc2aa09d7805f Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 11 Sep 2010 14:34:22 -0600 Subject: [PATCH 080/110] Add a File Path search mode Highlights any commit that touches a file. The "Show history of file" context menu item will now set the path search instead of creating a rev specifier. --- PBGitHistoryController.m | 10 ++-------- PBHistorySearchController.h | 1 + PBHistorySearchController.m | 31 +++++++++++++++++++++++++++---- gitx.m | 9 ++++++++- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 1de0764..c61a464 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -516,14 +516,8 @@ - (void)showCommitsFromTree:(id)sender { - // TODO: Enable this from webview as well! - - NSMutableArray *filePaths = [NSMutableArray arrayWithObjects:@"HEAD", @"--", NULL]; - [filePaths addObjectsFromArray:[sender representedObject]]; - - PBGitRevSpecifier *revSpec = [[PBGitRevSpecifier alloc] initWithParameters:filePaths]; - - repository.currentBranch = [repository addBranch:revSpec]; + NSString *searchString = [(NSArray *)[sender representedObject] componentsJoinedByString:@" "]; + [searchController setHistorySearch:searchString mode:kGitXPathSearchMode]; } - (void)showInFinderAction:(id)sender diff --git a/PBHistorySearchController.h b/PBHistorySearchController.h index c3e6459..d439906 100644 --- a/PBHistorySearchController.h +++ b/PBHistorySearchController.h @@ -13,6 +13,7 @@ typedef enum historySearchModes { kGitXBasicSeachMode = 1, kGitXPickaxeSearchMode, kGitXRegexSearchMode, + kGitXPathSearchMode, kGitXMaxSearchMode // always keep this item last } PBHistorySearchMode; diff --git a/PBHistorySearchController.m b/PBHistorySearchController.m index 2281da9..d59db39 100644 --- a/PBHistorySearchController.m +++ b/PBHistorySearchController.m @@ -35,6 +35,7 @@ #define kGitXBasicSearchLabel @"Subject, Author, SHA" #define kGitXPickaxeSearchLabel @"Commit (pickaxe)" #define kGitXRegexSearchLabel @"Commit (pickaxe regex)" +#define kGitXPathSearchLabel @"File path" #define kGitXSearchArrangedObjectsContext @"GitXSearchArrangedObjectsContext" @@ -244,6 +245,11 @@ item = [[NSMenuItem alloc] initWithTitle:kGitXRegexSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; [item setTarget:self]; [item setTag:kGitXRegexSearchMode]; + [searchMenu addItem:item]; + + item = [[NSMenuItem alloc] initWithTitle:kGitXPathSearchLabel action:@selector(selectSearchMode:) keyEquivalent:@""]; + [item setTarget:self]; + [item setTag:kGitXPathSearchMode]; [searchMenu addItem:item]; item = [NSMenuItem separatorItem]; @@ -289,6 +295,9 @@ item = [searchMenu itemWithTag:kGitXRegexSearchMode]; [item setState:(searchMode == kGitXRegexSearchMode) ? NSOnState : NSOffState]; + item = [searchMenu itemWithTag:kGitXPathSearchMode]; + [item setState:(searchMode == kGitXPathSearchMode) ? NSOnState : NSOffState]; + [[searchField cell] setSearchMenuTemplate:searchMenu]; [PBGitDefaults setHistorySearchMode:searchMode]; @@ -303,6 +312,9 @@ case kGitXRegexSearchMode: [[searchField cell] setPlaceholderString:kGitXRegexSearchLabel]; break; + case kGitXPathSearchMode: + [[searchField cell] setPlaceholderString:kGitXPathSearchLabel]; + break; default: [[searchField cell] setPlaceholderString:kGitXBasicSearchLabel]; break; @@ -372,7 +384,7 @@ -#pragma mark Pickaxe/Regex Search +#pragma mark Background Search - (void)startBackgroundSearch { @@ -390,9 +402,20 @@ results = nil; - NSMutableArray *searchArguments = [NSMutableArray arrayWithObjects:@"log", @"--pretty=format:%H", [NSString stringWithFormat:@"-S%@", searchString], nil]; - if (self.searchMode == kGitXRegexSearchMode) - [searchArguments insertObject:@"--pickaxe-regex" atIndex:1]; + NSMutableArray *searchArguments = [NSMutableArray arrayWithObjects:@"log", @"--pretty=format:%H", nil]; + switch (self.searchMode) { + case kGitXRegexSearchMode: + [searchArguments addObject:@"--pickaxe-regex"]; + case kGitXPickaxeSearchMode: + [searchArguments addObject:[NSString stringWithFormat:@"-S%@", searchString]]; + break; + case kGitXPathSearchMode: + [searchArguments addObject:@"--"]; + [searchArguments addObjectsFromArray:[searchString componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; + break; + default: + return; + } backgroundSearchTask = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:searchArguments inDir:[[historyController.repository fileURL] path]]; [backgroundSearchTask launch]; diff --git a/gitx.m b/gitx.m index f213977..05f2aa8 100644 --- a/gitx.m +++ b/gitx.m @@ -71,6 +71,8 @@ void usage(char const *programName) printf(" commits that introduce or remove an instance of \n"); printf(" -r, --regex=\n"); printf(" commits that introduce or remove strings that match \n"); + printf(" -p, --path=\n"); + printf(" commits that modify the file at file path\n"); printf("\n"); printf("Creating repositories\n"); printf(" These commands will create a git repository and then open it up in GitX\n"); @@ -214,10 +216,12 @@ void handleClone(NSURL *repositoryURL, NSMutableArray *arguments) #define kPickaxeSearch @"--Search=" #define kShortRegexSearch @"-r" #define kRegexSearch @"--regex=" +#define kShortPathSearch @"-p" +#define kPathSearch @"--path=" NSArray *commandLineSearchPrefixes() { - return [NSArray arrayWithObjects:kShortBasicSearch, kBasicSearch, kShortPickaxeSearch, kPickaxeSearch, kShortRegexSearch, kRegexSearch, nil]; + return [NSArray arrayWithObjects:kShortBasicSearch, kBasicSearch, kShortPickaxeSearch, kPickaxeSearch, kShortRegexSearch, kRegexSearch, kShortPathSearch, kPathSearch, nil]; } PBHistorySearchMode searchModeForCommandLineArgument(NSString *argument) @@ -231,6 +235,9 @@ PBHistorySearchMode searchModeForCommandLineArgument(NSString *argument) if ([argument hasPrefix:kShortRegexSearch] || [argument hasPrefix:kRegexSearch]) return kGitXRegexSearchMode; + if ([argument hasPrefix:kShortPathSearch] || [argument hasPrefix:kPathSearch]) + return kGitXPathSearchMode; + return 0; } From 8bb1173942328a68d9e04d2975a1f122902cd2a0 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 12 Sep 2010 16:33:23 -0600 Subject: [PATCH 081/110] Allow the stage view's context slider to move from 0 to 10 --- html/views/commit/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/commit/index.html b/html/views/commit/index.html index ef889de..54698da 100644 --- a/html/views/commit/index.html +++ b/html/views/commit/index.html @@ -14,7 +14,7 @@

- + Context: Nothing to commit From 5ddbcd18ef1494bb7cd00189d846e580e9d1d64a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 4 Sep 2010 12:04:30 -0600 Subject: [PATCH 082/110] Disable deleting and pushing the detached HEAD --- PBRefMenuItem.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index e7b7c0b..4b47fdc 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -44,6 +44,7 @@ NSString *headRefName = [headRef shortName]; BOOL isHead = [ref isEqualToRef:headRef]; BOOL isOnHeadBranch = isHead ? YES : [repo isRefOnHeadBranch:ref]; + BOOL isDetachedHead = (isHead && [headRefName isEqualToString:@"HEAD"]); NSString *remoteName = [ref remoteName]; if (!remoteName && [ref isBranch]) @@ -98,6 +99,9 @@ NSString *pushTitle = [NSString stringWithFormat:@"Push updates to %@", remoteName]; [items addObject:[PBRefMenuItem itemWithTitle:pushTitle action:@selector(pushUpdatesToRemote:) enabled:YES]]; } + else if (isDetachedHead) { + [items addObject:[PBRefMenuItem itemWithTitle:@"Push" action:nil enabled:NO]]; + } else { // push to default remote BOOL hasDefaultRemote = NO; @@ -128,7 +132,7 @@ // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:!isDetachedHead]]; for (PBRefMenuItem *item in items) { [item setTarget:target]; From 8591effc91d26ec5b6de7cb76399e15edf793711 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 12 Sep 2010 22:27:02 -0600 Subject: [PATCH 083/110] Bugfix: include missing scripting method definitions --- GitX.h | 5 +++++ GitX.sdef | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/GitX.h b/GitX.h index a07c4b7..9f7ff4e 100644 --- a/GitX.h +++ b/GitX.h @@ -77,6 +77,11 @@ * GitX Suite */ +// The GitX application. +@interface GitXApplication (GitXSuite) + +@end + // A document. @interface GitXDocument (GitXSuite) diff --git a/GitX.sdef b/GitX.sdef index 55a6d04..445b9f0 100644 --- a/GitX.sdef +++ b/GitX.sdef @@ -183,6 +183,18 @@ + + + + + + + + + + + + From 8637a21c3b6620ac87e03516b5e8f121e82b83b3 Mon Sep 17 00:00:00 2001 From: Joshua Bleecher Snyder Date: Fri, 9 Jul 2010 10:07:40 -0700 Subject: [PATCH 084/110] Display output of pre-commit hook --- PBGitIndex.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index ae954fa..87c7aa6 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -177,8 +177,13 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; int ret = 1; [self postCommitUpdate:@"Running hooks"]; - if (![repository executeHook:@"pre-commit" output:nil]) - return [self postCommitFailure:@"Pre-commit hook failed"]; + NSString *preCommitHookOutput = nil; + if (![repository executeHook:@"pre-commit" output:&preCommitHookOutput]) { + NSString *preCommitFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", + [preCommitHookOutput length] > 0 ? @":\n" : @"", + preCommitHookOutput]; + return [self postCommitFailure:preCommitFailureMessage]; + } if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) return [self postCommitFailure:@"Commit-msg hook failed"]; From ed833164d92fdd069c11272087ecbfce80c41584 Mon Sep 17 00:00:00 2001 From: Sebastian Staudt Date: Sun, 12 Sep 2010 14:30:11 +0200 Subject: [PATCH 085/110] Also display output of commit-msg hook --- PBGitIndex.m | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index 87c7aa6..d39ce25 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -177,16 +177,23 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; int ret = 1; [self postCommitUpdate:@"Running hooks"]; - NSString *preCommitHookOutput = nil; - if (![repository executeHook:@"pre-commit" output:&preCommitHookOutput]) { - NSString *preCommitFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", - [preCommitHookOutput length] > 0 ? @":\n" : @"", - preCommitHookOutput]; - return [self postCommitFailure:preCommitFailureMessage]; + NSString *hookFailureMessage = nil; + NSString *hookOutput = nil; + if (![repository executeHook:@"pre-commit" output:&hookOutput]) { + hookFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; } - if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) - return [self postCommitFailure:@"Commit-msg hook failed"]; + if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) { + hookFailureMessage = [NSString stringWithFormat:@"Commit-msg hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; + } + + if (hookFailureMessage != nil) { + return [self postCommitFailure:hookFailureMessage]; + } commitMessage = [NSString stringWithContentsOfFile:commitMessageFile encoding:NSUTF8StringEncoding error:nil]; From 21d1f3989fd8132251430bbe238de92dab502bf3 Mon Sep 17 00:00:00 2001 From: Sebastian Staudt Date: Mon, 13 Sep 2010 09:16:25 +0200 Subject: [PATCH 086/110] Added a dialog for failing commit hooks This enables the user to force a commit (i.e. --no-verify) when either pre-commit or commit-msg hook fails. --- GitX.xcodeproj/project.pbxproj | 10 + PBCommitHookFailedSheet.h | 25 + PBCommitHookFailedSheet.m | 38 + PBCommitHookFailedSheet.xib | 1288 ++++++++++++++++++++++++++++++++ PBGitCommitController.h | 1 + PBGitCommitController.m | 24 +- PBGitIndex.h | 3 +- PBGitIndex.m | 45 +- PBGitWindowController.h | 3 +- PBGitWindowController.m | 6 + PBGitXMessageSheet.h | 1 + PBGitXMessageSheet.m | 2 - 12 files changed, 1424 insertions(+), 22 deletions(-) create mode 100644 PBCommitHookFailedSheet.h create mode 100644 PBCommitHookFailedSheet.m create mode 100644 PBCommitHookFailedSheet.xib diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index f95d9c4..71a441a 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -21,6 +21,8 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */; }; + 02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */; }; 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; @@ -237,6 +239,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitHookFailedSheet.h; sourceTree = ""; }; + 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitHookFailedSheet.m; sourceTree = ""; }; + 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBCommitHookFailedSheet.xib; sourceTree = ""; }; 056438B60ED0C40B00985397 /* DetailViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DetailViewTemplate.png; path = Images/DetailViewTemplate.png; sourceTree = ""; }; 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; @@ -620,6 +625,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */, F5F7D0641062E7940072C81C /* UpdateKey.pem */, F50A41130EBB872D00208746 /* Widgets */, 47DBDB920E94F47200671A1E /* Preference Icons */, @@ -691,6 +697,8 @@ D82F435F111B9C6D00A25A39 /* Sheets */ = { isa = PBXGroup; children = ( + 02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */, + 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */, D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */, @@ -1172,6 +1180,7 @@ D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, D8F01C4B12182F19007F729F /* GitX.sdef in Resources */, D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */, + 02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1321,6 +1330,7 @@ D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */, D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, + 02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBCommitHookFailedSheet.h b/PBCommitHookFailedSheet.h new file mode 100644 index 0000000..869d196 --- /dev/null +++ b/PBCommitHookFailedSheet.h @@ -0,0 +1,25 @@ +// +// PBCommitHookFailedSheet.h +// GitX +// +// Created by Sebastian Staudt on 9/12/10. +// Copyright 2010 Sebastian Staudt. All rights reserved. +// + +#import + +#import "PBGitCommitController.h" +#import "PBGitXMessageSheet.h" + + +@interface PBCommitHookFailedSheet : PBGitXMessageSheet +{ + PBGitCommitController *commitController; +} + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller; + +- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller; +- (IBAction)forceCommit:(id)sender; + +@end \ No newline at end of file diff --git a/PBCommitHookFailedSheet.m b/PBCommitHookFailedSheet.m new file mode 100644 index 0000000..907d85a --- /dev/null +++ b/PBCommitHookFailedSheet.m @@ -0,0 +1,38 @@ +// +// PBCommitHookFailedSheet.m +// GitX +// +// Created by Sebastian Staudt on 9/12/10. +// Copyright 2010 Sebastian Staudt. All rights reserved. +// + +#import "PBCommitHookFailedSheet.h" +#import "PBGitWindowController.h" + + +@implementation PBCommitHookFailedSheet + +#pragma mark - +#pragma mark PBCommitHookFailedSheet + ++ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller +{ + PBCommitHookFailedSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCommitHookFailedSheet" andController:controller]; + [sheet beginMessageSheetForWindow:parentWindow withMessageText:message infoText:info]; +} + +- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller; +{ + self = [self initWithWindowNibName:windowNibName]; + commitController = controller; + + return self; +} + +- (IBAction)forceCommit:(id)sender +{ + [self closeMessageSheet:self]; + [commitController forceCommit:sender]; +} + +@end diff --git a/PBCommitHookFailedSheet.xib b/PBCommitHookFailedSheet.xib new file mode 100644 index 0000000..60e58b1 --- /dev/null +++ b/PBCommitHookFailedSheet.xib @@ -0,0 +1,1288 @@ + + + + 1050 + 10F569 + 788 + 1038.29 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 788 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCommitHookFailedSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 331}, {540, 179}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 289 + {{430, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + OK + + LucidaGrande + 13 + 1044 + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{17, 98}, {64, 64}} + + YES + + 130560 + 33554432 + + NSImage + NSApplicationIcon + + 0 + 0 + 0 + NO + + YES + + + + 266 + {{99, 142}, {424, 17}} + + YES + + 67239424 + 272629760 + <message> + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 274 + + YES + + + 2304 + + YES + + + 2322 + {423, 14} + + + + + + PGluZm8+A + + + YES + + YES + NSFont + NSParagraphStyle + + + YES + + Helvetica + 12 + 16 + + + 4 + + + + + + + + YES + + + 134 + + + + 423 + 1 + + + 2049 + 0 + + + 3 + MQA + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {423, 1e+07} + {223, 0} + + + + {422, 72} + + + + + + {4, -5} + 1 + + 2 + + + + -2147483392 + {{386, 1}, {15, 163}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + YES + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{98, 60}, {422, 72}} + + + 656 + + + + + + + 289 + {{289, 12}, {129, 32}} + + YES + + 67239424 + 134217728 + Force Commit + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + {540, 179} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + iconView + + + + 15 + + + + infoView + + + + 16 + + + + messageField + + + + 17 + + + + window + + + + 18 + + + + closeMessageSheet: + + + + 19 + + + + scrollView + + + + 20 + + + + forceCommit: + + + + 24 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + YES + + + + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 21 + + + YES + + + + + + 22 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 2.IBPluginDependency + 2.IBUserGuides + 21.IBPluginDependency + 22.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{279, 244}, {540, 179}} + com.apple.InterfaceBuilder.CocoaPlugin + {{279, 244}, {540, 179}} + + {196, 240} + {{357, 418}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + + 103 + 0 + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 24 + + + + YES + + PBCommitHookFailedSheet + PBGitXMessageSheet + + forceCommit: + id + + + forceCommit: + + forceCommit: + id + + + + IBProjectSource + PBCommitHookFailedSheet.h + + + + PBGitXMessageSheet + NSWindowController + + closeMessageSheet: + id + + + closeMessageSheet: + + closeMessageSheet: + id + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + NSImageView + NSTextView + NSTextField + NSScrollView + + + + YES + + YES + iconView + infoView + messageField + scrollView + + + YES + + iconView + NSImageView + + + infoView + NSTextView + + + messageField + NSTextField + + + scrollView + NSScrollView + + + + + IBProjectSource + PBGitXMessageSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + GitX.xcodeproj + 3 + + NSApplicationIcon + {128, 128} + + + diff --git a/PBGitCommitController.h b/PBGitCommitController.h index 0b39f05..ac852a3 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -29,5 +29,6 @@ - (IBAction) refresh:(id) sender; - (IBAction) commit:(id) sender; +- (IBAction) forceCommit:(id) sender; - (IBAction)signOff:(id)sender; @end diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 02d74e1..9f0eca1 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -14,9 +14,11 @@ @interface PBGitCommitController () - (void)refreshFinished:(NSNotification *)notification; +- (void)commitWithVerification:(BOOL) doVerify; - (void)commitStatusUpdated:(NSNotification *)notification; - (void)commitFinished:(NSNotification *)notification; - (void)commitFailed:(NSNotification *)notification; +- (void)commitHookFailed:(NSNotification *)notification; - (void)amendCommit:(NSNotification *)notification; - (void)indexChanged:(NSNotification *)notification; - (void)indexOperationFailed:(NSNotification *)notification; @@ -38,6 +40,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitStatusUpdated:) name:PBGitIndexCommitStatus object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitFinished:) name:PBGitIndexFinishedCommit object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitFailed:) name:PBGitIndexCommitFailed object:index]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(commitHookFailed:) name:PBGitIndexCommitHookFailed object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(amendCommit:) name:PBGitIndexAmendMessageAvailable object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexChanged:) name:PBGitIndexIndexUpdated object:index]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexOperationFailed:) name:PBGitIndexOperationFailed object:index]; @@ -106,6 +109,16 @@ } - (IBAction) commit:(id) sender +{ + [self commitWithVerification:YES]; +} + +- (IBAction) forceCommit:(id) sender +{ + [self commitWithVerification:NO]; +} + +- (void) commitWithVerification:(BOOL) doVerify { if ([[NSFileManager defaultManager] fileExistsAtPath:[repository.fileURL.path stringByAppendingPathComponent:@"MERGE_HEAD"]]) { [[repository windowController] showMessageSheet:@"Cannot commit merges" infoText:@"GitX cannot commit merges yet. Please commit your changes from the command line."]; @@ -129,7 +142,7 @@ self.isBusy = YES; [commitMessageView setEditable:NO]; - [index commitWithMessage:commitMessage]; + [index commitWithMessage:commitMessage andVerify:doVerify]; } @@ -161,6 +174,15 @@ [[repository windowController] showMessageSheet:@"Commit failed" infoText:reason]; } +- (void)commitHookFailed:(NSNotification *)notification +{ + self.isBusy = NO; + NSString *reason = [[notification userInfo] objectForKey:@"description"]; + self.status = [@"Commit hook failed: " stringByAppendingString:reason]; + [commitMessageView setEditable:YES]; + [[repository windowController] showCommitHookFailedSheet:@"Commit hook failed" infoText:reason commitController:self]; +} + - (void)amendCommit:(NSNotification *)notification { // Replace commit message with the old one if it's less than 3 characters long. diff --git a/PBGitIndex.h b/PBGitIndex.h index 7ca1db7..dee0651 100644 --- a/PBGitIndex.h +++ b/PBGitIndex.h @@ -26,6 +26,7 @@ extern NSString *PBGitIndexIndexUpdated; // Committing files extern NSString *PBGitIndexCommitStatus; extern NSString *PBGitIndexCommitFailed; +extern NSString *PBGitIndexCommitHookFailed; extern NSString *PBGitIndexFinishedCommit; // Changing to amend @@ -66,7 +67,7 @@ extern NSString *PBGitIndexOperationFailed; // Refresh the index - (void)refresh; -- (void)commitWithMessage:(NSString *)commitMessage; +- (void)commitWithMessage:(NSString *)commitMessage andVerify:(BOOL) doVerify; // Inter-file changes: - (BOOL)stageFiles:(NSArray *)stageFiles; diff --git a/PBGitIndex.m b/PBGitIndex.m index d39ce25..e41e5e5 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -21,6 +21,7 @@ NSString *PBGitIndexIndexUpdated = @"GBGitIndexIndexUpdated"; NSString *PBGitIndexCommitStatus = @"PBGitIndexCommitStatus"; NSString *PBGitIndexCommitFailed = @"PBGitIndexCommitFailed"; +NSString *PBGitIndexCommitHookFailed = @"PBGitIndexCommitHookFailed"; NSString *PBGitIndexFinishedCommit = @"PBGitIndexFinishedCommit"; NSString *PBGitIndexAmendMessageAvailable = @"PBGitIndexAmendMessageAvailable"; @@ -48,6 +49,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; - (NSString *) parentTree; - (void)postCommitUpdate:(NSString *)update; - (void)postCommitFailure:(NSString *)reason; +- (void)postCommitHookFailure:(NSString *)reason; - (void)postIndexChange; - (void)postOperationFailed:(NSString *)description; @end @@ -145,7 +147,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; } // TODO: make Asynchronous -- (void)commitWithMessage:(NSString *)commitMessage +- (void)commitWithMessage:(NSString *)commitMessage andVerify:(BOOL) doVerify { NSMutableString *commitSubject = [@"commit: " mutableCopy]; NSRange newLine = [commitMessage rangeOfString:@"\n"]; @@ -176,23 +178,25 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; [self postCommitUpdate:@"Creating commit"]; int ret = 1; - [self postCommitUpdate:@"Running hooks"]; - NSString *hookFailureMessage = nil; - NSString *hookOutput = nil; - if (![repository executeHook:@"pre-commit" output:&hookOutput]) { - hookFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", - [hookOutput length] > 0 ? @":\n" : @"", - hookOutput]; - } - - if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) { - hookFailureMessage = [NSString stringWithFormat:@"Commit-msg hook failed%@%@", - [hookOutput length] > 0 ? @":\n" : @"", - hookOutput]; - } + if (doVerify) { + [self postCommitUpdate:@"Running hooks"]; + NSString *hookFailureMessage = nil; + NSString *hookOutput = nil; + if (![repository executeHook:@"pre-commit" output:&hookOutput]) { + hookFailureMessage = [NSString stringWithFormat:@"Pre-commit hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; + } - if (hookFailureMessage != nil) { - return [self postCommitFailure:hookFailureMessage]; + if (![repository executeHook:@"commit-msg" withArgs:[NSArray arrayWithObject:commitMessageFile] output:nil]) { + hookFailureMessage = [NSString stringWithFormat:@"Commit-msg hook failed%@%@", + [hookOutput length] > 0 ? @":\n" : @"", + hookOutput]; + } + + if (hookFailureMessage != nil) { + return [self postCommitHookFailure:hookFailureMessage]; + } } commitMessage = [NSString stringWithContentsOfFile:commitMessageFile encoding:NSUTF8StringEncoding error:nil]; @@ -254,6 +258,13 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; userInfo:[NSDictionary dictionaryWithObject:reason forKey:@"description"]]; } +- (void)postCommitHookFailure:(NSString *)reason +{ + [[NSNotificationCenter defaultCenter] postNotificationName:PBGitIndexCommitHookFailed + object:self + userInfo:[NSDictionary dictionaryWithObject:reason forKey:@"description"]]; +} + - (void)postOperationFailed:(NSString *)description { [[NSNotificationCenter defaultCenter] postNotificationName:PBGitIndexOperationFailed diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 29f5245..0f38e22 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -9,7 +9,7 @@ #import #import "PBGitRepository.h" -@class PBViewController, PBGitSidebarController; +@class PBViewController, PBGitSidebarController, PBGitCommitController; @interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; @@ -37,6 +37,7 @@ - (void)changeContentController:(PBViewController *)controller; +- (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)infoText commitController:(PBGitCommitController *)controller; - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 1968c48..9fb9c13 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -11,6 +11,7 @@ #import "PBGitCommitController.h" #import "Terminal.h" #import "PBCloneRepsitoryToSheet.h" +#import "PBCommitHookFailedSheet.h" #import "PBGitXMessageSheet.h" #import "PBGitSidebarController.h" @@ -109,6 +110,11 @@ [sidebarController selectCurrentBranch]; } +- (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)infoText commitController:(PBGitCommitController *)controller +{ + [PBCommitHookFailedSheet beginMessageSheetForWindow:[self window] withMessageText:messageText infoText:infoText commitController:controller]; +} + - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText { [PBGitXMessageSheet beginMessageSheetForWindow:[self window] withMessageText:messageText infoText:infoText]; diff --git a/PBGitXMessageSheet.h b/PBGitXMessageSheet.h index 440cf01..60cd3c7 100644 --- a/PBGitXMessageSheet.h +++ b/PBGitXMessageSheet.h @@ -21,6 +21,7 @@ + (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withError:(NSError *)error; +- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; - (IBAction)closeMessageSheet:(id)sender; diff --git a/PBGitXMessageSheet.m b/PBGitXMessageSheet.m index 5c8441c..783cc94 100644 --- a/PBGitXMessageSheet.m +++ b/PBGitXMessageSheet.m @@ -14,8 +14,6 @@ @interface PBGitXMessageSheet () -- (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info; - - (void)setInfoString:(NSString *)info; - (void)resizeWindow; From da97c25a6aa3d74ab4aba417a8e6d6673f15e63d Mon Sep 17 00:00:00 2001 From: German Laullon Date: Tue, 14 Sep 2010 20:38:58 -0700 Subject: [PATCH 087/110] initial highlighter file view --- GLFileView.h | 21 + GLFileView.m | 33 + GitX.xcodeproj/project.pbxproj | 14 + PBGitHistoryController.h | 1 + PBGitHistoryController.m | 1 + PBGitHistoryView.xib | 536 ++--- PBGitTree.h | 1 + html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt | 165 ++ .../scripts/clipboard.swf | Bin 0 -> 1361 bytes .../scripts/shBrushAS3.js | 61 + .../scripts/shBrushBash.js | 66 + .../scripts/shBrushCSharp.js | 67 + .../scripts/shBrushColdFusion.js | 102 + .../scripts/shBrushCpp.js | 99 + .../scripts/shBrushCss.js | 93 + .../scripts/shBrushDelphi.js | 57 + .../scripts/shBrushDiff.js | 43 + .../scripts/shBrushErlang.js | 54 + .../scripts/shBrushGroovy.js | 69 + .../scripts/shBrushJScript.js | 52 + .../scripts/shBrushJava.js | 59 + .../scripts/shBrushJavaFX.js | 60 + .../scripts/shBrushObjC.js | 59 + .../scripts/shBrushPerl.js | 74 + .../scripts/shBrushPhp.js | 91 + .../scripts/shBrushPlain.js | 35 + .../scripts/shBrushPowerShell.js | 76 + .../scripts/shBrushPython.js | 66 + .../scripts/shBrushRuby.js | 57 + .../scripts/shBrushScala.js | 53 + .../scripts/shBrushSql.js | 68 + .../scripts/shBrushVb.js | 58 + .../scripts/shBrushXml.js | 71 + .../scripts/shCore.js | 30 + .../scripts/shLegacy.js | 30 + .../syntaxhighlighter_2.1.364/src/shCore.js | 2077 +++++++++++++++++ .../syntaxhighlighter_2.1.364/src/shLegacy.js | 172 ++ .../syntaxhighlighter_2.1.364/styles/help.png | Bin 0 -> 786 bytes .../styles/magnifier.png | Bin 0 -> 615 bytes .../styles/page_white_code.png | Bin 0 -> 603 bytes .../styles/page_white_copy.png | Bin 0 -> 309 bytes .../styles/printer.png | Bin 0 -> 731 bytes .../styles/shCore.css | 330 +++ .../styles/shThemeDefault.css | 173 ++ .../styles/shThemeDjango.css | 176 ++ .../styles/shThemeEclipse.css | 190 ++ .../styles/shThemeEmacs.css | 175 ++ .../styles/shThemeFadeToGrey.css | 177 ++ .../styles/shThemeMidnight.css | 175 ++ .../styles/shThemeRDark.css | 175 ++ html/lib/syntaxhighlighter_2.1.364/test.html | 42 + html/views/fileview/fileview.js | 9 + html/views/fileview/index.html | 14 + 53 files changed, 5911 insertions(+), 396 deletions(-) create mode 100644 GLFileView.h create mode 100644 GLFileView.m create mode 100644 html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/src/shCore.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/src/shLegacy.js create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/help.png create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/magnifier.png create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/page_white_code.png create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/page_white_copy.png create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/printer.png create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shCore.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeDefault.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeDjango.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeEclipse.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeEmacs.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeFadeToGrey.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeMidnight.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeRDark.css create mode 100644 html/lib/syntaxhighlighter_2.1.364/test.html create mode 100644 html/views/fileview/fileview.js create mode 100644 html/views/fileview/index.html diff --git a/GLFileView.h b/GLFileView.h new file mode 100644 index 0000000..6c2256b --- /dev/null +++ b/GLFileView.h @@ -0,0 +1,21 @@ +// +// GLFileView.h +// GitX +// +// Created by German Laullon on 14/09/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBWebController.h" + +#import "PBGitCommit.h" +#import "PBGitHistoryController.h" +#import "PBRefContextDelegate.h" + + +@interface GLFileView : PBWebController { + IBOutlet PBGitHistoryController* historyController; +} + +@end diff --git a/GLFileView.m b/GLFileView.m new file mode 100644 index 0000000..a61b3c7 --- /dev/null +++ b/GLFileView.m @@ -0,0 +1,33 @@ +// +// GLFileView.m +// GitX +// +// Created by German Laullon on 14/09/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import "GLFileView.h" + + +@implementation GLFileView + +- (void) awakeFromNib +{ + startFile = @"fileview"; + //repository = historyController.repository; + [super awakeFromNib]; + [historyController.treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeController"]; +} + +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + //NSLog(@"keyPath=%@ change=%@ context=%@ object=%@ \n %@",keyPath,change,context,object,[historyController.treeController selectedObjects]); + NSArray *files=[historyController.treeController selectedObjects]; + if ([files count]>0) { + PBGitTree *file=[files objectAtIndex:0]; + NSString *fileTxt=[file textContents]; + id script = [view windowScriptObject]; + [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]]; + } +} +@end diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index f95d9c4..d7e95db 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ /* Begin PBXBuildFile section */ 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; }; + 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 310DC1D71240599E0017A0F7 /* GLFileView.m */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; 47DBDB580E94EDE700671A1E /* DBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDB570E94EDE700671A1E /* DBPrefsWindowController.m */; }; @@ -243,6 +244,8 @@ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 310DC1D61240599E0017A0F7 /* GLFileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLFileView.h; sourceTree = ""; }; + 310DC1D71240599E0017A0F7 /* GLFileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLFileView.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX_Prefix.pch; sourceTree = ""; }; 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HistoryViewTemplate.png; path = Images/HistoryViewTemplate.png; sourceTree = ""; }; 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CommitViewTemplate.png; path = Images/CommitViewTemplate.png; sourceTree = ""; }; @@ -656,6 +659,15 @@ name = Frameworks; sourceTree = ""; }; + 310DC1D5124059820017A0F7 /* FileView */ = { + isa = PBXGroup; + children = ( + 310DC1D61240599E0017A0F7 /* GLFileView.h */, + 310DC1D71240599E0017A0F7 /* GLFileView.m */, + ); + name = FileView; + sourceTree = ""; + }; 47DBDB920E94F47200671A1E /* Preference Icons */ = { isa = PBXGroup; children = ( @@ -772,6 +784,7 @@ F57CC3850E05DDC1000472E2 /* Controllers */ = { isa = PBXGroup; children = ( + 310DC1D5124059820017A0F7 /* FileView */, F58DB55610566D1F00CFDF4A /* Sidebar */, F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, @@ -1321,6 +1334,7 @@ D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */, D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, + 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 8905277..9eb81e9 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -54,6 +54,7 @@ PBGitCommit *selectedCommit; } +@property (readonly) NSTreeController* treeController; @property (assign) int selectedCommitDetailsIndex; @property (retain) PBGitCommit *webCommit; @property (retain) PBGitTree* gitTree; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index c61a464..1693689 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -42,6 +42,7 @@ @synthesize selectedCommitDetailsIndex, webCommit, gitTree, commitController, refController; @synthesize searchController; @synthesize commitList; +@synthesize treeController; - (void)awakeFromNib { diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 4bda4c9..59ef69d 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@

YES - + YES @@ -100,6 +100,9 @@ PBWebHistoryController + + GLFileView + 4370 @@ -113,7 +116,7 @@ 289 - {{805, 3}, {37, 25}} + {{908, 3}, {37, 25}} YES @@ -299,7 +302,7 @@ 10 - {{0, -2}, {852, 5}} + {{0, -2}, {955, 5}} {0, 0} @@ -327,7 +330,7 @@ NO - {{0, 402}, {852, 30}} + {{0, 404}, {955, 30}} PBGitGradientBarView @@ -344,7 +347,7 @@ 10 - {{0, 143}, {852, 5}} + {{0, 144}, {955, 5}} {0, 0} @@ -376,13 +379,13 @@ 4352 - {852, 129} + {955, 130} YES 256 - {852, 17} + {955, 17} @@ -396,7 +399,7 @@ YES SubjectColumn - 549 + 652 40 1000 @@ -517,7 +520,7 @@ - MMMM d, yyyy h:mm a + d 'de' MMMM 'de' yyyy HH:mm NO @@ -644,7 +647,7 @@ 0 - {{0, 17}, {852, 129}} + {{0, 17}, {955, 130}} @@ -677,7 +680,7 @@ YES - {852, 17} + {955, 17} @@ -686,7 +689,7 @@ - {852, 146} + {955, 147} 560 @@ -706,7 +709,7 @@ -2147482359 - {{637, 3}, {16, 16}} + {{740, 3}, {16, 16}} 20746 100 @@ -714,7 +717,7 @@ 265 - {{662, 2}, {180, 19}} + {{765, 2}, {180, 19}} YES @@ -775,7 +778,7 @@ 265 - {{611, 3}, {43, 18}} + {{714, 3}, {43, 18}} YES @@ -811,7 +814,7 @@ 265 - {{527, 5}, {80, 14}} + {{630, 5}, {80, 14}} YES @@ -896,12 +899,12 @@ - {{0, 146}, {852, 24}} + {{0, 147}, {955, 24}} PBGitGradientBarView - {852, 170} + {955, 171} NSView @@ -913,7 +916,7 @@ 18 - {852, 232} + {955, 233} YES @@ -948,12 +951,12 @@ public.url-name - {{1, 0}, {851, 233}} + {{1, 0}, {954, 234}} - + YES @@ -975,7 +978,7 @@ YES - {852, 232} + {955, 233} Details @@ -1006,7 +1009,7 @@ 4368 - {191, 232} + {216, 233} YES @@ -1017,7 +1020,7 @@ YES - 188 + 213 16 1000 @@ -1060,7 +1063,7 @@ 0 - {{1, 1}, {191, 232}} + {{1, 1}, {216, 233}} @@ -1070,7 +1073,7 @@ 256 - {{192, 1}, {15, 232}} + {{217, 1}, {15, 233}} _doScroller: @@ -1088,7 +1091,7 @@ 0.99801188707351685 - {208, 234} + {233, 235} 18 @@ -1097,259 +1100,57 @@ QSAAAEEgAABBmAAAQZgAAA - + - 4370 + 268 YES - - - 2304 - + + + 274 + YES - - - 2322 - {545, 98} - - - - - - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Et harumd und lookum like Greek to me, dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda - - - YES - - YES - NSFont - NSParagraphStyle - - - YES - - Monaco - 10 - 16 - - - 3 - - YES - - 0.0 - - - 56 - - - 112 - - - 168 - - - 224 - - - 280 - - - 336 - - - 392 - - - 448 - - - 504 - - - 560 - - - 616 - - - 672 - - - 728 - - - 784 - - - 840 - - - 896 - - - 952 - - - 1008 - - - 1064 - - - 1120 - - - 1176 - - - 1232 - - - 1288 - - - 1344 - - - 1400 - - - 1456 - - - 1512 - - - 1568 - - - 1624 - - - 1680 - - - 1736 - - - - - - - - - YES - - - 6 - - - - 545 - 1 - - - 11233 - 0 - - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - 6 - System - selectedTextBackgroundColor - - - - 6 - System - selectedTextColor - - - - - - - YES - - YES - NSColor - NSUnderline - - - YES - - 1 - MCAwIDEAA - - - - - - - 7 - {1190, 1e+07} - {0, 0} - + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name - {{1, 1}, {628, 232}} - - - - - - {4, -5} - 1 - - 4 - - - - 256 - {{629, 1}, {15, 217}} - - - _doScroller: - 0.030031679198145866 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - 1 - - _doScroller: - 1 - 0.94565218687057495 + {723, 235} + + + + + + YES + YES - {{209, 0}, {645, 234}} + {{234, 0}, {723, 235}} - - 18 - - - + NSView - {{-1, -1}, {854, 234}} + {{-1, -1}, {957, 235}} YES 2 - {852, 232} + {955, 233} Tree @@ -1368,18 +1169,18 @@
- {{0, 171}, {852, 232}} + {{0, 172}, {955, 233}} NSView
- {852, 403} + {955, 405} 2 HistoryViewSplitView - {852, 432} + {955, 434} NSView @@ -1728,35 +1529,6 @@ 290 - - - value: selection.textContents - - - - - - value: selection.textContents - value - selection.textContents - - YES - - YES - NSAllowsEditingMultipleValuesSelection - NSConditionallySetsEditable - - - YES - - - - - 2 - - - 291 - searchField @@ -1909,14 +1681,6 @@ 395 - - - controller - - - - 396 - enabled: selectedCommitDetailsIndex @@ -2153,6 +1917,22 @@ 448 + + + view + + + + 453 + + + + historyController + + + + 454 + @@ -2408,23 +2188,11 @@ YES - + - - 11 - - - YES - - - - - - File Contents Scroll View - 10 @@ -2470,21 +2238,6 @@ - - 14 - - - - - 13 - - - - - 12 - - - 311 @@ -2758,6 +2511,26 @@ + + 449 + + + YES + + + + + + 450 + + + FileViewer + + + 452 + + + @@ -2766,11 +2539,6 @@ YES -3.IBPluginDependency 10.IBPluginDependency - 11.IBPluginDependency - 12.CustomClassName - 12.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency 15.CustomClassName 15.IBPluginDependency 16.IBPluginDependency @@ -2867,6 +2635,8 @@ 430.IBPluginDependency 431.IBPluginDependency 447.IBPluginDependency + 449.IBPluginDependency + 450.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 48.IBPluginDependency @@ -2883,11 +2653,6 @@ YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - PBQLTextView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBQLOutlineView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3052,7 +2817,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{9, 486}, {852, 432}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + {{2069, 399}, {955, 434}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3088,11 +2855,30 @@ - 448 + 454 YES + + GLFileView + PBWebController + + historyController + PBGitHistoryController + + + historyController + + historyController + PBGitHistoryController + + + + IBProjectSource + GLFileView.h + + GitXRelativeDateFormatter NSFormatter @@ -3556,9 +3342,7 @@ YES YES - selectBasicSearch: - selectPickaxeSearch: - selectRegexSearch: + selectSearchMode: stepperPressed: updateSearch: @@ -3567,32 +3351,20 @@ id id id - id - id YES YES - selectBasicSearch: - selectPickaxeSearch: - selectRegexSearch: + selectSearchMode: stepperPressed: updateSearch: YES - selectBasicSearch: - id - - - selectPickaxeSearch: - id - - - selectRegexSearch: + selectSearchMode: id @@ -3697,25 +3469,6 @@ PBQLOutlineView.h - - PBQLTextView - NSTextView - - controller - PBGitHistoryController - - - controller - - controller - PBGitHistoryController - - - - IBProjectSource - PBQLTextView.h - - PBRefController NSObject @@ -4464,6 +4217,13 @@ QuartzCore.framework/Headers/CIImageProvider.h + + NSObject + + IBFrameworkSource + ScriptingBridge.framework/Headers/SBApplication.h + + NSObject @@ -4685,14 +4445,6 @@ NSControl - - NSText - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSText.h - - NSTextField NSControl @@ -4709,14 +4461,6 @@ AppKit.framework/Headers/NSTextFieldCell.h - - NSTextView - NSText - - IBFrameworkSource - AppKit.framework/Headers/NSTextView.h - - NSTreeController NSObjectController diff --git a/PBGitTree.h b/PBGitTree.h index d48ab6e..67951a8 100644 --- a/PBGitTree.h +++ b/PBGitTree.h @@ -26,6 +26,7 @@ + (PBGitTree*) rootForCommit: (id) commit; + (PBGitTree*) treeForTree: (PBGitTree*) tree andPath: (NSString*) path; - (void) saveToFolder: (NSString *) directory; +- (NSString *)textContents; - (NSString*) tmpFileNameForContents; - (long long)fileSize; diff --git a/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt b/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt new file mode 100644 index 0000000..d74a432 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf b/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf new file mode 100644 index 0000000000000000000000000000000000000000..1b4d90a0fb838b38828bb2bb7f74c6629fd200c2 GIT binary patch literal 1361 zcmV-X1+Mx-S5pZa2LJ$goPAY&Y!pQlpV_b3-TUm}^X0f<&rEX&Y!- zauV@_vU_)Py)ApUWp7*B8VsPJiAGFNK>4FKkPyQkC1}JT#u^DBO2jKc3GfG)m^Ofk zs3=N6oxQ8o3UM-$nL$E532LObqcsxE{WFsO3;V4dFe?0)> zgCA)Zu=dGSgza-j~MBmh1>=YHvhW zjM$S(8ar~Rn40d@ltH0g?^m$}uWf!Q!%kH< z#xP^(x+!Y95+m+Yab4_H3?+$4u(V@Vt}~XDzL_;iqL{^o zp&OJavdxwNF<%uW+>lhbv~>tJx&D)vV-^K@4-n>gIL}Cuo^)MK^j2@Q5=E@(E?&c#M%&R zN2~)uCxR{n-3aC(n2%rqf`tecA?Oi`AoGNKe;%BVkBlB`FLik`TjxQHxw+$uc$EF~c!W)_K#E)2;kuZ3;AC~kD(D%158!=faIH7g*#&hCJlDj!{@^#Oh z&YnA!snInzdhQjh`|(Qhx29Y7cdBDm2OEziuibn3#L~q}Ki^y5KlPSqKlipTm^gFf zNMdBlx9#e9;OyPW9qD~{$8PeEH?Qm5Q+2lM%JJZp!X>x%IyQ5xfRV{0N=) literal 0 HcmV?d00001 diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js new file mode 100644 index 0000000..985a3e8 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js @@ -0,0 +1,61 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.AS3 = function() +{ + // Created by Peter Atoria @ http://iAtoria.com + + var inits = 'class interface function package'; + + var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + + 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + + 'extends false final finally flash_proxy for get if implements import in include Infinity ' + + 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + + 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + + 'return set static String super switch this throw true try typeof uint undefined unescape ' + + 'use void while with' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable + { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); +}; + +SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js new file mode 100644 index 0000000..f94b951 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js @@ -0,0 +1,66 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Bash = function() +{ + var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le'; + var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + + 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + + 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + + 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + + 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + + 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + + 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + + 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + + 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + + 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + + 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + + 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + + 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + + 'vi watch wc whereis which who whoami Wget xargs yes' + ; + + this.findMatches = function(regexList, code) + { + code = code.replace(/>/g, '>').replace(/</g, '<'); + this.code = code; + return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]); + }; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands + ]; +} + +SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js new file mode 100644 index 0000000..60b5be5 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js @@ -0,0 +1,67 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.CSharp = function() +{ + var keywords = 'abstract as base bool break byte case catch char checked class const ' + + 'continue decimal default delegate do double else enum event explicit ' + + 'extern false finally fixed float for foreach get goto if implicit in int ' + + 'interface internal is lock long namespace new null object operator out ' + + 'override params private protected public readonly ref return sbyte sealed set ' + + 'short sizeof stackalloc static string struct switch this throw true try ' + + 'typeof uint ulong unchecked unsafe ushort using virtual void while'; + + function fixComments(match, regexInfo) + { + var css = (match[0].indexOf("///") == 0) + ? 'color1' + : 'comments' + ; + + return [new SyntaxHighlighter.Match(match[0], match.index, css)]; + } + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword + { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' + { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; + diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js new file mode 100644 index 0000000..57de521 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js @@ -0,0 +1,102 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.ColdFusion = function() +{ + // Contributed by Jen + // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus + + var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + + 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + + 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + + 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + + 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + + 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + + 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + + 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + + 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + + 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + + 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + + 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + + 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + + 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + + 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + + 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + + 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + + 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + + 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + + 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + + 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + + 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + + 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + + 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + + 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + + 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + + 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + + 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + + 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + + 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + + 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + + 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + + 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + + 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + + 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + + 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + + 'XmlValidate Year YesNoFormat'; + + var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + + 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + + 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + + 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + + 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + + 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + + 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + + 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + + 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + + 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + + 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + + 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + + 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + + 'cfwindow cfxml cfzip cfzipparam'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; +} + +SyntaxHighlighter.brushes.ColdFusion.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.ColdFusion.aliases = ['coldfusion','cf']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js new file mode 100644 index 0000000..c80c1cb --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js @@ -0,0 +1,99 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Cpp = function() +{ + // Copyright 2006 Shin, YoungJin + + var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + + 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + + 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + + 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + + 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + + 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + + 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + + 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + + 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + + 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + + 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + + 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + + 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + + 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + + 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + + 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + + 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + + 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + + 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + + '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + + 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + + 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + + 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + + 'va_list wchar_t wctrans_t wctype_t wint_t signed'; + + var keywords = 'break case catch class const __finally __exception __try ' + + 'const_cast continue private public protected __declspec ' + + 'default delete deprecated dllexport dllimport do dynamic_cast ' + + 'else enum explicit extern if for friend goto inline ' + + 'mutable naked namespace new noinline noreturn nothrow ' + + 'register reinterpret_cast return selectany ' + + 'sizeof static static_cast struct switch template this ' + + 'thread throw true false try typedef typeid typename union ' + + 'using uuid virtual void volatile whcar_t while'; + + var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + + 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + + 'clock ctime difftime gmtime localtime mktime strftime time'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^ *#.*/gm, css: 'preprocessor' }, + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, + { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } + ]; +}; + +SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js new file mode 100644 index 0000000..a431ec2 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js @@ -0,0 +1,93 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.CSS = function() +{ + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes + { regex: /!important/g, css: 'color3' }, // !important + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + + this.forHtmlScript({ + left: /(<|<)\s*style.*?(>|>)/gi, + right: /(<|<)\/\s*style\s*(>|>)/gi + }); +}; + +SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.CSS.aliases = ['css']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js new file mode 100644 index 0000000..4487765 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Delphi = function() +{ + var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + + 'case char class comp const constructor currency destructor div do double ' + + 'downto else end except exports extended false file finalization finally ' + + 'for function goto if implementation in inherited int64 initialization ' + + 'integer interface is label library longint longword mod nil not object ' + + 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + + 'pint64 pointer private procedure program property pshortstring pstring ' + + 'pvariant pwidechar pwidestring protected public published raise real real48 ' + + 'record repeat set shl shortint shortstring shr single smallint string then ' + + 'threadvar to true try type unit until uses val var varirnt while widechar ' + + 'widestring with word write writeln xor'; + + this.regexList = [ + { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) + { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags + { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; +}; + +SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js new file mode 100644 index 0000000..4cf667a --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js @@ -0,0 +1,43 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Diff = function() +{ + this.regexList = [ + { regex: /^\+\+\+.*$/gm, css: 'color2' }, + { regex: /^\-\-\-.*$/gm, css: 'color2' }, + { regex: /^\s.*$/gm, css: 'color1' }, + { regex: /^@@.*@@$/gm, css: 'variable' }, + { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, + { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } + ]; +}; + +SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js new file mode 100644 index 0000000..e040592 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js @@ -0,0 +1,54 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Erlang = function() +{ + // Contributed by Jean-Lou Dupont + // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html + + // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 + var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ + 'case catch cond div end fun if let not of or orelse '+ + 'query receive rem try when xor'+ + // additional + ' module export import define'; + + this.regexList = [ + { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, + { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, + { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, + { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; +}; + +SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js new file mode 100644 index 0000000..4872777 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js @@ -0,0 +1,69 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Groovy = function() +{ + // Contributed by Andres Almiray + // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter + + var keywords = 'as assert break case catch class continue def default do else extends finally ' + + 'if in implements import instanceof interface new package property return switch ' + + 'throw throws try while public protected private static'; + var types = 'void boolean byte char short int long float double'; + var constants = 'null'; + var methods = 'allProperties count get size '+ + 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + + 'findIndexOf grep inject max min reverseEach sort ' + + 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + + 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + + 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + + 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + + 'transformChar transformLine withOutputStream withPrintWriter withStream ' + + 'withStreams withWriter withWriterAppend write writeLine '+ + 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ + 'getText'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /""".*"""/g, css: 'string' }, // GStrings + { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword + { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type + { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +} + +SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Groovy.aliases = ['groovy']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js new file mode 100644 index 0000000..fdb7398 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.JScript = function() +{ + var keywords = 'break case catch continue ' + + 'default delete do else false ' + + 'for function if in instanceof ' + + 'new null return super switch ' + + 'this throw true try typeof var while with' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); +}; + +SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js new file mode 100644 index 0000000..810049b --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Java = function() +{ + var keywords = 'abstract assert boolean break byte case catch char class const ' + + 'continue default do double else enum extends ' + + 'false final finally float for goto if implements import ' + + 'instanceof int interface long native new null ' + + 'package private protected public return ' + + 'short static strictfp super switch synchronized this throw throws true ' + + 'transient try void volatile while'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments + { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno + { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword + ]; + + this.forHtmlScript({ + left : /(<|<)%[@!=]?/g, + right : /%(>|>)/g + }); +}; + +SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Java.aliases = ['java']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js new file mode 100644 index 0000000..e22c2ec --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js @@ -0,0 +1,60 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.JavaFX = function() +{ + // Contributed by Patrick Webster + // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html + var datatypes = 'Boolean Byte Character Double Duration ' + + 'Float Integer Long Number Short String Void' + ; + + var keywords = 'abstract after and as assert at before bind bound break catch class ' + + 'continue def delete else exclusive extends false finally first for from ' + + 'function if import in indexof init insert instanceof into inverse last ' + + 'lazy mixin mod nativearray new not null on or override package postinit ' + + 'protected public public-init public-read replace return reverse sizeof ' + + 'step super then this throw true try tween typeof var where while with ' + + 'attribute let private readonly static trigger' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js new file mode 100644 index 0000000..2b93479 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * Copyright (C) 2010 German Laullon. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.ObjC = function() +{ + var keywords = 'abstract assert boolean break byte case catch char class const ' + + 'continue default do double else enum extends ' + + 'false final finally float for goto if implements import ' + + 'instanceof int interface long native new null ' + + 'package private protected public return ' + + 'short static strictfp super switch synchronized this throw throws true ' + + 'transient try void volatile while id synthesize pragma self IBAction IBOutlet property'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments + { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: /(\w*):/g, css: 'color1' }, // + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword + ]; + + this.forHtmlScript({ + left : /(<|<)%[@!=]?/g, + right : /%(>|>)/g + }); +}; + +SyntaxHighlighter.brushes.ObjC.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.ObjC.aliases = ['objc']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js new file mode 100644 index 0000000..6858508 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js @@ -0,0 +1,74 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Perl = function() +{ + // Contributed by David Simmons-Duffin and Marty Kube + + var funcs = + 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + + 'chroot close closedir connect cos crypt defined delete each endgrent ' + + 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + + 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + + 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + + 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + + 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + + 'getservbyname getservbyport getservent getsockname getsockopt glob ' + + 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + + 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + + 'oct open opendir ord pack pipe pop pos print printf prototype push ' + + 'quotemeta rand read readdir readline readlink readpipe recv rename ' + + 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + + 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + + 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + + 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + + 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + + 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + + 'undef unlink unpack unshift utime values vec wait waitpid warn write'; + + var keywords = + 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + + 'for foreach goto if import last local my next no our package redo ref ' + + 'require return sub tie tied unless untie until use wantarray while'; + + this.regexList = [ + { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, + { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); +} + +SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js new file mode 100644 index 0000000..51f69fb --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js @@ -0,0 +1,91 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Php = function() +{ + var funcs = 'abs acos acosh addcslashes addslashes ' + + 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ + 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ + 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ + 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ + 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ + 'array_push array_rand array_reduce array_reverse array_search array_shift '+ + 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ + 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ + 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ + 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ + 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ + 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ + 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ + 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ + 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ + 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ + 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ + 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ + 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ + 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ + 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ + 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ + 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ + 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ + 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ + 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ + 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ + 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+ + 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ + 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ + 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ + 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ + 'strtoupper strtr strval substr substr_compare'; + + var keywords = 'and or xor array as break case ' + + 'cfunction class const continue declare default die do else ' + + 'elseif enddeclare endfor endforeach endif endswitch endwhile ' + + 'extends for foreach function include include_once global if ' + + 'new old_function return static switch use require require_once ' + + 'var while abstract interface public implements extends private protected throw'; + + var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions + { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); +}; + +SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Php.aliases = ['php']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js new file mode 100644 index 0000000..74562e1 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js @@ -0,0 +1,35 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Plain = function() +{ +}; + +SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js new file mode 100644 index 0000000..9cce267 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js @@ -0,0 +1,76 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.PowerShell = function() +{ + // Contributes by B.v.Zanten, Getronics + // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro + + var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + + 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + + 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + + 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + + 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + + 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + + 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + + 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + + 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + + 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + + 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + + 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + + 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + + 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + + 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + + 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + + 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + + 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + + 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + + 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + + 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; + var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + + 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + + 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + + 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + + 'spps spsv sv tee cat cd cp h history kill lp ls ' + + 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + + 'erase rd ren type % \\?'; + + this.regexList = [ + { regex: /#.*$/gm, css: 'comments' }, // one line comments + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 + { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } + ]; +}; + +SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js new file mode 100644 index 0000000..eb1077e --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js @@ -0,0 +1,66 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Python = function() +{ + // Contributed by Gheorghe Milas and Ahmad Sherif + + var keywords = 'and assert break class continue def del elif else ' + + 'except exec finally for from global if import in is ' + + 'lambda not or pass print raise return try yield while'; + + var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + + 'chr classmethod cmp coerce compile complex delattr dict dir ' + + 'divmod enumerate eval execfile file filter float format frozenset ' + + 'getattr globals hasattr hash help hex id input int intern ' + + 'isinstance issubclass iter len list locals long map max min next ' + + 'object oct open ord pow print property range raw_input reduce ' + + 'reload repr reversed round set setattr slice sorted staticmethod ' + + 'str sum super tuple type type unichr unicode vars xrange zip'; + + var special = 'None True False self cls class_'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, + { regex: /^\s*@\w+/gm, css: 'decorator' }, + { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, + { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, + { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, + { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, + { regex: /\b\d+\.?\w*/g, css: 'value' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Python.aliases = ['py', 'python']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js new file mode 100644 index 0000000..6cf0b73 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Ruby = function() +{ + // Contributed by Erik Peterson. + + var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + + 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + + 'self super then throw true undef unless until when while yield'; + + var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + + 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + + 'ThreadGroup Thread Time TrueClass'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants + { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols + { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js new file mode 100644 index 0000000..6e595f7 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js @@ -0,0 +1,53 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Scala = function() +{ + // Contributed by Yegor Jbanov and David Bernard. + + var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + + 'override try lazy for var catch throw type extends class while with new final yield abstract ' + + 'else do if return protected private this package false'; + + var keyops = '[_:=><%#@]+'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword + ]; +} + +SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Scala.aliases = ['scala']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js new file mode 100644 index 0000000..0fe121c --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js @@ -0,0 +1,68 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Sql = function() +{ + var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + + 'current_user day isnull left lower month nullif replace right ' + + 'session_user space substring sum system_user upper user year'; + + var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + + 'binary bit by cascade char character check checkpoint close collate ' + + 'column commit committed connect connection constraint contains continue ' + + 'create cube current current_date current_time cursor database date ' + + 'deallocate dec decimal declare default delete desc distinct double drop ' + + 'dynamic else end end-exec escape except exec execute false fetch first ' + + 'float for force foreign forward free from full function global goto grant ' + + 'group grouping having hour ignore index inner insensitive insert instead ' + + 'int integer intersect into is isolation key last level load local max min ' + + 'minute modify move name national nchar next no numeric of off on only ' + + 'open option order out output partial password precision prepare primary ' + + 'prior privileges procedure public read real references relative repeatable ' + + 'restrict return returns revoke rollback rollup rows rule schema scroll ' + + 'second section select sequence serializable set size smallint static ' + + 'statistics table temp temporary then time timestamp to top transaction ' + + 'translation trigger true truncate uncommitted union unique update values ' + + 'varchar varying view when where with work'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; +}; + +SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Sql.aliases = ['sql']; + diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js new file mode 100644 index 0000000..bded9dd --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js @@ -0,0 +1,58 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Vb = function() +{ + var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + + 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + + 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + + 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + + 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + + 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + + 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + + 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + + 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + + 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + + 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + + 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + + 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + + 'Variant When While With WithEvents WriteOnly Xor'; + + this.regexList = [ + { regex: /'.*$/gm, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js new file mode 100644 index 0000000..23fb7e4 --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js @@ -0,0 +1,71 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Xml = function() +{ + function process(match, regexInfo) + { + var constructor = SyntaxHighlighter.Match, + code = match[0], + tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), + result = [] + ; + + if (match.attributes != null) + { + var attributes, + regex = new XRegExp('(? [\\w:\\-\\.]+)' + + '\\s*=\\s*' + + '(? ".*?"|\'.*?\'|\\w+)', + 'xg'); + + while ((attributes = regex.exec(code)) != null) + { + result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); + result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); + } + } + + if (tag != null) + result.push( + new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') + ); + + return result; + } + + this.regexList = [ + { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // + { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } + ]; +}; + +SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js new file mode 100644 index 0000000..938c48b --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js @@ -0,0 +1,30 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('c(!1q.2X){h 2X=l(){h p={6b:{"1s-R":"","84-2y":1,"83-2y-7W":I,"1I":v,"8d-89":I,"1H-2Q":4,"3g":I,"1w":I,"66":N,"8k-8l":I,"88":N,"5h-1p":I,"1L-1l":N},M:{4T:I,69:v,5l:16,5k:16,8B:N,8f:N,8s:"54",1f:{5q:"53 1g",5d:"9N 1g",5i:"9O 6q 6p",78:"9M C 9L 1V 9I 6p 9J",3t:"3t",6C:"?",1A:"2X\\n\\n",6T:"9K\'t 9P 2O D: ",7x:"9Q 9W\'t 9X D 1L-1l 9V: ",77:"<1L 9t=\\"2s://5x.6x.6B/9s/9x\\"><6z><9y 2s-9E=\\"9F-9D\\" 63=\\"1X/1L; 9C=9z-8\\" /><3i>9A 2X<33 1m=\\"39-9Y:9Z,an,ao,am-al;ai-3f:#aj;3f:#ak;39-2Q:ap;1X-6G:6u;\\">2X6O 2.1.ag (a5 15 6h)2s://6I.3ka3 a0 a1 f 1l, a2 8R 6q 8Q 8O 8W!8V C 8U 8X.8K 8N-6h 8M 8S."},8u:N},1r:{4Z:v,9o:v,3m:v,6f:{}},2d:{},8h:{9g:/\\/\\*[\\s\\S]*?\\*\\//3b,9d:/\\/\\/.*$/3b,9e:/#.*$/3b,9j:/"([^\\\\"\\n]|\\\\.)*"/g,9n:/\'([^\\\\\'\\n]|\\\\.)*\'/g,9m:/"([^\\\\"]|\\\\.)*"/g,8Y:/\'([^\\\\\']|\\\\.)*\'/g,9k:/(&X;|<)!--[\\s\\S]*?--(&Z;|>)/3b,43:/&X;\\w+:\\/\\/[\\w-.\\/?%&=@:;]*&Z;|\\w+:\\/\\/[\\w-.\\/?%&=@:;]*/g,9c:{G:/(&X;|<)\\?=?/g,1d:/\\?(&Z;|>)/g},93:{G:/(&X;|<)%=?/g,1d:/%(&Z;|>)/g},92:{G:/(&X;|<)\\s*1l.*?(&Z;|>)/4e,1d:/(&X;|<)\\/\\s*1l\\s*(&Z;|>)/4e}},1w:{1c:l(3O){h 3T=Q.22("3Y"),5s=p.1w.7d;3T.L="1w";D(h 30 1V 5s){h 6i=5s[30],5t=W 6i(3O),1Y=5t.1c();3O.6g[30]=5t;c(1Y==v){1J}c(7X(1Y)=="91"){1Y=p.1w.6m(1Y,3O.1k,30)}1Y.L+="5v "+30;3T.2p(1Y)}q 3T},6m:l(5L,7j,5K){h a=Q.22("a"),5N=a.1m,5D=p.M,5M=5D.5l,5J=5D.5k;a.27="#"+5K;a.3i=5L;a.5j=7j;a.76=5K;a.1Q=5L;c(40(5M)==N){5N.26=5M+"75"}c(40(5J)==N){5N.2e=5J+"75"}a.9l=l(e){97{p.1w.6M(f,e||1q.6Y,f.5j,f.76)}98(e){p.B.1A(e.6n)}q N};q a},6M:l(7i,7g,7b,7h,7f){h 5G=p.1r.6f[7b],5H;c(5G==v||(5H=5G.6g[7h])==v){q v}q 5H.2z(7i,7g,7f)},7d:{5q:l(5b){f.1c=l(){c(5b.V("66")!=I){q}q p.M.1f.5q};f.2z=l(5c,8T,8P){h A=5b.A;5c.7y.4p(5c);A.L=A.L.E("5O","")}},5d:l(6R){f.1c=l(){q p.M.1f.5d};f.2z=l(b1,bU,bV){h 3J=p.B.3d(6R.5g).E(/"+3J+"");2A.Q.4o()}},5i:l(64){h 3C,c2,6a=64.1k;f.1c=l(){h 2V=p.M;c(2V.69==v){q v}l 1E(56){h 5m="";D(h 5f 1V 56){5m+=""}q 5m};l 2i(5n){h 5p="";D(h 5o 1V 5n){5p+=" "+5o+"=\'"+5n[5o]+"\'"}q 5p};h 67={26:2V.5l,2e:2V.5k,1k:6a+"bY",4r:"bZ/x-71-6V",3i:p.M.1f.5i},5V={bE:"ay",bD:"bC",bA:"5j="+6a,c4:"N"},5U=2V.69,3x;c(/bG/i.1R(6K.7k)){3x="<4h"+2i({bH:"bM:bN-bL-bK-bI-bJ",c3:"2s://ck.cj.3k/cm/71/c9/6V/c8.c7#6O=9,0,0,0"})+2i(67)+">"+1E(5V)+1E({c6:5U})+""}F{3x=""}3C=Q.22("A");3C.1Q=3x;q 3C};f.2z=l(cf,ce,62){h 7c=62.cd;6U(7c){2K"7q":h 61=p.B.2T(p.B.3d(64.5g).E(/&X;/g,"<").E(/&Z;/g,">").E(/&aT;/g,"&"));c(1q.74){1q.74.aU("1X",61)}F{q p.B.2T(61)}2K"aR":p.B.1A(p.M.1f.78);2h;2K"aP":p.B.1A(62.6n);2h}}},aV:l(65){f.1c=l(){q p.M.1f.3t};f.2z=l(aW,bz,b0){h 1Z=Q.22("aZ"),1N=v;c(p.1r.3m!=v){Q.33.4p(p.1r.3m)}p.1r.3m=1Z;1Z.1m.aX="aY:aO;26:6r;2e:6r;G:-6j;4w:-6j;";Q.33.2p(1Z);1N=1Z.5Q.Q;6J(1N,1q.Q);1N.3D(""+65.A.1Q+"");1N.4o();1Z.5Q.4F();1Z.5Q.3t();l 6J(6N,6E){h 2I=6E.4O("4n");D(h i=0;i<2I.u;i++){c(2I[i].6y.6P()=="6A"&&/aE\\.1a$/.1R(2I[i].27)){6N.3D("<4n 4r=\\"1X/1a\\" 6y=\\"6A\\" 27=\\""+2I[i].27+"\\">")}}}}},az:l(aA){f.1c=l(){q p.M.1f.6C};f.2z=l(aF,aG){h 2A=p.B.4z("","4k",aM,aK,"7a=0"),1N=2A.Q;1N.3D(p.M.1f.77);1N.4o();2A.4F()}}}},B:{Y:l(49,73,3y){3y=3e.aH(3y||0,0);D(h i=3y;i<49.u;i++){c(49[i]==73){q i}}q-1},6d:l(72){q 72+3e.aI(3e.b2()*b3).2u()},6c:l(51,4L){h 3h={},1W;D(1W 1V 51){3h[1W]=51[1W]}D(1W 1V 4L){3h[1W]=4L[1W]}q 3h},80:l(4J){6U(4J){2K"I":q I;2K"N":q N}q 4J},4z:l(43,6W,4B,4H,2N){h x=(6X.26-4B)/2,y=(6X.2e-4H)/2;2N+=", G="+x+", 4w="+y+", 26="+4B+", 2e="+4H;2N=2N.E(/^,/,"");h 4E=1q.bk(43,6W,2N);4E.4F();q 4E},7C:l(1G,1T,1U){c(1G.6Z){1G["e"+1T+1U]=1U;1G[1T+1U]=l(){1G["e"+1T+1U](1q.6Y)};1G.6Z("bw"+1T,1G[1T+1U])}F{1G.bv(1T,1U,N)}},1A:l(z){1A(p.M.1f.1A+z)},4u:l(4N,6Q){h 2r=p.1r.4Z,3V=v;c(2r==v){2r={};D(h 2L 1V p.2d){h 42=p.2d[2L].bu;c(42==v){1J}p.2d[2L].R=2L.6P();D(h i=0;i<42.u;i++){2r[42[i]]=2L}}p.1r.4Z=2r}3V=p.2d[2r[4N]];c(3V==v&&6Q!=N){p.B.1A(p.M.1f.6T+4N)}q 3V},46:l(z,6S){h 2E=z.1P("\\n");D(h i=0;i<2E.u;i++){2E[i]=6S(2E[i])}q 2E.5A("\\n")},8C:l(z){q z.E(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},8H:l(z){h 3X,45={},4P=W U("^\\\\[(?<4c>(.*?))\\\\]$"),7e=W U("(?[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<24>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");2j((3X=7e.T(z))!=v){h 2f=3X.24.E(/^[\'"]|[\'"]$/g,"");c(2f!=v&&4P.1R(2f)){h m=4P.T(2f);2f=m.4c.u>0?m.4c.1P(/\\s*,\\s*/):[]}45[3X.R]=2f}q 45},7K:l(z,1a){c(z==v||z.u==0||z=="\\n"){q z}z=z.E(/"+2l+""})}q z},7V:l(6l,6o){h 32=6l.2u();2j(32.u<6o){32="0"+32}q 32},6k:l(){h 3w=Q.22("A"),3B,3o=0,44=Q.33,1k=p.B.6d("6k"),36="",4U="";3w.1Q=36+"6e\\">"+36+"1p\\">"+36+"2y\\">"+36+"63"+"\\"><4G 1s=\\"b5\\"><4G 1k=\\""+1k+"\\">&2B;"+4U+4U+2Y+2Y+2Y+2Y;44.2p(3w);3B=Q.bb(1k);c(/bg/i.1R(6K.7k)){h 6v=1q.be(3B,v);3o=85(6v.bc("26"))}F{3o=3B.bd}44.4p(3w);q 3o},8b:l(79,6s){h 1H="";D(h i=0;i<6s;i++){1H+=" "}q 79.E(/\\t/g,1H)},8a:l(2Z,4f){h bF=2Z.1P("\\n"),1H="\\t",4d="";D(h i=0;i<50;i++){4d+=" "}l 8x(3s,18,8A){q 3s.29(0,18)+4d.29(0,8A)+3s.29(18+1,3s.u)};2Z=p.B.46(2Z,l(20){c(20.Y(1H)==-1){q 20}h 18=0;2j((18=20.Y(1H))!=-1){h 8w=4f-18%4f;20=8x(20,18,8w)}q 20});q 2Z},3d:l(z){h br=/|&X;br\\s*\\/?&Z;/4e;c(p.M.8B==I){z=z.E(br,"\\n")}c(p.M.8f==I){z=z.E(br,"")}q z},2G:l(z){q z.E(/^\\s+|\\s+$/g,"")},2T:l(z){h 21=p.B.3d(z).1P("\\n"),bf=W bh(),8D=/^\\s*/,2a=ba;D(h i=0;i<21.u&&2a>0;i++){h 4x=21[i];c(p.B.2G(4x).u==0){1J}h 4I=8D.T(4x);c(4I==v){q z}2a=3e.2a(4I[0].u,2a)}c(2a>0){D(h i=0;i<21.u;i++){21[i]=21[i].29(2a)}}q 21.5A("\\n")},82:l(35,31){c(35.H<31.H){q-1}F{c(35.H>31.H){q 1}F{c(35.u<31.u){q-1}F{c(35.u>31.u){q 1}}}}q 0},2D:l(8q,34){l 8n(4D,8r){q[W p.4v(4D[0],4D.H,8r.1a)]};h b4=0,4s=v,3L=[],8p=34.4X?34.4X:8n;2j((4s=34.3K.T(8q))!=v){3L=3L.2t(8p(4s,34))}q 3L},8m:l(8o){h X="&X;",Z="&Z;";q 8o.E(p.8h.43,l(m){h 4j="",47="";c(m.Y(X)==0){47=X;m=m.3U(X.u)}c(m.Y(Z)==m.u-Z.u){m=m.3U(0,m.u-Z.u);4j=Z}q 47+""+m+""+4j})},8v:l(){h 3N=Q.4O("1l"),4i=[];D(h i=0;i<3N.u;i++){c(3N[i].4r=="6e"){4i.K(3N[i])}}q 4i},8I:l(4b){h 4q="",1v=p.B.2G(4b),3R=N;c(1v.Y(4q)==0){1v=1v.3U(4q.u);3R=I}c(1v.Y(3S)==1v.u-3S.u){1v=1v.3U(0,1v.u-3S.u);3R=I}q 3R?1v:4b}},1I:l(8E,4R){l 8e(4g){h 4Q=[];D(h i=0;i<4g.u;i++){4Q.K(4g[i])}q 4Q};h 2q=4R?[4R]:8e(Q.4O(p.M.8s)),8J="1Q",2k=v,4S=p.M;c(4S.4T){2q=2q.2t(p.B.8v())}c(2q.u===0){q}D(h i=0;i<2q.u;i++){h 2M=2q[i],28=p.B.8H(2M.L),1D,2W,25;28=p.B.6c(8E,28);1D=28["2O"];c(1D==v){1J}c(28["1L-1l"]=="I"||p.6b["1L-1l"]==I){2k=W p.4a(1D);1D="b9"}F{h 3P=p.B.4u(1D);c(3P){1D=3P.R;2k=W 3P()}F{1J}}2W=2M[8J];c(4S.4T){2W=p.B.8I(2W)}28["2O-R"]=1D;2k.1I(2W,28);25=2k.A;c(p.M.8u){25=Q.22("bj");25.24=2k.A.1Q;25.1m.26="bt";25.1m.2e="bx"}2M.7y.bs(25,2M)}},bq:l(7H){p.B.7C(1q,"bl",l(){p.1I(7H)})}};p.4v=l(4A,7G,1a){f.24=4A;f.H=7G;f.u=4A.u;f.1a=1a;f.5Y=v};p.4v.14.2u=l(){q f.24};p.4a=l(4K){h 3z=p.B.4u(4K),2g,4W=W p.2d.bm(),bn=v;c(3z==v){q}2g=W 3z();f.4m=4W;c(2g.3I==v){p.B.1A(p.M.1f.7x+4K);q}4W.59.K({3K:2g.3I.C,4X:7p});l 3A(4Y,7w){D(h j=0;j<4Y.u;j++){4Y[j].H+=7w}};l 7p(19,bp){h 7n=19.C,1o=[],4M=2g.59,7l=19.H+19.G.u,2U=2g.3I,1n;D(h i=0;i<4M.u;i++){1n=p.B.2D(7n,4M[i]);3A(1n,7l);1o=1o.2t(1n)}c(2U.G!=v&&19.G!=v){1n=p.B.2D(19.G,2U.G);3A(1n,19.H);1o=1o.2t(1n)}c(2U.1d!=v&&19.1d!=v){1n=p.B.2D(19.1d,2U.1d);3A(1n,19.H+19[0].bo(19.1d));1o=1o.2t(1n)}D(h j=0;j<1o.u;j++){1o[j].5Y=3z.R}q 1o}};p.4a.14.1I=l(7t,7s){f.4m.1I(7t,7s);f.A=f.4m.A};p.7I=l(){};p.7I.14={V:l(7J,7Z){h 4l=f.1E[7J];q p.B.80(4l==v?7Z:4l)},1c:l(7Y){q Q.22(7Y)},8i:l(2F,81){h 3u=[];c(2F!=v){D(h i=0;i<2F.u;i++){c(7X(2F[i])=="4h"){3u=3u.2t(p.B.2D(81,2F[i]))}}}q 3u.aB(p.B.82)},86:l(){h 23=f.2C;D(h i=0;i<23.u;i++){c(23[i]===v){1J}h 2x=23[i],4V=2x.H+2x.u;D(h j=i+1;j<23.u&&23[i]!==v;j++){h 1S=23[j];c(1S===v){1J}F{c(1S.H>4V){2h}F{c(1S.H==2x.H&&1S.u>2x.u){f.2C[i]=v}F{c(1S.H>=2x.H&&1S.H<4V){f.2C[j]=v}}}}}}},8t:l(2H){h 3r=2H.1P(/\\n/g),3n=85(f.V("84-2y")),2v=f.V("83-2y-7W"),7N=f.V("1I",[]),7U=f.V("3g");2H="";c(2v==I){2v=(3n+3r.u-1).2u().u}F{c(40(2v)==I){2v=0}}D(h i=0;i<3r.u;i++){h 1x=3r[i],60=/^(&2B;|\\s)+/.T(1x),52="aN"+(i%2==0?1:2),7F=p.B.7V(3n+i,2v),7P=p.B.Y(7N,(3n+i).2u())!=-1,2S=v;c(60!=v){2S=60[0].2u();1x=1x.29(2S.u)}1x=p.B.2G(1x);c(1x.u==0){1x="&2B;"}c(7P){52+=" aQ"}2H+=""+"<7L>"+"<7T>"+(7U?"<3F 1s=\\"aS\\">"+7F+"":"")+"<3F 1s=\\"63\\">"+(2S!=v?""+2S.E(" ","&2B;")+"":"")+1x+""+""+""+""}q 2H},8y:l(5X,5T){h 18=0,3c="",3a=p.B.7K,5S=f.V("2O-R","");l 5W(5Z){h 5R=5Z?(5Z.5Y||5S):5S;q 5R?5R+" ":""};D(h i=0;i<5T.u;i++){h 1y=5T[i],3G;c(1y===v||1y.u===0){1J}3G=5W(1y);3c+=3a(5X.29(18,1y.H-18),3G+"7O")+3a(1y.24,3G+1y.1a);18=1y.H+1y.u}3c+=3a(5X.29(18),5W()+"7O");q 3c},1I:l(C,7E){h cb=p.M,1r=p.1r,A,ci,3Z,ch="cn";f.1E={};f.A=v;f.1p=v;f.C=v;f.1i=v;f.6g={};f.1k=p.B.6d("cl");1r.6f[f.1k]=f;c(C===v){C=""}f.1E=p.B.6c(p.6b,7E||{});c(f.V("88")==I){f.1E.1w=f.1E.3g=N}f.A=A=f.1c("3Y");f.1p=f.1c("3Y");f.1p.L="1p";L="6e";A.1k=f.1k;c(f.V("66")){L+=" 5O"}c(f.V("3g")==N){L+=" bB"}c(f.V("5h-1p")==N){f.1p.L+=" bO-5h"}L+=" "+f.V("1s-R");L+=" "+f.V("2O-R");A.L=L;f.5g=C;f.C=p.B.8C(C).E(/\\r/g," ");3Z=f.V("1H-2Q");f.C=f.V("8d-89")==I?p.B.8a(f.C,3Z):p.B.8b(f.C,3Z);f.C=p.B.2T(f.C);c(f.V("1w")){f.1i=f.1c("3Y");f.1i.L="1i";f.1i.2p(p.1w.1c(f));A.2p(f.1i);h 1i=f.1i;l 58(){1i.L=1i.L.E("53","")};A.c0=l(){58();1i.L+=" 53"};A.bX=l(){58()}}A.2p(f.1p);f.2C=f.8i(f.59,f.C);f.86();C=f.8y(f.C,f.2C);C=f.8t(p.B.2G(C));c(f.V("8k-8l")){C=p.B.8m(C)}f.1p.1Q=C},9f:l(z){z=z.E(/^\\s+|\\s+$/g,"").E(/\\s+/g,"|");q"\\\\b(?:"+z+")\\\\b"},9i:l(2J){f.3I={G:{3K:2J.G,1a:"1l"},1d:{3K:2J.1d,1a:"1l"},C:W U("(?"+2J.G.1g+")"+"(?.*?)"+"(?<1d>"+2J.1d.1g+")","96")}}};q p}()}c(!1q.U){(l(){h 2w={T:10.14.T,87:5I.14.87,E:5I.14.E,1P:5I.14.1P},1F={13:/(?:[^\\\\([#\\s.]+|\\\\(?!k<[\\w$]+>|[7z]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[7z]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,99:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,37:/^(?:\\s+|#.*)+/,5B:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7Q:/&&\\[\\^?/g,7S:/]/g},7o=l(5C,5v,5u){D(h i=5u||0;i<5C.u;i++){c(5C[i]===5v){q i}}q-1},8G=/()??/.T("")[1]!==3j,3q={};U=l(1e,1O){c(1e 68 10){c(1O!==3j){3H 7r("4y\'t 4C 9a 8z 95 7u 10 5u 94")}q 1e.3E()}h 1O=1O||"",7R=1O.Y("s")>-1,7M=1O.Y("x")>-1,5z=N,3v=[],1b=[],13=1F.13,J,cc,38,3M,3p;13.O=0;2j(J=2w.T.2n(13,1e)){c(J[2]){c(!1F.5B.1R(1e.17(13.O))){1b.K("(?:)")}}F{c(J[1]){3v.K(J[3]||v);c(J[3]){5z=I}1b.K("(")}F{c(J[4]){3M=7o(3v,J[4]);1b.K(3M>-1?"\\\\"+(3M+1)+(40(1e.5w(13.O))?"":"(?:)"):J[0])}F{c(J[5]){1b.K(3q.7m?3q.7m.7q(J[5],J[0].5w(1)==="P"):J[0])}F{c(J[6]){c(1e.5w(13.O)==="]"){1b.K(J[6]==="["?"(?!)":"[\\\\S\\\\s]");13.O++}F{cc=U.8g("&&"+1e.17(J.H),1F.7Q,1F.7S,"",{7D:"\\\\"})[0];1b.K(J[6]+cc+"]");13.O+=cc.u+1}}F{c(J[7]){c(7R&&J[7]==="."){1b.K("[\\\\S\\\\s]")}F{c(7M&&1F.37.1R(J[7])){38=2w.T.2n(1F.37,1e.17(13.O-1))[0].u;c(!1F.5B.1R(1e.17(13.O-1+38))){1b.K("(?:)")}13.O+=38-1}F{1b.K(J[7])}}}F{1b.K(J[0])}}}}}}}3p=10(1b.5A(""),2w.E.2n(1O,/[9B]+/g,""));3p.1C={1g:1e,2m:5z?3v:v};q 3p};U.9q=l(R,o){3q[R]=o};10.14.T=l(z){h 1h=2w.T.2n(f,z),R,i,5y;c(1h){c(8G&&1h.u>1){5y=W 10("^"+f.1g+"$(?!\\\\s)",f.5E());2w.E.2n(1h[0],5y,l(){D(i=1;i<8j.u-2;i++){c(8j[i]===3j){1h[i]=3j}}})}c(f.1C&&f.1C.2m){D(i=1;i<1h.u;i++){R=f.1C.2m[i-1];c(R){1h[R]=1h[i]}}}c(f.3l&&f.O>(1h.H+1h[0].u)){f.O--}}q 1h}})()}10.14.5E=l(){q(f.3l?"g":"")+(f.av?"i":"")+(f.8F?"m":"")+(f.37?"x":"")+(f.a4?"y":"")};10.14.3E=l(7A){h 5F=W U(f.1g,(7A||"")+f.5E());c(f.1C){5F.1C={1g:f.1C.1g,2m:f.1C.2m?f.1C.2m.17(0):v}}q 5F};10.14.2n=l(90,z){q f.T(z)};10.14.9b=l(9h,8c){q f.T(8c[0])};U.5P=l(57,5e){h 55="/"+57+"/"+(5e||"");q U.5P[55]||(U.5P[55]=W U(57,5e))};U.41=l(z){q z.E(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};U.8g=l(z,G,11,1j,2R){h 2R=2R||{},2P=2R.7D,12=2R.c5,1j=1j||"",5r=1j.Y("g")>-1,70=1j.Y("i")>-1,7v=1j.Y("m")>-1,5a=1j.Y("y")>-1,1j=1j.E(/y/g,""),G=G 68 10?(G.3l?G:G.3E("g")):W U(G,"g"+1j),11=11 68 10?(11.3l?11:11.3E("g")):W U(11,"g"+1j),1M=[],2o=0,1u=0,1t=0,1z=0,2b,2c,1B,1K,3Q,48;c(2P){c(2P.u>1){3H aC("4y\'t 4C aL aJ 7u 41 7B")}c(7v){3H 7r("4y\'t 4C 41 7B 8z bi b8 8F b7")}3Q=U.41(2P);48=W 10("^(?:"+3Q+"[\\\\S\\\\s]|(?:(?!"+G.1g+"|"+11.1g+")[^"+3Q+"])+)+",70?"i":"")}2j(I){G.O=11.O=1t+(2P?(48.T(z.17(1t))||[""])[0].u:0);1B=G.T(z);1K=11.T(z);c(1B&&1K){c(1B.H<=1K.H){1K=v}F{1B=v}}c(1B||1K){1u=(1B||1K).H;1t=(1B?G:11).O}F{c(!2o){2h}}c(5a&&!2o&&1u>1z){2h}c(1B){c(!2o++){2b=1u;2c=1t}}F{c(1K&&2o){c(!--2o){c(12){c(12[0]&&2b>1z){1M.K([12[0],z.17(1z,2b),1z,2b])}c(12[1]){1M.K([12[1],z.17(2b,2c),2b,2c])}c(12[2]){1M.K([12[2],z.17(2c,1u),2c,1u])}c(12[3]){1M.K([12[3],z.17(1u,1t),1u,1t])}}F{1M.K(z.17(2c,1u))}1z=1t;c(!5r){2h}}}F{G.O=11.O=0;3H bP("8L aq 9r ar 8Z")}}c(1u===1t){1t++}}c(5r&&!5a&&12&&12[0]&&z.u>1z){1M.K([12[0],z.17(1z),1z,z.u])}G.O=11.O=0;q 1M};',62,768,'||||||||||||if|||this||var||||function||||sh|return||||length|null||||str|div|utils|code|for|replace|else|left|index|true|_121|push|className|config|false|lastIndex||document|name||exec|XRegExp|getParam|new|lt|indexOf|gt|RegExp|_139|vN|part|prototype|||slice|pos|_d3|css|_11f|create|right|_119|strings|source|_129|bar|_13a|id|script|style|_da|_d6|lines|window|vars|class|_145|_144|_b5|toolbar|_f4|_103|_146|alert|_149|_x|_c3|params|lib|obj|tab|highlight|continue|_14a|html|_142|doc|_11a|split|innerHTML|test|_ec|_5a|_5b|in|_4f|text|_8|_3c|_91|_98|createElement|_e7|value|_c5|width|href|_c2|substr|min|_147|_148|brushes|height|_6e|_cd|break|attributes|while|_be|_75|captureNames|call|_143|appendChild|_bc|_5f|http|concat|toString|_f0|real|_e9|line|execute|wnd|nbsp|matches|getMatches|_66|_e3|trim|_ed|_40|_10f|case|_61|_c1|_55|brush|_13c|size|_13b|_f9|unindent|_d9|_28|_c4|SyntaxHighlighter|_81|_88|_5|m2|_7a|body|_a2|m1|_80|extended|len|font|_fe|gm|_fd|fixInputString|Math|color|gutter|_4e|title|undefined|com|global|printFrame|_ef|_7d|_125|_118|_ee|_8e|print|_e5|_11e|_7b|_32|_49|_cc|offsetMatches|_7c|_25|write|addFlags|td|_104|throw|htmlScript|_22|regex|_a7|_124|_af|_2|_c6|_14b|_b6|_b4|_3|substring|_60|_76|_6a|DIV|_10b|isNaN|escape|_62|url|_7e|_6b|eachLine|_ae|esc|_47|HtmlScript|_b2|values|_8c|gi|_89|_b9|object|_b0|_ad|_blank|_e1|xmlBrush|link|close|removeChild|_b3|type|_a6|_73|findBrush|Match|top|_9d|can|popup|_c8|_53|supply|_a3|win|focus|span|_54|_9e|_50|_cb|_4d|_d7|_5d|getElementsByTagName|_6c|_ba|_b8|_bf|useScriptTags|_82|_ea|_ce|func|_d0|discoveredBrushes||_4c|_f6|show|pre|key|_29|_133|hide|regexList|_141|_19|_1a|viewSource|_134|_2b|originalCode|wrap|copyToClipboard|highlighterId|toolbarItemHeight|toolbarItemWidth|_2a|_2c|_2e|_2d|expandSource|_13e|_4|_7|from|item|charAt|www|r2|_11d|join|quantifier|_113|_e|getNativeFlags|_12e|_17|_18|String|_10|_b|_9|_f|_d|collapsed|cache|contentWindow|_101|_ff|_fb|swf|_30|getBrushNameCss|_fa|brushName|_100|_f5|_37|_35|content|_24|_38|collapse|_2f|instanceof|clipboardSwf|_27|defaults|merge|guid|syntaxhighlighter|highlighters|toolbarCommands|2009|_6|500px|measureSpace|_78|createButton|message|_79|clipboard|to|0px|_85|decoration|center|_83|margin|w3|rel|head|stylesheet|org|help|xhtml1|_3f|0099FF|align|DTD|alexgorbatchev|copyStyles|navigator|none|executeCommand|_3e|version|toLowerCase|_5e|_1e|_65|noBrush|switch|flash|_52|screen|event|attachEvent|_13f|shockwave|_4b|_48|clipboardData|px|commandName|aboutDialog|copyToClipboardConfirmation|_84|scrollbars|_14|_36|items|_6d|_16|_13|_15|_12|_a|userAgent|_d8|unicode|_d5|_112|process|get|TypeError|_de|_dd|one|_140|_d1|brushNotHtmlScript|parentNode|pP|_12d|character|addEvent|escapeChar|_106|_f7|_c9|_c7|Highlighter|_df|decorate|table|_11c|_f1|plain|_f8|classLeft|_11b|classRight|tr|_f2|padNumber|numbers|typeof|_e2|_e0|toBoolean|_e4|matchesSortCallback|pad|first|parseInt|removeNestedMatches|match|light|tabs|processSmartTabs|processTabs|args|smart|toArray|stripBrs|matchRecursive|regexLib|findMatches|arguments|auto|links|processUrls|defaultAdd|_a9|_a8|_a1|_a4|tagName|createDisplayLines|debug|getSyntaxHighlighterScriptTags|_93|insertSpaces|processMatches|when|_90|bloggerMode|trimFirstAndLastLines|_9a|_b7|multiline|_117|parseParams|stripCData|_bd|Copyright|subject|Alex|2004|development|_1c|keep|donate|Gorbatchev|_1b|syntax|JavaScript|active|highlighter|multiLineSingleQuotedString|delimiters|_12f|string|scriptScriptTags|aspScriptTags|another|constructing|sgi|try|catch|replaceVar|flags|apply|phpScriptTags|singleLineCComments|singleLinePerlComments|getKeywords|multiLineCComments|_131|forHtmlScript|doubleQuotedString|xmlComments|onclick|multiLineDoubleQuotedString|singleQuotedString|spaceWidth|bottom|addPlugin|contains|1999|xmlns|dtd|TR|transitional|xhtml|meta|utf|About|sx|charset|Type|equiv|Content|EN|Transitional|your|now|Can|is|The|view|copy|find|Brush|PUBLIC|W3C|XHTML|DOCTYPE|option|wasn|configured|family|Geneva|you|like|please|If|sticky|October|target|https|paypal|_s|xclick|hosted_button_id|cmd|webscr|cgi|bin|364|4em|background|fff|000|serif|sans|Arial|Helvetica|1em|data|unbalanced|75em|large|xx|ignoreCase|3em|2930402|always|about|_42|sort|SyntaxError|printing|shCore|_43|_44|max|round|than|250|more|500|alt|absolute|error|highlighted|ok|number|amp|setData|printSource|_39|cssText|position|IFRAME|_3b|_1f|random|1000000|_a5|block|CDATA|flag|the|htmlscript|1000|getElementById|getPropertyValue|offsetWidth|getComputedStyle|_99|opera|Array|using|textarea|open|load|Xml|_cf|lastIndexOf|_d4|all||replaceChild|70em|aliases|addEventListener|on|30em|spaces|_3a|flashVars|nogutter|transparent|wmode|allowScriptAccess|_8a|msie|classid|96b8|444553540000|11cf|ae6d|clsid|d27cdb6e|no|Error|location|resizable|400|750|_20|_21|menubar|onmouseout|_clipboard|application|onmouseover|param|_26|codebase|menu|valueNames|movie|cab|swflash|cabs|embed|conf||command|_34|_33|src|_10c|_10a|macromedia|download|highlighter_|pub|important'.split('|'),0,{})) diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js new file mode 100644 index 0000000..126b9ee --- /dev/null +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js @@ -0,0 +1,30 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.1.364 (October 15 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 y={d:{}};y.d={F:6(S,l,q,k,m,n){6 J(z,Y){1 V=16 15("^"+Y+"\\\\[(?\\\\w+)\\\\]$","14"),x=2;h(1 i=0;i. + */ +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... +var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** + * Pads line numbers. Possible values are: + * + * false - don't pad line numbers. + * true - automaticaly pad numbers with minimum required number of leading zeroes. + * [int] - length up to which pad line numbers. + */ + 'pad-line-numbers' : true, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : true, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false, + + /** Enables or disables automatic line wrapping. */ + 'wrap-lines' : true, + + 'html-script' : false + }, + + config : { + /** Enables use of tags. */ + scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } + }, + + toolbar : { + /** + * Creates new toolbar for a highlighter. + * @param {Highlighter} highlighter Target highlighter. + */ + create : function(highlighter) + { + var div = document.createElement('DIV'), + items = sh.toolbar.items + ; + + div.className = 'toolbar'; + + for (var name in items) + { + var constructor = items[name], + command = new constructor(highlighter), + element = command.create() + ; + + highlighter.toolbarCommands[name] = command; + + if (element == null) + continue; + + if (typeof(element) == 'string') + element = sh.toolbar.createButton(element, highlighter.id, name); + + element.className += 'item ' + name; + div.appendChild(element); + } + + return div; + }, + + /** + * Create a standard anchor button for the toolbar. + * @param {String} label Label text to display. + * @param {String} highlighterId Highlighter ID that this button would belong to. + * @param {String} commandName Command name that would be executed. + * @return {Element} Returns an 'A' element. + */ + createButton : function(label, highlighterId, commandName) + { + var a = document.createElement('a'), + style = a.style, + config = sh.config, + width = config.toolbarItemWidth, + height = config.toolbarItemHeight + ; + + a.href = '#' + commandName; + a.title = label; + a.highlighterId = highlighterId; + a.commandName = commandName; + a.innerHTML = label; + + if (isNaN(width) == false) + style.width = width + 'px'; + + if (isNaN(height) == false) + style.height = height + 'px'; + + a.onclick = function(e) + { + try + { + sh.toolbar.executeCommand( + this, + e || window.event, + this.highlighterId, + this.commandName + ); + } + catch(e) + { + sh.utils.alert(e.message); + } + + return false; + }; + + return a; + }, + + /** + * Executes a toolbar command. + * @param {Element} sender Sender element. + * @param {MouseEvent} event Original mouse event object. + * @param {String} highlighterId Highlighter DIV element ID. + * @param {String} commandName Name of the command to execute. + * @return {Object} Passes out return value from command execution. + */ + executeCommand : function(sender, event, highlighterId, commandName, args) + { + var highlighter = sh.vars.highlighters[highlighterId], + command + ; + + if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null) + return null; + + return command.execute(sender, event, args); + }, + + /** Collection of toolbar items. */ + items : { + expandSource : function(highlighter) + { + this.create = function() + { + if (highlighter.getParam('collapse') != true) + return; + + return sh.config.strings.expandSource; + }; + + this.execute = function(sender, event, args) + { + var div = highlighter.div; + + sender.parentNode.removeChild(sender); + div.className = div.className.replace('collapsed', ''); + }; + }, + + /** + * Command to open a new window and display the original unformatted source code inside. + */ + viewSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.viewSource; + }; + + this.execute = function(sender, event, args) + { + var code = sh.utils.fixInputString(highlighter.originalCode).replace(/' + code + ''); + wnd.document.close(); + }; + }, + + /** + * Command to copy the original source code in to the clipboard. + * Uses Flash method if clipboardSwf is configured. + */ + copyToClipboard : function(highlighter) + { + var flashDiv, flashSwf, + highlighterId = highlighter.id + ; + + this.create = function() + { + var config = sh.config; + + // disable functionality if running locally + if (config.clipboardSwf == null) + return null; + + function params(list) + { + var result = ''; + + for (var name in list) + result += ""; + + return result; + }; + + function attributes(list) + { + var result = ''; + + for (var name in list) + result += " " + name + "='" + list[name] + "'"; + + return result; + }; + + var args1 = { + width : config.toolbarItemWidth, + height : config.toolbarItemHeight, + id : highlighterId + '_clipboard', + type : 'application/x-shockwave-flash', + title : sh.config.strings.copyToClipboard + }, + + // these arguments are used in IE's collection + args2 = { + allowScriptAccess : 'always', + wmode : 'transparent', + flashVars : 'highlighterId=' + highlighterId, + menu : 'false' + }, + swf = config.clipboardSwf, + html + ; + + if (/msie/i.test(navigator.userAgent)) + { + html = '' + + params(args2) + + params({ movie : swf }) + + '' + ; + } + else + { + html = '' + ; + } + + flashDiv = document.createElement('div'); + flashDiv.innerHTML = html; + + return flashDiv; + }; + + this.execute = function(sender, event, args) + { + var command = args.command; + + switch (command) + { + case 'get': + var code = sh.utils.unindent( + sh.utils.fixInputString(highlighter.originalCode) + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + ); + + if(window.clipboardData) + // will fall through to the confirmation because there isn't a break + window.clipboardData.setData('text', code); + else + return sh.utils.unindent(code); + + case 'ok': + sh.utils.alert(sh.config.strings.copyToClipboardConfirmation); + break; + + case 'error': + sh.utils.alert(args.message); + break; + } + }; + }, + + /** Command to print the colored source code. */ + printSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.print; + }; + + this.execute = function(sender, event, args) + { + var iframe = document.createElement('IFRAME'), + doc = null + ; + + // make sure there is never more than one hidden iframe created by SH + if (sh.vars.printFrame != null) + document.body.removeChild(sh.vars.printFrame); + + sh.vars.printFrame = iframe; + + // this hides the iframe + iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; + + document.body.appendChild(iframe); + doc = iframe.contentWindow.document; + + copyStyles(doc, window.document); + doc.write('
' + highlighter.div.innerHTML + '
'); + doc.close(); + + iframe.contentWindow.focus(); + iframe.contentWindow.print(); + + function copyStyles(destDoc, sourceDoc) + { + var links = sourceDoc.getElementsByTagName('link'); + + for(var i = 0; i < links.length; i++) + if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href)) + destDoc.write(''); + }; + }; + }, + + /** Command to display the about dialog window. */ + about : function(highlighter) + { + this.create = function() + { + return sh.config.strings.help; + }; + + this.execute = function(sender, event) + { + var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'), + doc = wnd.document + ; + + doc.write(sh.config.strings.aboutDialog); + doc.close(); + wnd.focus(); + }; + } + } + }, + + utils : { + /** + * Finds an index of element in the array. + * @ignore + * @param {Object} searchElement + * @param {Number} fromIndex + * @return {Number} Returns index of element if found; -1 otherwise. + */ + indexOf : function(array, searchElement, fromIndex) + { + fromIndex = Math.max(fromIndex || 0, 0); + + for (var i = fromIndex; i < array.length; i++) + if(array[i] == searchElement) + return i; + + return -1; + }, + + /** + * Generates a unique element ID. + */ + guid : function(prefix) + { + return prefix + Math.round(Math.random() * 1000000).toString(); + }, + + /** + * Merges two objects. Values from obj2 override values in obj1. + * Function is NOT recursive and works only for one dimensional objects. + * @param {Object} obj1 First object. + * @param {Object} obj2 Second object. + * @return {Object} Returns combination of both objects. + */ + merge: function(obj1, obj2) + { + var result = {}, name; + + for (name in obj1) + result[name] = obj1[name]; + + for (name in obj2) + result[name] = obj2[name]; + + return result; + }, + + /** + * Attempts to convert string to boolean. + * @param {String} value Input string. + * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise. + */ + toBoolean: function(value) + { + switch (value) + { + case "true": + return true; + + case "false": + return false; + } + + return value; + }, + + /** + * Opens up a centered popup window. + * @param {String} url URL to open in the window. + * @param {String} name Popup name. + * @param {int} width Popup width. + * @param {int} height Popup height. + * @param {String} options window.open() options. + * @return {Window} Returns window instance. + */ + popup: function(url, name, width, height, options) + { + var x = (screen.width - width) / 2, + y = (screen.height - height) / 2 + ; + + options += ', left=' + x + + ', top=' + y + + ', width=' + width + + ', height=' + height + ; + options = options.replace(/^,/, ''); + + var win = window.open(url, name, options); + win.focus(); + return win; + }, + + /** + * Adds event handler to the target object. + * @param {Object} obj Target object. + * @param {String} type Name of the event. + * @param {Function} func Handling function. + */ + addEvent: function(obj, type, func) + { + if (obj.attachEvent) + { + obj['e' + type + func] = func; + obj[type + func] = function() + { + obj['e' + type + func](window.event); + } + obj.attachEvent('on' + type, obj[type + func]); + } + else + { + obj.addEventListener(type, func, false); + } + }, + + /** + * Displays an alert. + * @param {String} str String to display. + */ + alert: function(str) + { + alert(sh.config.strings.alert + str) + }, + + /** + * Finds a brush by its alias. + * + * @param {String} alias Brush alias. + * @param {Boolean} alert Suppresses the alert if false. + * @return {Brush} Returns bursh constructor if found, null otherwise. + */ + findBrush: function(alias, alert) + { + var brushes = sh.vars.discoveredBrushes, + result = null + ; + + if (brushes == null) + { + brushes = {}; + + // Find all brushes + for (var brush in sh.brushes) + { + var aliases = sh.brushes[brush].aliases; + + if (aliases == null) + continue; + + // keep the brush name + sh.brushes[brush].name = brush.toLowerCase(); + + for (var i = 0; i < aliases.length; i++) + brushes[aliases[i]] = brush; + } + + sh.vars.discoveredBrushes = brushes; + } + + result = sh.brushes[brushes[alias]]; + + if (result == null && alert != false) + sh.utils.alert(sh.config.strings.noBrush + alias); + + return result; + }, + + /** + * Executes a callback on each line and replaces each line with result from the callback. + * @param {Object} str Input string. + * @param {Object} callback Callback function taking one string argument and returning a string. + */ + eachLine: function(str, callback) + { + var lines = str.split('\n'); + + for (var i = 0; i < lines.length; i++) + lines[i] = callback(lines[i]); + + return lines.join('\n'); + }, + + /** + * This is a special trim which only removes first and last empty lines + * and doesn't affect valid leading space on the first line. + * + * @param {String} str Input string + * @return {String} Returns string without empty first and last lines. + */ + trimFirstAndLastLines: function(str) + { + return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, ''); + }, + + /** + * Parses key/value pairs into hash object. + * + * Understands the following formats: + * - name: word; + * - name: [word, word]; + * - name: "string"; + * - name: 'string'; + * + * For example: + * name1: value; name2: [value, value]; name3: 'value' + * + * @param {String} str Input string. + * @return {Object} Returns deserialized object. + */ + parseParams: function(str) + { + var match, + result = {}, + arrayRegex = new XRegExp("^\\[(?(.*?))\\]$"), + regex = new XRegExp( + "(?[\\w-]+)" + + "\\s*:\\s*" + + "(?" + + "[\\w-%#]+|" + // word + "\\[.*?\\]|" + // [] array + '".*?"|' + // "" string + "'.*?'" + // '' string + ")\\s*;?", + "g" + ) + ; + + while ((match = regex.exec(str)) != null) + { + var value = match.value + .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings + ; + + // try to parse array value + if (value != null && arrayRegex.test(value)) + { + var m = arrayRegex.exec(value); + value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []; + } + + result[match.name] = value; + } + + return result; + }, + + /** + * Wraps each line of the string into tag with given style applied to it. + * + * @param {String} str Input string. + * @param {String} css Style name to apply to the string. + * @return {String} Returns input string with each line surrounded by tag. + */ + decorate: function(str, css) + { + if (str == null || str.length == 0 || str == '\n') + return str; + + str = str.replace(/... to them so that + // leading spaces aren't included. + if (css != null) + str = sh.utils.eachLine(str, function(line) + { + if (line.length == 0) + return ''; + + var spaces = ''; + + line = line.replace(/^( | )+/, function(s) + { + spaces = s; + return ''; + }); + + if (line.length == 0) + return spaces; + + return spaces + '' + line + ''; + }); + + return str; + }, + + /** + * Pads number with zeros until it's length is the same as given length. + * + * @param {Number} number Number to pad. + * @param {Number} length Max string length with. + * @return {String} Returns a string padded with proper amount of '0'. + */ + padNumber : function(number, length) + { + var result = number.toString(); + + while (result.length < length) + result = '0' + result; + + return result; + }, + + /** + * Measures width of a single space character. + * @return {Number} Returns width of a single space character. + */ + measureSpace : function() + { + var container = document.createElement('div'), + span, + result = 0, + body = document.body, + id = sh.utils.guid('measureSpace'), + + // variable names will be compressed, so it's better than a plain string + divOpen = '
' + + divOpen + 'lines">' + + divOpen + 'line">' + + divOpen + 'content' + + '"> ' + closeSpan + closeSpan + + closeDiv + + closeDiv + + closeDiv + + closeDiv + ; + + body.appendChild(container); + span = document.getElementById(id); + + if (/opera/i.test(navigator.userAgent)) + { + var style = window.getComputedStyle(span, null); + result = parseInt(style.getPropertyValue("width")); + } + else + { + result = span.offsetWidth; + } + + body.removeChild(container); + + return result; + }, + + /** + * Replaces tabs with spaces. + * + * @param {String} code Source code. + * @param {Number} tabSize Size of the tab. + * @return {String} Returns code with all tabs replaces by spaces. + */ + processTabs : function(code, tabSize) + { + var tab = ''; + + for (var i = 0; i < tabSize; i++) + tab += ' '; + + return code.replace(/\t/g, tab); + }, + + /** + * Replaces tabs with smart spaces. + * + * @param {String} code Code to fix the tabs in. + * @param {Number} tabSize Number of spaces in a column. + * @return {String} Returns code with all tabs replaces with roper amount of spaces. + */ + processSmartTabs : function(code, tabSize) + { + var lines = code.split('\n'), + tab = '\t', + spaces = '' + ; + + // Create a string with 1000 spaces to copy spaces from... + // It's assumed that there would be no indentation longer than that. + for (var i = 0; i < 50; i++) + spaces += ' '; // 20 spaces * 50 + + // This function inserts specified amount of spaces in the string + // where a tab is while removing that given tab. + function insertSpaces(line, pos, count) + { + return line.substr(0, pos) + + spaces.substr(0, count) + + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab + ; + }; + + // Go through all the lines and do the 'smart tabs' magic. + code = sh.utils.eachLine(code, function(line) + { + if (line.indexOf(tab) == -1) + return line; + + var pos = 0; + + while ((pos = line.indexOf(tab)) != -1) + { + // This is pretty much all there is to the 'smart tabs' logic. + // Based on the position within the line and size of a tab, + // calculate the amount of spaces we need to insert. + var spaces = tabSize - pos % tabSize; + line = insertSpaces(line, pos, spaces); + } + + return line; + }); + + return code; + }, + + /** + * Performs various string fixes based on configuration. + */ + fixInputString : function(str) + { + var br = /|<br\s*\/?>/gi; + + if (sh.config.bloggerMode == true) + str = str.replace(br, '\n'); + + if (sh.config.stripBrs == true) + str = str.replace(br, ''); + + return str; + }, + + /** + * Removes all white space at the begining and end of a string. + * + * @param {String} str String to trim. + * @return {String} Returns string without leading and following white space characters. + */ + trim: function(str) + { + return str.replace(/^\s+|\s+$/g, ''); + }, + + /** + * Unindents a block of text by the lowest common indent amount. + * @param {String} str Text to unindent. + * @return {String} Returns unindented text block. + */ + unindent: function(str) + { + var lines = sh.utils.fixInputString(str).split('\n'), + indents = new Array(), + regex = /^\s*/, + min = 1000 + ; + + // go through every line and check for common number of indents + for (var i = 0; i < lines.length && min > 0; i++) + { + var line = lines[i]; + + if (sh.utils.trim(line).length == 0) + continue; + + var matches = regex.exec(line); + + // In the event that just one line doesn't have leading white space + // we can't unindent anything, so bail completely. + if (matches == null) + return str; + + min = Math.min(matches[0].length, min); + } + + // trim minimum common number of white space from the begining of every line + if (min > 0) + for (var i = 0; i < lines.length; i++) + lines[i] = lines[i].substr(min); + + return lines.join('\n'); + }, + + /** + * Callback method for Array.sort() which sorts matches by + * index position and then by length. + * + * @param {Match} m1 Left object. + * @param {Match} m2 Right object. + * @return {Number} Returns -1, 0 or -1 as a comparison result. + */ + matchesSortCallback: function(m1, m2) + { + // sort matches by index first + if(m1.index < m2.index) + return -1; + else if(m1.index > m2.index) + return 1; + else + { + // if index is the same, sort by length + if(m1.length < m2.length) + return -1; + else if(m1.length > m2.length) + return 1; + } + + return 0; + }, + + /** + * Executes given regular expression on provided code and returns all + * matches that are found. + * + * @param {String} code Code to execute regular expression on. + * @param {Object} regex Regular expression item info from regexList collection. + * @return {Array} Returns a list of Match objects. + */ + getMatches: function(code, regexInfo) + { + function defaultAdd(match, regexInfo) + { + return [new sh.Match(match[0], match.index, regexInfo.css)]; + }; + + var index = 0, + match = null, + result = [], + func = regexInfo.func ? regexInfo.func : defaultAdd + ; + + while((match = regexInfo.regex.exec(code)) != null) + result = result.concat(func(match, regexInfo)); + + return result; + }, + + processUrls: function(code) + { + var lt = '<', + gt = '>' + ; + + return code.replace(sh.regexLib.url, function(m) + { + var suffix = '', prefix = ''; + + // We include < and > in the URL for the common cases like + // The problem is that they get transformed into <http://google.com> + // Where as > easily looks like part of the URL string. + + if (m.indexOf(lt) == 0) + { + prefix = lt; + m = m.substring(lt.length); + } + + if (m.indexOf(gt) == m.length - gt.length) + { + m = m.substring(0, m.length - gt.length); + suffix = gt; + } + + return prefix + '' + m + '' + suffix; + }); + }, + + /** + * Finds all + + + + + + + + + + + + + + + + + + + + + + + +

SyntaxHihglighter Test

+

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

+ +
+function test() : String
+{
+	return 10;
+}
+
+ diff --git a/html/views/fileview/fileview.js b/html/views/fileview/fileview.js new file mode 100644 index 0000000..2168e9e --- /dev/null +++ b/html/views/fileview/fileview.js @@ -0,0 +1,9 @@ +var showFile = function(txt) { + $("source").style.display = ""; + $("source").innerHTML="
"+txt+"
"; + + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.highlight(); + + return; +} diff --git a/html/views/fileview/index.html b/html/views/fileview/index.html new file mode 100644 index 0000000..888eba5 --- /dev/null +++ b/html/views/fileview/index.html @@ -0,0 +1,14 @@ + + + + + + + + + + + +
+ + \ No newline at end of file From 84ea6320319f315981dc88ac4573df92ed0a28c5 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Wed, 15 Sep 2010 17:00:07 -0700 Subject: [PATCH 088/110] NGScopeBar --- MGScopeBar/AppController.h | 20 + MGScopeBar/AppController.m | 220 ++ MGScopeBar/English.lproj/InfoPlist.strings | Bin 0 -> 92 bytes MGScopeBar/English.lproj/MainMenu.xib | 3278 ++++++++++++++++++++ MGScopeBar/Info.plist | 28 + MGScopeBar/MGRecessedPopUpButtonCell.h | 21 + MGScopeBar/MGRecessedPopUpButtonCell.m | 54 + MGScopeBar/MGScopeBar.h | 51 + MGScopeBar/MGScopeBar.m | 1049 +++++++ MGScopeBar/MGScopeBarDelegateProtocol.h | 46 + MGScopeBar/MGScopeBar_Prefix.pch | 7 + MGScopeBar/ReadMe.txt | 75 + MGScopeBar/Source Code License.rtf | 104 + MGScopeBar/TODO | 9 + 14 files changed, 4962 insertions(+) create mode 100644 MGScopeBar/AppController.h create mode 100644 MGScopeBar/AppController.m create mode 100644 MGScopeBar/English.lproj/InfoPlist.strings create mode 100644 MGScopeBar/English.lproj/MainMenu.xib create mode 100644 MGScopeBar/Info.plist create mode 100644 MGScopeBar/MGRecessedPopUpButtonCell.h create mode 100644 MGScopeBar/MGRecessedPopUpButtonCell.m create mode 100644 MGScopeBar/MGScopeBar.h create mode 100644 MGScopeBar/MGScopeBar.m create mode 100644 MGScopeBar/MGScopeBarDelegateProtocol.h create mode 100644 MGScopeBar/MGScopeBar_Prefix.pch create mode 100644 MGScopeBar/ReadMe.txt create mode 100644 MGScopeBar/Source Code License.rtf create mode 100644 MGScopeBar/TODO diff --git a/MGScopeBar/AppController.h b/MGScopeBar/AppController.h new file mode 100644 index 0000000..37ed4eb --- /dev/null +++ b/MGScopeBar/AppController.h @@ -0,0 +1,20 @@ +// +// AppController.h +// MGScopeBar +// +// Created by Matt Gemmell on 16/03/2008. +// + +#import +#import "MGScopeBarDelegateProtocol.h" + +@interface AppController : NSObject { + IBOutlet NSTextField *labelField; + IBOutlet MGScopeBar *scopeBar; + IBOutlet NSView *accessoryView; + NSMutableArray *groups; +} + +@property(retain) NSMutableArray *groups; + +@end diff --git a/MGScopeBar/AppController.m b/MGScopeBar/AppController.m new file mode 100644 index 0000000..3a5297c --- /dev/null +++ b/MGScopeBar/AppController.m @@ -0,0 +1,220 @@ +// +// AppController.m +// MGScopeBar +// +// Created by Matt Gemmell on 16/03/2008. +// + +#import "AppController.h" +#import "MGScopeBar.h" + + +// Keys for our sample data. +#define GROUP_LABEL @"Label" // string +#define GROUP_SEPARATOR @"HasSeparator" // BOOL as NSNumber +#define GROUP_SELECTION_MODE @"SelectionMode" // MGScopeBarGroupSelectionMode (int) as NSNumber +#define GROUP_ITEMS @"Items" // array of dictionaries, each containing the following keys: +#define ITEM_IDENTIFIER @"Identifier" // string +#define ITEM_NAME @"Name" // string + + +@implementation AppController + + +#pragma mark Setup and teardown + + +- (void)awakeFromNib +{ + // In this method we basically just set up some sample data for the scope bar, + // so that we can respond to the MGScopeBarDelegate methods easily. + + self.groups = [NSMutableArray arrayWithCapacity:0]; + scopeBar.delegate = self; + + // Add first group of items. + NSArray *items = [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + @"HereItem", ITEM_IDENTIFIER, + @"Here", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"ThereItem", ITEM_IDENTIFIER, + @"There", ITEM_NAME, + nil], + nil]; + + [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: + @"Search:", GROUP_LABEL, + [NSNumber numberWithBool:NO], GROUP_SEPARATOR, + [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. + items, GROUP_ITEMS, + nil]]; + + // Add second group of items. + items = [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + @"ContentsItem", ITEM_IDENTIFIER, + @"Contents", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"FileNamesItem", ITEM_IDENTIFIER, + @"File Names", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"MetadataItem", ITEM_IDENTIFIER, + @"Metadata", ITEM_NAME, + nil], + nil]; + + [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: + // deliberately not specifying a label + [NSNumber numberWithBool:YES], GROUP_SEPARATOR, + [NSNumber numberWithInt:MGMultipleSelectionMode], GROUP_SELECTION_MODE, // multiple selection group. + items, GROUP_ITEMS, + nil]]; + + // Add third group of items. + items = [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + @"AllFilesItem", ITEM_IDENTIFIER, + @"All Files", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"ImagesOnlyItem", ITEM_IDENTIFIER, + @"Images Only", ITEM_NAME, + nil], + nil]; + + [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: + @"Kind:", GROUP_LABEL, + [NSNumber numberWithBool:YES], GROUP_SEPARATOR, + [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. + items, GROUP_ITEMS, + nil]]; + + // Tell the scope bar to ask us for data (since we're the scope-bar's delegate). + [scopeBar reloadData]; + + // Since our first group is a radio-mode group, the scope bar will automatically select its first item. + // The scope bar will take care of deselecting other items when you select a new item in a radio-mode group. + + // We'll also select the first item in our second group, which is a multiple-selection group. + // You can (and must) use this method to programmatically select/deselect items in the bar. + [scopeBar setSelected:YES forItem:@"ContentsItem" inGroup:1]; // remember that group-numbers are zero-based. + + // Clear out the label field below the scope bar. + [labelField setStringValue:@""]; +} + + +- (void)dealloc +{ + self.groups = nil; + [super dealloc]; +} + + +#pragma mark MGScopeBarDelegate methods + + +- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar +{ + return [self.groups count]; +} + + +- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber +{ + NSString *res=[[self.groups objectAtIndex:groupNumber] valueForKeyPath:[NSString stringWithFormat:@"%@.%@", GROUP_ITEMS, ITEM_IDENTIFIER]]; + NSLog(@"-itemIdentifiersForGroup- %@",res); + return res; +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber +{ + NSString *res= [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_LABEL]; // might be nil, which is fine (nil means no label). + NSLog(@"-labelForGroup- %@",res); + return res; +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber +{ + NSArray *items = [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_ITEMS]; + if (items) { + // We'll iterate here, since this is just a demo. This avoids having to keep an NSDictionary of identifiers + // for each group as well as an array for ordering. In a more realistic scenario, you'd probably want to be + // able to look-up an item by its identifier in constant time. + for (NSDictionary *item in items) { + if ([[item objectForKey:ITEM_IDENTIFIER] isEqualToString:identifier]) { + NSLog(@"-titleOfItem- %@=%@",identifier,[item objectForKey:ITEM_NAME]); + return [item objectForKey:ITEM_NAME]; + break; + } + } + } + return nil; +} + + +- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber +{ + return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SELECTION_MODE] intValue]; +} + + +- (BOOL)scopeBar:(MGScopeBar *)theScopeBar showSeparatorBeforeGroup:(int)groupNumber +{ + // Optional method. If not implemented, all groups except the first will have a separator before them. + return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SEPARATOR] boolValue]; +} + + +- (NSImage *)scopeBar:(MGScopeBar *)scopeBar imageForItem:(NSString *)identifier inGroup:(int)groupNumber +{ + // Optional method. If not implemented (or if you return nil), items will not have an image. + if (groupNumber == 0) { + return [NSImage imageNamed:@"NSComputer"]; + + } else if (groupNumber == 2) { + if ([identifier isEqualToString:@"AllFilesItem"]) { + return [NSImage imageNamed:@"NSGenericDocument"]; + + } else if ([identifier isEqualToString:@"ImagesOnlyItem"]) { + return [[NSWorkspace sharedWorkspace] iconForFileType:@"png"]; + } + } + + return nil; +} + + +- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar +{ + // Optional method. If not implemented (or if you return nil), the scope-bar will not have an accessory view. + return accessoryView; +} + + +- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected + forItem:(NSString *)identifier inGroup:(int)groupNumber +{ + // Display some text showing what just happened. + NSString *displayString = [NSString stringWithFormat:@"\"%@\" %@ in group %d.", + identifier, + (selected) ? @"selected" : @"deselected", + groupNumber]; + [labelField setStringValue:displayString]; + //NSLog(@"%@", displayString); +} + + +#pragma mark Accessors and properties + + +@synthesize groups; + + +@end diff --git a/MGScopeBar/English.lproj/InfoPlist.strings b/MGScopeBar/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..5e45963c382ba690b781b953a00585212b898ac5 GIT binary patch literal 92 zcmW-XQ3`+{5C!MkQ~2$No+IcIkqMDxWCV8j>LCj|yTg2Mz+o9F%uHlf9u}h9EuK`F a!Y*1dX%G66ZqL#C$|bw0ZoP5@jOGW1ArT7z literal 0 HcmV?d00001 diff --git a/MGScopeBar/English.lproj/MainMenu.xib b/MGScopeBar/English.lproj/MainMenu.xib new file mode 100644 index 0000000..9c12f0b --- /dev/null +++ b/MGScopeBar/English.lproj/MainMenu.xib @@ -0,0 +1,3278 @@ + + + + 1050 + 9F33 + 672 + 949.34 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + NewApplication + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + NewApplication + + YES + + + About NewApplication + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + UHJlZmVyZW5jZXPigKY + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide NewApplication + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit NewApplication + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + T3BlbuKApg + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + U2F2ZSBBc+KApg + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + UHJpbnTigKY + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + RmluZOKApg + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + U2hvdyBTcGVsbGluZ+KApg + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Q3VzdG9taXplIFRvb2xiYXLigKY + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + NewApplication Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + 15 + 2 + {{153, 619}, {805, 122}} + 1946157056 + MGScopeBar Demo + NSWindow + + {1000, 122} + {250, 122} + + + 256 + + YES + + + 266 + {{0, 97}, {805, 25}} + + MGScopeBar + + + + 266 + {{17, 48}, {771, 17}} + + YES + + 68288064 + 138413056 + + + LucidaGrande + 1.300000e+01 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {805, 122} + + + {{0, 0}, {1440, 878}} + {250, 144} + {1000, 144} + + + NSFontManager + + + AppController + + + + 265 + + YES + + + 265 + {{1, 0}, {52, 19}} + + YES + + -2080244224 + 134217728 + Save + + LucidaGrande + 1.200000e+01 + 16 + + + -2038152961 + 164 + + + 400 + 75 + + + + {54, 20} + NSView + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + alignLeft: + + + + 442 + + + + alignJustified: + + + + 443 + + + + copyRuler: + + + + 444 + + + + alignCenter: + + + + 445 + + + + toggleRuler: + + + + 446 + + + + alignRight: + + + + 447 + + + + pasteRuler: + + + + 448 + + + + terminate: + + + + 449 + + + + labelField + + + + 454 + + + + scopeBar + + + + 455 + + + + delegate + + + + 456 + + + + nextKeyView + + + + 458 + + + + initialFirstResponder + + + + 459 + + + + accessoryView + + + + 461 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 103 + + + YES + + + + 1 + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + 3 + + + 80 + + + 8 + + + 78 + + + 6 + + + 72 + + + + + 82 + + + 9 + + + 124 + + + YES + + + + + + 77 + + + 5 + + + 73 + + + 1 + + + 79 + + + 7 + + + 112 + + + 10 + + + 74 + + + 2 + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 106 + + + YES + + + + 2 + + + 111 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + 1111 + + + 144 + + + + + 129 + + + 121 + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 371 + + + YES + + + + + + 372 + + + YES + + + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + 377 + + + YES + + + + + + 378 + + + YES + + + + + + 379 + + + YES + + + + + + + + + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + 387 + + + + + 388 + + + YES + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + YES + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + YES + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + YES + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + YES + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + 450 + + + + + 451 + + + + + 452 + + + YES + + + + + + 453 + + + + + 460 + + + YES + + + + + + 462 + + + YES + + + + + + 463 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 103.IBPluginDependency + 103.ImportedFromIB2 + 106.IBPluginDependency + 106.ImportedFromIB2 + 106.editorWindowContentRectSynchronizationRect + 111.IBPluginDependency + 111.ImportedFromIB2 + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 371.windowTemplate.hasMaxSize + 371.windowTemplate.hasMinSize + 371.windowTemplate.maxSize + 371.windowTemplate.minSize + 372.IBPluginDependency + 375.IBPluginDependency + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 377.IBPluginDependency + 378.IBPluginDependency + 379.IBPluginDependency + 380.IBPluginDependency + 381.IBPluginDependency + 382.IBPluginDependency + 383.IBPluginDependency + 384.IBPluginDependency + 385.IBPluginDependency + 386.IBPluginDependency + 387.IBPluginDependency + 388.IBEditorWindowLastContentRect + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency + 450.IBPluginDependency + 451.IBPluginDependency + 452.IBPluginDependency + 453.IBPluginDependency + 460.IBEditorWindowLastContentRect + 460.IBPluginDependency + 462.IBPluginDependency + 463.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{596, 852}, {216, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{187, 434}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{207, 285}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{153, 619}, {805, 122}} + com.apple.InterfaceBuilder.CocoaPlugin + {{153, 619}, {805, 122}} + + {{33, 99}, {480, 360}} + + + {1000, 122} + {250, 122} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{437, 242}, {86, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{523, 2}, {178, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{76, 814}, {54, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{219, 102}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 474}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 463 + + + + YES + + AppController + NSObject + + YES + + YES + accessoryView + labelField + scopeBar + + + YES + NSView + NSTextField + MGScopeBar + + + + IBProjectSource + AppController.h + + + + MGScopeBar + NSView + + delegate + id + + + IBProjectSource + MGScopeBar.h + + + + + 0 + ../MGScopeBar.xcodeproj + 3 + + diff --git a/MGScopeBar/Info.plist b/MGScopeBar/Info.plist new file mode 100644 index 0000000..612b7da --- /dev/null +++ b/MGScopeBar/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/MGScopeBar/MGRecessedPopUpButtonCell.h b/MGScopeBar/MGRecessedPopUpButtonCell.h new file mode 100644 index 0000000..9955ccf --- /dev/null +++ b/MGScopeBar/MGRecessedPopUpButtonCell.h @@ -0,0 +1,21 @@ +// +// MGRecessedPopUpButtonCell.h +// MGScopeBar +// +// Created by Matt Gemmell on 20/03/2008. +// Copyright 2008 Instinctive Code. +// + +#import + +/* + This cell class is used only for NSPopUpButtons which do NOT automatically + get their titles from their selected menu-items, since such popup-buttons + are weirdly broken when using the recessed bezel-style. +*/ + +@interface MGRecessedPopUpButtonCell : NSPopUpButtonCell { + NSButton *recessedButton; // we use a separate NSButton to do the bezel-drawing. +} + +@end diff --git a/MGScopeBar/MGRecessedPopUpButtonCell.m b/MGScopeBar/MGRecessedPopUpButtonCell.m new file mode 100644 index 0000000..d41bb92 --- /dev/null +++ b/MGScopeBar/MGRecessedPopUpButtonCell.m @@ -0,0 +1,54 @@ +// +// MGRecessedPopUpButtonCell.m +// MGScopeBar +// +// Created by Matt Gemmell on 20/03/2008. +// Copyright 2008 Instinctive Code. +// + +#import "MGRecessedPopUpButtonCell.h" + + +@implementation MGRecessedPopUpButtonCell + + +- (id)initTextCell:(NSString *)title pullsDown:(BOOL)pullsDown +{ + if ((self = [super initTextCell:title pullsDown:pullsDown])) { + recessedButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 30, 20)]; // arbitrary frame. + [recessedButton setTitle:@""]; + [recessedButton setBezelStyle:NSRecessedBezelStyle]; + [recessedButton setButtonType:NSPushOnPushOffButton]; + [[recessedButton cell] setHighlightsBy:NSCellIsBordered | NSCellIsInsetButton]; + [recessedButton setShowsBorderOnlyWhileMouseInside:NO]; + [recessedButton setState:NSOnState]; // ensures it looks pushed-in. + } + return self; +} + + +- (void)dealloc +{ + [recessedButton release]; + [super dealloc]; +} + + +- (void)drawTitleWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + // Inset title rect since its position is broken when NSPopUpButton + // isn't using its selected item as its title. + NSRect titleFrame = cellFrame; + titleFrame.origin.y += 1.0; + [super drawTitleWithFrame:titleFrame inView:controlView]; +} + + +- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView +{ + [recessedButton setFrame:frame]; + [recessedButton drawRect:frame]; +} + + +@end diff --git a/MGScopeBar/MGScopeBar.h b/MGScopeBar/MGScopeBar.h new file mode 100644 index 0000000..21b383a --- /dev/null +++ b/MGScopeBar/MGScopeBar.h @@ -0,0 +1,51 @@ +// +// MGScopeBar.h +// MGScopeBar +// +// Created by Matt Gemmell on 15/03/2008. +// Copyright 2008 Instinctive Code. +// + +#import +#import "MGScopeBarDelegateProtocol.h" + +@interface MGScopeBar : NSView { +@private + IBOutlet id delegate; // weak ref. + NSMutableArray *_separatorPositions; // x-coords of separators, indexed by their group-number. + NSMutableArray *_groups; // groups of items. + NSView *_accessoryView; // weak ref since it's a subview. + NSMutableDictionary *_identifiers; // map of identifiers to items. + NSMutableArray *_selectedItems; // all selected items in all groups; see note below. + float _lastWidth; // previous width of view from when we last resized. + NSInteger _firstCollapsedGroup; // index of first group collapsed into a popup. + float _totalGroupsWidthForPopups; // total width needed to show all groups expanded (excluding padding and accessory). + float _totalGroupsWidth; // total width needed to show all groups as native-width popups (excluding padding and accessory). + BOOL _smartResizeEnabled; // whether to do our clever collapsing/expanding of buttons when resizing (Smart Resizing). +} + +@property(assign) id delegate; // should implement the MGScopeBarDelegate protocol. + +- (void)reloadData; // causes the scope-bar to reload all groups/items from its delegate. +- (void)sizeToFit; // only resizes vertically to optimum height; does not affect width. +- (void)adjustSubviews; // performs Smart Resizing if enabled. You should only need to call this yourself if you change the width of the accessoryView. + +// Smart Resize is the intelligent conversion of button-groups into NSPopUpButtons and vice-versa, based on available space. +// This functionality is enabled (YES) by default. Changing this setting will automatically call -reloadData. +- (BOOL)smartResizeEnabled; +- (void)setSmartResizeEnabled:(BOOL)enabled; + +// The following method must be used to manage selections in the scope-bar; do not attempt to manipulate buttons etc directly. +- (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber; +- (NSArray *)selectedItems; + +/* + Note: The -selectedItems method returns an array of arrays. + Each index in the returned array represents the group of items at that index. + The contents of each sub-array are the identifiers of each selected item in that group. + Sub-arrays may be empty, but will always be present (i.e. you will always find an NSArray). + Depending on the group's selection-mode, sub-arrays may contain zero, one or many identifiers. + The identifiers in each sub-array are not in any particular order. + */ + +@end diff --git a/MGScopeBar/MGScopeBar.m b/MGScopeBar/MGScopeBar.m new file mode 100644 index 0000000..28454e3 --- /dev/null +++ b/MGScopeBar/MGScopeBar.m @@ -0,0 +1,1049 @@ +// +// MGScopeBar.m +// MGScopeBar +// +// Created by Matt Gemmell on 15/03/2008. +// Copyright 2008 Instinctive Code. +// + +#import "MGScopeBar.h" +#import "MGRecessedPopUpButtonCell.h" + + +#define SCOPE_BAR_H_INSET 8.0 // inset on left and right +#define SCOPE_BAR_HEIGHT 25.0 // used in -sizeToFit +#define SCOPE_BAR_START_COLOR_GRAY [NSColor colorWithCalibratedWhite:0.75 alpha:1.0] // bottom color of gray gradient +#define SCOPE_BAR_END_COLOR_GRAY [NSColor colorWithCalibratedWhite:0.90 alpha:1.0] // top color of gray gradient +#define SCOPE_BAR_START_COLOR_BLUE [NSColor colorWithCalibratedRed:0.71 green:0.75 blue:0.81 alpha:1.0] // bottom color of blue gradient +#define SCOPE_BAR_END_COLOR_BLUE [NSColor colorWithCalibratedRed:0.80 green:0.82 blue:0.87 alpha:1.0] // top color of blue gradient +#define SCOPE_BAR_BORDER_COLOR [NSColor colorWithCalibratedWhite:0.69 alpha:1.0] // bottom line's color +#define SCOPE_BAR_BORDER_WIDTH 1.0 // bottom line's width + +#define SCOPE_BAR_SEPARATOR_COLOR [NSColor colorWithCalibratedWhite:0.52 alpha:1.0] // color of vertical-line separators between groups +#define SCOPE_BAR_SEPARATOR_WIDTH 1.0 // width of vertical-line separators between groups +#define SCOPE_BAR_SEPARATOR_HEIGHT 16.0 // separators are vertically centered in the bar + +#define SCOPE_BAR_LABEL_COLOR [NSColor colorWithCalibratedWhite:0.45 alpha:1.0] // color of groups' labels +#define SCOPE_BAR_FONTSIZE 12.0 // font-size of labels and buttons +#define SCOPE_BAR_ITEM_SPACING 6.0 // spacing between buttons/separators/labels +#define SCOPE_BAR_BUTTON_IMAGE_SIZE 16.0 // size of buttons' images (width and height) + +#define SCOPE_BAR_HIDE_POPUP_BG YES // whether the bezel background of an NSPopUpButton is hidden when none of its menu-items are selected. + +// Appearance metrics. These were chosen to mimic the Finder's "Find" (Spotlight / Smart Group / etc) window's scope-bar. +#define MENU_PADDING 25.0 // how much wider a popup-button is than a regular button with the same title. +#define MENU_MIN_WIDTH 60.0 // minimum width a popup-button can be narrowed to. + +// NSPopUpButton titles used for groups which allow multiple selection. +#define POPUP_TITLE_EMPTY_SELECTION NSLocalizedString(@"(None)", nil) // title used when no items in the popup are selected. +#define POPUP_TITLE_MULTIPLE_SELECTION NSLocalizedString(@"(Multiple)", nil) // title used when multiple items in the popup are selected. + + +// ---- end of configurable settings ---- // + + +// Keys for internal use. +#define GROUP_IDENTIFIERS @"Identifiers" // NSMutableArray of identifier strings. +#define GROUP_BUTTONS @"Buttons" // NSMutableArray of either NSButtons or NSMenuItems, one per item. +#define GROUP_SELECTION_MODE @"SelectionMode" // MGScopeBarGroupSelectionMode (int) as NSNumber. +#define GROUP_MENU_MODE @"MenuMode" // BOOL, YES if group is collected in a popup-menu, else NO. +#define GROUP_POPUP_BUTTON @"PopupButton" // NSPopUpButton (only present if group is in menu-mode). +#define GROUP_HAS_SEPARATOR @"HasSeparator" // BOOL, YES if group has a separator before it. +#define GROUP_HAS_LABEL @"HasLabel" // BOOL, YES if group has a label. +#define GROUP_LABEL_FIELD @"LabelField" // NSTextField for the label (optional; only if group has a label) +#define GROUP_TOTAL_BUTTONS_WIDTH @"TotalButtonsWidth" // Width of all buttons in a group plus spacings between them (doesn't include label etc) +#define GROUP_WIDEST_BUTTON_WIDTH @"WidestButtonWidth" // Width of widest button, used when making popup-menus. +#define GROUP_CUMULATIVE_WIDTH @"CumulativeWidth" // Width from left of leftmost group to right of this group (all groups fully expanded). + + +@interface MGScopeBar (MGPrivateMethods) + +- (IBAction)scopeButtonClicked:(id)sender; +- (NSButton *)getButtonForItem:(NSString *)identifier inGroup:(int)groupNumber; // returns relevant button/menu-item +- (void)updateSelectedState:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber informDelegate:(BOOL)inform; +- (NSButton *)buttonForItem:(NSString *)identifier inGroup:(int)groupNumber + withTitle:(NSString *)title image:(NSImage *)image; // creates a new NSButton +- (NSMenuItem *)menuItemForItem:(NSString *)identifier inGroup:(int)groupNumber + withTitle:(NSString *)title image:(NSImage *)image; // creates a new NSMenuitem +- (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group; +- (void)setControl:(NSObject *)control forIdentifier:(NSString *)identifier inGroup:(int)groupNumber; +- (void)updateMenuTitleForGroupAtIndex:(int)groupNumber; + +@end + + +@implementation MGScopeBar + + +#pragma mark Setup and teardown + + +- (id)initWithFrame:(NSRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + _smartResizeEnabled = YES; + // Everything else is reset in -reloadData. + } + return self; +} + + +- (void)dealloc +{ + delegate = nil; + if (_accessoryView) { + [_accessoryView removeFromSuperview]; + _accessoryView = nil; // weak ref + } + [_separatorPositions release]; + [_groups release]; + [_identifiers release]; + [_selectedItems release]; + + [super dealloc]; +} + + +#pragma mark Data management + + +- (void)reloadData +{ + // Resize if necessary. + [self sizeToFit]; + + // Remove any old objects. + if (_accessoryView) { + [_accessoryView removeFromSuperview]; + _accessoryView = nil; // weak ref + } + + NSArray *subviews = [[self subviews] copy]; // so we don't mutate the collection we're iterating over. + [subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + [subviews release]; // because copies are retained. + + [_separatorPositions release]; + _separatorPositions = nil; + [_groups release]; + _groups = nil; + [_identifiers release]; + _identifiers = nil; + [_selectedItems release]; + _selectedItems = nil; + _firstCollapsedGroup = NSNotFound; + _lastWidth = NSNotFound; + _totalGroupsWidth = 0; + _totalGroupsWidthForPopups = 0; + + // Configure contents via delegate. + if (self.delegate && [delegate conformsToProtocol:@protocol(MGScopeBarDelegate)]) { + int numGroups = [delegate numberOfGroupsInScopeBar:self]; + + if (numGroups > 0) { + _separatorPositions = [[NSMutableArray alloc] initWithCapacity:numGroups]; + _groups = [[NSMutableArray alloc] initWithCapacity:numGroups]; + _identifiers = [[NSMutableDictionary alloc] initWithCapacity:0]; + _selectedItems = [[NSMutableArray alloc] initWithCapacity:numGroups]; + + int xCoord = SCOPE_BAR_H_INSET; + NSRect ctrlRect = NSZeroRect; + BOOL providesImages = [delegate respondsToSelector:@selector(scopeBar:imageForItem:inGroup:)]; + + int groupNum; + for (groupNum = 0; groupNum < numGroups; groupNum++) { + // Add separator if appropriate. + BOOL addSeparator = (groupNum > 0); // default behavior. + if ([delegate respondsToSelector:@selector(scopeBar:showSeparatorBeforeGroup:)]) { + addSeparator = [delegate scopeBar:self showSeparatorBeforeGroup:groupNum]; + } + if (addSeparator) { + [_separatorPositions addObject:[NSNumber numberWithInt:xCoord]]; + xCoord += SCOPE_BAR_SEPARATOR_WIDTH + SCOPE_BAR_ITEM_SPACING; + + _totalGroupsWidth += SCOPE_BAR_SEPARATOR_WIDTH + SCOPE_BAR_ITEM_SPACING; + _totalGroupsWidthForPopups += SCOPE_BAR_SEPARATOR_WIDTH + SCOPE_BAR_ITEM_SPACING; + } else { + [_separatorPositions addObject:[NSNull null]]; + } + + // Add label if appropriate. + NSString *groupLabel = [delegate scopeBar:self labelForGroup:groupNum]; + NSTextField *labelField = nil; + BOOL hasLabel = NO; + if (groupLabel && [groupLabel length] > 0) { + hasLabel = YES; + ctrlRect = NSMakeRect(xCoord, 6, 15, 50); + labelField = [[NSTextField alloc] initWithFrame:ctrlRect]; + [labelField setStringValue:groupLabel]; + [labelField setEditable:NO]; + [labelField setBordered:NO]; + [labelField setDrawsBackground:NO]; + [labelField setTextColor:SCOPE_BAR_LABEL_COLOR]; + [labelField setFont:[NSFont boldSystemFontOfSize:SCOPE_BAR_FONTSIZE]]; + [labelField sizeToFit]; + ctrlRect.size = [labelField frame].size; + [labelField setFrame:ctrlRect]; + [self addSubview:labelField]; + [labelField release]; + + xCoord += ctrlRect.size.width + SCOPE_BAR_ITEM_SPACING; + + _totalGroupsWidth += ctrlRect.size.width + SCOPE_BAR_ITEM_SPACING; + _totalGroupsWidthForPopups += ctrlRect.size.width + SCOPE_BAR_ITEM_SPACING; + } + + // Create group information for use during interaction. + NSArray *identifiers = [delegate scopeBar:self itemIdentifiersForGroup:groupNum]; + NSMutableArray *usedIdentifiers = [NSMutableArray arrayWithCapacity:[identifiers count]]; + NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:[identifiers count]]; + MGScopeBarGroupSelectionMode selMode = [delegate scopeBar:self selectionModeForGroup:groupNum]; + if (selMode != MGRadioSelectionMode && selMode != MGMultipleSelectionMode) { + // Sanity check, since this is just an int. + selMode = MGRadioSelectionMode; + } + NSMutableDictionary *groupInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + usedIdentifiers, GROUP_IDENTIFIERS, + buttons, GROUP_BUTTONS, + [NSNumber numberWithInt:selMode], GROUP_SELECTION_MODE, + [NSNumber numberWithBool:NO], GROUP_MENU_MODE, + [NSNumber numberWithBool:hasLabel], GROUP_HAS_LABEL, + [NSNumber numberWithBool:addSeparator], GROUP_HAS_SEPARATOR, + nil]; + if (hasLabel) { + [groupInfo setObject:labelField forKey:GROUP_LABEL_FIELD]; + } + [_groups addObject:groupInfo]; + [_selectedItems addObject:[NSMutableArray arrayWithCapacity:0]]; + + // Add buttons for this group. + float widestButtonWidth = 0; + float totalButtonsWidth = 0; + for (NSString *itemID in identifiers) { + if (![usedIdentifiers containsObject:itemID]) { + [usedIdentifiers addObject:itemID]; + } else { + // Identifier already used for this group; skip it. + continue; + } + + NSString *title = [delegate scopeBar:self titleOfItem:itemID inGroup:groupNum]; + NSImage *image = nil; + if (providesImages) { + image = [delegate scopeBar:self imageForItem:itemID inGroup:groupNum]; + } + NSButton *button = [self buttonForItem:itemID inGroup:groupNum withTitle:title image:image]; + + ctrlRect = [button frame]; + ctrlRect.origin.x = xCoord; + [button setFrame:ctrlRect]; + [self addSubview:button]; + [buttons addObject:button]; + + // Adjust x-coordinate for next item in the bar. + xCoord += ctrlRect.size.width + SCOPE_BAR_ITEM_SPACING; + + // Update total and widest button widths. + if (totalButtonsWidth > 0) { + // Add spacing before this item, since it's not the first in the group. + totalButtonsWidth += SCOPE_BAR_ITEM_SPACING; + } + totalButtonsWidth += ctrlRect.size.width; + if (ctrlRect.size.width > widestButtonWidth) { + widestButtonWidth = ctrlRect.size.width; + } + } + + // Add the accumulated buttons' width and the widest button's width to groupInfo. + [groupInfo setObject:[NSNumber numberWithFloat:totalButtonsWidth] forKey:GROUP_TOTAL_BUTTONS_WIDTH]; + [groupInfo setObject:[NSNumber numberWithFloat:widestButtonWidth] forKey:GROUP_WIDEST_BUTTON_WIDTH]; + + _totalGroupsWidth += totalButtonsWidth; + _totalGroupsWidthForPopups += widestButtonWidth + MENU_PADDING; + + float cumulativeWidth = _totalGroupsWidth + (groupNum * SCOPE_BAR_ITEM_SPACING); + [groupInfo setObject:[NSNumber numberWithFloat:cumulativeWidth] forKey:GROUP_CUMULATIVE_WIDTH]; + + // If this is a radio-mode group, select the first item automatically. + if (selMode == MGRadioSelectionMode) { + [self updateSelectedState:YES forItem:[identifiers objectAtIndex:0] inGroup:groupNum informDelegate:YES]; + } + } + + _totalGroupsWidth += ((numGroups - 1) * SCOPE_BAR_ITEM_SPACING); + _totalGroupsWidthForPopups += ((numGroups - 1) * SCOPE_BAR_ITEM_SPACING); + } + + // Add accessoryView, if provided. + if ([delegate respondsToSelector:@selector(accessoryViewForScopeBar:)]) { + _accessoryView = [delegate accessoryViewForScopeBar:self]; + if (_accessoryView) { + // Remove NSViewMaxXMargin flag from resizing mask, if present. + NSUInteger mask = [_accessoryView autoresizingMask]; + if (mask & NSViewMaxXMargin) { + mask &= ~NSViewMaxXMargin; + } + + // Add NSViewMinXMargin flag to resizing mask, if not present. + if (!(mask & NSViewMinXMargin)) { + mask = (mask | NSViewMinXMargin); + } + + // Update view sizing mask. + [_accessoryView setAutoresizingMask:mask]; + + // Adjust frame appropriately. + NSRect frame = [_accessoryView frame]; + frame.origin.x = round(NSMaxX([self bounds]) - (frame.size.width + SCOPE_BAR_H_INSET)); + frame.origin.y = round(((SCOPE_BAR_HEIGHT - frame.size.height) / 2.0)); + [_accessoryView setFrame:frame]; + + // Add as subview. + [self addSubview:_accessoryView]; + } + } + + // Layout subviews appropriately. + [self adjustSubviews]; + } + + [self setNeedsDisplay:YES]; +} + + +#pragma mark Utility methods + + +- (void)sizeToFit +{ + NSRect frame = [self frame]; + if (frame.size.height != SCOPE_BAR_HEIGHT) { + float delta = SCOPE_BAR_HEIGHT - frame.size.height; + frame.size.height += delta; + frame.origin.y -= delta; + [self setFrame:frame]; + } +} + + +- (void)adjustSubviews +{ + if (!_smartResizeEnabled) { + return; + } + + /* + We need to work out which groups we can show fully expanded, and which must be collapsed into popup-buttons. + Any kind of frame-change may have happened, so we need to take care to create or remove buttons or popup-buttons as needed. + */ + + // Bail out if we have nothing to do. + if (!_groups || [_groups count] == 0) { + return; + } + + // Obtain current width of view. + float viewWidth = [self bounds].size.width; + + // Abort if there hasn't been any genuine change in width. + if ((viewWidth == _lastWidth) && (_lastWidth != NSNotFound)) { + return; + } + + // Determine whether we got narrower or wider. + float narrower = ((_lastWidth == NSNotFound) || (viewWidth < _lastWidth)); + + // Find width available for showing groups. + float availableWidth = viewWidth - (SCOPE_BAR_H_INSET * 2.0); + if (_accessoryView) { + // Account for _accessoryView, leaving a normal amount of spacing to the left of it. + availableWidth -= ([_accessoryView frame].size.width + SCOPE_BAR_ITEM_SPACING); + } + + BOOL shouldAdjustPopups = (availableWidth < _totalGroupsWidthForPopups); + NSInteger oldFirstCollapsedGroup = _firstCollapsedGroup; + + // Work out which groups we should now check for collapsibility/expandability. + NSEnumerator *groupsEnumerator = nil; + NSRange enumRange; + BOOL proceed = YES; + + if (narrower) { + // Got narrower, so work backwards from oldFirstCollapsedGroup (excluding that group, since it's already collapsed), + // checking to see if we need to collapse any more groups to the left. + enumRange = NSMakeRange(0, oldFirstCollapsedGroup); + // If no groups were previously collapsed, work backwards from the last group (including that group). + if (oldFirstCollapsedGroup == NSNotFound) { + enumRange.length = [_groups count]; + } + groupsEnumerator = [[_groups subarrayWithRange:enumRange] reverseObjectEnumerator]; + + } else { + // Got wider, so work forwards from oldFirstCollapsedGroup (including that group) checking to see if we can + // expand any groups into full buttons. + enumRange = NSMakeRange(oldFirstCollapsedGroup, [_groups count] - oldFirstCollapsedGroup); + // If no groups were previously collapsed, we have nothing to do here. + if (oldFirstCollapsedGroup == NSNotFound) { + proceed = NO; + } + if (proceed) { + groupsEnumerator = [[_groups subarrayWithRange:enumRange] objectEnumerator]; + } + } + + // Get the current occupied width within this view. + float currentOccupiedWidth = 0; + NSDictionary *group = [_groups objectAtIndex:0]; + BOOL menuMode = [[group objectForKey:GROUP_MENU_MODE] boolValue]; + NSButton *firstButton = nil; + if (menuMode) { + firstButton = [group objectForKey:GROUP_POPUP_BUTTON]; + } else { + firstButton = [[group objectForKey:GROUP_BUTTONS] objectAtIndex:0]; + } + float leftLimit = NSMinX([firstButton frame]); + // Account for label in first group, if present. + if ([[group objectForKey:GROUP_HAS_LABEL] boolValue]) { + NSTextField *label = (NSTextField *)[group objectForKey:GROUP_LABEL_FIELD]; + leftLimit -= (SCOPE_BAR_ITEM_SPACING + [label frame].size.width); + } + + group = [_groups lastObject]; + menuMode = [[group objectForKey:GROUP_MENU_MODE] boolValue]; + NSButton *lastButton = nil; + if (menuMode) { + lastButton = [group objectForKey:GROUP_POPUP_BUTTON]; + } else { + lastButton = [[group objectForKey:GROUP_BUTTONS] lastObject]; + } + float rightLimit = NSMaxX([lastButton frame]); + currentOccupiedWidth = rightLimit - leftLimit; + + // Work out whether we need to try collapsing groups at all, if we're narrowing. + // We have already handled the case of not requiring to expand groups if we're widening, above. + if (proceed && narrower) { + if (availableWidth >= currentOccupiedWidth) { + // We still have enough room for what we're showing; no change needed. + proceed = NO; + } + } + + if (proceed) { + // Disable screen updates. + NSDisableScreenUpdates(); + + // See how many further groups we can expand or contract. + float theoreticalOccupiedWidth = currentOccupiedWidth; + for (NSDictionary *groupInfo in groupsEnumerator) { + BOOL complete = NO; + float expandedWidth = [[groupInfo objectForKey:GROUP_TOTAL_BUTTONS_WIDTH] floatValue]; + float contractedWidth = [[groupInfo objectForKey:GROUP_WIDEST_BUTTON_WIDTH] floatValue] + MENU_PADDING; + + if (narrower) { + // We're narrowing. See if collapsing this group brings us within availableWidth. + if (((theoreticalOccupiedWidth - expandedWidth) + contractedWidth) <= availableWidth) { + // We're now within width constraints, so we're done iterating. + complete = YES; + } // else, continue trying to to collapse groups. + theoreticalOccupiedWidth = ((theoreticalOccupiedWidth - expandedWidth) + contractedWidth); + + } else { + // 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"); + break; + } // else, continue trying to expand groups. + theoreticalOccupiedWidth = ((theoreticalOccupiedWidth - contractedWidth) + expandedWidth); + //NSLog(@"We can continue expanding"); + } + + // Update _firstCollapsedGroup appropriately. + if (_firstCollapsedGroup == NSNotFound) { + _firstCollapsedGroup = ((narrower) ? [_groups count] : -1); + oldFirstCollapsedGroup = _firstCollapsedGroup; + } + _firstCollapsedGroup += ((narrower) ? -1 : 1); + + // Terminate if we now fit the available space as best we can. + if (complete) { + break; + } + } + + // 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); + if (_firstCollapsedGroup != oldFirstCollapsedGroup) { + if (narrower) { + // Narrower. _firstCollapsedGroup will be less (earlier) than oldFirstCollapsedGroup. + changedRange.location = _firstCollapsedGroup; + changedRange.length = (oldFirstCollapsedGroup - _firstCollapsedGroup); + } else { + // Wider. _firstCollapsedGroup will be greater (later) than oldFirstCollapsedGroup. + changedRange.location = oldFirstCollapsedGroup; + changedRange.length = (_firstCollapsedGroup - oldFirstCollapsedGroup); + } + } else { + // _firstCollapsedGroup and oldFirstCollapsedGroup are the same; nothing needs changed. + adjusting = NO; + } + + // 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)); + NSInteger nextXCoord = NSNotFound; + if (adjusting) { + int i; + for (i = changedRange.location; i < NSMaxRange(changedRange); i++) { + NSMutableDictionary *groupInfo = [_groups objectAtIndex:i]; + + if (nextXCoord == NSNotFound) { + BOOL menuMode = [[groupInfo objectForKey:GROUP_MENU_MODE] boolValue]; + NSButton *firstButton = nil; + if (!menuMode) { + firstButton = [[groupInfo objectForKey:GROUP_BUTTONS] objectAtIndex:0]; + } else { + firstButton = [groupInfo objectForKey:GROUP_POPUP_BUTTON]; + } + nextXCoord = [firstButton frame].origin.x; + } else { + // Add group-spacing, separator and label as appropriate. + nextXCoord += SCOPE_BAR_ITEM_SPACING; + if ([[groupInfo objectForKey:GROUP_HAS_SEPARATOR] boolValue]) { + nextXCoord += (SCOPE_BAR_SEPARATOR_WIDTH + SCOPE_BAR_ITEM_SPACING); + } + if ([[groupInfo objectForKey:GROUP_HAS_LABEL] boolValue]) { + NSTextField *labelField = (NSTextField *)[groupInfo objectForKey:GROUP_LABEL_FIELD]; + float labelWidth = [labelField frame].size.width; + nextXCoord += (labelWidth + SCOPE_BAR_ITEM_SPACING); + } + } + + NSPopUpButton *popup = nil; + if (narrower) { + // Remove buttons. + NSArray *buttons = [groupInfo objectForKey:GROUP_BUTTONS]; + [buttons makeObjectsPerformSelector:@selector(removeFromSuperview)]; + + // Create popup and add it to this view. + popup = [self popupButtonForGroup:groupInfo]; + NSRect popupFrame = [popup frame]; + popupFrame.origin.x = nextXCoord; + [popup setFrame:popupFrame]; + [groupInfo setObject:popup forKey:GROUP_POPUP_BUTTON]; + [self addSubview:popup positioned:NSWindowBelow relativeTo:_accessoryView]; + nextXCoord += popupFrame.size.width; + + // Ensure popup has appropriate title. + [self updateMenuTitleForGroupAtIndex:i]; + + } else { + // Remove and release popup. + popup = [groupInfo objectForKey:GROUP_POPUP_BUTTON]; + [popup removeFromSuperview]; + [groupInfo removeObjectForKey:GROUP_POPUP_BUTTON]; + + // Replace menuItems with buttons. + float buttonX = nextXCoord; + NSMutableArray *menuItems = [groupInfo objectForKey:GROUP_BUTTONS]; + NSArray *selectedItems = [_selectedItems objectAtIndex:i]; + int i; + for (i = 0; i < [menuItems count]; i++) { + NSMenuItem *menuItem = [menuItems objectAtIndex:i]; + NSString *itemIdentifier = [menuItem representedObject]; + NSButton *button = [self buttonForItem:itemIdentifier + inGroup:[menuItem tag] + withTitle:[menuItem title] + image:[menuItem image]]; + NSRect buttonFrame = [button frame]; + buttonFrame.origin.x = buttonX; + [button setFrame:buttonFrame]; + if ([selectedItems containsObject:itemIdentifier]) { + [button setState:NSOnState]; + } + [self addSubview:button positioned:NSWindowBelow relativeTo:_accessoryView]; + [menuItems replaceObjectAtIndex:i withObject:button]; + buttonX += [button frame].size.width + SCOPE_BAR_ITEM_SPACING; + } + nextXCoord = (buttonX - SCOPE_BAR_ITEM_SPACING); + } + + // Update GROUP_MENU_MODE for this group. + [groupInfo setObject:[NSNumber numberWithBool:narrower] forKey:GROUP_MENU_MODE]; + } + } + + // Modify positions/sizes of groups and separators as required. + float startIndex = MIN(changedRange.location, _firstCollapsedGroup); + float xCoord = 0; + float perGroupDelta = 0; + if (shouldAdjustPopups) { + perGroupDelta = ((_totalGroupsWidthForPopups - availableWidth) / [_groups count]); + } + int i; + for (i = startIndex; i < [_groups count]; i++) { + NSDictionary *groupInfo = [_groups objectAtIndex:i]; + BOOL menuMode = [[groupInfo objectForKey:GROUP_MENU_MODE] boolValue]; + + // Further contract or expand popups if appropriate. + if (shouldAdjustPopups) { + float fullPopupWidth = [[groupInfo objectForKey:GROUP_WIDEST_BUTTON_WIDTH] floatValue] + MENU_PADDING; + float popupWidth = fullPopupWidth - perGroupDelta; + popupWidth = MAX(popupWidth, MENU_MIN_WIDTH); + popupWidth = MIN(popupWidth, fullPopupWidth); + + NSPopUpButton *button = [groupInfo objectForKey:GROUP_POPUP_BUTTON]; + NSRect buttonRect = [button frame]; + buttonRect.size.width = popupWidth; + [button setFrame:buttonRect]; + } + + // Reposition groups appropriately. + if (i > startIndex) { + // Reposition separator if present. + if ([[groupInfo objectForKey:GROUP_HAS_SEPARATOR] boolValue]) { + [_separatorPositions replaceObjectAtIndex:i withObject:[NSNumber numberWithInt:xCoord]]; + xCoord += (SCOPE_BAR_SEPARATOR_WIDTH + SCOPE_BAR_ITEM_SPACING); + } + + // Reposition label if present. + if ([[groupInfo objectForKey:GROUP_HAS_LABEL] boolValue]) { + NSTextField *label = [groupInfo objectForKey:GROUP_LABEL_FIELD]; + NSRect labelFrame = [label frame]; + labelFrame.origin.x = xCoord; + [label setFrame:labelFrame]; + xCoord = NSMaxX(labelFrame) + SCOPE_BAR_ITEM_SPACING; + } + + // Reposition buttons or popup. + if (menuMode) { + NSPopUpButton *button = [groupInfo objectForKey:GROUP_POPUP_BUTTON]; + NSRect buttonRect = [button frame]; + buttonRect.origin.x = xCoord; + [button setFrame:buttonRect]; + xCoord = NSMaxX(buttonRect) + SCOPE_BAR_ITEM_SPACING; + + } else { + NSArray *buttons = [groupInfo objectForKey:GROUP_BUTTONS]; + for (NSButton *button in buttons) { + NSRect buttonRect = [button frame]; + buttonRect.origin.x = xCoord; + [button setFrame:buttonRect]; + xCoord = NSMaxX(buttonRect) + SCOPE_BAR_ITEM_SPACING; + } + } + + } else { + // Set up initial value of xCoord. + NSButton *button = nil; + if (menuMode) { + button = [groupInfo objectForKey:GROUP_POPUP_BUTTON]; + } else { + button = [[groupInfo objectForKey:GROUP_BUTTONS] lastObject]; + } + xCoord = NSMaxX([button frame]) + SCOPE_BAR_ITEM_SPACING; + } + } + + // Reset _firstCollapsedGroup to NSNotFound if necessary. + if (!narrower) { + if (_firstCollapsedGroup >= [_groups count]) { + _firstCollapsedGroup = NSNotFound; + } + } + } + + // Re-enable screen updates. + NSEnableScreenUpdates(); + } + + // Take note of our width for comparison next time. + _lastWidth = viewWidth; +} + + +- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize +{ + [super resizeSubviewsWithOldSize:oldBoundsSize]; + [self adjustSubviews]; +} + + +- (NSButton *)getButtonForItem:(NSString *)identifier inGroup:(int)groupNumber +{ + NSButton *button = nil; + NSArray *group = [_identifiers objectForKey:identifier]; + if (group && [group count] > groupNumber) { + NSObject *element = [group objectAtIndex:groupNumber]; + if (element != [NSNull null]) { + button = (NSButton *)element; + } + } + + return button; +} + + +- (NSButton *)buttonForItem:(NSString *)identifier inGroup:(int)groupNumber + withTitle:(NSString *)title image:(NSImage *)image +{ + NSRect ctrlRect = NSMakeRect(0, 0, 50, 20); // arbitrary size; will be resized later. + NSButton *button = [[NSButton alloc] initWithFrame:ctrlRect]; + [button setTitle:title]; + [[button cell] setRepresentedObject:identifier]; + [button setTag:groupNumber]; + [button setFont:[NSFont boldSystemFontOfSize:SCOPE_BAR_FONTSIZE]]; + [button setTarget:self]; + [button setAction:@selector(scopeButtonClicked:)]; + [button setBezelStyle:NSRecessedBezelStyle]; + [button setButtonType:NSPushOnPushOffButton]; + [[button cell] setHighlightsBy:NSCellIsBordered | NSCellIsInsetButton]; + [button setShowsBorderOnlyWhileMouseInside:YES]; + if (image) { + [image setSize:NSMakeSize(SCOPE_BAR_BUTTON_IMAGE_SIZE, SCOPE_BAR_BUTTON_IMAGE_SIZE)]; + [button setImagePosition:NSImageLeft]; + [button setImage:image]; + } + [button sizeToFit]; + ctrlRect = [button frame]; + ctrlRect.origin.y = floor(([self frame].size.height - ctrlRect.size.height) / 2.0); + [button setFrame:ctrlRect]; + + [self setControl:button forIdentifier:identifier inGroup:groupNumber]; + + return [button autorelease]; +} + + +- (NSMenuItem *)menuItemForItem:(NSString *)identifier inGroup:(int)groupNumber + withTitle:(NSString *)title image:(NSImage *)image +{ + NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:title action:@selector(scopeButtonClicked:) keyEquivalent:@""]; + [menuItem setTarget:self]; + [menuItem setImage:image]; + [menuItem setRepresentedObject:identifier]; + [menuItem setTag:groupNumber]; + + [self setControl:menuItem forIdentifier:identifier inGroup:groupNumber]; + + return [menuItem autorelease]; +} + + +- (NSPopUpButton *)popupButtonForGroup:(NSDictionary *)group +{ + float popWidth = floor([[group objectForKey:GROUP_WIDEST_BUTTON_WIDTH] floatValue] + MENU_PADDING); + NSRect popFrame = NSMakeRect(0, 0, popWidth, 20); // arbitrary height. + NSPopUpButton *popup = [[NSPopUpButton alloc] initWithFrame:popFrame pullsDown:NO]; + + // Since we're not using the selected item's title, we need to specify a NSMenuItem for the title. + BOOL multiSelect = ([[group objectForKey:GROUP_SELECTION_MODE] intValue] == MGMultipleSelectionMode); + if (multiSelect) { + MGRecessedPopUpButtonCell *cell = [[MGRecessedPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]; + [popup setCell:cell]; + [cell release]; + + [[popup cell] setUsesItemFromMenu:NO]; + NSMenuItem *titleItem = [[NSMenuItem alloc] init]; + [[popup cell] setMenuItem:titleItem]; + [titleItem release]; + } + + // Configure appearance and behaviour. + [popup setFont:[NSFont boldSystemFontOfSize:SCOPE_BAR_FONTSIZE]]; + [popup setBezelStyle:NSRecessedBezelStyle]; + [popup setButtonType:NSPushOnPushOffButton]; + [[popup cell] setHighlightsBy:NSCellIsBordered | NSCellIsInsetButton]; + [popup setShowsBorderOnlyWhileMouseInside:NO]; + [[popup cell] setAltersStateOfSelectedItem:NO]; + [[popup cell] setArrowPosition:NSPopUpArrowAtBottom]; + [popup setPreferredEdge:NSMaxXEdge]; + + // Add appropriate items. + [popup removeAllItems]; + NSMutableArray *buttons = [group objectForKey:GROUP_BUTTONS]; + int i; + for (i = 0; i < [buttons count]; i++) { + NSButton *button = (NSButton *)[buttons objectAtIndex:i]; + NSMenuItem *menuItem = [self menuItemForItem:[[button cell] representedObject] + inGroup:[button tag] + withTitle:[button title] + image:[button image]]; + [menuItem setState:[button state]]; + [buttons replaceObjectAtIndex:i withObject:menuItem]; + [[popup menu] addItem:menuItem]; + } + + // Vertically center the popup within our frame. + if (!multiSelect) { + [popup sizeToFit]; + } + popFrame = [popup frame]; + popFrame.origin.y = ceil(([self frame].size.height - popFrame.size.height) / 2.0); + [popup setFrame:popFrame]; + + return [popup autorelease]; +} + + +- (void)setControl:(NSObject *)control forIdentifier:(NSString *)identifier inGroup:(int)groupNumber +{ + if (!_identifiers) { + _identifiers = [[NSMutableDictionary alloc] initWithCapacity:0]; + } + + NSMutableArray *identArray = [_identifiers objectForKey:identifier]; + if (!identArray) { + identArray = [[[NSMutableArray alloc] initWithCapacity:groupNumber + 1] autorelease]; + [_identifiers setObject:identArray forKey:identifier]; + } + + int count = [identArray count]; + if (groupNumber >= count) { + // Pad identArray with nulls if appropriate, so this control lies at index groupNumber. + int i; + for (i = count; i < groupNumber; i++) { + [identArray addObject:[NSNull null]]; + } + [identArray addObject:control]; + } else { + [identArray replaceObjectAtIndex:groupNumber withObject:control]; + } +} + + +- (void)updateMenuTitleForGroupAtIndex:(int)groupNumber +{ + // Ensure that this group's popup (if present) has the correct title, + // accounting for the group's selection-mode and selected item(s). + + if (groupNumber < 0 || groupNumber >= [_groups count]) { + return; + } + + NSDictionary *group = [_groups objectAtIndex:groupNumber]; + if (group) { + NSPopUpButton *popup = [group objectForKey:GROUP_POPUP_BUTTON]; + if (popup) { + NSArray *groupSelection = [_selectedItems objectAtIndex:groupNumber]; + int numSelected = [groupSelection count]; + if (numSelected == 0) { + // No items selected. + [popup setTitle:POPUP_TITLE_EMPTY_SELECTION]; + [[[popup cell] menuItem] setImage:nil]; + + } else if (numSelected > 1) { + // Multiple items selected. + [popup setTitle:POPUP_TITLE_MULTIPLE_SELECTION]; + [[[popup cell] menuItem] setImage:nil]; + + } else { + // One item selected. + NSString *identifier = [groupSelection objectAtIndex:0]; + NSArray *items = [group objectForKey:GROUP_BUTTONS]; + NSMenuItem *item = nil; + for (NSMenuItem *thisItem in items) { + if ([[thisItem representedObject] isEqualToString:identifier]) { + item = thisItem; + break; + } + } + if (item) { + [popup setTitle:[item title]]; + [[[popup cell] menuItem] setImage:[item image]]; + } + } + + if (SCOPE_BAR_HIDE_POPUP_BG) { + BOOL hasBackground = [[popup cell] isBordered]; + if (numSelected == 0 && hasBackground) { + [[popup cell] setBordered:NO]; + } else if (!hasBackground) { + [[popup cell] setBordered:YES]; + } + } + } + } +} + + +#pragma mark Drawing + + +- (void)drawRect:(NSRect)rect +{ + // Draw gradient background. + NSGradient *gradient = [[[NSGradient alloc] initWithStartingColor:SCOPE_BAR_START_COLOR_GRAY + endingColor:SCOPE_BAR_END_COLOR_GRAY] autorelease]; + [gradient drawInRect:[self bounds] angle:90.0]; + + // Draw border. + NSRect lineRect = [self bounds]; + lineRect.size.height = SCOPE_BAR_BORDER_WIDTH; + [SCOPE_BAR_BORDER_COLOR set]; + NSRectFill(lineRect); + + // Draw separators. + if ([_separatorPositions count] > 0) { + [SCOPE_BAR_SEPARATOR_COLOR set]; + NSRect sepRect = NSMakeRect(0, 0, SCOPE_BAR_SEPARATOR_WIDTH, SCOPE_BAR_SEPARATOR_HEIGHT); + sepRect.origin.y = (([self bounds].size.height - sepRect.size.height) / 2.0); + for (NSObject *sepPosn in _separatorPositions) { + if (sepPosn != [NSNull null]) { + sepRect.origin.x = [(NSNumber *)sepPosn intValue]; + NSRectFill(sepRect); + } + } + } +} + + +#pragma mark Interaction + + +- (IBAction)scopeButtonClicked:(id)sender +{ + NSButton *button = (NSButton *)sender; + BOOL menuMode = [sender isKindOfClass:[NSMenuItem class]]; + NSString *identifier = [((menuMode) ? sender : [sender cell]) representedObject]; + int groupNumber = [sender tag]; + BOOL nowSelected = YES; + if (menuMode) { + // MenuItem. Ensure item has appropriate state. + nowSelected = ![[_selectedItems objectAtIndex:groupNumber] containsObject:identifier]; + [sender setState:((nowSelected) ? NSOnState : NSOffState)]; + } else { + // Button. Item will already have appropriate state. + nowSelected = ([button state] != NSOffState); + } + [self setSelected:nowSelected forItem:identifier inGroup:groupNumber]; +} + + +#pragma mark Accessors and properties + + +- (void)setSelected:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber +{ + // Change state of other items in group appropriately, informing delegate if possible. + // First we find the appropriate group-info for the item's identifier. + if (identifier && groupNumber >= 0 && groupNumber < [_groups count]) { + NSDictionary *group = [_groups objectAtIndex:groupNumber]; + BOOL nowSelected = selected; + BOOL informDelegate = YES; + + if (group) { + [group retain]; + NSDisableScreenUpdates(); + + // We found the group which this item belongs to. Obtain selection-mode and identifiers. + MGScopeBarGroupSelectionMode selMode = [[group objectForKey:GROUP_SELECTION_MODE] intValue]; + BOOL radioMode = (selMode == MGRadioSelectionMode); + + if (radioMode) { + // This is a radio-mode group. Ensure this item isn't already selected. + NSArray *groupSelections = [[_selectedItems objectAtIndex:groupNumber] copy]; + + if (nowSelected) { + // Before selecting this item, we first need to deselect any other selected items in this group. + for (NSString *selectedIdentifier in groupSelections) { + // Reselect the just-deselected item without informing the delegate, since nothing really changed. + [self updateSelectedState:NO forItem:selectedIdentifier inGroup:groupNumber informDelegate:NO]; + } + } else { + // Prevent deselection if this item is already selected. + if ([groupSelections containsObject:identifier]) { + nowSelected = YES; + informDelegate = NO; + } + } + [groupSelections release]; + } + + // Change selected state of this item. + [self updateSelectedState:nowSelected forItem:identifier inGroup:groupNumber informDelegate:informDelegate]; + + // Update popup-menu's title if appropriate. + if ([[group objectForKey:GROUP_MENU_MODE] boolValue]) { + [self updateMenuTitleForGroupAtIndex:groupNumber]; + } + + [group release]; + NSEnableScreenUpdates(); + } + } +} + + +- (void)updateSelectedState:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber informDelegate:(BOOL)inform +{ + // This method simply updates the selected state of the item's control, maintains selectedItems, and informs the delegate. + // All management of dependencies (such as deselecting other selected items in a radio-selection-mode group) is performed + // in the setSelected:forItem:inGroup: method. + + // Determine whether we can inform the delegate about this change. + SEL stateChangedSel = @selector(scopeBar:selectedStateChanged:forItem:inGroup:); + BOOL responds = (delegate && [delegate respondsToSelector:stateChangedSel]); + + // Ensure selected status of item's control reflects desired value. + NSButton *button = [self getButtonForItem:identifier inGroup:groupNumber]; + if (selected && [button state] == NSOffState) { + [button setState:NSOnState]; + } else if (!selected && [button state] != NSOffState) { + [button setState:NSOffState]; + } + + // Maintain _selectedItems appropriately. + if (_selectedItems && [_selectedItems count] > groupNumber) { + NSMutableArray *groupSelections = [_selectedItems objectAtIndex:groupNumber]; + BOOL alreadySelected = [groupSelections containsObject:identifier]; + if (selected && !alreadySelected) { + [groupSelections addObject:identifier]; + } else if (!selected && alreadySelected) { + [groupSelections removeObject:identifier]; + } + } + + // Inform delegate about this change if possible. + if (inform && responds) { + [delegate scopeBar:self selectedStateChanged:selected forItem:identifier inGroup:groupNumber]; + } +} + + +- (NSArray *)selectedItems +{ + return [[_selectedItems copy] autorelease]; +} + + +- (void)setDelegate:(id)newDelegate +{ + if (delegate != newDelegate) { + delegate = newDelegate; + [self reloadData]; + } +} + + +- (BOOL)smartResizeEnabled +{ + return _smartResizeEnabled; +} + + +- (void)setSmartResizeEnabled:(BOOL)enabled +{ + if (enabled != _smartResizeEnabled) { + _smartResizeEnabled = enabled; + [self reloadData]; + } +} + + +@synthesize delegate; + + +@end diff --git a/MGScopeBar/MGScopeBarDelegateProtocol.h b/MGScopeBar/MGScopeBarDelegateProtocol.h new file mode 100644 index 0000000..3a65bb2 --- /dev/null +++ b/MGScopeBar/MGScopeBarDelegateProtocol.h @@ -0,0 +1,46 @@ +// +// MGScopeBarDelegateProtocol.h +// MGScopeBar +// +// Created by Matt Gemmell on 15/03/2008. +// Copyright 2008 Instinctive Code. +// + +#import + + +// Selection modes for the buttons within a group. +typedef enum _MGScopeBarGroupSelectionMode { + MGRadioSelectionMode = 0, // Exactly one item in the group will be selected at a time (no more, and no less). + MGMultipleSelectionMode = 1 // Any number of items in the group (including none) may be selected at a time. +} MGScopeBarGroupSelectionMode; + + +@class MGScopeBar; +@protocol MGScopeBarDelegate + + +// Methods used to configure the scope bar. +// Note: all groupNumber parameters are zero-based. + +@required +- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar; +- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber; +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber; // return nil or an empty string for no label. +- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber; +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber; + +@optional +// If the following method is not implemented, all groups except the first will have a separator before them. +- (BOOL)scopeBar:(MGScopeBar *)theScopeBar showSeparatorBeforeGroup:(int)groupNumber; +- (NSImage *)scopeBar:(MGScopeBar *)theScopeBar imageForItem:(NSString *)identifier inGroup:(int)groupNumber; // default is no image. Will be shown at 16x16. +- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)theScopeBar; // default is no accessory view. + + +// Notification methods. + +@optional +- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber; + + +@end diff --git a/MGScopeBar/MGScopeBar_Prefix.pch b/MGScopeBar/MGScopeBar_Prefix.pch new file mode 100644 index 0000000..045096c --- /dev/null +++ b/MGScopeBar/MGScopeBar_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'MGScopeBar' target in the 'MGScopeBar' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/MGScopeBar/ReadMe.txt b/MGScopeBar/ReadMe.txt new file mode 100644 index 0000000..df86e43 --- /dev/null +++ b/MGScopeBar/ReadMe.txt @@ -0,0 +1,75 @@ +MGScopeBar +By Matt Legend Gemmell +http://mattgemmell.com/ +http://instinctivecode.com/ + + + +What is MGScopeBar? +------------------- + +MGScopeBar is a control which provides a "scope bar" or "filter bar", much like that found in iTunes, the Finder (in the Find/Spotlight window), and Mail. + + + +What platforms does it support? +------------------------------- + +MGScopeBar supports Mac OS X 10.5 (Leopard) or later. + + + +What are the licensing requirements? +------------------------------------ + +A license documented is included with the source code, but essentially it's a BSD-like license but requiring attribution. You're free to use the code in any kind of project, commercial or otherwise. You're also free to redistribute it, either modified or as-is. Read the license document for more details, and contact me if you have questions. + + + +How do I use it in my project? +------------------------------ + +Just copy the five files whose names start with "MG" into your project, and you're good to go. You can also use the AppController class as a handy reference, since it provides a demo of how MGScopeBar works. + + + +What can it do? +--------------- + +MGScopeBar gives you a scope bar control which gets its data from a delegate; it's very like NSTableView and other similar controls, so you should find it easy to use. + +You can specify multiple "groups" of buttons, each of which can have: + +1. An optional separator before the group. + +2. An optional label to the left of the first button (and after the separator). + +3. A series of buttons, each of which has a title, unique identifier string, and optional icon. + +4. A selection-mode for the group; either radio-mode (only one item selected at a time), or multiple-selection (zero or more items can be selected at a time). + +Scope bars also support an optional accessory view, displayed at the right side of the bar. + +You can choose whether to use the Smart Resize feature (which is on by default). Smart Resize causes the scope bar to automatically collapse button-groups into popup-menus to better fit the available space. + +You should read the MGScopeBarDelegateProtocol.h file to see a list of the delegate methods your delegate object will need to implement. + + + +How do I know which buttons are selected in which groups? +--------------------------------------------------------- + +There's a delegate method which will be called whenever the user interacts with the scope bar in such a way as to change the selection in any group; see the delegate protocol (and the example code in AppController) for more details. + +You can also call the -selectedItems method on MGScopeBar to find out exactly what's selected at any time. See the MGScopeBar.h file for an explanation of the data returned from this method. + + + +Getting in touch +---------------- + +Whilst I can't provide specific help with integrating MGScopeBar into your application, I always welcome feedback, suggestions and bug reports. Feel free to get in touch with me via my gmail address (matt.gemmell) anytime. + +I hope you enjoy using MGScopeBar. + +-Matt Legend Gemmell diff --git a/MGScopeBar/Source Code License.rtf b/MGScopeBar/Source Code License.rtf new file mode 100644 index 0000000..e71939b --- /dev/null +++ b/MGScopeBar/Source Code License.rtf @@ -0,0 +1,104 @@ +{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red51\green51\blue51;\red0\green180\blue128;\red255\green0\blue0; +\red31\green105\blue199;\red119\green119\blue119;} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} +\deftab720 +\pard\pardeftab720\ql\qnatural + +\f0\b\fs24 \cf2 Matt Gemmell / Instinctive Code Source Code License\ + +\b0\fs22 Last updated: 19th May 2008 +\fs24 \ +\ +\ +Thanks for downloading some of our source code!\ +\ +This is the license agreement for the source code which this document accompanies (don\'92t worry: you\'92re allowed to use it in your own products, commercial or otherwise).\ +\ +The full license text is further down this page, and you should only use the source code if you agree to the terms in that text. For convenience, though, we\'92ve put together a human-readable +\b non-authoritative +\b0 interpretation of the license which will hopefully answer any questions you have.\ +\ +\ + +\b \cf3 Green +\b0 \cf2 text shows +\b \cf3 what you can do with the code +\b0 \cf2 .\ + +\b \cf4 Red +\b0 \cf2 text means +\b \cf4 restrictions you must abide by +\b0 \cf2 .\ +\ +Basically, the license says that:\ +\ +\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural +\ls1\ilvl0\cf2 {\listtext 1. }You can +\b \cf3 use the code in your own products, including commercial and/or closed-source products +\b0 \cf2 .\ +{\listtext 2. }You can +\b \cf3 modify the code +\b0 \cf0 as you wish\cf2 , and +\b \cf3 use the modified code in your products +\b0 \cf2 .\ +{\listtext 3. }You can +\b \cf3 redistribute the original, unmodified code +\b0 \cf2 , but you +\b \cf4 have to include the full license text below +\b0 \cf2 .\ +{\listtext 4. }You can +\b \cf3 redistribute the modified code +\b0 \cf2 as you wish ( +\b \cf4 without the full license text below +\b0 \cf2 ).\ +{\listtext 5. }In all cases, you +\b \cf4 must include a credit mentioning Matt Gemmell +\b0 \cf2 as the original author of the source.\ +{\listtext 6. }Matt Gemmell is \cf0 not liable for anything you do with the code\cf2 , no matter what. So be sensible.\ +{\listtext 7. }You +\b \cf4 can\'92t use the name Matt Gemmell, the name Instinctive Code, the Instinctive Code logo or any other related marks to promote your products +\b0 \cf2 based on the code.\ +{\listtext 8. }If you agree to all of that, go ahead and use the source. Otherwise, don\'92t!\ +\pard\pardeftab720\ql\qnatural +\cf2 \ + +\b \ +\ +Suggested Attribution Format\ + +\b0 \ +The license requires that you give credit to Matt Gemmell, as the original author of any of our source that you use. The placement and format of the credit is up to you, but we prefer the credit to be in the software\'92s \'93About\'94 window. Alternatively, you could put the credit in a list of acknowledgements within the software, in the software\'92s documentation, or on the web page for the software. The suggested format for the attribution is:\ +\ +\pard\pardeftab720\ql\qnatural + +\b \cf0 Includes code by {\field{\*\fldinst{HYPERLINK "http://mattgemmell.com/"}}{\fldrslt \cf5 Matt Gemmell}}\cf6 . +\b0 \ +\pard\pardeftab720\ql\qnatural +\cf2 \ +where would be replaced by the name of the specific source-code package you made use of. Where possible, please link the text \'93Matt Gemmell\'94 to the following URL, or include the URL as plain text: {\field{\*\fldinst{HYPERLINK "http://mattgemmell.com/"}}{\fldrslt \cf5 http://mattgemmell.com/}}\ +\ +\ + +\b Full Source Code License Text\ +\ + +\b0 Below you can find the actual text of the license agreement. +\b \ +\ +\pard\pardeftab720\ql\qnatural +\cf6 \ +License Agreement for Source Code provided by Matt Gemmell +\b0 \ +\ +This software is supplied to you by Matt Gemmell in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this software.\ +\ +In consideration of your agreement to abide by the following terms, and subject to these terms, Matt Gemmell grants you a personal, non-exclusive license, to use, reproduce, modify and redistribute the software, with or without modifications, in source and/or binary forms; provided that if you redistribute the software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the software, and that in all cases attribution of Matt Gemmell as the original author of the source code shall be included in all such resulting software products or distributions.\uc0\u8232 \ +Neither the name, trademarks, service marks or logos of Matt Gemmell or Instinctive Code may be used to endorse or promote products derived from the software without specific prior written permission from Matt Gemmell. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Matt Gemmell herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the software may be incorporated.\ +\ +The software is provided by Matt Gemmell on an "AS IS" basis. MATT GEMMELL AND INSTINCTIVE CODE MAKE NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\ +\ +IN NO EVENT SHALL MATT GEMMELL OR INSTINCTIVE CODE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF MATT GEMMELL OR INSTINCTIVE CODE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ +} \ No newline at end of file diff --git a/MGScopeBar/TODO b/MGScopeBar/TODO new file mode 100644 index 0000000..30747a1 --- /dev/null +++ b/MGScopeBar/TODO @@ -0,0 +1,9 @@ +MGScopeBar TODO + + +- Maybe properly support a blue gradient appearance (like Mail in Tiger)? + - Easy to change background gradient, but buttons/popups still highlight gray. + +- Accessibility support + - The control needs to indicate which groups it contains, what selection-mode those groups support, etc. + - Otherwise it's just an opaque group of buttons to VoiceOver. From 9200d3e3102571ab57d361653089a02728de4717 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Wed, 15 Sep 2010 17:00:50 -0700 Subject: [PATCH 089/110] blame --- GLFileView.h | 13 ++- GLFileView.m | 162 ++++++++++++++++++++++++++++++++- GitX.xcodeproj/project.pbxproj | 42 +++++++++ PBGitHistoryView.xib | 104 +++++++++++++++++---- PBGitTree.h | 1 + PBGitTree.m | 20 ++++ html/views/blame/blame.css | 54 +++++++++++ html/views/blame/blame.js | 9 ++ html/views/blame/index.html | 14 +++ 9 files changed, 399 insertions(+), 20 deletions(-) create mode 100644 html/views/blame/blame.css create mode 100644 html/views/blame/blame.js create mode 100644 html/views/blame/index.html diff --git a/GLFileView.h b/GLFileView.h index 6c2256b..8babf1c 100644 --- a/GLFileView.h +++ b/GLFileView.h @@ -8,14 +8,23 @@ #import #import "PBWebController.h" - +#import "MGScopeBarDelegateProtocol.h" #import "PBGitCommit.h" #import "PBGitHistoryController.h" #import "PBRefContextDelegate.h" +@class PBGitGradientBarView; -@interface GLFileView : PBWebController { +@interface GLFileView : PBWebController { IBOutlet PBGitHistoryController* historyController; + IBOutlet MGScopeBar *typeBar; + NSMutableArray *groups; } +- (void)showFile; +- (void)didLoad; +- (NSString *)parseBlame:(NSString *)txt; + +@property(retain) NSMutableArray *groups; + @end diff --git a/GLFileView.m b/GLFileView.m index a61b3c7..e9dcb87 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -7,7 +7,14 @@ // #import "GLFileView.h" +#import "PBGitGradientBarView.h" +#define GROUP_LABEL @"Label" // string +#define GROUP_SEPARATOR @"HasSeparator" // BOOL as NSNumber +#define GROUP_SELECTION_MODE @"SelectionMode" // MGScopeBarGroupSelectionMode (int) as NSNumber +#define GROUP_ITEMS @"Items" // array of dictionaries, each containing the following keys: +#define ITEM_IDENTIFIER @"Identifier" // string +#define ITEM_NAME @"Name" // string @implementation GLFileView @@ -17,17 +24,170 @@ //repository = historyController.repository; [super awakeFromNib]; [historyController.treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeController"]; + + self.groups = [NSMutableArray arrayWithCapacity:0]; + + NSArray *items = [NSArray arrayWithObjects: + [NSDictionary dictionaryWithObjectsAndKeys: + startFile, ITEM_IDENTIFIER, + @"Source", ITEM_NAME, + nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"blame", ITEM_IDENTIFIER, + @"Blame", ITEM_NAME, + nil], + nil]; + [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:NO], GROUP_SEPARATOR, + [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. + items, GROUP_ITEMS, + nil]]; + [typeBar reloadData]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { //NSLog(@"keyPath=%@ change=%@ context=%@ object=%@ \n %@",keyPath,change,context,object,[historyController.treeController selectedObjects]); + [self showFile]; +} + +- (void) showFile +{ NSArray *files=[historyController.treeController selectedObjects]; if ([files count]>0) { PBGitTree *file=[files objectAtIndex:0]; - NSString *fileTxt=[file textContents]; + + NSString *fileTxt=@""; + if(startFile==@"fileview") + fileTxt=[file textContents]; + if(startFile==@"blame") + fileTxt=[self parseBlame:[file blame]]; + id script = [view windowScriptObject]; [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]]; } } + +#pragma mark MGScopeBarDelegate methods + + +- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar +{ + return [self.groups count]; +} + + +- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber +{ + return [[self.groups objectAtIndex:groupNumber] valueForKeyPath:[NSString stringWithFormat:@"%@.%@", GROUP_ITEMS, ITEM_IDENTIFIER]]; +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber +{ + return [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_LABEL]; // might be nil, which is fine (nil means no label). +} + + +- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber +{ + NSArray *items = [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_ITEMS]; + if (items) { + for (NSDictionary *item in items) { + if ([[item objectForKey:ITEM_IDENTIFIER] isEqualToString:identifier]) { + return [item objectForKey:ITEM_NAME]; + break; + } + } + } + return nil; +} + + +- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber +{ + return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SELECTION_MODE] intValue]; +} + +- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber +{ + startFile=identifier; + NSString *path = [NSString stringWithFormat:@"html/views/%@", identifier]; + NSString *html = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; + //NSLog(@"[FileViewerController scopeBar:selectedStateChanged] -> file: '%@' (%@)",html,identifier); + NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:html]]; + [[view mainFrame] loadRequest:request]; +} + +- (void) didLoad +{ + [self showFile]; +} + +- (NSString *) parseBlame:(NSString *)txt +{ + txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; + txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@">"]; + + NSArray *lines = [txt componentsSeparatedByString:@"\n"]; + NSString *line; + NSMutableDictionary *headers=[NSMutableDictionary dictionary]; + NSMutableString *res=[NSMutableString string]; + + [res appendString:@"\n"]; + int i=0; + while(i<[lines count]){ + line=[lines objectAtIndex:i]; + NSArray *header=[line componentsSeparatedByString:@" "]; + if([header count]==4){ + int nLines=[(NSString *)[header objectAtIndex:3] intValue]; + [res appendFormat:@"\n",nLines]; + line=[lines objectAtIndex:++i]; + if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){ + NSString *author=line; + NSString *summary=nil; + while(summary==nil){ + line=[lines objectAtIndex:i++]; + if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"summary"]){ + summary=line; + } + } + NSString *block=[NSString stringWithFormat:@"\n\n"]; + }else{ + break; + } + [res appendString:@"\n"]; + } + [res appendString:@"

%@

%@

\n",author,summary]; + [headers setObject:block forKey:[header objectAtIndex:0]]; + } + [res appendString:[headers objectForKey:[header objectAtIndex:0]]]; + + NSMutableString *code=[NSMutableString string]; + do{ + line=[lines objectAtIndex:i++]; + }while([line characterAtIndex:0]!='\t'); + line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"    "]; + [code appendString:line]; + [code appendString:@"\n"]; + + int n; + for(n=1;n%@",[header objectAtIndex:2],code]; + [res appendString:@"
\n"]; + //NSLog(@"%@",res); + + return (NSString *)res; +} + +@synthesize groups; + @end diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index d7e95db..40e86a2 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -23,6 +23,12 @@ /* Begin PBXBuildFile section */ 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; }; 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 310DC1D71240599E0017A0F7 /* GLFileView.m */; }; + 31460CB2124185BA00B90AED /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460C7B124185BA00B90AED /* AppController.m */; }; + 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */; }; + 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA9124185BA00B90AED /* MGScopeBar.m */; }; + 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31460CAF124185BA00B90AED /* ReadMe.txt */; }; + 31460CD5124185BA00B90AED /* Source Code License.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB0124185BA00B90AED /* Source Code License.rtf */; }; + 31460CD6124185BA00B90AED /* TODO in Resources */ = {isa = PBXBuildFile; fileRef = 31460CB1124185BA00B90AED /* TODO */; }; 3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; }; 3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; }; 47DBDB580E94EDE700671A1E /* DBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47DBDB570E94EDE700671A1E /* DBPrefsWindowController.m */; }; @@ -246,6 +252,17 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 310DC1D61240599E0017A0F7 /* GLFileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLFileView.h; sourceTree = ""; }; 310DC1D71240599E0017A0F7 /* GLFileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLFileView.m; sourceTree = ""; }; + 31460C7A124185BA00B90AED /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; + 31460C7B124185BA00B90AED /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; + 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGRecessedPopUpButtonCell.h; sourceTree = ""; }; + 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGRecessedPopUpButtonCell.m; sourceTree = ""; }; + 31460CA8124185BA00B90AED /* MGScopeBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar.h; sourceTree = ""; }; + 31460CA9124185BA00B90AED /* MGScopeBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGScopeBar.m; sourceTree = ""; }; + 31460CAD124185BA00B90AED /* MGScopeBar_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar_Prefix.pch; sourceTree = ""; }; + 31460CAE124185BA00B90AED /* MGScopeBarDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBarDelegateProtocol.h; sourceTree = ""; }; + 31460CAF124185BA00B90AED /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; + 31460CB0124185BA00B90AED /* Source Code License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = "Source Code License.rtf"; sourceTree = ""; }; + 31460CB1124185BA00B90AED /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* GitX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX_Prefix.pch; sourceTree = ""; }; 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HistoryViewTemplate.png; path = Images/HistoryViewTemplate.png; sourceTree = ""; }; 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CommitViewTemplate.png; path = Images/CommitViewTemplate.png; sourceTree = ""; }; @@ -568,6 +585,7 @@ 29B97314FDCFA39411CA2CEA /* GitTest */ = { isa = PBXGroup; children = ( + 31460C79124185B900B90AED /* MGScopeBar */, F5886A080ED5D26B0066E74C /* SpeedTest */, 913D5E420E5563FD00CECEA2 /* cli */, D89E9B4C1218C22A0097A90B /* GitXScripting */, @@ -668,6 +686,24 @@ name = FileView; sourceTree = ""; }; + 31460C79124185B900B90AED /* MGScopeBar */ = { + isa = PBXGroup; + children = ( + 31460C7A124185BA00B90AED /* AppController.h */, + 31460C7B124185BA00B90AED /* AppController.m */, + 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */, + 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */, + 31460CA8124185BA00B90AED /* MGScopeBar.h */, + 31460CA9124185BA00B90AED /* MGScopeBar.m */, + 31460CAD124185BA00B90AED /* MGScopeBar_Prefix.pch */, + 31460CAE124185BA00B90AED /* MGScopeBarDelegateProtocol.h */, + 31460CAF124185BA00B90AED /* ReadMe.txt */, + 31460CB0124185BA00B90AED /* Source Code License.rtf */, + 31460CB1124185BA00B90AED /* TODO */, + ); + path = MGScopeBar; + sourceTree = ""; + }; 47DBDB920E94F47200671A1E /* Preference Icons */ = { isa = PBXGroup; children = ( @@ -1185,6 +1221,9 @@ D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */, D8F01C4B12182F19007F729F /* GitX.sdef in Resources */, D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */, + 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */, + 31460CD5124185BA00B90AED /* Source Code License.rtf in Resources */, + 31460CD6124185BA00B90AED /* TODO in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1335,6 +1374,9 @@ D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */, + 31460CB2124185BA00B90AED /* AppController.m in Sources */, + 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */, + 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 59ef69d..2f7c9dc 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@
YES - + YES @@ -671,6 +671,7 @@ 1 _doScroller: + 0.19685863874345549 0.99882769584655762 @@ -1105,6 +1106,13 @@ 268 YES + + + 266 + {{0, 211}, {723, 24}} + + MGScopeBar + 274 @@ -1129,7 +1137,7 @@ public.url-name - {723, 235} + {723, 210} @@ -1933,6 +1941,22 @@ 454 + + + typeBar + + + + 484 + + + + delegate + + + + 485 + @@ -2244,12 +2268,12 @@ YES - + Commits Scope Bar @@ -2517,8 +2541,10 @@ YES + + Viewer 450 @@ -2531,6 +2557,15 @@ + + 475 + + + YES + + + TypeBar + @@ -2639,6 +2674,7 @@ 450.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency + 475.IBPluginDependency 48.IBPluginDependency 49.IBAttributePlaceholdersKey 49.IBPluginDependency @@ -2822,6 +2858,7 @@ {{2069, 399}, {955, 434}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2855,7 +2892,7 @@ - 454 + 485 @@ -2864,14 +2901,35 @@ GLFileView PBWebController - historyController - PBGitHistoryController + YES + + YES + historyController + typeBar + + + YES + PBGitHistoryController + PBGitGradientBarView + - historyController - - historyController - PBGitHistoryController + YES + + YES + historyController + typeBar + + + YES + + historyController + PBGitHistoryController + + + typeBar + PBGitGradientBarView + @@ -2906,6 +2964,25 @@ GitXTextFieldCell.h + + MGScopeBar + NSView + + delegate + id + + + delegate + + delegate + id + + + + IBProjectSource + MGScopeBar/MGScopeBar.h + + NSApplication @@ -4217,13 +4294,6 @@ QuartzCore.framework/Headers/CIImageProvider.h - - NSObject - - IBFrameworkSource - ScriptingBridge.framework/Headers/SBApplication.h - - NSObject diff --git a/PBGitTree.h b/PBGitTree.h index 67951a8..7eecf96 100644 --- a/PBGitTree.h +++ b/PBGitTree.h @@ -27,6 +27,7 @@ + (PBGitTree*) treeForTree: (PBGitTree*) tree andPath: (NSString*) path; - (void) saveToFolder: (NSString *) directory; - (NSString *)textContents; +- (NSString *)blame; - (NSString*) tmpFileNameForContents; - (long long)fileSize; diff --git a/PBGitTree.m b/PBGitTree.m index 1a5f838..b5a7026 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -115,6 +115,26 @@ return [repository outputForArguments:[NSArray arrayWithObjects:@"show", [self refSpec], nil]]; } +- (NSString *) blame +{ + if (!leaf) + return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; + + if ([self hasBinaryAttributes]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + if ([self fileSize] > 52428800) // ~50MB + return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]]; + + NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", @"-p", [self fullPath], sha, nil]]; + + if ([self hasBinaryHeader:contents]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + + return contents; +} + - (long long)fileSize { if (_fileSize) diff --git a/html/views/blame/blame.css b/html/views/blame/blame.css new file mode 100644 index 0000000..a020e8a --- /dev/null +++ b/html/views/blame/blame.css @@ -0,0 +1,54 @@ +table { + border-collapse: collapse; + border-spacing: 0; +} + +body,th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + vertical-align: baseline; + background: transparent; +} + +p{ + margin: 0; + padding: 0; +} + +tr.block.l2 p.summary, +tr.block.l3 p.summary, +tr.block.l1 p.summary{ + display: none; +} + +table.blocks td { + vertical-align: top; +} + +p.author { + white-space: nowrap; +} + +table.blocks { + font: 11px "Menlo" !important; +} + +table tr.block{ + border-top: 1px solid #c9c9c9; +} +table.blocks{ + border-bottom: 1px solid #c9c9c9; + width: 100%; +} + +table.blocks tr td:nth-of-type(2) { + width: 100%; +} + +table.blocks tr.block td:nth-of-type(1){ + padding-right: 5px; + padding-left: 5px; +} \ No newline at end of file diff --git a/html/views/blame/blame.js b/html/views/blame/blame.js new file mode 100644 index 0000000..a89326b --- /dev/null +++ b/html/views/blame/blame.js @@ -0,0 +1,9 @@ +var showFile = function(txt) { + $("txt").style.display = ""; + $("txt").innerHTML="
"+txt+"
"; + + SyntaxHighlighter.defaults['toolbar'] = false; + + SyntaxHighlighter.highlight(); + return; +} diff --git a/html/views/blame/index.html b/html/views/blame/index.html new file mode 100644 index 0000000..8be6a6f --- /dev/null +++ b/html/views/blame/index.html @@ -0,0 +1,14 @@ + + + + + + + + + + + +
hola + + \ No newline at end of file From 1a4a179e9a49120aa84a01500be2b1c744776842 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Thu, 16 Sep 2010 22:54:28 -0700 Subject: [PATCH 090/110] History --- GLFileView.h | 2 + GLFileView.m | 24 ++++- PBGitTree.h | 1 + PBGitTree.m | 22 +++- html/views/log/format.html | 8 ++ html/views/log/index.html | 19 ++++ html/views/log/log.css | 12 +++ html/views/log/log.js | 10 ++ html/views/log/test.html | 200 +++++++++++++++++++++++++++++++++++++ 9 files changed, 294 insertions(+), 4 deletions(-) create mode 100644 html/views/log/format.html create mode 100644 html/views/log/index.html create mode 100644 html/views/log/log.css create mode 100644 html/views/log/log.js create mode 100644 html/views/log/test.html diff --git a/GLFileView.h b/GLFileView.h index 8babf1c..2e752da 100644 --- a/GLFileView.h +++ b/GLFileView.h @@ -19,6 +19,7 @@ IBOutlet PBGitHistoryController* historyController; IBOutlet MGScopeBar *typeBar; NSMutableArray *groups; + NSString *logFormat; } - (void)showFile; @@ -26,5 +27,6 @@ - (NSString *)parseBlame:(NSString *)txt; @property(retain) NSMutableArray *groups; +@property(retain) NSString *logFormat; @end diff --git a/GLFileView.m b/GLFileView.m index e9dcb87..f64c39a 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -20,6 +20,11 @@ - (void) awakeFromNib { + NSString *formatFile = [[NSBundle mainBundle] pathForResource:@"format" ofType:@"html" inDirectory:@"html/views/log"]; + if(formatFile!=nil) + logFormat=[NSString stringWithContentsOfURL:[NSURL fileURLWithPath:formatFile] encoding:NSUTF8StringEncoding error:nil]; + + startFile = @"fileview"; //repository = historyController.repository; [super awakeFromNib]; @@ -36,6 +41,10 @@ @"blame", ITEM_IDENTIFIER, @"Blame", ITEM_NAME, nil], + [NSDictionary dictionaryWithObjectsAndKeys: + @"log", ITEM_IDENTIFIER, + @"History", ITEM_NAME, + nil], nil]; [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], GROUP_SEPARATOR, @@ -60,16 +69,24 @@ NSString *fileTxt=@""; if(startFile==@"fileview") fileTxt=[file textContents]; - if(startFile==@"blame") + else if(startFile==@"blame") fileTxt=[self parseBlame:[file blame]]; + else if(startFile==@"log") + fileTxt=[file log:logFormat]; id script = [view windowScriptObject]; [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]]; } } -#pragma mark MGScopeBarDelegate methods +#pragma mark JavaScript log.js methods +- (void) selectCommit:(NSString*)c +{ + [historyController selectCommit:[PBGitSHA shaWithString:c]]; +} + +#pragma mark MGScopeBarDelegate methods - (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar { @@ -114,7 +131,7 @@ startFile=identifier; NSString *path = [NSString stringWithFormat:@"html/views/%@", identifier]; NSString *html = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; - //NSLog(@"[FileViewerController scopeBar:selectedStateChanged] -> file: '%@' (%@)",html,identifier); + NSLog(@"[FileViewerController scopeBar:selectedStateChanged] -> file: '%@' (%@)",html,identifier); NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:html]]; [[view mainFrame] loadRequest:request]; } @@ -189,5 +206,6 @@ } @synthesize groups; +@synthesize logFormat; @end diff --git a/PBGitTree.h b/PBGitTree.h index 7eecf96..ebffbde 100644 --- a/PBGitTree.h +++ b/PBGitTree.h @@ -28,6 +28,7 @@ - (void) saveToFolder: (NSString *) directory; - (NSString *)textContents; - (NSString *)blame; +- (NSString *) log:(NSString *)format; - (NSString*) tmpFileNameForContents; - (long long)fileSize; diff --git a/PBGitTree.m b/PBGitTree.m index b5a7026..134648e 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -119,7 +119,7 @@ { if (!leaf) return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; - + if ([self hasBinaryAttributes]) return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; @@ -135,6 +135,26 @@ return contents; } +- (NSString *) log:(NSString *)format +{ + if (!leaf) + return [NSString stringWithFormat:@"This is a tree with path %@", [self fullPath]]; + + if ([self hasBinaryAttributes]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + if ([self fileSize] > 52428800) // ~50MB + return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]]; + + NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"log", [NSString stringWithFormat:@"--pretty=format:%@",format], @"--", [self fullPath], nil]]; + + if ([self hasBinaryHeader:contents]) + return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; + + + return contents; +} + - (long long)fileSize { if (_fileSize) diff --git a/html/views/log/format.html b/html/views/log/format.html new file mode 100644 index 0000000..92b50ae --- /dev/null +++ b/html/views/log/format.html @@ -0,0 +1,8 @@ +
+

%s

+ + + + +
Author:%an
Date:%ar
Commit:%H
+
diff --git a/html/views/log/index.html b/html/views/log/index.html new file mode 100644 index 0000000..593d6b1 --- /dev/null +++ b/html/views/log/index.html @@ -0,0 +1,19 @@ + + + Details for commit + + + + + + + + + + + + +
+ diff --git a/html/views/log/log.css b/html/views/log/log.css new file mode 100644 index 0000000..a6ae36a --- /dev/null +++ b/html/views/log/log.css @@ -0,0 +1,12 @@ +.commit table tr td:nth-of-type(1){ + text-align: right; + color: gray; +} + +.commit{ + margin: 10px; + padding: 10px; + border-radius: 10px; + border: 1px solid #CCC; + -webkit-box-shadow: 1px 1px 2px #DDD; +} \ No newline at end of file diff --git a/html/views/log/log.js b/html/views/log/log.js new file mode 100644 index 0000000..f484fe6 --- /dev/null +++ b/html/views/log/log.js @@ -0,0 +1,10 @@ +var selectCommit = function(a) { + window.Controller.selectCommit_(a); + return false; +} + +var showFile = function(txt) { + $("log").style.display = ""; + $("log").innerHTML=txt; + return; +} diff --git a/html/views/log/test.html b/html/views/log/test.html new file mode 100644 index 0000000..5e8d6e1 --- /dev/null +++ b/html/views/log/test.html @@ -0,0 +1,200 @@ + + Details for commit + + + + + + + + + + + + +
+ + + + +
Commit:703782163ddb653789c304e396eadb31f541864f
Author:Pieter de Bie
Date:10 months ago
+
PBChangedFile: Add assert to make sure we're not doing something stupid
+
+
+ +
+ + + + +
Commit:0d8ba8c2632e129fe7627f86d907c8b470c1bf20
Author:Pieter de Bie
Date:1 year, 1 month ago
+
Rename 'CachedChanges" to "StagedChanges" for greater consistency
+
+
+ +
+ + + + +
Commit:f9ff15cc6bf3c807425321581002f676985dd222
Author:Pieter de Bie
Date:1 year, 1 month ago
+
PBChangedFile: remove shouldBeDeleted boolean
+
We don't need this anymore
+
+ +
+ + + + +
Commit:8d729dae4cc8d3b564d149d6c9bb96922ee1bafa
Author:Pieter de Bie
Date:1 year, 6 months ago
+
CommitView: Don't change selection when refreshing
+
We used to read in a completely new array when refreshing +the index. The problem with this is that the selection +changes when reading in the new array. We avoid this +by changing the current array, rather than loading in +a completely new one.
+
+ +
+ + + + +
Commit:0975426f2f5119335c00768006b1ede0252ac448
Author:Pieter de Bie
Date:2 years, 7 months ago
+
CommitView: move index functions to separate controller
+
This merges functionality that was previously stored in the +combination of PBGitCommitController / PBChangedFile to a +dedicated controller, PBGitIndexController. +
+
+ +
+ + + + +
Commit:1d19bd64dfa83def18d5271c9afef9300ef0d65e
Author:Pieter de Bie
Date:2 years, 8 months ago
+
PBChangedFile: Don't use cat to read file contents
+
This changes PBChangedFile to read in files by using +NSString's stringWithContentsOfFile: method. + +It still uses the UTF8 encoding scheme so that we +can capture binary files. This should perhaps be loosened to +also allow other encodings. +
+
+ +
+ + + + +
Commit:472d36c7f970d9f3dbda3b9d7c8a7d51546bda56
Author:Pieter de Bie
Date:2 years, 8 months ago
+
CommitView: Add context menu to revert changes
+
+
+ +
+ + + + +
Commit:e659e63fc08ecd46cc1c26b6260126502ec656aa
Author:Pieter de Bie
Date:2 years, 8 months ago
+
CommitView: Add option to amend commits
+
+
+ +
+ + + + +
Commit:5010511bdb358ad376fd4668368bc5c12d9d8214
Author:Pieter de Bie
Date:2 years, 8 months ago
+
CommitView: Always use a single PBChangedFile object
+
This makes sure we don't add a double object to our array, +if a file has both cached and unstaged changes. +
+
+ +
+ + + + +
Commit:a0f248ef9f50a3af0efebdfb29c706bd97011a97
Author:Pieter de Bie
Date:2 years, 8 months ago
+
CommitView: Also show deleted files correctly
+
+
+ +
+ + + + +
Commit:001b6bf10eeaaf618971bc079e7415690c4c8d1a
Author:Pieter de Bie
Date:2 years, 9 months ago
+
CommitView: Handle new files better
+
This fixes the 'cat' command that was acting up and also shows +information when a file could not be displayed
+
+ +
+ + + + +
Commit:aafc284eb8fbd69acf40acfef07e25f409a87a18
Author:Pieter de Bie
Date:2 years, 9 months ago
+
ChangedFile: add a path separator to reset command
+
Sometimes a file could not be reset because it contained weird characters. + +This hopefully fixes it. +
+
+ +
+ + + + +
Commit:76e176e8b4ac59438340b129874ffbdfa7404ea3
Author:Pieter de Bie
Date:2 years, 9 months ago
+
Add staging and unstaging of files
+
+
+ +
+ + + + +
Commit:9b3909e7592d3c8648accb67642a2b57a441f128
Author:Pieter de Bie
Date:2 years, 9 months ago
+
CommitView: Add a status bar to the diff view
+
+
+ +
+ + + + +
Commit:44009b6f3e7e6fc5b54910c2b2a9a54b13f95a14
Author:Pieter de Bie
Date:2 years, 9 months ago
+
CommitView: use only one array for all files
+
+
+ +
+ + + + +
Commit:252796ee26ce733c4a6d3044e3142f9ee5df005e
Author:Pieter de Bie
Date:2 years, 9 months ago
+
CommitView: Show basic files
+
+
+ + \ No newline at end of file From f4a6d3fe0b9a8d2718365161263bf4447e0b3503 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 17 Sep 2010 23:45:19 -0600 Subject: [PATCH 091/110] Set the working directory for arguments sent from the cli This allows running the gitx cli in a subdirectory and specifying file paths in that directory without having to type out the full path. --- PBGitRepository.m | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/PBGitRepository.m b/PBGitRepository.m index 9d7862c..cd1e143 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -905,7 +905,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; #pragma mark GitX Scripting -- (void)handleRevListArguments:(NSArray *)arguments +- (void)handleRevListArguments:(NSArray *)arguments inWorkingDirectory:(NSURL *)workingDirectory { if (![arguments count]) return; @@ -915,19 +915,23 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; // the argument may be a branch or tag name but will probably not be the full reference if ([arguments count] == 1) { PBGitRef *refArgument = [self refForName:[arguments lastObject]]; - if (refArgument) + if (refArgument) { revListSpecifier = [[PBGitRevSpecifier alloc] initWithRef:refArgument]; + revListSpecifier.workingDirectory = workingDirectory; + } } - if (!revListSpecifier) + if (!revListSpecifier) { revListSpecifier = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; + revListSpecifier.workingDirectory = workingDirectory; + } self.currentBranch = [self addBranch:revListSpecifier]; [PBGitDefaults setShowStageView:NO]; [self.windowController showHistoryView:self]; } -- (void)handleBranchFilterEventForFilter:(PBGitXBranchFilterType)filter additionalArguments:(NSMutableArray *)arguments +- (void)handleBranchFilterEventForFilter:(PBGitXBranchFilterType)filter additionalArguments:(NSMutableArray *)arguments inWorkingDirectory:(NSURL *)workingDirectory { self.currentBranchFilter = filter; [PBGitDefaults setShowStageView:NO]; @@ -936,11 +940,11 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; // treat any additional arguments as a rev-list specifier if ([arguments count] > 1) { [arguments removeObjectAtIndex:0]; - [self handleRevListArguments:arguments]; + [self handleRevListArguments:arguments inWorkingDirectory:workingDirectory]; } } -- (void)handleGitXScriptingArguments:(NSAppleEventDescriptor *)argumentsList +- (void)handleGitXScriptingArguments:(NSAppleEventDescriptor *)argumentsList inWorkingDirectory:(NSURL *)workingDirectory { NSMutableArray *arguments = [NSMutableArray array]; uint argumentsIndex = 1; // AppleEvent list descriptor's are one based @@ -964,22 +968,22 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; } if ([firstArgument isEqualToString:@"--all"]) { - [self handleBranchFilterEventForFilter:kGitXAllBranchesFilter additionalArguments:arguments]; + [self handleBranchFilterEventForFilter:kGitXAllBranchesFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; return; } if ([firstArgument isEqualToString:@"--local"]) { - [self handleBranchFilterEventForFilter:kGitXLocalRemoteBranchesFilter additionalArguments:arguments]; + [self handleBranchFilterEventForFilter:kGitXLocalRemoteBranchesFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; return; } if ([firstArgument isEqualToString:@"--branch"]) { - [self handleBranchFilterEventForFilter:kGitXSelectedBranchFilter additionalArguments:arguments]; + [self handleBranchFilterEventForFilter:kGitXSelectedBranchFilter additionalArguments:arguments inWorkingDirectory:workingDirectory]; return; } // if the argument is not a known command then treat it as a rev-list specifier - [self handleRevListArguments:arguments]; + [self handleRevListArguments:arguments inWorkingDirectory:workingDirectory]; } // see if the current appleEvent has the command line arguments from the gitx cli @@ -996,9 +1000,10 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; // on app launch there may be many repositories opening, so double check that this is the right repo NSString *path = [[eventRecord paramDescriptorForKeyword:typeFileURL] stringValue]; if (path) { - if ([[PBGitRepository gitDirForURL:[NSURL URLWithString:path]] isEqual:[self fileURL]]) { + NSURL *workingDirectory = [NSURL URLWithString:path]; + if ([[PBGitRepository gitDirForURL:workingDirectory] isEqual:[self fileURL]]) { NSAppleEventDescriptor *argumentsList = [eventRecord paramDescriptorForKeyword:kGitXAEKeyArgumentsList]; - [self handleGitXScriptingArguments:argumentsList]; + [self handleGitXScriptingArguments:argumentsList inWorkingDirectory:workingDirectory]; // showWindows may be called more than once during app launch so remove the CLI data after we handle the event [currentAppleEvent removeDescriptorWithKeyword:keyAEPropData]; From 2852ecbf01b29fe85ad505910aa6a5ae54c98807 Mon Sep 17 00:00:00 2001 From: Johannes Gilger Date: Sun, 12 Sep 2010 15:46:15 +0200 Subject: [PATCH 092/110] History: Correctly wrap lots of tags When there are many tags in a commit we want them to wrap. This fixes lighthouse ticket #220. Signed-off-by: Johannes Gilger --- html/views/history/history.css | 2 +- html/views/history/history.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/views/history/history.css b/html/views/history/history.css index 21e939c..f2b694a 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -130,7 +130,7 @@ a.showdiff { font-size: 9px; font-family: Helvetica; border: 1px solid black; - margin-right: 5px; + margin-right: 2px; padding: 1px 3px 1px 3px; -webkit-border-radius: 2px; } diff --git a/html/views/history/history.js b/html/views/history/history.js index ca970fb..b9520ca 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -161,7 +161,7 @@ var showRefs = function() { refs.innerHTML = ""; for (var i = 0; i < commit.refs.length; i++) { var ref = commit.refs[i]; - refs.innerHTML += '' + ref.shortName() + ''; + refs.innerHTML += '' + ref.shortName() + ' '; } } else refs.parentNode.style.display = "none"; From f2cf4381799b25c55aed0c1fd9d36d58a89af272 Mon Sep 17 00:00:00 2001 From: Johannes Gilger Date: Sun, 12 Sep 2010 17:10:47 +0200 Subject: [PATCH 093/110] History-View: Clear list of files on showDiff This clears the list of files before redrawing the showDiff method. Fixes Lighthouse ticket #263 Signed-off-by: Johannes Gilger --- html/views/history/history.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/views/history/history.js b/html/views/history/history.js index b9520ca..c0ac4c6 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -219,6 +219,8 @@ var loadCommit = function(commitObject, currentRef) { var showDiff = function() { + $("files").innerHTML = ""; + // Callback for the diff highlighter. Used to generate a filelist var newfile = function(name1, name2, id, mode_change, old_mode, new_mode) { var img = document.createElement("img"); From 95b48779e84f87ee2c586f2e35f8adcbaa1bba82 Mon Sep 17 00:00:00 2001 From: Johannes Gilger Date: Sun, 12 Sep 2010 17:40:27 +0200 Subject: [PATCH 094/110] Diff-View: Honor whitespace preference This honors the preferences for showing differences in whitespacing when using diff between single revisions/branches. Signed-off-by: Johannes Gilger --- PBDiffWindowController.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PBDiffWindowController.m b/PBDiffWindowController.m index 496c850..06403d5 100644 --- a/PBDiffWindowController.m +++ b/PBDiffWindowController.m @@ -9,6 +9,7 @@ #import "PBDiffWindowController.h" #import "PBGitRepository.h" #import "PBGitCommit.h" +#import "PBGitDefaults.h" @implementation PBDiffWindowController @@ -34,6 +35,10 @@ NSString *commitSelector = [NSString stringWithFormat:@"%@..%@", [startCommit realSha], [diffCommit realSha]]; NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", commitSelector, nil]; + + if (![PBGitDefaults showWhitespaceDifferences]) + [arguments insertObject:@"-w" atIndex:1]; + if (filePaths) { [arguments addObject:@"--"]; [arguments addObjectsFromArray:filePaths]; From 5194d5c5c98d881ca40041e059ae5e6f6bfbb7a0 Mon Sep 17 00:00:00 2001 From: Johannes Gilger Date: Sun, 12 Sep 2010 19:34:03 +0200 Subject: [PATCH 095/110] History: Show author/committer according to .mailmap This does not affect the display of the diff, since it is done with git show --pretty=raw. Signed-off-by: Johannes Gilger --- PBGitRevList.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitRevList.mm b/PBGitRevList.mm index 851d6ed..8ab64e1 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -102,7 +102,7 @@ using namespace std; std::map encodingMap; NSThread *currentThread = [NSThread currentThread]; - NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%cn\01%s\01%P\01%at"; + NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%s\01%P\01%at"; BOOL showSign = [rev hasLeftRight]; if (showSign) From d1298a6c574882ae56909b700d8f6632f106a2e4 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sat, 18 Sep 2010 11:18:21 -0700 Subject: [PATCH 096/110] remove the "author" and "summary" labels --- GLFileView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GLFileView.m b/GLFileView.m index f64c39a..76f0547 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -161,12 +161,12 @@ [res appendFormat:@"\n",nLines]; line=[lines objectAtIndex:++i]; if([[[line componentsSeparatedByString:@" "] objectAtIndex:0] isEqual:@"author"]){ - NSString *author=line; + 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; + summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""]; } } NSString *block=[NSString stringWithFormat:@"

%@

%@

\n\n",author,summary]; From 3f4c435d5fe24fc9821b650aceefaf1e3fefe0dd Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sat, 18 Sep 2010 11:18:57 -0700 Subject: [PATCH 097/110] blame command should be "blame -p SHA -- filename" --- PBGitTree.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitTree.m b/PBGitTree.m index 134648e..d6e685c 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -126,7 +126,7 @@ if ([self fileSize] > 52428800) // ~50MB return [NSString stringWithFormat:@"%@ is too big to be displayed (%d bytes)", [self fullPath], [self fileSize]]; - NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", @"-p", [self fullPath], sha, nil]]; + NSString *contents=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"blame", @"-p", sha, @"--", [self fullPath], nil]]; if ([self hasBinaryHeader:contents]) return [NSString stringWithFormat:@"%@ appears to be a binary file of %d bytes", [self fullPath], [self fileSize]]; From 3a2549602085116076d16729cab27604b449d3f2 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sat, 18 Sep 2010 11:19:29 -0700 Subject: [PATCH 098/110] log format use %aN for the author name so that git uses the names from .mailmap --- html/views/log/format.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/log/format.html b/html/views/log/format.html index 92b50ae..f4b84f7 100644 --- a/html/views/log/format.html +++ b/html/views/log/format.html @@ -1,7 +1,7 @@

%s

- +
Author:%an
Author:%aN
Date:%ar
Commit:%H
From a7faf4f06ae9904d50d1826f830d5a93390db38c Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sat, 18 Sep 2010 11:20:22 -0700 Subject: [PATCH 099/110] Remove the Quick Look button from the upper history toolbar and put it in the file list's bar --- GLFileView.h | 1 + GLFileView.m | 6 +- PBGitHistoryView.xib | 139 ++++++++++++++++++++++++++++--------------- 3 files changed, 97 insertions(+), 49 deletions(-) diff --git a/GLFileView.h b/GLFileView.h index 2e752da..cd92804 100644 --- a/GLFileView.h +++ b/GLFileView.h @@ -20,6 +20,7 @@ IBOutlet MGScopeBar *typeBar; NSMutableArray *groups; NSString *logFormat; + IBOutlet NSView *accessoryView; } - (void)showFile; diff --git a/GLFileView.m b/GLFileView.m index 76f0547..aee67b9 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -131,11 +131,15 @@ startFile=identifier; NSString *path = [NSString stringWithFormat:@"html/views/%@", identifier]; NSString *html = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path]; - NSLog(@"[FileViewerController scopeBar:selectedStateChanged] -> file: '%@' (%@)",html,identifier); NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:html]]; [[view mainFrame] loadRequest:request]; } +- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar +{ + return accessoryView; +} + - (void) didLoad { [self showFile]; diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 2f7c9dc..350a02f 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@
YES - + YES @@ -113,34 +113,6 @@ 266 YES - - - 289 - {{908, 3}, {37, 25}} - - YES - - -2080244224 - 134217728 - QuickLook - - LucidaGrande - 13 - 1044 - - - -2033958657 - 163 - - NSImage - NSQuickLookTemplate - - - IA - 400 - 75 - - 292 @@ -150,7 +122,11 @@ -2080244224 0 - + + LucidaGrande + 13 + 1044 + YES @@ -1109,6 +1085,47 @@ 266 + + YES + + + 268 + + YES + + + 289 + {{41, 1.5}, {29, 19}} + + YES + + -2080244224 + 134217728 + QuickLook + + LucidaGrande-Bold + 12 + 16 + + + 147079423 + 173 + + NSImage + NSQuickLookTemplate + + + IA + 400 + 75 + + + + {{639, 0}, {84, 24}} + + NSView + + {{0, 211}, {723, 24}} MGScopeBar @@ -1957,6 +1974,14 @@ 485 + + + accessoryView + + + + 487 + @@ -2303,7 +2328,6 @@ - @@ -2445,20 +2469,6 @@ - - 49 - - - YES - - - - - - 50 - - - 407 @@ -2562,10 +2572,34 @@ YES + TypeBar + + 486 + + + YES + + + + + + 49 + + + YES + + + + + + 50 + + + @@ -2676,6 +2710,7 @@ 46.IBPluginDependency 475.IBPluginDependency 48.IBPluginDependency + 486.IBPluginDependency 49.IBAttributePlaceholdersKey 49.IBPluginDependency 50.IBPluginDependency @@ -2859,6 +2894,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2892,7 +2928,7 @@ - 485 + 487 @@ -2904,31 +2940,38 @@ YES YES + accessoryView historyController typeBar YES + NSView PBGitHistoryController - PBGitGradientBarView + MGScopeBar YES YES + accessoryView historyController typeBar YES + + accessoryView + NSView + historyController PBGitHistoryController typeBar - PBGitGradientBarView + MGScopeBar From 6d564bb4638ba4367b9304eb2181e732266b05bc Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sat, 18 Sep 2010 11:20:45 -0700 Subject: [PATCH 100/110] In Xcode put the folder for MGScopeBar in the Aux folder --- GitX.xcodeproj/project.pbxproj | 8 +- MGScopeBar/AppController.h | 20 --- MGScopeBar/AppController.m | 220 --------------------------------- 3 files changed, 1 insertion(+), 247 deletions(-) delete mode 100644 MGScopeBar/AppController.h delete mode 100644 MGScopeBar/AppController.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 40e86a2..ff2820e 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ /* Begin PBXBuildFile section */ 056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; }; 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 310DC1D71240599E0017A0F7 /* GLFileView.m */; }; - 31460CB2124185BA00B90AED /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460C7B124185BA00B90AED /* AppController.m */; }; 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */; }; 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA9124185BA00B90AED /* MGScopeBar.m */; }; 31460CD4124185BA00B90AED /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = 31460CAF124185BA00B90AED /* ReadMe.txt */; }; @@ -252,8 +251,6 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 310DC1D61240599E0017A0F7 /* GLFileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLFileView.h; sourceTree = ""; }; 310DC1D71240599E0017A0F7 /* GLFileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLFileView.m; sourceTree = ""; }; - 31460C7A124185BA00B90AED /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - 31460C7B124185BA00B90AED /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGRecessedPopUpButtonCell.h; sourceTree = ""; }; 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGRecessedPopUpButtonCell.m; sourceTree = ""; }; 31460CA8124185BA00B90AED /* MGScopeBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGScopeBar.h; sourceTree = ""; }; @@ -585,7 +582,6 @@ 29B97314FDCFA39411CA2CEA /* GitTest */ = { isa = PBXGroup; children = ( - 31460C79124185B900B90AED /* MGScopeBar */, F5886A080ED5D26B0066E74C /* SpeedTest */, 913D5E420E5563FD00CECEA2 /* cli */, D89E9B4C1218C22A0097A90B /* GitXScripting */, @@ -689,8 +685,6 @@ 31460C79124185B900B90AED /* MGScopeBar */ = { isa = PBXGroup; children = ( - 31460C7A124185BA00B90AED /* AppController.h */, - 31460C7B124185BA00B90AED /* AppController.m */, 31460CA6124185BA00B90AED /* MGRecessedPopUpButtonCell.h */, 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */, 31460CA8124185BA00B90AED /* MGScopeBar.h */, @@ -851,6 +845,7 @@ F57CC43E0E05E472000472E2 /* Aux */ = { isa = PBXGroup; children = ( + 31460C79124185B900B90AED /* MGScopeBar */, 47DBDBC80E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.h */, 47DBDBC90E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m */, F5AD56770E79B78100EDAAFE /* PBCommitList.h */, @@ -1374,7 +1369,6 @@ D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */, D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */, 310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */, - 31460CB2124185BA00B90AED /* AppController.m in Sources */, 31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */, 31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */, ); diff --git a/MGScopeBar/AppController.h b/MGScopeBar/AppController.h deleted file mode 100644 index 37ed4eb..0000000 --- a/MGScopeBar/AppController.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// AppController.h -// MGScopeBar -// -// Created by Matt Gemmell on 16/03/2008. -// - -#import -#import "MGScopeBarDelegateProtocol.h" - -@interface AppController : NSObject { - IBOutlet NSTextField *labelField; - IBOutlet MGScopeBar *scopeBar; - IBOutlet NSView *accessoryView; - NSMutableArray *groups; -} - -@property(retain) NSMutableArray *groups; - -@end diff --git a/MGScopeBar/AppController.m b/MGScopeBar/AppController.m deleted file mode 100644 index 3a5297c..0000000 --- a/MGScopeBar/AppController.m +++ /dev/null @@ -1,220 +0,0 @@ -// -// AppController.m -// MGScopeBar -// -// Created by Matt Gemmell on 16/03/2008. -// - -#import "AppController.h" -#import "MGScopeBar.h" - - -// Keys for our sample data. -#define GROUP_LABEL @"Label" // string -#define GROUP_SEPARATOR @"HasSeparator" // BOOL as NSNumber -#define GROUP_SELECTION_MODE @"SelectionMode" // MGScopeBarGroupSelectionMode (int) as NSNumber -#define GROUP_ITEMS @"Items" // array of dictionaries, each containing the following keys: -#define ITEM_IDENTIFIER @"Identifier" // string -#define ITEM_NAME @"Name" // string - - -@implementation AppController - - -#pragma mark Setup and teardown - - -- (void)awakeFromNib -{ - // In this method we basically just set up some sample data for the scope bar, - // so that we can respond to the MGScopeBarDelegate methods easily. - - self.groups = [NSMutableArray arrayWithCapacity:0]; - scopeBar.delegate = self; - - // Add first group of items. - NSArray *items = [NSArray arrayWithObjects: - [NSDictionary dictionaryWithObjectsAndKeys: - @"HereItem", ITEM_IDENTIFIER, - @"Here", ITEM_NAME, - nil], - [NSDictionary dictionaryWithObjectsAndKeys: - @"ThereItem", ITEM_IDENTIFIER, - @"There", ITEM_NAME, - nil], - nil]; - - [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: - @"Search:", GROUP_LABEL, - [NSNumber numberWithBool:NO], GROUP_SEPARATOR, - [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. - items, GROUP_ITEMS, - nil]]; - - // Add second group of items. - items = [NSArray arrayWithObjects: - [NSDictionary dictionaryWithObjectsAndKeys: - @"ContentsItem", ITEM_IDENTIFIER, - @"Contents", ITEM_NAME, - nil], - [NSDictionary dictionaryWithObjectsAndKeys: - @"FileNamesItem", ITEM_IDENTIFIER, - @"File Names", ITEM_NAME, - nil], - [NSDictionary dictionaryWithObjectsAndKeys: - @"MetadataItem", ITEM_IDENTIFIER, - @"Metadata", ITEM_NAME, - nil], - nil]; - - [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: - // deliberately not specifying a label - [NSNumber numberWithBool:YES], GROUP_SEPARATOR, - [NSNumber numberWithInt:MGMultipleSelectionMode], GROUP_SELECTION_MODE, // multiple selection group. - items, GROUP_ITEMS, - nil]]; - - // Add third group of items. - items = [NSArray arrayWithObjects: - [NSDictionary dictionaryWithObjectsAndKeys: - @"AllFilesItem", ITEM_IDENTIFIER, - @"All Files", ITEM_NAME, - nil], - [NSDictionary dictionaryWithObjectsAndKeys: - @"ImagesOnlyItem", ITEM_IDENTIFIER, - @"Images Only", ITEM_NAME, - nil], - nil]; - - [self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys: - @"Kind:", GROUP_LABEL, - [NSNumber numberWithBool:YES], GROUP_SEPARATOR, - [NSNumber numberWithInt:MGRadioSelectionMode], GROUP_SELECTION_MODE, // single selection group. - items, GROUP_ITEMS, - nil]]; - - // Tell the scope bar to ask us for data (since we're the scope-bar's delegate). - [scopeBar reloadData]; - - // Since our first group is a radio-mode group, the scope bar will automatically select its first item. - // The scope bar will take care of deselecting other items when you select a new item in a radio-mode group. - - // We'll also select the first item in our second group, which is a multiple-selection group. - // You can (and must) use this method to programmatically select/deselect items in the bar. - [scopeBar setSelected:YES forItem:@"ContentsItem" inGroup:1]; // remember that group-numbers are zero-based. - - // Clear out the label field below the scope bar. - [labelField setStringValue:@""]; -} - - -- (void)dealloc -{ - self.groups = nil; - [super dealloc]; -} - - -#pragma mark MGScopeBarDelegate methods - - -- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar -{ - return [self.groups count]; -} - - -- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber -{ - NSString *res=[[self.groups objectAtIndex:groupNumber] valueForKeyPath:[NSString stringWithFormat:@"%@.%@", GROUP_ITEMS, ITEM_IDENTIFIER]]; - NSLog(@"-itemIdentifiersForGroup- %@",res); - return res; -} - - -- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber -{ - NSString *res= [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_LABEL]; // might be nil, which is fine (nil means no label). - NSLog(@"-labelForGroup- %@",res); - return res; -} - - -- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber -{ - NSArray *items = [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_ITEMS]; - if (items) { - // We'll iterate here, since this is just a demo. This avoids having to keep an NSDictionary of identifiers - // for each group as well as an array for ordering. In a more realistic scenario, you'd probably want to be - // able to look-up an item by its identifier in constant time. - for (NSDictionary *item in items) { - if ([[item objectForKey:ITEM_IDENTIFIER] isEqualToString:identifier]) { - NSLog(@"-titleOfItem- %@=%@",identifier,[item objectForKey:ITEM_NAME]); - return [item objectForKey:ITEM_NAME]; - break; - } - } - } - return nil; -} - - -- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber -{ - return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SELECTION_MODE] intValue]; -} - - -- (BOOL)scopeBar:(MGScopeBar *)theScopeBar showSeparatorBeforeGroup:(int)groupNumber -{ - // Optional method. If not implemented, all groups except the first will have a separator before them. - return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SEPARATOR] boolValue]; -} - - -- (NSImage *)scopeBar:(MGScopeBar *)scopeBar imageForItem:(NSString *)identifier inGroup:(int)groupNumber -{ - // Optional method. If not implemented (or if you return nil), items will not have an image. - if (groupNumber == 0) { - return [NSImage imageNamed:@"NSComputer"]; - - } else if (groupNumber == 2) { - if ([identifier isEqualToString:@"AllFilesItem"]) { - return [NSImage imageNamed:@"NSGenericDocument"]; - - } else if ([identifier isEqualToString:@"ImagesOnlyItem"]) { - return [[NSWorkspace sharedWorkspace] iconForFileType:@"png"]; - } - } - - return nil; -} - - -- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar -{ - // Optional method. If not implemented (or if you return nil), the scope-bar will not have an accessory view. - return accessoryView; -} - - -- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected - forItem:(NSString *)identifier inGroup:(int)groupNumber -{ - // Display some text showing what just happened. - NSString *displayString = [NSString stringWithFormat:@"\"%@\" %@ in group %d.", - identifier, - (selected) ? @"selected" : @"deselected", - groupNumber]; - [labelField setStringValue:displayString]; - //NSLog(@"%@", displayString); -} - - -#pragma mark Accessors and properties - - -@synthesize groups; - - -@end From 9a9de9577c6af02c8ea88c9d33a23f428347a430 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 18 Sep 2010 19:14:35 -0600 Subject: [PATCH 101/110] Bugfix: crasher on 10.5 due to webkit and the + + Gist it + From bcee4aa91eb3e0c7e6ca47eb25272c28f6f7f190 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sun, 19 Sep 2010 12:17:18 -0700 Subject: [PATCH 102/110] html and code parse errors... --- GLFileView.m | 11 +++++++++-- .../syntaxhighlighter_2.1.364/scripts/shBrushObjC.js | 3 +-- html/views/fileview/fileview.js | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/GLFileView.m b/GLFileView.m index aee67b9..bc7b0f3 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -68,7 +68,7 @@ NSString *fileTxt=@""; if(startFile==@"fileview") - fileTxt=[file textContents]; + fileTxt=[self parseHTML:[file textContents]]; else if(startFile==@"blame") fileTxt=[self parseBlame:[file blame]]; else if(startFile==@"log") @@ -145,11 +145,18 @@ [self showFile]; } -- (NSString *) parseBlame:(NSString *)txt +- (NSString *) parseHTML:(NSString *)txt { txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@">"]; + return txt; +} + +- (NSString *) parseBlame:(NSString *)txt +{ + txt=[self parseHTML:txt]; + NSArray *lines = [txt componentsSeparatedByString:@"\n"]; NSString *line; NSMutableDictionary *headers=[NSMutableDictionary dictionary]; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js index 2b93479..a1e7fd1 100644 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js +++ b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js @@ -40,8 +40,7 @@ SyntaxHighlighter.brushes.ObjC = function() 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.multiLineCComments, css: 'comments' }, // multiline comments { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers diff --git a/html/views/fileview/fileview.js b/html/views/fileview/fileview.js index 2168e9e..a8abad6 100644 --- a/html/views/fileview/fileview.js +++ b/html/views/fileview/fileview.js @@ -7,3 +7,10 @@ var showFile = function(txt) { return; } + +var test=function(txt) { + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.highlight(); + + return; +} From 6cf9cc13c8efc3ec4f3f63ea99e5999a66aa3c24 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sun, 19 Sep 2010 13:01:26 -0700 Subject: [PATCH 103/110] SyntaxHighlighter 3.0.83 --- GLFileView.h | 1 + html/css/shThemeGitX.css | 118 + .../LGPL-LICENSE} | 328 +- html/lib/syntaxhighlighter/MIT-LICENSE | 20 + .../compass/_theme_template.scss | 120 + html/lib/syntaxhighlighter/compass/config.rb | 14 + .../lib/syntaxhighlighter/compass/shCore.scss | 216 + .../compass/shCoreDefault.scss | 2 + .../compass/shCoreDjango.scss | 2 + .../compass/shCoreEclipse.scss | 2 + .../compass/shCoreEmacs.scss | 2 + .../compass/shCoreFadeToGrey.scss | 2 + .../compass/shCoreMDUltra.scss | 2 + .../compass/shCoreMidnight.scss | 2 + .../compass/shCoreRDark.scss | 2 + .../compass/shThemeDefault.scss | 7 + .../compass/shThemeDjango.scss | 36 + .../compass/shThemeEclipse.scss | 48 + .../compass/shThemeEmacs.scss | 32 + .../compass/shThemeFadeToGrey.scss | 36 + .../compass/shThemeMDUltra.scss | 32 + .../compass/shThemeMidnight.scss | 32 + .../compass/shThemeRDark.scss | 32 + html/lib/syntaxhighlighter/index.html | 22 + .../syntaxhighlighter/scripts/shAutoloader.js | 17 + .../syntaxhighlighter/scripts/shBrushAS3.js | 59 + .../scripts/shBrushAppleScript.js | 75 + .../syntaxhighlighter/scripts/shBrushBash.js | 59 + .../scripts/shBrushCSharp.js | 65 + .../scripts/shBrushColdFusion.js | 100 + .../syntaxhighlighter/scripts/shBrushCpp.js | 97 + .../syntaxhighlighter/scripts/shBrushCss.js | 91 + .../scripts/shBrushDelphi.js | 55 + .../syntaxhighlighter/scripts/shBrushDiff.js | 41 + .../scripts/shBrushErlang.js | 52 + .../scripts/shBrushGroovy.js | 67 + .../scripts/shBrushJScript.js | 52 + .../syntaxhighlighter/scripts/shBrushJava.js | 57 + .../scripts/shBrushJavaFX.js | 58 + .../scripts/shBrushObjC.js | 1 + .../syntaxhighlighter/scripts/shBrushPerl.js | 72 + .../syntaxhighlighter/scripts/shBrushPhp.js | 88 + .../syntaxhighlighter/scripts/shBrushPlain.js | 33 + .../scripts/shBrushPowerShell.js | 74 + .../scripts/shBrushPython.js | 64 + .../syntaxhighlighter/scripts/shBrushRuby.js | 55 + .../syntaxhighlighter/scripts/shBrushSass.js | 94 + .../syntaxhighlighter/scripts/shBrushScala.js | 51 + .../syntaxhighlighter/scripts/shBrushSql.js | 66 + .../syntaxhighlighter/scripts/shBrushVb.js | 56 + .../syntaxhighlighter/scripts/shBrushXml.js | 69 + html/lib/syntaxhighlighter/scripts/shCore.js | 17 + .../lib/syntaxhighlighter/scripts/shLegacy.js | 17 + .../lib/syntaxhighlighter/src/shAutoloader.js | 130 + html/lib/syntaxhighlighter/src/shCore.js | 1721 +++++ .../src/shLegacy.js | 57 +- html/lib/syntaxhighlighter/styles/shCore.css | 225 + .../styles/shCoreDefault.css | 328 + .../syntaxhighlighter/styles/shCoreDjango.css | 331 + .../styles/shCoreEclipse.css | 339 + .../syntaxhighlighter/styles/shCoreEmacs.css | 324 + .../styles/shCoreFadeToGrey.css | 328 + .../styles/shCoreMDUltra.css | 324 + .../styles/shCoreMidnight.css | 324 + .../syntaxhighlighter/styles/shCoreRDark.css | 324 + .../styles/shThemeDefault.css | 117 + .../styles/shThemeDjango.css | 120 + .../styles/shThemeEclipse.css | 128 + .../syntaxhighlighter/styles/shThemeEmacs.css | 113 + .../styles/shThemeFadeToGrey.css | 117 + .../styles/shThemeMDUltra.css | 113 + .../styles/shThemeMidnight.css | 113 + .../syntaxhighlighter/styles/shThemeRDark.css | 113 + html/lib/syntaxhighlighter/tests/.rvmrc | 1 + .../syntaxhighlighter/tests/brushes/sass.html | 204 + .../tests/brushes_tests.html | 136 + .../tests/cases/001_basic.html | 42 + .../tests/cases/002_brushes.html | 50 + .../tests/cases/003_script_tag.html | 42 + .../tests/cases/004_url_parsing.html | 43 + .../tests/cases/005_no_gutter.html | 33 + .../tests/cases/006_pad_line_numbers.html | 39 + .../tests/cases/007_collapse.html | 60 + .../tests/cases/007_collapse_interaction.html | 44 + .../tests/cases/008_first_line.html | 29 + .../tests/cases/009_class_name.html | 32 + .../tests/cases/010_highlight.html | 70 + .../tests/cases/011_smart_tabs.html | 98 + .../tests/cases/012_server_side.html | 35 + .../tests/cases/013_html_script.html | 34 + .../tests/cases/014_legacy.html | 70 + .../syntaxhighlighter/tests/commonjs_tests.js | 52 + .../tests/js/jquery-1.4.2.js | 6240 +++++++++++++++++ html/lib/syntaxhighlighter/tests/js/qunit.css | 135 + html/lib/syntaxhighlighter/tests/js/qunit.js | 1069 +++ .../tests/syntaxhighlighter_tests.html | 242 + .../syntaxhighlighter/tests/theme_tests.html | 134 + html/lib/syntaxhighlighter/tests/webrick.rb | 11 + html/lib/syntaxhighlighter/tests/webrick.sh | 2 + .../scripts/clipboard.swf | Bin 1361 -> 0 bytes .../scripts/shBrushAS3.js | 61 - .../scripts/shBrushBash.js | 66 - .../scripts/shBrushCSharp.js | 67 - .../scripts/shBrushColdFusion.js | 102 - .../scripts/shBrushCpp.js | 99 - .../scripts/shBrushCss.js | 93 - .../scripts/shBrushDelphi.js | 57 - .../scripts/shBrushDiff.js | 43 - .../scripts/shBrushErlang.js | 54 - .../scripts/shBrushGroovy.js | 69 - .../scripts/shBrushJScript.js | 52 - .../scripts/shBrushJava.js | 59 - .../scripts/shBrushJavaFX.js | 60 - .../scripts/shBrushPerl.js | 74 - .../scripts/shBrushPhp.js | 91 - .../scripts/shBrushPlain.js | 35 - .../scripts/shBrushPowerShell.js | 76 - .../scripts/shBrushPython.js | 66 - .../scripts/shBrushRuby.js | 57 - .../scripts/shBrushScala.js | 53 - .../scripts/shBrushSql.js | 68 - .../scripts/shBrushVb.js | 58 - .../scripts/shBrushXml.js | 71 - .../scripts/shCore.js | 30 - .../scripts/shLegacy.js | 30 - .../syntaxhighlighter_2.1.364/src/shCore.js | 2077 ------ .../syntaxhighlighter_2.1.364/styles/help.png | Bin 786 -> 0 bytes .../styles/magnifier.png | Bin 615 -> 0 bytes .../styles/page_white_code.png | Bin 603 -> 0 bytes .../styles/page_white_copy.png | Bin 309 -> 0 bytes .../styles/printer.png | Bin 731 -> 0 bytes .../styles/shCore.css | 330 - .../styles/shThemeDefault.css | 173 - .../styles/shThemeDjango.css | 176 - .../styles/shThemeEclipse.css | 190 - .../styles/shThemeEmacs.css | 175 - .../styles/shThemeFadeToGrey.css | 177 - .../styles/shThemeMidnight.css | 175 - .../styles/shThemeRDark.css | 175 - html/lib/syntaxhighlighter_2.1.364/test.html | 42 - html/views/blame/blame.css | 42 +- html/views/blame/index.html | 8 +- html/views/fileview/index.html | 8 +- html/views/fileview/index_test.html | 48 + 144 files changed, 17325 insertions(+), 5510 deletions(-) create mode 100644 html/css/shThemeGitX.css rename html/lib/{syntaxhighlighter_2.1.364/LGPLv3.txt => syntaxhighlighter/LGPL-LICENSE} (97%) create mode 100644 html/lib/syntaxhighlighter/MIT-LICENSE create mode 100644 html/lib/syntaxhighlighter/compass/_theme_template.scss create mode 100644 html/lib/syntaxhighlighter/compass/config.rb create mode 100644 html/lib/syntaxhighlighter/compass/shCore.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreDefault.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreDjango.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreEclipse.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreEmacs.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreMidnight.scss create mode 100644 html/lib/syntaxhighlighter/compass/shCoreRDark.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeDefault.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeDjango.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeEclipse.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeEmacs.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeMidnight.scss create mode 100644 html/lib/syntaxhighlighter/compass/shThemeRDark.scss create mode 100644 html/lib/syntaxhighlighter/index.html create mode 100644 html/lib/syntaxhighlighter/scripts/shAutoloader.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushAS3.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushAppleScript.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushBash.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushCSharp.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushCpp.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushCss.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushDelphi.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushDiff.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushErlang.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushGroovy.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushJScript.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushJava.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js rename html/lib/{syntaxhighlighter_2.1.364 => syntaxhighlighter}/scripts/shBrushObjC.js (99%) create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushPerl.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushPhp.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushPlain.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushPython.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushRuby.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushSass.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushScala.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushSql.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushVb.js create mode 100644 html/lib/syntaxhighlighter/scripts/shBrushXml.js create mode 100644 html/lib/syntaxhighlighter/scripts/shCore.js create mode 100644 html/lib/syntaxhighlighter/scripts/shLegacy.js create mode 100644 html/lib/syntaxhighlighter/src/shAutoloader.js create mode 100644 html/lib/syntaxhighlighter/src/shCore.js rename html/lib/{syntaxhighlighter_2.1.364 => syntaxhighlighter}/src/shLegacy.js (75%) create mode 100644 html/lib/syntaxhighlighter/styles/shCore.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreDefault.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreDjango.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreEclipse.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreEmacs.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreFadeToGrey.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreMDUltra.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreMidnight.css create mode 100644 html/lib/syntaxhighlighter/styles/shCoreRDark.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeDefault.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeDjango.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeEclipse.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeEmacs.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeFadeToGrey.css create mode 100755 html/lib/syntaxhighlighter/styles/shThemeMDUltra.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeMidnight.css create mode 100644 html/lib/syntaxhighlighter/styles/shThemeRDark.css create mode 100644 html/lib/syntaxhighlighter/tests/.rvmrc create mode 100644 html/lib/syntaxhighlighter/tests/brushes/sass.html create mode 100644 html/lib/syntaxhighlighter/tests/brushes_tests.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/001_basic.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/002_brushes.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/003_script_tag.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/007_collapse.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/008_first_line.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/009_class_name.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/010_highlight.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/012_server_side.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/013_html_script.html create mode 100644 html/lib/syntaxhighlighter/tests/cases/014_legacy.html create mode 100644 html/lib/syntaxhighlighter/tests/commonjs_tests.js create mode 100644 html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js create mode 100644 html/lib/syntaxhighlighter/tests/js/qunit.css create mode 100644 html/lib/syntaxhighlighter/tests/js/qunit.js create mode 100644 html/lib/syntaxhighlighter/tests/syntaxhighlighter_tests.html create mode 100644 html/lib/syntaxhighlighter/tests/theme_tests.html create mode 100755 html/lib/syntaxhighlighter/tests/webrick.rb create mode 100755 html/lib/syntaxhighlighter/tests/webrick.sh delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/src/shCore.js delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/help.png delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/magnifier.png delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/page_white_code.png delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/page_white_copy.png delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/printer.png delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shCore.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeDefault.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeDjango.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeEclipse.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeEmacs.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeFadeToGrey.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeMidnight.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/styles/shThemeRDark.css delete mode 100644 html/lib/syntaxhighlighter_2.1.364/test.html create mode 100644 html/views/fileview/index_test.html diff --git a/GLFileView.h b/GLFileView.h index cd92804..79b3707 100644 --- a/GLFileView.h +++ b/GLFileView.h @@ -26,6 +26,7 @@ - (void)showFile; - (void)didLoad; - (NSString *)parseBlame:(NSString *)txt; +- (NSString *)parseHTML:(NSString *)txt; @property(retain) NSMutableArray *groups; @property(retain) NSString *logFormat; diff --git a/html/css/shThemeGitX.css b/html/css/shThemeGitX.css new file mode 100644 index 0000000..fda832c --- /dev/null +++ b/html/css/shThemeGitX.css @@ -0,0 +1,118 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter { + background-color: white !important; + font: 11px "Menlo" !important; +} +.syntaxhighlighter .line.alt1 { + background-color: white !important; +} +.syntaxhighlighter .line.alt2 { + background-color: white !important; +} +.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { + background-color: #e0e0e0 !important; +} +.syntaxhighlighter .line.highlighted.number { + color: black !important; +} +.syntaxhighlighter table caption { + color: black !important; +} +.syntaxhighlighter .gutter { + color: #afafaf !important; +} +.syntaxhighlighter .gutter .line { + border-right: 3px solid #6ce26c !important; +} +.syntaxhighlighter .gutter .line.highlighted { + background-color: #6ce26c !important; + color: white !important; +} +.syntaxhighlighter.printing .line .content { + border: none !important; +} +.syntaxhighlighter.collapsed { + overflow: visible !important; +} +.syntaxhighlighter.collapsed .toolbar { + color: blue !important; + background: white !important; + border: 1px solid #6ce26c !important; +} +.syntaxhighlighter.collapsed .toolbar a { + color: blue !important; +} +.syntaxhighlighter.collapsed .toolbar a:hover { + color: red !important; +} +.syntaxhighlighter .toolbar { + color: white !important; + background: #6ce26c !important; + border: none !important; +} +.syntaxhighlighter .toolbar a { + color: white !important; +} +.syntaxhighlighter .toolbar a:hover { + color: black !important; +} +.syntaxhighlighter .plain, .syntaxhighlighter .plain a { + color: black !important; +} +.syntaxhighlighter .comments, .syntaxhighlighter .comments a { + color: #008200 !important; +} +.syntaxhighlighter .string, .syntaxhighlighter .string a { + color: blue !important; +} +.syntaxhighlighter .keyword { + color: #006699 !important; +} +.syntaxhighlighter .preprocessor { + color: gray !important; +} +.syntaxhighlighter .variable { + color: #aa7700 !important; +} +.syntaxhighlighter .value { + color: #009900 !important; +} +.syntaxhighlighter .functions { + color: #ff1493 !important; +} +.syntaxhighlighter .constants { + color: #0066cc !important; +} +.syntaxhighlighter .script { + font-weight: bold !important; + color: #006699 !important; + background-color: none !important; +} +.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { + color: gray !important; +} +.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { + color: red !important; +} + +.syntaxhighlighter .keyword { + font-weight: bold !important; +} diff --git a/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt b/html/lib/syntaxhighlighter/LGPL-LICENSE similarity index 97% rename from html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt rename to html/lib/syntaxhighlighter/LGPL-LICENSE index d74a432..3f9959f 100644 --- a/html/lib/syntaxhighlighter_2.1.364/LGPLv3.txt +++ b/html/lib/syntaxhighlighter/LGPL-LICENSE @@ -1,165 +1,165 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the Library. \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/MIT-LICENSE b/html/lib/syntaxhighlighter/MIT-LICENSE new file mode 100644 index 0000000..e7c70ba --- /dev/null +++ b/html/lib/syntaxhighlighter/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2003, 2004 Jim Weirich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/html/lib/syntaxhighlighter/compass/_theme_template.scss b/html/lib/syntaxhighlighter/compass/_theme_template.scss new file mode 100644 index 0000000..53f4df5 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/_theme_template.scss @@ -0,0 +1,120 @@ +$background: white !default; + +$line_alt1_background: $background !default; +$line_alt2_background: $background !default; + +$line_highlighted_background: #e0e0e0 !default; +$line_highlighted_number: black !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #6ce26c !default; +$gutter_border: 3px solid $gutter_border_color !default; + +$toolbar_collapsed_a: #00f !default; +$toolbar_collapsed_a_hover: #f00 !default; +$toolbar_collapsed_background: #fff !default; +$toolbar_collapsed_border: 1px solid $gutter_border_color !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #000 !default; +$toolbar_background: $gutter_border_color !default; +$toolbar_border: none !default; + +$code_plain: black !default; +$code_comments: #008200 !default; +$code_string: blue !default; +$code_keyword: #006699 !default; +$code_preprocessor: gray !default; +$code_variable: #aa7700 !default; +$code_value: #009900 !default; +$code_functions: #ff1493 !default; +$code_constants: #0066cc !default; +$code_script: $code_keyword !default; +$code_script_background: none !default; +$code_color1: gray !default; +$code_color2: #ff1493 !default; +$code_color3: red !default; + +$caption_color: $code_plain !default; + +// Interface elements. +.syntaxhighlighter { + background-color: $background !important; + + // Highlighed line number + .line { + &.alt1 { background-color: $line_alt1_background !important; } + &.alt2 { background-color: $line_alt2_background !important; } + + // Highlighed line + &.highlighted { + &.alt1, &.alt2 { background-color: $line_highlighted_background !important; } + &.number { color: $line_highlighted_number !important; } + } + } + + table { + caption { + color: $caption_color !important; + } + } + + // Add border to the lines + .gutter { + color: $gutter_text !important; + .line { + border-right: $gutter_border !important; + + &.highlighted { + background-color: $gutter_border_color !important; + color: $background !important; + } + } + } + + &.printing .line .content { border: none !important; } + + &.collapsed { + overflow: visible !important; + + .toolbar { + color: $toolbar_collapsed_a !important; + background: $toolbar_collapsed_background !important; + border: $toolbar_collapsed_border !important; + + a { + color: $toolbar_collapsed_a !important; + &:hover { color: $toolbar_collapsed_a_hover !important; } + } + } + } + + .toolbar { + color: $toolbar_a !important; + background: $toolbar_background !important; + border: $toolbar_border !important; + a { + color: $toolbar_a !important; + &:hover { color: $toolbar_a_hover !important; } + } + } + + // Actual syntax highlighter colors. + .plain, .plain a { color: $code_plain !important; } + .comments, .comments a { color: $code_comments !important; } + .string, .string a { color: $code_string !important; } + .keyword { color: $code_keyword !important; } + .preprocessor { color: $code_preprocessor !important; } + .variable { color: $code_variable !important; } + .value { color: $code_value !important; } + .functions { color: $code_functions !important; } + .constants { color: $code_constants !important; } + .script { + font-weight: bold !important; + color: $code_script !important; + background-color: $code_script_background !important; + } + .color1, .color1 a { color: $code_color1 !important; } + .color2, .color2 a { color: $code_color2 !important; } + .color3, .color3 a { color: $code_color3 !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/config.rb b/html/lib/syntaxhighlighter/compass/config.rb new file mode 100644 index 0000000..6f82de1 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/config.rb @@ -0,0 +1,14 @@ +environment = :production +project_type = :stand_alone +http_path = "/" +css_dir = "../styles" +sass_dir = "." +images_dir = "images" +sass_options = { + :line_numbers => false, + :debug_info => false +} + +# output_style = :compressed +# output_style = :compact +output_style = :expanded diff --git a/html/lib/syntaxhighlighter/compass/shCore.scss b/html/lib/syntaxhighlighter/compass/shCore.scss new file mode 100644 index 0000000..a67e4f9 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCore.scss @@ -0,0 +1,216 @@ +@mixin round_corners_custom($top, $right, $bottom, $left) { + -moz-border-radius: $top $right $bottom $left !important; + -webkit-border-radius: $top $right $bottom $left !important; +} + +@mixin round_corners($radius) { + @include round_corners_custom($radius, $radius, $radius, $radius); +} + +.syntaxhighlighter { + a, + div, + code, + table, + table td, + table tr, + table tbody, + table thead, + table caption, + textarea { + @include round_corners(0); + + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font: { + family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + weight: normal !important; + style: normal !important; + size: 1em !important; + } + min: { + // For IE8, FF & WebKit + height: inherit !important; + // For IE7 + height: auto !important; + } + } +} + +.syntaxhighlighter { + width: 100% !important; + margin: 1em 0 1em 0 !important; + + position: relative !important; + overflow: auto !important; + font-size: 1em !important; + + &.source { overflow: hidden !important; } + + // set up bold and italic + .bold { font-weight: bold !important; } + .italic { font-style: italic !important; } + + .line { white-space: pre !important; } + + // main table and columns + table { + width: 100% !important; + caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; + } + + td.code { + width: 100% !important; + + .container { + position: relative !important; + + textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; + } + } + } + + // middle spacing between line numbers and lines + td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; + } + + td.code .line { + padding: 0 1em !important; + } + } + + &.nogutter { + td.code { + .container textarea, .line { padding-left: 0em !important; } + } + } + + &.show { display: block !important; } + + // Adjust some properties when collapsed + &.collapsed { + table { display: none !important; } + + .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; + + span { + display: inline !important; + margin-right: 1em !important; + + a { + padding: 0 !important; + display: none !important; + &.expandSource { display: inline !important; } + } + } + } + } + + // Styles for the toolbar + .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; + + span.title { display: inline !important; } + + a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; + + &.expandSource { display: none !important; } + } + } + + &.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; + + .toolbar { + line-height: 8px !important; + a { + padding-top: 0px !important; + } + } + } + + // Print view. + // Colors are based on the default theme without background. + &.printing { + .line.alt1 .content, + .line.alt2 .content, + .line.highlighted .number, + .line.highlighted.alt1 .content, + .line.highlighted.alt2 .content { background: none !important; } + + // Gutter line numbers + .line { + .number { color: #bbbbbb !important; } + // Add border to the lines + .content { color: black !important; } + } + + // Toolbar when visible + .toolbar { display: none !important; } + a { text-decoration: none !important; } + .plain, .plain a { color: black !important; } + .comments, .comments a { color: #008200 !important; } + .string, .string a { color: blue !important; } + .keyword { + color: #006699 !important; + font-weight: bold !important; + } + .preprocessor { color: gray !important; } + .variable { color: #aa7700 !important; } + .value { color: #009900 !important; } + .functions { color: #ff1493 !important; } + .constants { color: #0066cc !important; } + .script { font-weight: bold !important; } + .color1, .color1 a { color: gray !important; } + .color2, .color2 a { color: #ff1493 !important; } + .color3, .color3 a { color: red !important; } + .break, .break a { color: black !important; } + } +} \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/compass/shCoreDefault.scss b/html/lib/syntaxhighlighter/compass/shCoreDefault.scss new file mode 100644 index 0000000..ff80c7f --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreDefault.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeDefault.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreDjango.scss b/html/lib/syntaxhighlighter/compass/shCoreDjango.scss new file mode 100644 index 0000000..ef572e9 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreDjango.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeDjango.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss b/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss new file mode 100644 index 0000000..9767f53 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreEclipse.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeEclipse.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss b/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss new file mode 100644 index 0000000..5e466f3 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreEmacs.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeEmacs.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss b/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss new file mode 100644 index 0000000..4628595 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreFadeToGrey.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeFadeToGrey.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss b/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss new file mode 100644 index 0000000..10ad4c5 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreMDUltra.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeMDUltra.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss b/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss new file mode 100644 index 0000000..e357eb2 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreMidnight.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeMidnight.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shCoreRDark.scss b/html/lib/syntaxhighlighter/compass/shCoreRDark.scss new file mode 100644 index 0000000..5c26da3 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shCoreRDark.scss @@ -0,0 +1,2 @@ +@import "shCore.scss"; +@import "shThemeRDark.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeDefault.scss b/html/lib/syntaxhighlighter/compass/shThemeDefault.scss new file mode 100644 index 0000000..1574dae --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeDefault.scss @@ -0,0 +1,7 @@ +// Default Syntax Highlighter theme. + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .keyword { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeDjango.scss b/html/lib/syntaxhighlighter/compass/shThemeDjango.scss new file mode 100644 index 0000000..8e95c56 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeDjango.scss @@ -0,0 +1,36 @@ +// Django SyntaxHighlighter theme + +$background: #0a2b1d !default; + +$line_highlighted_background: #233729 !default; +$line_highlighted_number: white !default; + +$gutter_text: #497958 !default; +$gutter_border_color: #41a83e !default; + +$toolbar_collapsed_a: #96dd3b !default; +$toolbar_collapsed_a_hover: #fff !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #ffe862 !default; + +$code_plain: #f8f8f8 !default; +$code_comments: #336442 !default; +$code_string: #9df39f !default; +$code_keyword: #96dd3b !default; +$code_preprocessor: #91bb9e !default; +$code_variable: #ffaa3e !default; +$code_value: #f7e741 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #eb939a !default; +$code_color2: #91bb9e !default; +$code_color3: #edef7d !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .comments { font-style: italic !important; } + .keyword { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss b/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss new file mode 100644 index 0000000..193fb1d --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeEclipse.scss @@ -0,0 +1,48 @@ +// Eclipse IDE SyntaxHighlighter color theme +// (C) Code-House +// :http//blog.code-house.org/2009/10/xml-i-adnotacje-kod-ogolnego-przeznaczenia-i-jpa/ + +$background: #fff !default; + +$line_highlighted_background: #c3defe !default; +$line_highlighted_number: #fff !default; + +$gutter_text: #787878 !default; +$gutter_border_color: #d4d0c8 !default; + +$toolbar_collapsed_a: #3f5fbf !default; +$toolbar_collapsed_a_hover: #aa7700 !default; +$toolbar_collapsed_background: #fff !default; + +$toolbar_a: #a0a0a0 !default; +$toolbar_a_hover: red !default; + +$code_plain: black !default; +$code_comments: #3f5fbf !default; +$code_string: #2a00ff !default; +$code_keyword: #7f0055 !default; +$code_preprocessor: #646464 !default; +$code_variable: #aa7700 !default; +$code_value: #009900 !default; +$code_functions: #ff1493 !default; +$code_constants: #0066cc !default; +$code_color1: gray !default; +$code_color2: #ff1493 !default; +$code_color3: red !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .keyword { font-weight: bold !important; } + + .xml { + .keyword { + color: #3f7f7f !important; + font-weight: normal !important; } + .color1, .color1 a { color: #7f007f !important; } + .string { + font-style: italic !important; + color: #2a00ff !important; + } + } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss b/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss new file mode 100644 index 0000000..11c9deb --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeEmacs.scss @@ -0,0 +1,32 @@ +// Emacs SyntaxHighlighter theme based on theme by Joshua Emmons +// http://www.skia.net/ + +$background: black !default; + +$line_highlighted_background: #2A3133 !default; +$line_highlighted_number: white !default; + +$gutter_text: #d3d3d3 !default; +$gutter_border_color: #990000 !default; + +$toolbar_collapsed_a: #ebdb8d !default; +$toolbar_collapsed_a_hover: #ff7d27 !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #9ccff4 !default; + +$code_plain: #d3d3d3 !default; +$code_comments: #ff7d27 !default; +$code_string: #ff9e7b !default; +$code_keyword: aqua !default; +$code_preprocessor: #aec4de !default; +$code_variable: #ffaa3e !default; +$code_value: #009900 !default; +$code_functions: #81cef9 !default; +$code_constants: #ff9e7b !default; +$code_color1: #ebdb8d !default; +$code_color2: #ff7d27 !default; +$code_color3: #aec4de !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss b/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss new file mode 100644 index 0000000..7963814 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeFadeToGrey.scss @@ -0,0 +1,36 @@ +// Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager +// :http//www.ibrasten.com/ + +$background: #121212 !default; + +$line_highlighted_background: #2C2C29 !default; +$line_highlighted_number: white !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #3185b9 !default; + +$toolbar_collapsed_a: #3185b9 !default; +$toolbar_collapsed_a_hover: #d01d33 !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #96daff !default; + +$code_plain: white !default; +$code_comments: #696854 !default; +$code_string: #e3e658 !default; +$code_keyword: #d01d33 !default; +$code_preprocessor: #435a5f !default; +$code_variable: #898989 !default; +$code_value: #009900 !default; +$code_functions: #aaaaaa !default; +$code_constants: #96daff !default; +$code_color1: #ffc074 !default; +$code_color2: #4a8cdb !default; +$code_color3: #96daff !default; + +@import "_theme_template.scss"; + +.syntaxhighlighter { + .functions { font-weight: bold !important; } +} diff --git a/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss b/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss new file mode 100644 index 0000000..0356fa6 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeMDUltra.scss @@ -0,0 +1,32 @@ +// MDUltra SyntaxHighlighter theme based on Midnight Theme +// http://www.mddev.co.uk/ + +$background: #222222 !default; + +$line_highlighted_background: #253e5a !default; +$line_highlighted_number: white !default; + +$gutter_text: #38566f !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #428bdd !default; +$toolbar_collapsed_a_hover: lime !default; +$toolbar_collapsed_background: black !default; + +$toolbar_a: #aaaaff !default; +$toolbar_a_hover: #9ccff4 !default; + +$code_plain: lime !default; +$code_comments: #428bdd !default; +$code_string: lime !default; +$code_keyword: #aaaaff !default; +$code_preprocessor: #8aa6c1 !default; +$code_variable: aqua !default; +$code_value: #f7e741 !default; +$code_functions: #ff8000 !default; +$code_constants: yellow !default; +$code_color1: red !default; +$code_color2: yellow !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss b/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss new file mode 100644 index 0000000..a4dae02 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeMidnight.scss @@ -0,0 +1,32 @@ +// Midnight SyntaxHighlighter theme based on theme by J.D. Myers +// http://webdesign.lsnjd.com/ + +$background: #0f192a !default; + +$line_highlighted_background: #253e5a !default; +$line_highlighted_number: #38566f !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #428bdd !default; +$toolbar_collapsed_a_hover: #1dc116 !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #D1EDFF !default; +$toolbar_a_hover: #8aa6c1 !default; + +$code_plain: #d1edff !default; +$code_comments: #428bdd !default; +$code_string: #1dc116 !default; +$code_keyword: #b43d3d !default; +$code_preprocessor: #8aa6c1 !default; +$code_variable: #ffaa3e !default; +$code_value: #f7e741 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #f8bb00 !default; +$code_color2: white !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/compass/shThemeRDark.scss b/html/lib/syntaxhighlighter/compass/shThemeRDark.scss new file mode 100644 index 0000000..3b67b15 --- /dev/null +++ b/html/lib/syntaxhighlighter/compass/shThemeRDark.scss @@ -0,0 +1,32 @@ +// RDark SyntaxHighlighter theme based on theme by Radu Dineiu +// http://www.vim.org/scripts/script.php?script_id=1732 + +$background: #1b2426 !default; + +$line_highlighted_background: #323E41 !default; +$line_highlighted_number: #b9bdb6 !default; + +$gutter_text: #afafaf !default; +$gutter_border_color: #435a5f !default; + +$toolbar_collapsed_a: #5ba1cf !default; +$toolbar_collapsed_a_hover: #5ce638 !default; +$toolbar_collapsed_background: #000 !default; + +$toolbar_a: #fff !default; +$toolbar_a_hover: #e0e8ff !default; + +$code_plain: #b9bdb6 !default; +$code_comments: #878a85 !default; +$code_string: #5ce638 !default; +$code_keyword: #5ba1cf !default; +$code_preprocessor: #435a5f !default; +$code_variable: #ffaa3e !default; +$code_value: #009900 !default; +$code_functions: #ffaa3e !default; +$code_constants: #e0e8ff !default; +$code_color1: #e0e8ff !default; +$code_color2: white !default; +$code_color3: #ffaa3e !default; + +@import "_theme_template.scss"; diff --git a/html/lib/syntaxhighlighter/index.html b/html/lib/syntaxhighlighter/index.html new file mode 100644 index 0000000..60908f4 --- /dev/null +++ b/html/lib/syntaxhighlighter/index.html @@ -0,0 +1,22 @@ + + + + + Hello SyntaxHighlighter + + + + + + + + +

Hello SyntaxHighlighter

+
+function helloSyntaxHighlighter()
+{
+	return "hi!";
+}
+
+ + diff --git a/html/lib/syntaxhighlighter/scripts/shAutoloader.js b/html/lib/syntaxhighlighter/scripts/shAutoloader.js new file mode 100644 index 0000000..4e29bdd --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shAutoloader.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g, + css: 'color2' }, + + { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, + css: 'keyword' }, + + { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals + css: 'keyword' }, + + { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g, + css: 'color3' }, + + { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, + css: 'color3' }, + + { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['applescript']; + + SyntaxHighlighter.brushes.AppleScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushBash.js b/html/lib/syntaxhighlighter/scripts/shBrushBash.js new file mode 100644 index 0000000..8c29696 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushBash.js @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le'; + var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + + 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + + 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + + 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + + 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + + 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + + 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + + 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + + 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + + 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + + 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + + 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + + 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + + 'vi watch wc whereis which who whoami Wget xargs yes' + ; + + this.regexList = [ + { regex: /^#!.*$/gm, css: 'preprocessor bold' }, + { regex: /\/[\w-\/]+/gm, css: 'plain' }, + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['bash', 'shell']; + + SyntaxHighlighter.brushes.Bash = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js b/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js new file mode 100644 index 0000000..079214e --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCSharp.js @@ -0,0 +1,65 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'abstract as base bool break byte case catch char checked class const ' + + 'continue decimal default delegate do double else enum event explicit ' + + 'extern false finally fixed float for foreach get goto if implicit in int ' + + 'interface internal is lock long namespace new null object operator out ' + + 'override params private protected public readonly ref return sbyte sealed set ' + + 'short sizeof stackalloc static string struct switch this throw true try ' + + 'typeof uint ulong unchecked unsafe ushort using virtual void while'; + + function fixComments(match, regexInfo) + { + var css = (match[0].indexOf("///") == 0) + ? 'color1' + : 'comments' + ; + + return [new SyntaxHighlighter.Match(match[0], match.index, css)]; + } + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword + { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' + { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['c#', 'c-sharp', 'csharp']; + + SyntaxHighlighter.brushes.CSharp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js b/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js new file mode 100644 index 0000000..627dbb9 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushColdFusion.js @@ -0,0 +1,100 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Jen + // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus + + var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + + 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + + 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + + 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + + 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + + 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + + 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + + 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + + 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + + 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + + 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + + 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + + 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + + 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + + 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + + 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + + 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + + 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + + 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + + 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + + 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + + 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + + 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + + 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + + 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + + 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + + 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + + 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + + 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + + 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + + 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + + 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + + 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + + 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + + 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + + 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + + 'XmlValidate Year YesNoFormat'; + + var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + + 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + + 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + + 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + + 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + + 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + + 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + + 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + + 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + + 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + + 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + + 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + + 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + + 'cfwindow cfxml cfzip cfzipparam'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['coldfusion','cf']; + + SyntaxHighlighter.brushes.ColdFusion = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCpp.js b/html/lib/syntaxhighlighter/scripts/shBrushCpp.js new file mode 100644 index 0000000..9f70d3a --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCpp.js @@ -0,0 +1,97 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Copyright 2006 Shin, YoungJin + + var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + + 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + + 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + + 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + + 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + + 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + + 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + + 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + + 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + + 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + + 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + + 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + + 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + + 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + + 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + + 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + + 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + + 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + + 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + + '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + + 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + + 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + + 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + + 'va_list wchar_t wctrans_t wctype_t wint_t signed'; + + var keywords = 'break case catch class const __finally __exception __try ' + + 'const_cast continue private public protected __declspec ' + + 'default delete deprecated dllexport dllimport do dynamic_cast ' + + 'else enum explicit extern if for friend goto inline ' + + 'mutable naked namespace new noinline noreturn nothrow ' + + 'register reinterpret_cast return selectany ' + + 'sizeof static static_cast struct switch template this ' + + 'thread throw true false try typedef typeid typename union ' + + 'using uuid virtual void volatile whcar_t while'; + + var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + + 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + + 'clock ctime difftime gmtime localtime mktime strftime time'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^ *#.*/gm, css: 'preprocessor' }, + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, + { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['cpp', 'c']; + + SyntaxHighlighter.brushes.Cpp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushCss.js b/html/lib/syntaxhighlighter/scripts/shBrushCss.js new file mode 100644 index 0000000..4297a9a --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushCss.js @@ -0,0 +1,91 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes + { regex: /!important/g, css: 'color3' }, // !important + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + + this.forHtmlScript({ + left: /(<|<)\s*style.*?(>|>)/gi, + right: /(<|<)\/\s*style\s*(>|>)/gi + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['css']; + + SyntaxHighlighter.brushes.CSS = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js b/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js new file mode 100644 index 0000000..e1060d4 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushDelphi.js @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + + 'case char class comp const constructor currency destructor div do double ' + + 'downto else end except exports extended false file finalization finally ' + + 'for function goto if implementation in inherited int64 initialization ' + + 'integer interface is label library longint longword mod nil not object ' + + 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + + 'pint64 pointer private procedure program property pshortstring pstring ' + + 'pvariant pwidechar pwidestring protected public published raise real real48 ' + + 'record repeat set shl shortint shortstring shr single smallint string then ' + + 'threadvar to true try type unit until uses val var varirnt while widechar ' + + 'widestring with word write writeln xor'; + + this.regexList = [ + { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) + { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags + { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['delphi', 'pascal', 'pas']; + + SyntaxHighlighter.brushes.Delphi = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushDiff.js b/html/lib/syntaxhighlighter/scripts/shBrushDiff.js new file mode 100644 index 0000000..e9b14fc --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushDiff.js @@ -0,0 +1,41 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + this.regexList = [ + { regex: /^\+\+\+.*$/gm, css: 'color2' }, + { regex: /^\-\-\-.*$/gm, css: 'color2' }, + { regex: /^\s.*$/gm, css: 'color1' }, + { regex: /^@@.*@@$/gm, css: 'variable' }, + { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, + { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['diff', 'patch']; + + SyntaxHighlighter.brushes.Diff = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushErlang.js b/html/lib/syntaxhighlighter/scripts/shBrushErlang.js new file mode 100644 index 0000000..6ba7d9d --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushErlang.js @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Jean-Lou Dupont + // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html + + // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 + var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ + 'case catch cond div end fun if let not of or orelse '+ + 'query receive rem try when xor'+ + // additional + ' module export import define'; + + this.regexList = [ + { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, + { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, + { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, + { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['erl', 'erlang']; + + SyntaxHighlighter.brushes.Erland = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js b/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js new file mode 100644 index 0000000..6ec5c18 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushGroovy.js @@ -0,0 +1,67 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Andres Almiray + // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter + + var keywords = 'as assert break case catch class continue def default do else extends finally ' + + 'if in implements import instanceof interface new package property return switch ' + + 'throw throws try while public protected private static'; + var types = 'void boolean byte char short int long float double'; + var constants = 'null'; + var methods = 'allProperties count get size '+ + 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + + 'findIndexOf grep inject max min reverseEach sort ' + + 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + + 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + + 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + + 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + + 'transformChar transformLine withOutputStream withPrintWriter withStream ' + + 'withStreams withWriter withWriterAppend write writeLine '+ + 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ + 'getText'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /""".*"""/g, css: 'string' }, // GStrings + { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword + { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type + { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['groovy']; + + SyntaxHighlighter.brushes.Groovy = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJScript.js b/html/lib/syntaxhighlighter/scripts/shBrushJScript.js new file mode 100644 index 0000000..ff98dab --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJScript.js @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'break case catch continue ' + + 'default delete do else false ' + + 'for function if in instanceof ' + + 'new null return super switch ' + + 'this throw true try typeof var while with' + ; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: r.singleLineCComments, css: 'comments' }, // one line comments + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(r.scriptScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['js', 'jscript', 'javascript']; + + SyntaxHighlighter.brushes.JScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJava.js b/html/lib/syntaxhighlighter/scripts/shBrushJava.js new file mode 100644 index 0000000..d692fd6 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJava.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'abstract assert boolean break byte case catch char class const ' + + 'continue default do double else enum extends ' + + 'false final finally float for goto if implements import ' + + 'instanceof int interface long native new null ' + + 'package private protected public return ' + + 'short static strictfp super switch synchronized this throw throws true ' + + 'transient try void volatile while'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments + { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno + { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword + ]; + + this.forHtmlScript({ + left : /(<|<)%[@!=]?/g, + right : /%(>|>)/g + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['java']; + + SyntaxHighlighter.brushes.Java = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js b/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js new file mode 100644 index 0000000..1a150a6 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushJavaFX.js @@ -0,0 +1,58 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Patrick Webster + // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html + var datatypes = 'Boolean Byte Character Double Duration ' + + 'Float Integer Long Number Short String Void' + ; + + var keywords = 'abstract after and as assert at before bind bound break catch class ' + + 'continue def delete else exclusive extends false finally first for from ' + + 'function if import in indexof init insert instanceof into inverse last ' + + 'lazy mixin mod nativearray new not null on or override package postinit ' + + 'protected public public-init public-read replace return reverse sizeof ' + + 'step super then this throw true try tween typeof var where while with ' + + 'attribute let private readonly static trigger' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['jfx', 'javafx']; + + SyntaxHighlighter.brushes.JavaFX = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js b/html/lib/syntaxhighlighter/scripts/shBrushObjC.js similarity index 99% rename from html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js rename to html/lib/syntaxhighlighter/scripts/shBrushObjC.js index a1e7fd1..d99555d 100644 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushObjC.js +++ b/html/lib/syntaxhighlighter/scripts/shBrushObjC.js @@ -56,3 +56,4 @@ SyntaxHighlighter.brushes.ObjC = function() SyntaxHighlighter.brushes.ObjC.prototype = new SyntaxHighlighter.Highlighter(); SyntaxHighlighter.brushes.ObjC.aliases = ['objc']; + diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPerl.js b/html/lib/syntaxhighlighter/scripts/shBrushPerl.js new file mode 100644 index 0000000..d94a2e0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPerl.js @@ -0,0 +1,72 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by David Simmons-Duffin and Marty Kube + + var funcs = + 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + + 'chroot close closedir connect cos crypt defined delete each endgrent ' + + 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + + 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + + 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + + 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + + 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + + 'getservbyname getservbyport getservent getsockname getsockopt glob ' + + 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + + 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + + 'oct open opendir ord pack pipe pop pos print printf prototype push ' + + 'quotemeta rand read readdir readline readlink readpipe recv rename ' + + 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + + 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + + 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + + 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + + 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + + 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + + 'undef unlink unpack unshift utime values vec wait waitpid warn write'; + + var keywords = + 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + + 'for foreach goto if import last local my next no our package redo ref ' + + 'require return sub tie tied unless untie until use wantarray while'; + + this.regexList = [ + { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, + { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['perl', 'Perl', 'pl']; + + SyntaxHighlighter.brushes.Perl = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPhp.js b/html/lib/syntaxhighlighter/scripts/shBrushPhp.js new file mode 100644 index 0000000..95e6e43 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPhp.js @@ -0,0 +1,88 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var funcs = 'abs acos acosh addcslashes addslashes ' + + 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ + 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ + 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ + 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ + 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ + 'array_push array_rand array_reduce array_reverse array_search array_shift '+ + 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ + 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ + 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ + 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ + 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ + 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ + 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ + 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ + 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ + 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ + 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ + 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ + 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ + 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ + 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ + 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ + 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ + 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ + 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ + 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ + 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ + 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ + 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ + 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ + 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ + 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ + 'strtoupper strtr strval substr substr_compare'; + + var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + + 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + + 'function include include_once global goto if implements interface instanceof namespace new ' + + 'old_function or private protected public return require require_once static switch ' + + 'throw try use var while xor '; + + var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions + { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['php']; + + SyntaxHighlighter.brushes.Php = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPlain.js b/html/lib/syntaxhighlighter/scripts/shBrushPlain.js new file mode 100644 index 0000000..9f7d9e9 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPlain.js @@ -0,0 +1,33 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['text', 'plain']; + + SyntaxHighlighter.brushes.Plain = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js b/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js new file mode 100644 index 0000000..0be1752 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPowerShell.js @@ -0,0 +1,74 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributes by B.v.Zanten, Getronics + // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro + + var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + + 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + + 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + + 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + + 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + + 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + + 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + + 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + + 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + + 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + + 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + + 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + + 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + + 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + + 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + + 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + + 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + + 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + + 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + + 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + + 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; + var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + + 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + + 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + + 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + + 'spps spsv sv tee cat cd cp h history kill lp ls ' + + 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + + 'erase rd ren type % \\?'; + + this.regexList = [ + { regex: /#.*$/gm, css: 'comments' }, // one line comments + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 + { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['powershell', 'ps']; + + SyntaxHighlighter.brushes.PowerShell = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushPython.js b/html/lib/syntaxhighlighter/scripts/shBrushPython.js new file mode 100644 index 0000000..ce77462 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushPython.js @@ -0,0 +1,64 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Gheorghe Milas and Ahmad Sherif + + var keywords = 'and assert break class continue def del elif else ' + + 'except exec finally for from global if import in is ' + + 'lambda not or pass print raise return try yield while'; + + var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + + 'chr classmethod cmp coerce compile complex delattr dict dir ' + + 'divmod enumerate eval execfile file filter float format frozenset ' + + 'getattr globals hasattr hash help hex id input int intern ' + + 'isinstance issubclass iter len list locals long map max min next ' + + 'object oct open ord pow print property range raw_input reduce ' + + 'reload repr reversed round set setattr slice sorted staticmethod ' + + 'str sum super tuple type type unichr unicode vars xrange zip'; + + var special = 'None True False self cls class_'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, + { regex: /^\s*@\w+/gm, css: 'decorator' }, + { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, + { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, + { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, + { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, + { regex: /\b\d+\.?\w*/g, css: 'value' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['py', 'python']; + + SyntaxHighlighter.brushes.Python = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushRuby.js b/html/lib/syntaxhighlighter/scripts/shBrushRuby.js new file mode 100644 index 0000000..ff82130 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushRuby.js @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Erik Peterson. + + var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + + 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + + 'self super then throw true undef unless until when while yield'; + + var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + + 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + + 'ThreadGroup Thread Time TrueClass'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants + { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols + { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; + + SyntaxHighlighter.brushes.Ruby = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushSass.js b/html/lib/syntaxhighlighter/scripts/shBrushSass.js new file mode 100644 index 0000000..aa04da0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushSass.js @@ -0,0 +1,94 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + var statements = '!important !default'; + var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: r.singleLineCComments, css: 'comments' }, // singleline comments + { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements + { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sass', 'scss']; + + SyntaxHighlighter.brushes.Sass = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushScala.js b/html/lib/syntaxhighlighter/scripts/shBrushScala.js new file mode 100644 index 0000000..4b0b6f0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushScala.js @@ -0,0 +1,51 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + // Contributed by Yegor Jbanov and David Bernard. + + var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + + 'override try lazy for var catch throw type extends class while with new final yield abstract ' + + 'else do if return protected private this package false'; + + var keyops = '[_:=><%#@]+'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['scala']; + + SyntaxHighlighter.brushes.Scala = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushSql.js b/html/lib/syntaxhighlighter/scripts/shBrushSql.js new file mode 100644 index 0000000..5c2cd88 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushSql.js @@ -0,0 +1,66 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + + 'current_user day isnull left lower month nullif replace right ' + + 'session_user space substring sum system_user upper user year'; + + var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + + 'binary bit by cascade char character check checkpoint close collate ' + + 'column commit committed connect connection constraint contains continue ' + + 'create cube current current_date current_time cursor database date ' + + 'deallocate dec decimal declare default delete desc distinct double drop ' + + 'dynamic else end end-exec escape except exec execute false fetch first ' + + 'float for force foreign forward free from full function global goto grant ' + + 'group grouping having hour ignore index inner insensitive insert instead ' + + 'int integer intersect into is isolation key last level load local max min ' + + 'minute modify move name national nchar next no numeric of off on only ' + + 'open option order out output partial password precision prepare primary ' + + 'prior privileges procedure public read real references relative repeatable ' + + 'restrict return returns revoke rollback rollup rows rule schema scroll ' + + 'second section select sequence serializable set size smallint static ' + + 'statistics table temp temporary then time timestamp to top transaction ' + + 'translation trigger true truncate uncommitted union unique update values ' + + 'varchar varying view when where with work'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sql']; + + SyntaxHighlighter.brushes.Sql = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/html/lib/syntaxhighlighter/scripts/shBrushVb.js b/html/lib/syntaxhighlighter/scripts/shBrushVb.js new file mode 100644 index 0000000..be845dc --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushVb.js @@ -0,0 +1,56 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + + 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + + 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + + 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + + 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + + 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + + 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + + 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + + 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + + 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + + 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + + 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + + 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + + 'Variant When While With WithEvents WriteOnly Xor'; + + this.regexList = [ + { regex: /'.*$/gm, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['vb', 'vbnet']; + + SyntaxHighlighter.brushes.Vb = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shBrushXml.js b/html/lib/syntaxhighlighter/scripts/shBrushXml.js new file mode 100644 index 0000000..69d9fd0 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shBrushXml.js @@ -0,0 +1,69 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + function process(match, regexInfo) + { + var constructor = SyntaxHighlighter.Match, + code = match[0], + tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), + result = [] + ; + + if (match.attributes != null) + { + var attributes, + regex = new XRegExp('(? [\\w:\\-\\.]+)' + + '\\s*=\\s*' + + '(? ".*?"|\'.*?\'|\\w+)', + 'xg'); + + while ((attributes = regex.exec(code)) != null) + { + result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); + result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); + } + } + + if (tag != null) + result.push( + new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') + ); + + return result; + } + + this.regexList = [ + { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // + { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; + + SyntaxHighlighter.brushes.Xml = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/html/lib/syntaxhighlighter/scripts/shCore.js b/html/lib/syntaxhighlighter/scripts/shCore.js new file mode 100644 index 0000000..b47b645 --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shCore.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) diff --git a/html/lib/syntaxhighlighter/scripts/shLegacy.js b/html/lib/syntaxhighlighter/scripts/shLegacy.js new file mode 100644 index 0000000..6d9fd4d --- /dev/null +++ b/html/lib/syntaxhighlighter/scripts/shLegacy.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?\\\\w+)\\\\]$","U"),i=1,p=0;p tags to the document body + for (i = 0; i < elements.length; i++) + { + var url = brushes[elements[i].params.brush]; + + if (!url) + continue; + + scripts[url] = false; + loadScript(url); + } + + function loadScript(url) + { + var script = document.createElement('script'), + done = false + ; + + script.src = url; + script.type = 'text/javascript'; + script.language = 'javascript'; + script.onload = script.onreadystatechange = function() + { + if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) + { + done = true; + scripts[url] = true; + checkAll(); + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + script.parentNode.removeChild(script); + } + }; + + // sync way of adding script tags to the page + document.body.appendChild(script); + }; + + function checkAll() + { + for(var url in scripts) + if (scripts[url] == false) + return; + + if (allCalled) + SyntaxHighlighter.highlight(allParams); + }; +}; + +})(); diff --git a/html/lib/syntaxhighlighter/src/shCore.js b/html/lib/syntaxhighlighter/src/shCore.js new file mode 100644 index 0000000..4214763 --- /dev/null +++ b/html/lib/syntaxhighlighter/src/shCore.js @@ -0,0 +1,1721 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +var SyntaxHighlighter = function() { + +// CommonJS +if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') +{ + XRegExp = require('XRegExp').XRegExp; +} + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... +var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** + * Pads line numbers. Possible values are: + * + * false - don't pad line numbers. + * true - automaticaly pad numbers with minimum required number of leading zeroes. + * [int] - length up to which pad line numbers. + */ + 'pad-line-numbers' : false, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Title to be displayed above the code block. */ + 'title' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Enables quick code copy and paste from double click. */ + 'quick-code' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : true, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false, + + 'html-script' : false + }, + + config : { + space : ' ', + + /** Enables use of tags. */ + scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } + }, + + toolbar: { + /** + * Generates HTML markup for the toolbar. + * @param {Highlighter} highlighter Highlighter instance. + * @return {String} Returns HTML markup. + */ + getHtml: function(highlighter) + { + var html = '
', + items = sh.toolbar.items, + list = items.list + ; + + function defaultGetHtml(highlighter, name) + { + return sh.toolbar.getButtonHtml(highlighter, name, sh.config.strings[name]); + }; + + for (var i = 0; i < list.length; i++) + html += (items[list[i]].getHtml || defaultGetHtml)(highlighter, list[i]); + + html += '
'; + + return html; + }, + + /** + * Generates HTML markup for a regular button in the toolbar. + * @param {Highlighter} highlighter Highlighter instance. + * @param {String} commandName Command name that would be executed. + * @param {String} label Label text to display. + * @return {String} Returns HTML markup. + */ + getButtonHtml: function(highlighter, commandName, label) + { + return '' + label + '' + ; + }, + + /** + * Event handler for a toolbar anchor. + */ + handler: function(e) + { + var target = e.target, + className = target.className || '' + ; + + function getValue(name) + { + var r = new RegExp(name + '_(\\w+)'), + match = r.exec(className) + ; + + return match ? match[1] : null; + }; + + var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id), + commandName = getValue('command') + ; + + // execute the toolbar command + if (highlighter && commandName) + sh.toolbar.items[commandName].execute(highlighter); + + // disable default A click behaviour + e.preventDefault(); + }, + + /** Collection of toolbar items. */ + items : { + // Ordered lis of items in the toolbar. Can't expect `for (var n in items)` to be consistent. + list: ['expandSource', 'help'], + + expandSource: { + getHtml: function(highlighter) + { + if (highlighter.getParam('collapse') != true) + return ''; + + var title = highlighter.getParam('title'); + return sh.toolbar.getButtonHtml(highlighter, 'expandSource', title ? title : sh.config.strings.expandSource); + }, + + execute: function(highlighter) + { + var div = getHighlighterDivById(highlighter.id); + removeClass(div, 'collapsed'); + } + }, + + /** Command to display the about dialog window. */ + help: { + execute: function(highlighter) + { + var wnd = popup('', '_blank', 500, 250, 'scrollbars=0'), + doc = wnd.document + ; + + doc.write(sh.config.strings.aboutDialog); + doc.close(); + wnd.focus(); + } + } + } + }, + + /** + * Finds all elements on the page which should be processes by SyntaxHighlighter. + * + * @param {Object} globalParams Optional parameters which override element's + * parameters. Only used if element is specified. + * + * @param {Object} element Optional element to highlight. If none is + * provided, all elements in the current document + * are returned which qualify. + * + * @return {Array} Returns list of { target: DOMElement, params: Object } objects. + */ + findElements: function(globalParams, element) + { + var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)), + conf = sh.config, + result = [] + ; + + // support for \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/brushes_tests.html b/html/lib/syntaxhighlighter/tests/brushes_tests.html new file mode 100644 index 0000000..e1e2068 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/brushes_tests.html @@ -0,0 +1,136 @@ + + + + + SyntaxHighlighter Brushes Tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/cases/001_basic.html b/html/lib/syntaxhighlighter/tests/cases/001_basic.html new file mode 100644 index 0000000..1d57334 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/001_basic.html @@ -0,0 +1,42 @@ +
+	/**
+	 * multiline comment 
+	 */
+	
+	text
+	
+	// single line comment
+	
+	text
+	
+	"string" text 'string' text "string"
+	"string with \" escape" text 'string with \' escape' text "string with \" escape"
+	
+	var code = '\
+		function helloWorld()\
+		{\
+			// this is great!\
+			for(var i = 0; i <= 1; i++)\
+				alert("yay");\
+		}\
+		';
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/002_brushes.html b/html/lib/syntaxhighlighter/tests/cases/002_brushes.html new file mode 100644 index 0000000..e9c64e2 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/002_brushes.html @@ -0,0 +1,50 @@ +
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
test
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html b/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html new file mode 100644 index 0000000..9b44292 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/003_script_tag.html @@ -0,0 +1,42 @@ +
+ +
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html b/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html new file mode 100644 index 0000000..d489a66 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/004_url_parsing.html @@ -0,0 +1,43 @@ +
+/**
+ * Please see <http://www.alexgorbatchev.come/?test=1&y=2>
+ */
+var home = "http://www.alexgorbatchev.come/?test=1&y=2;test/1/2/3;";
+// < http://www.gnu.org/licenses/?test=1&y=2 >.
+
+// Test embedded URLs that terminate at a left angle bracket.
+// See bug #28: http://bitbucket.org/alexg/syntaxhighlighter/issue/28/
+"http://www.example.com/song2.mp3";
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html b/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html new file mode 100644 index 0000000..6e6b1be --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/005_no_gutter.html @@ -0,0 +1,33 @@ +
+			public Image getImage(URL url, String name) {
+				try {
+					/*
+					   Regular multiline comment.
+					*/
+				    return getImage(new URL(url, name));
+				} catch (MalformedURLException e) {
+				    return null;
+				}
+			}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html b/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html new file mode 100644 index 0000000..8ebdd55 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/006_pad_line_numbers.html @@ -0,0 +1,39 @@ +
+/**
+ * Returns an Image object that can then be painted on the screen. 
+ * The url argument must specify an absolute {@link URL}. The name
+ * argument is a specifier that is relative to the url argument. 
+ *
+ * @param  url  an absolute URL giving the base location of the image
+ * @param  name the location of the image, relative to the url argument
+ * @return      the image at the specified URL
+ * @see         Image
+ */
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/007_collapse.html b/html/lib/syntaxhighlighter/tests/cases/007_collapse.html new file mode 100644 index 0000000..2643bb5 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/007_collapse.html @@ -0,0 +1,60 @@ +
+	/**
+	 * Returns an Image object that can then be painted on the screen. 
+	 * The url argument must specify an absolute {@link URL}. The name
+	 * argument is a specifier that is relative to the url argument. 
+	 *
+	 * @param  url  an absolute URL giving the base location of the image
+	 * @param  name the location of the image, relative to the url argument
+	 * @return      the image at the specified URL
+	 * @see         Image
+	 */
+
+ +
+	/**
+	 * Returns an Image object that can then be painted on the screen. 
+	 * The url argument must specify an absolute {@link URL}. The name
+	 * argument is a specifier that is relative to the url argument. 
+	 *
+	 * @param  url  an absolute URL giving the base location of the image
+	 * @param  name the location of the image, relative to the url argument
+	 * @return      the image at the specified URL
+	 * @see         Image
+	 */
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html b/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html new file mode 100644 index 0000000..ea72046 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/007_collapse_interaction.html @@ -0,0 +1,44 @@ + diff --git a/html/lib/syntaxhighlighter/tests/cases/008_first_line.html b/html/lib/syntaxhighlighter/tests/cases/008_first_line.html new file mode 100644 index 0000000..169dc38 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/008_first_line.html @@ -0,0 +1,29 @@ +
+	partial class Foo
+	{
+		function test()
+		{
+			yield return;
+		}
+	}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/009_class_name.html b/html/lib/syntaxhighlighter/tests/cases/009_class_name.html new file mode 100644 index 0000000..f2437d5 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/009_class_name.html @@ -0,0 +1,32 @@ +
+	public Image getImage(URL url, String name) {
+		try {
+			/*
+			   Regular multiline comment.
+			*/
+		    return getImage(new URL(url, name));
+		} catch (MalformedURLException e) {
+		    return null;
+		}
+	}
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/010_highlight.html b/html/lib/syntaxhighlighter/tests/cases/010_highlight.html new file mode 100644 index 0000000..64b6613 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/010_highlight.html @@ -0,0 +1,70 @@ +
+	public function validateStrongPassword(password:String):Boolean
+	{
+		if (password == null || password.length <= 0)
+		{
+			return false;
+		}
+		
+		return STRONG_PASSWORD_PATTERN.test(password);
+	}
+
+ + + diff --git a/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html b/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html new file mode 100644 index 0000000..d6d62fc --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/011_smart_tabs.html @@ -0,0 +1,98 @@ +
+	the		words	in		this	paragraph
+	should	look	like	they	are
+	evenly	spaced	between	columns
+
+ +
+	the	words	in	this	paragraph
+	should	look	like	they	are
+	evenly	spaced	between	columns
+
+ +
+	the		words	in		this	paragraph
+	should	look	out		of		whack
+	because	smart	tabs	are		disabled
+
+ + diff --git a/html/lib/syntaxhighlighter/tests/cases/012_server_side.html b/html/lib/syntaxhighlighter/tests/cases/012_server_side.html new file mode 100644 index 0000000..1bb4217 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/012_server_side.html @@ -0,0 +1,35 @@ + + +
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/013_html_script.html b/html/lib/syntaxhighlighter/tests/cases/013_html_script.html new file mode 100644 index 0000000..c0a1201 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/013_html_script.html @@ -0,0 +1,34 @@ +
+<hello>
+	<%
+		package free.cafekiwi.gotapi;
+	%>
+</hello>
+
+
+<%= print(); %>
+
+ + \ No newline at end of file diff --git a/html/lib/syntaxhighlighter/tests/cases/014_legacy.html b/html/lib/syntaxhighlighter/tests/cases/014_legacy.html new file mode 100644 index 0000000..eb4343e --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/cases/014_legacy.html @@ -0,0 +1,70 @@ +
basic check
+
no toolbar
+
no gutter
+
collapsed
+
first line
+ + diff --git a/html/lib/syntaxhighlighter/tests/commonjs_tests.js b/html/lib/syntaxhighlighter/tests/commonjs_tests.js new file mode 100644 index 0000000..cda8162 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/commonjs_tests.js @@ -0,0 +1,52 @@ +/** + * This is a CommonJS compatibility test. You can run this file with node. + */ +require.paths.unshift(__dirname + '/../scripts'); + +var sys = require('sys'), + shSyntaxHighlighter = require('shCore').SyntaxHighlighter, + code = 'test', + brushes = [ + 'AS3', + 'AppleScript', + 'Bash', + 'CSharp', + 'ColdFusion', + 'Cpp', + 'Css', + 'Delphi', + 'Diff', + 'Erlang', + 'Groovy', + 'JScript', + 'Java', + 'JavaFX', + 'Perl', + 'Php', + 'Plain', + 'PowerShell', + 'Python', + 'Ruby', + 'Sass', + 'Scala', + 'Sql', + 'Vb', + 'Xml' + ] + ; + +brushes.sort(); + +for (var i = 0; i < brushes.length; i++) +{ + var name = brushes[i], + brush = require('shBrush' + name).Brush + ; + + brush = new brush(); + brush.init({ toolbar: false }); + + var result = brush.getHtml(code); + + sys.puts(name + (result != null ? ': ok' : ': NOT OK')); +} diff --git a/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js b/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js new file mode 100644 index 0000000..e414a7e --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/js/jquery-1.4.2.js @@ -0,0 +1,6240 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function( window, undefined ) { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwnProperty = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + indexOf = Array.prototype.indexOf; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + if ( elem ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && /^\w+$/.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging object literal values or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { + var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src + : jQuery.isArray(copy) ? [] : {}; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // Handle when the DOM is ready + ready: function() { + // Make sure that the DOM is not already loaded + if ( !jQuery.isReady ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 13 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, i = 0; + while ( (fn = readyList[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Reset the list of functions + readyList = null; + } + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + return jQuery.ready(); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor + && !hasOwnProperty.call(obj, "constructor") + && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwnProperty.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") + .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + trim: function( text ) { + return (text || "").replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = []; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + if ( !inv !== !callback( elems[ i ], i ) ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch( error ) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +function evalScript( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } +} + +// Mutifunctional method to get and set values to a collection +// The value/s can be optionally by executed if its a function +function access( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; +} + +function now() { + return (new Date).getTime(); +} +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + now(); + + div.style.display = "none"; + div.innerHTML = "
a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, + + parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null, + + // Will be defined later + deleteExpando: true, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null + }; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ).style.display = 'none'; + + div = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; +var expando = "jQuery" + now(), uuid = 0, windowData = {}; + +jQuery.extend({ + cache: {}, + + expando:expando, + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + "object": true, + "applet": true + }, + + data: function( elem, name, data ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache; + + if ( !id && typeof name === "string" && data === undefined ) { + return null; + } + + // Compute a unique ID for the element + if ( !id ) { + id = ++uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + elem[ expando ] = id; + thisCache = cache[ id ] = jQuery.extend(true, {}, name); + + } else if ( !cache[ id ] ) { + elem[ expando ] = id; + cache[ id ] = {}; + } + + thisCache = cache[ id ]; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } + + // Completely remove the data cache + delete cache[ id ]; + } + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + if ( typeof key === "undefined" && this.length ) { + return jQuery.data( this[0] ); + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + } + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else { + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { + jQuery.data( this, key, value ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i, elem ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); +var rclass = /[\n\t]/g, + rspace = /\s+/, + rreturn = /\r/g, + rspecialurl = /href|src|style/, + rtype = /(button|input)/i, + rfocusable = /(button|input|object|select|textarea)/i, + rclickable = /^(a|area)$/i, + rradiocheck = /radio|checkbox/; + +jQuery.fn.extend({ + attr: function( name, value ) { + return access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", setClass = elem.className; + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split(rspace); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, i = 0, self = jQuery(this), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Typecast each time if the value is a Function and the appended + // value is therefore different each time. + if ( typeof val === "number" ) { + val += ""; + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // Only do all the following if this is a node (faster for style) + if ( elem.nodeType === 1 ) { + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + if ( name in elem && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + elem[ name ] = value; + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } + + // elem is actually elem.style ... set the style + // Using attr for specific style information is now deprecated. Use style instead. + return jQuery.style( elem, name, value ); + } +}); +var rnamespaces = /\.(.*)$/, + fcleanup = function( nm ) { + return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { + return "\\" + ch; + }); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events = elemData.events || {}, + eventHandle = elemData.handle, eventHandle; + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + handleObj.guid = handler.guid; + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( var j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( var j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[expando] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery.data( elem, "handle" ); + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var target = event.target, old, + isClick = jQuery.nodeName(target, "a") && type === "click", + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ type ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + type ]; + + if ( old ) { + target[ "on" + type ] = null; + } + + jQuery.event.triggered = true; + target[ type ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( old ) { + target[ "on" + type ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace, events; + + event = arguments[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + var events = jQuery.data(this, "events"), handlers = events[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, arguments ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, body = document.body; + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { + event.which = event.charCode || event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); + }, + + remove: function( handleObj ) { + var remove = true, + type = handleObj.origType.replace(rnamespaces, ""); + + jQuery.each( jQuery.data(this, "events").live || [], function() { + if ( type === this.origType.replace(rnamespaces, "") ) { + remove = false; + return false; + } + }); + + if ( remove ) { + jQuery.event.remove( this, handleObj.origType, liveHandler ); + } + } + + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( this.setInterval ) { + this.onbeforeunload = eventHandle; + } + + return false; + }, + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +var removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + elem.removeEventListener( type, handle, false ); + } : + function( elem, type, handle ) { + elem.detachEvent( "on" + type, handle ); + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = now(); + + // Mark it as fixed + this[ expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + } + // otherwise set the returnValue property of the original event to false (IE) + e.returnValue = false; + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var formElems = /textarea|input|select/i, + + changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information/focus[in] is not needed anymore + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return formElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return formElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.handle.call( this, e ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + context.each(function(){ + jQuery.event.add( this, liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + }); + + } else { + // unbind live handler + context.unbind( liveConvert( type, selector ), fn ); + } + } + + return this; + } +}); + +function liveHandler( event ) { + var stop, elems = [], selectors = [], args = arguments, + related, match, handleObj, elem, j, i, l, data, + events = jQuery.data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( match[i].selector === handleObj.selector ) { + elem = match[i].elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) { + stop = false; + break; + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( fn ) { + return fn ? this.bind( name, fn ) : this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + window.attachEvent("onunload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function(selector, context, results, seed) { + results = results || []; + var origContext = context = context || document; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + var ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } + + if ( context ) { + var ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + var cur = parts.pop(), pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); + } + } + } + } + + return results; +}; + +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; + +Sizzle.find = function(expr, context, isXML){ + var set, match; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && isXML(set[0]); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string"; + + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return /h\d/i.test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return /input|select|textarea|button/i.test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var i = 0, l = not.length; i < l; i++ ) { + if ( not[i] === elem ) { + return false; + } + } + + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + return true; + case 'nth': + var first = match[2], last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ + return "\\" + (num - 0 + 1); + })); +} + +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var i = 0, l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( var i = 0; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } + + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } + + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } + + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date).getTime(); + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; + + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + root = form = null; // release memory in IE +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } + + div = null; // release memory in IE +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

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

SyntaxHighlighter Highlight Lines Test

+

+
+

+
    + + + +
    +
    + + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/theme_tests.html b/html/lib/syntaxhighlighter/tests/theme_tests.html new file mode 100644 index 0000000..da07ecf --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/theme_tests.html @@ -0,0 +1,134 @@ + + + + + SyntaxHighlighter Theme Tests + + + + + +
    + + + + + + + + + diff --git a/html/lib/syntaxhighlighter/tests/webrick.rb b/html/lib/syntaxhighlighter/tests/webrick.rb new file mode 100755 index 0000000..0b3c93c --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/webrick.rb @@ -0,0 +1,11 @@ +require 'webrick' +include WEBrick + +s = HTTPServer.new( + :Port => 2010, + :DocumentRoot => Dir::pwd +) +s.mount('/sh/scripts', WEBrick::HTTPServlet::FileHandler, '../scripts') +s.mount('/sh/styles', WEBrick::HTTPServlet::FileHandler, '../styles') +trap('INT') { s.stop } +s.start diff --git a/html/lib/syntaxhighlighter/tests/webrick.sh b/html/lib/syntaxhighlighter/tests/webrick.sh new file mode 100755 index 0000000..7e249f8 --- /dev/null +++ b/html/lib/syntaxhighlighter/tests/webrick.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ruby webrick.rb diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf b/html/lib/syntaxhighlighter_2.1.364/scripts/clipboard.swf deleted file mode 100644 index 1b4d90a0fb838b38828bb2bb7f74c6629fd200c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1361 zcmV-X1+Mx-S5pZa2LJ$goPAY&Y!pQlpV_b3-TUm}^X0f<&rEX&Y!- zauV@_vU_)Py)ApUWp7*B8VsPJiAGFNK>4FKkPyQkC1}JT#u^DBO2jKc3GfG)m^Ofk zs3=N6oxQ8o3UM-$nL$E532LObqcsxE{WFsO3;V4dFe?0)> zgCA)Zu=dGSgza-j~MBmh1>=YHvhW zjM$S(8ar~Rn40d@ltH0g?^m$}uWf!Q!%kH< z#xP^(x+!Y95+m+Yab4_H3?+$4u(V@Vt}~XDzL_;iqL{^o zp&OJavdxwNF<%uW+>lhbv~>tJx&D)vV-^K@4-n>gIL}Cuo^)MK^j2@Q5=E@(E?&c#M%&R zN2~)uCxR{n-3aC(n2%rqf`tecA?Oi`AoGNKe;%BVkBlB`FLik`TjxQHxw+$uc$EF~c!W)_K#E)2;kuZ3;AC~kD(D%158!=faIH7g*#&hCJlDj!{@^#Oh z&YnA!snInzdhQjh`|(Qhx29Y7cdBDm2OEziuibn3#L~q}Ki^y5KlPSqKlipTm^gFf zNMdBlx9#e9;OyPW9qD~{$8PeEH?Qm5Q+2lM%JJZp!X>x%IyQ5xfRV{0N=) diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js deleted file mode 100644 index 985a3e8..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushAS3.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.AS3 = function() -{ - // Created by Peter Atoria @ http://iAtoria.com - - var inits = 'class interface function package'; - - var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + - 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + - 'extends false final finally flash_proxy for get if implements import in include Infinity ' + - 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + - 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + - 'return set static String super switch this throw true try typeof uint undefined unescape ' + - 'use void while with' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable - { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); -}; - -SyntaxHighlighter.brushes.AS3.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.AS3.aliases = ['actionscript3', 'as3']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js deleted file mode 100644 index f94b951..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushBash.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Bash = function() -{ - var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le'; - var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + - 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + - 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + - 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + - 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + - 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + - 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + - 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + - 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + - 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + - 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + - 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + - 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + - 'vi watch wc whereis which who whoami Wget xargs yes' - ; - - this.findMatches = function(regexList, code) - { - code = code.replace(/>/g, '>').replace(/</g, '<'); - this.code = code; - return SyntaxHighlighter.Highlighter.prototype.findMatches.apply(this, [regexList, code]); - }; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands - ]; -} - -SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js deleted file mode 100644 index 60b5be5..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCSharp.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.CSharp = function() -{ - var keywords = 'abstract as base bool break byte case catch char checked class const ' + - 'continue decimal default delegate do double else enum event explicit ' + - 'extern false finally fixed float for foreach get goto if implicit in int ' + - 'interface internal is lock long namespace new null object operator out ' + - 'override params private protected public readonly ref return sbyte sealed set ' + - 'short sizeof stackalloc static string struct switch this throw true try ' + - 'typeof uint ulong unchecked unsafe ushort using virtual void while'; - - function fixComments(match, regexInfo) - { - var css = (match[0].indexOf("///") == 0) - ? 'color1' - : 'comments' - ; - - return [new SyntaxHighlighter.Match(match[0], match.index, css)]; - } - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword - { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' - { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; - diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js deleted file mode 100644 index 57de521..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushColdFusion.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.ColdFusion = function() -{ - // Contributed by Jen - // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus - - var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + - 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + - 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + - 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + - 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + - 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + - 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + - 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + - 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + - 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + - 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + - 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + - 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + - 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + - 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + - 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + - 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + - 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + - 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + - 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + - 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + - 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + - 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + - 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + - 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + - 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + - 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + - 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + - 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + - 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + - 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + - 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + - 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + - 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + - 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + - 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + - 'XmlValidate Year YesNoFormat'; - - var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + - 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + - 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + - 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + - 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + - 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + - 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + - 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + - 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + - 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + - 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + - 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + - 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + - 'cfwindow cfxml cfzip cfzipparam'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -} - -SyntaxHighlighter.brushes.ColdFusion.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.ColdFusion.aliases = ['coldfusion','cf']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js deleted file mode 100644 index c80c1cb..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCpp.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Cpp = function() -{ - // Copyright 2006 Shin, YoungJin - - var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + - 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + - 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + - 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + - 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + - 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + - 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + - 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + - 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + - 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + - 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + - 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + - 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + - 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + - 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + - 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + - 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + - 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + - 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + - '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + - 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + - 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + - 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + - 'va_list wchar_t wctrans_t wctype_t wint_t signed'; - - var keywords = 'break case catch class const __finally __exception __try ' + - 'const_cast continue private public protected __declspec ' + - 'default delete deprecated dllexport dllimport do dynamic_cast ' + - 'else enum explicit extern if for friend goto inline ' + - 'mutable naked namespace new noinline noreturn nothrow ' + - 'register reinterpret_cast return selectany ' + - 'sizeof static static_cast struct switch template this ' + - 'thread throw true false try typedef typeid typename union ' + - 'using uuid virtual void volatile whcar_t while'; - - var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + - 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + - 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + - 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + - 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + - 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + - 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + - 'fwrite getc getchar gets perror printf putc putchar puts remove ' + - 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + - 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + - 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + - 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + - 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + - 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + - 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + - 'clock ctime difftime gmtime localtime mktime strftime time'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^ *#.*/gm, css: 'preprocessor' }, - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, - { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } - ]; -}; - -SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js deleted file mode 100644 index a431ec2..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushCss.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.CSS = function() -{ - function getKeywordsCSS(str) - { - return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; - }; - - function getValuesCSS(str) - { - return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; - }; - - var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + - 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + - 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + - 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + - 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + - 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + - 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + - 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + - 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + - 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + - 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + - 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + - 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + - 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; - - var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ - 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ - 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ - 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ - 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ - 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ - 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ - 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ - 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ - 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ - 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ - 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ - 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ - 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; - - var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors - { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes - { regex: /!important/g, css: 'color3' }, // !important - { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values - { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts - ]; - - this.forHtmlScript({ - left: /(<|<)\s*style.*?(>|>)/gi, - right: /(<|<)\/\s*style\s*(>|>)/gi - }); -}; - -SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.CSS.aliases = ['css']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js deleted file mode 100644 index 4487765..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDelphi.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Delphi = function() -{ - var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + - 'case char class comp const constructor currency destructor div do double ' + - 'downto else end except exports extended false file finalization finally ' + - 'for function goto if implementation in inherited int64 initialization ' + - 'integer interface is label library longint longword mod nil not object ' + - 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + - 'pint64 pointer private procedure program property pshortstring pstring ' + - 'pvariant pwidechar pwidestring protected public published raise real real48 ' + - 'record repeat set shl shortint shortstring shr single smallint string then ' + - 'threadvar to true try type unit until uses val var varirnt while widechar ' + - 'widestring with word write writeln xor'; - - this.regexList = [ - { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) - { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags - { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -}; - -SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js deleted file mode 100644 index 4cf667a..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushDiff.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Diff = function() -{ - this.regexList = [ - { regex: /^\+\+\+.*$/gm, css: 'color2' }, - { regex: /^\-\-\-.*$/gm, css: 'color2' }, - { regex: /^\s.*$/gm, css: 'color1' }, - { regex: /^@@.*@@$/gm, css: 'variable' }, - { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, - { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } - ]; -}; - -SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js deleted file mode 100644 index e040592..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushErlang.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Erlang = function() -{ - // Contributed by Jean-Lou Dupont - // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html - - // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 - var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ - 'case catch cond div end fun if let not of or orelse '+ - 'query receive rem try when xor'+ - // additional - ' module export import define'; - - this.regexList = [ - { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, - { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, - { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, - { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; -}; - -SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js deleted file mode 100644 index 4872777..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushGroovy.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Groovy = function() -{ - // Contributed by Andres Almiray - // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter - - var keywords = 'as assert break case catch class continue def default do else extends finally ' + - 'if in implements import instanceof interface new package property return switch ' + - 'throw throws try while public protected private static'; - var types = 'void boolean byte char short int long float double'; - var constants = 'null'; - var methods = 'allProperties count get size '+ - 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + - 'findIndexOf grep inject max min reverseEach sort ' + - 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + - 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + - 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + - 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + - 'transformChar transformLine withOutputStream withPrintWriter withStream ' + - 'withStreams withWriter withWriterAppend write writeLine '+ - 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ - 'getText'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /""".*"""/g, css: 'string' }, // GStrings - { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword - { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type - { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -} - -SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Groovy.aliases = ['groovy']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js deleted file mode 100644 index fdb7398..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJScript.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.JScript = function() -{ - var keywords = 'break case catch continue ' + - 'default delete do else false ' + - 'for function if in instanceof ' + - 'new null return super switch ' + - 'this throw true try typeof var while with' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); -}; - -SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js deleted file mode 100644 index 810049b..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJava.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Java = function() -{ - var keywords = 'abstract assert boolean break byte case catch char class const ' + - 'continue default do double else enum extends ' + - 'false final finally float for goto if implements import ' + - 'instanceof int interface long native new null ' + - 'package private protected public return ' + - 'short static strictfp super switch synchronized this throw throws true ' + - 'transient try void volatile while'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments - { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno - { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword - ]; - - this.forHtmlScript({ - left : /(<|<)%[@!=]?/g, - right : /%(>|>)/g - }); -}; - -SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Java.aliases = ['java']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js deleted file mode 100644 index e22c2ec..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushJavaFX.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.JavaFX = function() -{ - // Contributed by Patrick Webster - // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html - var datatypes = 'Boolean Byte Character Double Duration ' - + 'Float Integer Long Number Short String Void' - ; - - var keywords = 'abstract after and as assert at before bind bound break catch class ' - + 'continue def delete else exclusive extends false finally first for from ' - + 'function if import in indexof init insert instanceof into inverse last ' - + 'lazy mixin mod nativearray new not null on or override package postinit ' - + 'protected public public-init public-read replace return reverse sizeof ' - + 'step super then this throw true try tween typeof var where while with ' - + 'attribute let private readonly static trigger' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js deleted file mode 100644 index 6858508..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPerl.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Perl = function() -{ - // Contributed by David Simmons-Duffin and Marty Kube - - var funcs = - 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + - 'chroot close closedir connect cos crypt defined delete each endgrent ' + - 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + - 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + - 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + - 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + - 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + - 'getservbyname getservbyport getservent getsockname getsockopt glob ' + - 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + - 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + - 'oct open opendir ord pack pipe pop pos print printf prototype push ' + - 'quotemeta rand read readdir readline readlink readpipe recv rename ' + - 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + - 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + - 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + - 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + - 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + - 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + - 'undef unlink unpack unshift utime values vec wait waitpid warn write'; - - var keywords = - 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + - 'for foreach goto if import last local my next no our package redo ref ' + - 'require return sub tie tied unless untie until use wantarray while'; - - this.regexList = [ - { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, - { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); -} - -SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl']; \ No newline at end of file diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js deleted file mode 100644 index 51f69fb..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPhp.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Php = function() -{ - var funcs = 'abs acos acosh addcslashes addslashes ' + - 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ - 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ - 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ - 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ - 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ - 'array_push array_rand array_reduce array_reverse array_search array_shift '+ - 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ - 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ - 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ - 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ - 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ - 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ - 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ - 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ - 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ - 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ - 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ - 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ - 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ - 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ - 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ - 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ - 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ - 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ - 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ - 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ - 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ - 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+ - 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ - 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ - 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ - 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ - 'strtoupper strtr strval substr substr_compare'; - - var keywords = 'and or xor array as break case ' + - 'cfunction class const continue declare default die do else ' + - 'elseif enddeclare endfor endforeach endif endswitch endwhile ' + - 'extends for foreach function include include_once global if ' + - 'new old_function return static switch use require require_once ' + - 'var while abstract interface public implements extends private protected throw'; - - var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\$\w+/g, css: 'variable' }, // variables - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions - { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); -}; - -SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Php.aliases = ['php']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js deleted file mode 100644 index 74562e1..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPlain.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Plain = function() -{ -}; - -SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js deleted file mode 100644 index 9cce267..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPowerShell.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.PowerShell = function() -{ - // Contributes by B.v.Zanten, Getronics - // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro - - var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + - 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + - 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + - 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + - 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + - 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + - 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + - 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + - 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + - 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + - 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + - 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + - 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + - 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + - 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + - 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + - 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + - 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + - 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + - 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + - 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; - var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + - 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + - 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + - 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + - 'spps spsv sv tee cat cd cp h history kill lp ls ' + - 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + - 'erase rd ren type % \\?'; - - this.regexList = [ - { regex: /#.*$/gm, css: 'comments' }, // one line comments - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 - { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } - ]; -}; - -SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js deleted file mode 100644 index eb1077e..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushPython.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Python = function() -{ - // Contributed by Gheorghe Milas and Ahmad Sherif - - var keywords = 'and assert break class continue def del elif else ' + - 'except exec finally for from global if import in is ' + - 'lambda not or pass print raise return try yield while'; - - var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + - 'chr classmethod cmp coerce compile complex delattr dict dir ' + - 'divmod enumerate eval execfile file filter float format frozenset ' + - 'getattr globals hasattr hash help hex id input int intern ' + - 'isinstance issubclass iter len list locals long map max min next ' + - 'object oct open ord pow print property range raw_input reduce ' + - 'reload repr reversed round set setattr slice sorted staticmethod ' + - 'str sum super tuple type type unichr unicode vars xrange zip'; - - var special = 'None True False self cls class_'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, - { regex: /^\s*@\w+/gm, css: 'decorator' }, - { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, - { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, - { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, - { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, - { regex: /\b\d+\.?\w*/g, css: 'value' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Python.aliases = ['py', 'python']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js deleted file mode 100644 index 6cf0b73..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushRuby.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Ruby = function() -{ - // Contributed by Erik Peterson. - - var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + - 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + - 'self super then throw true undef unless until when while yield'; - - var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + - 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + - 'ThreadGroup Thread Time TrueClass'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants - { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols - { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror', 'rb']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js deleted file mode 100644 index 6e595f7..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushScala.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Scala = function() -{ - // Contributed by Yegor Jbanov and David Bernard. - - var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + - 'override try lazy for var catch throw type extends class while with new final yield abstract ' + - 'else do if return protected private this package false'; - - var keyops = '[_:=><%#@]+'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword - ]; -} - -SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Scala.aliases = ['scala']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js deleted file mode 100644 index 0fe121c..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushSql.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Sql = function() -{ - var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + - 'current_user day isnull left lower month nullif replace right ' + - 'session_user space substring sum system_user upper user year'; - - var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + - 'binary bit by cascade char character check checkpoint close collate ' + - 'column commit committed connect connection constraint contains continue ' + - 'create cube current current_date current_time cursor database date ' + - 'deallocate dec decimal declare default delete desc distinct double drop ' + - 'dynamic else end end-exec escape except exec execute false fetch first ' + - 'float for force foreign forward free from full function global goto grant ' + - 'group grouping having hour ignore index inner insensitive insert instead ' + - 'int integer intersect into is isolation key last level load local max min ' + - 'minute modify move name national nchar next no numeric of off on only ' + - 'open option order out output partial password precision prepare primary ' + - 'prior privileges procedure public read real references relative repeatable ' + - 'restrict return returns revoke rollback rollup rows rule schema scroll ' + - 'second section select sequence serializable set size smallint static ' + - 'statistics table temp temporary then time timestamp to top transaction ' + - 'translation trigger true truncate uncommitted union unique update values ' + - 'varchar varying view when where with work'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; -}; - -SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Sql.aliases = ['sql']; - diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js deleted file mode 100644 index bded9dd..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushVb.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Vb = function() -{ - var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + - 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + - 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + - 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + - 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + - 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + - 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + - 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + - 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + - 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + - 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + - 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + - 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + - 'Variant When While With WithEvents WriteOnly Xor'; - - this.regexList = [ - { regex: /'.*$/gm, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); -}; - -SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js deleted file mode 100644 index 23fb7e4..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shBrushXml.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -SyntaxHighlighter.brushes.Xml = function() -{ - function process(match, regexInfo) - { - var constructor = SyntaxHighlighter.Match, - code = match[0], - tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), - result = [] - ; - - if (match.attributes != null) - { - var attributes, - regex = new XRegExp('(? [\\w:\\-\\.]+)' + - '\\s*=\\s*' + - '(? ".*?"|\'.*?\'|\\w+)', - 'xg'); - - while ((attributes = regex.exec(code)) != null) - { - result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); - result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); - } - } - - if (tag != null) - result.push( - new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') - ); - - return result; - } - - this.regexList = [ - { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // - { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } - ]; -}; - -SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); -SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html']; diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js deleted file mode 100644 index 938c48b..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shCore.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('c(!1q.2X){h 2X=l(){h p={6b:{"1s-R":"","84-2y":1,"83-2y-7W":I,"1I":v,"8d-89":I,"1H-2Q":4,"3g":I,"1w":I,"66":N,"8k-8l":I,"88":N,"5h-1p":I,"1L-1l":N},M:{4T:I,69:v,5l:16,5k:16,8B:N,8f:N,8s:"54",1f:{5q:"53 1g",5d:"9N 1g",5i:"9O 6q 6p",78:"9M C 9L 1V 9I 6p 9J",3t:"3t",6C:"?",1A:"2X\\n\\n",6T:"9K\'t 9P 2O D: ",7x:"9Q 9W\'t 9X D 1L-1l 9V: ",77:"<1L 9t=\\"2s://5x.6x.6B/9s/9x\\"><6z><9y 2s-9E=\\"9F-9D\\" 63=\\"1X/1L; 9C=9z-8\\" /><3i>9A 2X<33 1m=\\"39-9Y:9Z,an,ao,am-al;ai-3f:#aj;3f:#ak;39-2Q:ap;1X-6G:6u;\\">2X6O 2.1.ag (a5 15 6h)2s://6I.3ka3 a0 a1 f 1l, a2 8R 6q 8Q 8O 8W!8V C 8U 8X.8K 8N-6h 8M 8S."},8u:N},1r:{4Z:v,9o:v,3m:v,6f:{}},2d:{},8h:{9g:/\\/\\*[\\s\\S]*?\\*\\//3b,9d:/\\/\\/.*$/3b,9e:/#.*$/3b,9j:/"([^\\\\"\\n]|\\\\.)*"/g,9n:/\'([^\\\\\'\\n]|\\\\.)*\'/g,9m:/"([^\\\\"]|\\\\.)*"/g,8Y:/\'([^\\\\\']|\\\\.)*\'/g,9k:/(&X;|<)!--[\\s\\S]*?--(&Z;|>)/3b,43:/&X;\\w+:\\/\\/[\\w-.\\/?%&=@:;]*&Z;|\\w+:\\/\\/[\\w-.\\/?%&=@:;]*/g,9c:{G:/(&X;|<)\\?=?/g,1d:/\\?(&Z;|>)/g},93:{G:/(&X;|<)%=?/g,1d:/%(&Z;|>)/g},92:{G:/(&X;|<)\\s*1l.*?(&Z;|>)/4e,1d:/(&X;|<)\\/\\s*1l\\s*(&Z;|>)/4e}},1w:{1c:l(3O){h 3T=Q.22("3Y"),5s=p.1w.7d;3T.L="1w";D(h 30 1V 5s){h 6i=5s[30],5t=W 6i(3O),1Y=5t.1c();3O.6g[30]=5t;c(1Y==v){1J}c(7X(1Y)=="91"){1Y=p.1w.6m(1Y,3O.1k,30)}1Y.L+="5v "+30;3T.2p(1Y)}q 3T},6m:l(5L,7j,5K){h a=Q.22("a"),5N=a.1m,5D=p.M,5M=5D.5l,5J=5D.5k;a.27="#"+5K;a.3i=5L;a.5j=7j;a.76=5K;a.1Q=5L;c(40(5M)==N){5N.26=5M+"75"}c(40(5J)==N){5N.2e=5J+"75"}a.9l=l(e){97{p.1w.6M(f,e||1q.6Y,f.5j,f.76)}98(e){p.B.1A(e.6n)}q N};q a},6M:l(7i,7g,7b,7h,7f){h 5G=p.1r.6f[7b],5H;c(5G==v||(5H=5G.6g[7h])==v){q v}q 5H.2z(7i,7g,7f)},7d:{5q:l(5b){f.1c=l(){c(5b.V("66")!=I){q}q p.M.1f.5q};f.2z=l(5c,8T,8P){h A=5b.A;5c.7y.4p(5c);A.L=A.L.E("5O","")}},5d:l(6R){f.1c=l(){q p.M.1f.5d};f.2z=l(b1,bU,bV){h 3J=p.B.3d(6R.5g).E(/"+3J+"");2A.Q.4o()}},5i:l(64){h 3C,c2,6a=64.1k;f.1c=l(){h 2V=p.M;c(2V.69==v){q v}l 1E(56){h 5m="";D(h 5f 1V 56){5m+=""}q 5m};l 2i(5n){h 5p="";D(h 5o 1V 5n){5p+=" "+5o+"=\'"+5n[5o]+"\'"}q 5p};h 67={26:2V.5l,2e:2V.5k,1k:6a+"bY",4r:"bZ/x-71-6V",3i:p.M.1f.5i},5V={bE:"ay",bD:"bC",bA:"5j="+6a,c4:"N"},5U=2V.69,3x;c(/bG/i.1R(6K.7k)){3x="<4h"+2i({bH:"bM:bN-bL-bK-bI-bJ",c3:"2s://ck.cj.3k/cm/71/c9/6V/c8.c7#6O=9,0,0,0"})+2i(67)+">"+1E(5V)+1E({c6:5U})+""}F{3x=""}3C=Q.22("A");3C.1Q=3x;q 3C};f.2z=l(cf,ce,62){h 7c=62.cd;6U(7c){2K"7q":h 61=p.B.2T(p.B.3d(64.5g).E(/&X;/g,"<").E(/&Z;/g,">").E(/&aT;/g,"&"));c(1q.74){1q.74.aU("1X",61)}F{q p.B.2T(61)}2K"aR":p.B.1A(p.M.1f.78);2h;2K"aP":p.B.1A(62.6n);2h}}},aV:l(65){f.1c=l(){q p.M.1f.3t};f.2z=l(aW,bz,b0){h 1Z=Q.22("aZ"),1N=v;c(p.1r.3m!=v){Q.33.4p(p.1r.3m)}p.1r.3m=1Z;1Z.1m.aX="aY:aO;26:6r;2e:6r;G:-6j;4w:-6j;";Q.33.2p(1Z);1N=1Z.5Q.Q;6J(1N,1q.Q);1N.3D(""+65.A.1Q+"");1N.4o();1Z.5Q.4F();1Z.5Q.3t();l 6J(6N,6E){h 2I=6E.4O("4n");D(h i=0;i<2I.u;i++){c(2I[i].6y.6P()=="6A"&&/aE\\.1a$/.1R(2I[i].27)){6N.3D("<4n 4r=\\"1X/1a\\" 6y=\\"6A\\" 27=\\""+2I[i].27+"\\">")}}}}},az:l(aA){f.1c=l(){q p.M.1f.6C};f.2z=l(aF,aG){h 2A=p.B.4z("","4k",aM,aK,"7a=0"),1N=2A.Q;1N.3D(p.M.1f.77);1N.4o();2A.4F()}}}},B:{Y:l(49,73,3y){3y=3e.aH(3y||0,0);D(h i=3y;i<49.u;i++){c(49[i]==73){q i}}q-1},6d:l(72){q 72+3e.aI(3e.b2()*b3).2u()},6c:l(51,4L){h 3h={},1W;D(1W 1V 51){3h[1W]=51[1W]}D(1W 1V 4L){3h[1W]=4L[1W]}q 3h},80:l(4J){6U(4J){2K"I":q I;2K"N":q N}q 4J},4z:l(43,6W,4B,4H,2N){h x=(6X.26-4B)/2,y=(6X.2e-4H)/2;2N+=", G="+x+", 4w="+y+", 26="+4B+", 2e="+4H;2N=2N.E(/^,/,"");h 4E=1q.bk(43,6W,2N);4E.4F();q 4E},7C:l(1G,1T,1U){c(1G.6Z){1G["e"+1T+1U]=1U;1G[1T+1U]=l(){1G["e"+1T+1U](1q.6Y)};1G.6Z("bw"+1T,1G[1T+1U])}F{1G.bv(1T,1U,N)}},1A:l(z){1A(p.M.1f.1A+z)},4u:l(4N,6Q){h 2r=p.1r.4Z,3V=v;c(2r==v){2r={};D(h 2L 1V p.2d){h 42=p.2d[2L].bu;c(42==v){1J}p.2d[2L].R=2L.6P();D(h i=0;i<42.u;i++){2r[42[i]]=2L}}p.1r.4Z=2r}3V=p.2d[2r[4N]];c(3V==v&&6Q!=N){p.B.1A(p.M.1f.6T+4N)}q 3V},46:l(z,6S){h 2E=z.1P("\\n");D(h i=0;i<2E.u;i++){2E[i]=6S(2E[i])}q 2E.5A("\\n")},8C:l(z){q z.E(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},8H:l(z){h 3X,45={},4P=W U("^\\\\[(?<4c>(.*?))\\\\]$"),7e=W U("(?[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<24>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");2j((3X=7e.T(z))!=v){h 2f=3X.24.E(/^[\'"]|[\'"]$/g,"");c(2f!=v&&4P.1R(2f)){h m=4P.T(2f);2f=m.4c.u>0?m.4c.1P(/\\s*,\\s*/):[]}45[3X.R]=2f}q 45},7K:l(z,1a){c(z==v||z.u==0||z=="\\n"){q z}z=z.E(/"+2l+""})}q z},7V:l(6l,6o){h 32=6l.2u();2j(32.u<6o){32="0"+32}q 32},6k:l(){h 3w=Q.22("A"),3B,3o=0,44=Q.33,1k=p.B.6d("6k"),36="",4U="";3w.1Q=36+"6e\\">"+36+"1p\\">"+36+"2y\\">"+36+"63"+"\\"><4G 1s=\\"b5\\"><4G 1k=\\""+1k+"\\">&2B;"+4U+4U+2Y+2Y+2Y+2Y;44.2p(3w);3B=Q.bb(1k);c(/bg/i.1R(6K.7k)){h 6v=1q.be(3B,v);3o=85(6v.bc("26"))}F{3o=3B.bd}44.4p(3w);q 3o},8b:l(79,6s){h 1H="";D(h i=0;i<6s;i++){1H+=" "}q 79.E(/\\t/g,1H)},8a:l(2Z,4f){h bF=2Z.1P("\\n"),1H="\\t",4d="";D(h i=0;i<50;i++){4d+=" "}l 8x(3s,18,8A){q 3s.29(0,18)+4d.29(0,8A)+3s.29(18+1,3s.u)};2Z=p.B.46(2Z,l(20){c(20.Y(1H)==-1){q 20}h 18=0;2j((18=20.Y(1H))!=-1){h 8w=4f-18%4f;20=8x(20,18,8w)}q 20});q 2Z},3d:l(z){h br=/|&X;br\\s*\\/?&Z;/4e;c(p.M.8B==I){z=z.E(br,"\\n")}c(p.M.8f==I){z=z.E(br,"")}q z},2G:l(z){q z.E(/^\\s+|\\s+$/g,"")},2T:l(z){h 21=p.B.3d(z).1P("\\n"),bf=W bh(),8D=/^\\s*/,2a=ba;D(h i=0;i<21.u&&2a>0;i++){h 4x=21[i];c(p.B.2G(4x).u==0){1J}h 4I=8D.T(4x);c(4I==v){q z}2a=3e.2a(4I[0].u,2a)}c(2a>0){D(h i=0;i<21.u;i++){21[i]=21[i].29(2a)}}q 21.5A("\\n")},82:l(35,31){c(35.H<31.H){q-1}F{c(35.H>31.H){q 1}F{c(35.u<31.u){q-1}F{c(35.u>31.u){q 1}}}}q 0},2D:l(8q,34){l 8n(4D,8r){q[W p.4v(4D[0],4D.H,8r.1a)]};h b4=0,4s=v,3L=[],8p=34.4X?34.4X:8n;2j((4s=34.3K.T(8q))!=v){3L=3L.2t(8p(4s,34))}q 3L},8m:l(8o){h X="&X;",Z="&Z;";q 8o.E(p.8h.43,l(m){h 4j="",47="";c(m.Y(X)==0){47=X;m=m.3U(X.u)}c(m.Y(Z)==m.u-Z.u){m=m.3U(0,m.u-Z.u);4j=Z}q 47+""+m+""+4j})},8v:l(){h 3N=Q.4O("1l"),4i=[];D(h i=0;i<3N.u;i++){c(3N[i].4r=="6e"){4i.K(3N[i])}}q 4i},8I:l(4b){h 4q="",1v=p.B.2G(4b),3R=N;c(1v.Y(4q)==0){1v=1v.3U(4q.u);3R=I}c(1v.Y(3S)==1v.u-3S.u){1v=1v.3U(0,1v.u-3S.u);3R=I}q 3R?1v:4b}},1I:l(8E,4R){l 8e(4g){h 4Q=[];D(h i=0;i<4g.u;i++){4Q.K(4g[i])}q 4Q};h 2q=4R?[4R]:8e(Q.4O(p.M.8s)),8J="1Q",2k=v,4S=p.M;c(4S.4T){2q=2q.2t(p.B.8v())}c(2q.u===0){q}D(h i=0;i<2q.u;i++){h 2M=2q[i],28=p.B.8H(2M.L),1D,2W,25;28=p.B.6c(8E,28);1D=28["2O"];c(1D==v){1J}c(28["1L-1l"]=="I"||p.6b["1L-1l"]==I){2k=W p.4a(1D);1D="b9"}F{h 3P=p.B.4u(1D);c(3P){1D=3P.R;2k=W 3P()}F{1J}}2W=2M[8J];c(4S.4T){2W=p.B.8I(2W)}28["2O-R"]=1D;2k.1I(2W,28);25=2k.A;c(p.M.8u){25=Q.22("bj");25.24=2k.A.1Q;25.1m.26="bt";25.1m.2e="bx"}2M.7y.bs(25,2M)}},bq:l(7H){p.B.7C(1q,"bl",l(){p.1I(7H)})}};p.4v=l(4A,7G,1a){f.24=4A;f.H=7G;f.u=4A.u;f.1a=1a;f.5Y=v};p.4v.14.2u=l(){q f.24};p.4a=l(4K){h 3z=p.B.4u(4K),2g,4W=W p.2d.bm(),bn=v;c(3z==v){q}2g=W 3z();f.4m=4W;c(2g.3I==v){p.B.1A(p.M.1f.7x+4K);q}4W.59.K({3K:2g.3I.C,4X:7p});l 3A(4Y,7w){D(h j=0;j<4Y.u;j++){4Y[j].H+=7w}};l 7p(19,bp){h 7n=19.C,1o=[],4M=2g.59,7l=19.H+19.G.u,2U=2g.3I,1n;D(h i=0;i<4M.u;i++){1n=p.B.2D(7n,4M[i]);3A(1n,7l);1o=1o.2t(1n)}c(2U.G!=v&&19.G!=v){1n=p.B.2D(19.G,2U.G);3A(1n,19.H);1o=1o.2t(1n)}c(2U.1d!=v&&19.1d!=v){1n=p.B.2D(19.1d,2U.1d);3A(1n,19.H+19[0].bo(19.1d));1o=1o.2t(1n)}D(h j=0;j<1o.u;j++){1o[j].5Y=3z.R}q 1o}};p.4a.14.1I=l(7t,7s){f.4m.1I(7t,7s);f.A=f.4m.A};p.7I=l(){};p.7I.14={V:l(7J,7Z){h 4l=f.1E[7J];q p.B.80(4l==v?7Z:4l)},1c:l(7Y){q Q.22(7Y)},8i:l(2F,81){h 3u=[];c(2F!=v){D(h i=0;i<2F.u;i++){c(7X(2F[i])=="4h"){3u=3u.2t(p.B.2D(81,2F[i]))}}}q 3u.aB(p.B.82)},86:l(){h 23=f.2C;D(h i=0;i<23.u;i++){c(23[i]===v){1J}h 2x=23[i],4V=2x.H+2x.u;D(h j=i+1;j<23.u&&23[i]!==v;j++){h 1S=23[j];c(1S===v){1J}F{c(1S.H>4V){2h}F{c(1S.H==2x.H&&1S.u>2x.u){f.2C[i]=v}F{c(1S.H>=2x.H&&1S.H<4V){f.2C[j]=v}}}}}}},8t:l(2H){h 3r=2H.1P(/\\n/g),3n=85(f.V("84-2y")),2v=f.V("83-2y-7W"),7N=f.V("1I",[]),7U=f.V("3g");2H="";c(2v==I){2v=(3n+3r.u-1).2u().u}F{c(40(2v)==I){2v=0}}D(h i=0;i<3r.u;i++){h 1x=3r[i],60=/^(&2B;|\\s)+/.T(1x),52="aN"+(i%2==0?1:2),7F=p.B.7V(3n+i,2v),7P=p.B.Y(7N,(3n+i).2u())!=-1,2S=v;c(60!=v){2S=60[0].2u();1x=1x.29(2S.u)}1x=p.B.2G(1x);c(1x.u==0){1x="&2B;"}c(7P){52+=" aQ"}2H+=""+"<7L>"+"<7T>"+(7U?"<3F 1s=\\"aS\\">"+7F+"":"")+"<3F 1s=\\"63\\">"+(2S!=v?""+2S.E(" ","&2B;")+"":"")+1x+""+""+""+""}q 2H},8y:l(5X,5T){h 18=0,3c="",3a=p.B.7K,5S=f.V("2O-R","");l 5W(5Z){h 5R=5Z?(5Z.5Y||5S):5S;q 5R?5R+" ":""};D(h i=0;i<5T.u;i++){h 1y=5T[i],3G;c(1y===v||1y.u===0){1J}3G=5W(1y);3c+=3a(5X.29(18,1y.H-18),3G+"7O")+3a(1y.24,3G+1y.1a);18=1y.H+1y.u}3c+=3a(5X.29(18),5W()+"7O");q 3c},1I:l(C,7E){h cb=p.M,1r=p.1r,A,ci,3Z,ch="cn";f.1E={};f.A=v;f.1p=v;f.C=v;f.1i=v;f.6g={};f.1k=p.B.6d("cl");1r.6f[f.1k]=f;c(C===v){C=""}f.1E=p.B.6c(p.6b,7E||{});c(f.V("88")==I){f.1E.1w=f.1E.3g=N}f.A=A=f.1c("3Y");f.1p=f.1c("3Y");f.1p.L="1p";L="6e";A.1k=f.1k;c(f.V("66")){L+=" 5O"}c(f.V("3g")==N){L+=" bB"}c(f.V("5h-1p")==N){f.1p.L+=" bO-5h"}L+=" "+f.V("1s-R");L+=" "+f.V("2O-R");A.L=L;f.5g=C;f.C=p.B.8C(C).E(/\\r/g," ");3Z=f.V("1H-2Q");f.C=f.V("8d-89")==I?p.B.8a(f.C,3Z):p.B.8b(f.C,3Z);f.C=p.B.2T(f.C);c(f.V("1w")){f.1i=f.1c("3Y");f.1i.L="1i";f.1i.2p(p.1w.1c(f));A.2p(f.1i);h 1i=f.1i;l 58(){1i.L=1i.L.E("53","")};A.c0=l(){58();1i.L+=" 53"};A.bX=l(){58()}}A.2p(f.1p);f.2C=f.8i(f.59,f.C);f.86();C=f.8y(f.C,f.2C);C=f.8t(p.B.2G(C));c(f.V("8k-8l")){C=p.B.8m(C)}f.1p.1Q=C},9f:l(z){z=z.E(/^\\s+|\\s+$/g,"").E(/\\s+/g,"|");q"\\\\b(?:"+z+")\\\\b"},9i:l(2J){f.3I={G:{3K:2J.G,1a:"1l"},1d:{3K:2J.1d,1a:"1l"},C:W U("(?"+2J.G.1g+")"+"(?.*?)"+"(?<1d>"+2J.1d.1g+")","96")}}};q p}()}c(!1q.U){(l(){h 2w={T:10.14.T,87:5I.14.87,E:5I.14.E,1P:5I.14.1P},1F={13:/(?:[^\\\\([#\\s.]+|\\\\(?!k<[\\w$]+>|[7z]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[7z]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,99:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,37:/^(?:\\s+|#.*)+/,5B:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7Q:/&&\\[\\^?/g,7S:/]/g},7o=l(5C,5v,5u){D(h i=5u||0;i<5C.u;i++){c(5C[i]===5v){q i}}q-1},8G=/()??/.T("")[1]!==3j,3q={};U=l(1e,1O){c(1e 68 10){c(1O!==3j){3H 7r("4y\'t 4C 9a 8z 95 7u 10 5u 94")}q 1e.3E()}h 1O=1O||"",7R=1O.Y("s")>-1,7M=1O.Y("x")>-1,5z=N,3v=[],1b=[],13=1F.13,J,cc,38,3M,3p;13.O=0;2j(J=2w.T.2n(13,1e)){c(J[2]){c(!1F.5B.1R(1e.17(13.O))){1b.K("(?:)")}}F{c(J[1]){3v.K(J[3]||v);c(J[3]){5z=I}1b.K("(")}F{c(J[4]){3M=7o(3v,J[4]);1b.K(3M>-1?"\\\\"+(3M+1)+(40(1e.5w(13.O))?"":"(?:)"):J[0])}F{c(J[5]){1b.K(3q.7m?3q.7m.7q(J[5],J[0].5w(1)==="P"):J[0])}F{c(J[6]){c(1e.5w(13.O)==="]"){1b.K(J[6]==="["?"(?!)":"[\\\\S\\\\s]");13.O++}F{cc=U.8g("&&"+1e.17(J.H),1F.7Q,1F.7S,"",{7D:"\\\\"})[0];1b.K(J[6]+cc+"]");13.O+=cc.u+1}}F{c(J[7]){c(7R&&J[7]==="."){1b.K("[\\\\S\\\\s]")}F{c(7M&&1F.37.1R(J[7])){38=2w.T.2n(1F.37,1e.17(13.O-1))[0].u;c(!1F.5B.1R(1e.17(13.O-1+38))){1b.K("(?:)")}13.O+=38-1}F{1b.K(J[7])}}}F{1b.K(J[0])}}}}}}}3p=10(1b.5A(""),2w.E.2n(1O,/[9B]+/g,""));3p.1C={1g:1e,2m:5z?3v:v};q 3p};U.9q=l(R,o){3q[R]=o};10.14.T=l(z){h 1h=2w.T.2n(f,z),R,i,5y;c(1h){c(8G&&1h.u>1){5y=W 10("^"+f.1g+"$(?!\\\\s)",f.5E());2w.E.2n(1h[0],5y,l(){D(i=1;i<8j.u-2;i++){c(8j[i]===3j){1h[i]=3j}}})}c(f.1C&&f.1C.2m){D(i=1;i<1h.u;i++){R=f.1C.2m[i-1];c(R){1h[R]=1h[i]}}}c(f.3l&&f.O>(1h.H+1h[0].u)){f.O--}}q 1h}})()}10.14.5E=l(){q(f.3l?"g":"")+(f.av?"i":"")+(f.8F?"m":"")+(f.37?"x":"")+(f.a4?"y":"")};10.14.3E=l(7A){h 5F=W U(f.1g,(7A||"")+f.5E());c(f.1C){5F.1C={1g:f.1C.1g,2m:f.1C.2m?f.1C.2m.17(0):v}}q 5F};10.14.2n=l(90,z){q f.T(z)};10.14.9b=l(9h,8c){q f.T(8c[0])};U.5P=l(57,5e){h 55="/"+57+"/"+(5e||"");q U.5P[55]||(U.5P[55]=W U(57,5e))};U.41=l(z){q z.E(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};U.8g=l(z,G,11,1j,2R){h 2R=2R||{},2P=2R.7D,12=2R.c5,1j=1j||"",5r=1j.Y("g")>-1,70=1j.Y("i")>-1,7v=1j.Y("m")>-1,5a=1j.Y("y")>-1,1j=1j.E(/y/g,""),G=G 68 10?(G.3l?G:G.3E("g")):W U(G,"g"+1j),11=11 68 10?(11.3l?11:11.3E("g")):W U(11,"g"+1j),1M=[],2o=0,1u=0,1t=0,1z=0,2b,2c,1B,1K,3Q,48;c(2P){c(2P.u>1){3H aC("4y\'t 4C aL aJ 7u 41 7B")}c(7v){3H 7r("4y\'t 4C 41 7B 8z bi b8 8F b7")}3Q=U.41(2P);48=W 10("^(?:"+3Q+"[\\\\S\\\\s]|(?:(?!"+G.1g+"|"+11.1g+")[^"+3Q+"])+)+",70?"i":"")}2j(I){G.O=11.O=1t+(2P?(48.T(z.17(1t))||[""])[0].u:0);1B=G.T(z);1K=11.T(z);c(1B&&1K){c(1B.H<=1K.H){1K=v}F{1B=v}}c(1B||1K){1u=(1B||1K).H;1t=(1B?G:11).O}F{c(!2o){2h}}c(5a&&!2o&&1u>1z){2h}c(1B){c(!2o++){2b=1u;2c=1t}}F{c(1K&&2o){c(!--2o){c(12){c(12[0]&&2b>1z){1M.K([12[0],z.17(1z,2b),1z,2b])}c(12[1]){1M.K([12[1],z.17(2b,2c),2b,2c])}c(12[2]){1M.K([12[2],z.17(2c,1u),2c,1u])}c(12[3]){1M.K([12[3],z.17(1u,1t),1u,1t])}}F{1M.K(z.17(2c,1u))}1z=1t;c(!5r){2h}}}F{G.O=11.O=0;3H bP("8L aq 9r ar 8Z")}}c(1u===1t){1t++}}c(5r&&!5a&&12&&12[0]&&z.u>1z){1M.K([12[0],z.17(1z),1z,z.u])}G.O=11.O=0;q 1M};',62,768,'||||||||||||if|||this||var||||function||||sh|return||||length|null||||str|div|utils|code|for|replace|else|left|index|true|_121|push|className|config|false|lastIndex||document|name||exec|XRegExp|getParam|new|lt|indexOf|gt|RegExp|_139|vN|part|prototype|||slice|pos|_d3|css|_11f|create|right|_119|strings|source|_129|bar|_13a|id|script|style|_da|_d6|lines|window|vars|class|_145|_144|_b5|toolbar|_f4|_103|_146|alert|_149|_x|_c3|params|lib|obj|tab|highlight|continue|_14a|html|_142|doc|_11a|split|innerHTML|test|_ec|_5a|_5b|in|_4f|text|_8|_3c|_91|_98|createElement|_e7|value|_c5|width|href|_c2|substr|min|_147|_148|brushes|height|_6e|_cd|break|attributes|while|_be|_75|captureNames|call|_143|appendChild|_bc|_5f|http|concat|toString|_f0|real|_e9|line|execute|wnd|nbsp|matches|getMatches|_66|_e3|trim|_ed|_40|_10f|case|_61|_c1|_55|brush|_13c|size|_13b|_f9|unindent|_d9|_28|_c4|SyntaxHighlighter|_81|_88|_5|m2|_7a|body|_a2|m1|_80|extended|len|font|_fe|gm|_fd|fixInputString|Math|color|gutter|_4e|title|undefined|com|global|printFrame|_ef|_7d|_125|_118|_ee|_8e|print|_e5|_11e|_7b|_32|_49|_cc|offsetMatches|_7c|_25|write|addFlags|td|_104|throw|htmlScript|_22|regex|_a7|_124|_af|_2|_c6|_14b|_b6|_b4|_3|substring|_60|_76|_6a|DIV|_10b|isNaN|escape|_62|url|_7e|_6b|eachLine|_ae|esc|_47|HtmlScript|_b2|values|_8c|gi|_89|_b9|object|_b0|_ad|_blank|_e1|xmlBrush|link|close|removeChild|_b3|type|_a6|_73|findBrush|Match|top|_9d|can|popup|_c8|_53|supply|_a3|win|focus|span|_54|_9e|_50|_cb|_4d|_d7|_5d|getElementsByTagName|_6c|_ba|_b8|_bf|useScriptTags|_82|_ea|_ce|func|_d0|discoveredBrushes||_4c|_f6|show|pre|key|_29|_133|hide|regexList|_141|_19|_1a|viewSource|_134|_2b|originalCode|wrap|copyToClipboard|highlighterId|toolbarItemHeight|toolbarItemWidth|_2a|_2c|_2e|_2d|expandSource|_13e|_4|_7|from|item|charAt|www|r2|_11d|join|quantifier|_113|_e|getNativeFlags|_12e|_17|_18|String|_10|_b|_9|_f|_d|collapsed|cache|contentWindow|_101|_ff|_fb|swf|_30|getBrushNameCss|_fa|brushName|_100|_f5|_37|_35|content|_24|_38|collapse|_2f|instanceof|clipboardSwf|_27|defaults|merge|guid|syntaxhighlighter|highlighters|toolbarCommands|2009|_6|500px|measureSpace|_78|createButton|message|_79|clipboard|to|0px|_85|decoration|center|_83|margin|w3|rel|head|stylesheet|org|help|xhtml1|_3f|0099FF|align|DTD|alexgorbatchev|copyStyles|navigator|none|executeCommand|_3e|version|toLowerCase|_5e|_1e|_65|noBrush|switch|flash|_52|screen|event|attachEvent|_13f|shockwave|_4b|_48|clipboardData|px|commandName|aboutDialog|copyToClipboardConfirmation|_84|scrollbars|_14|_36|items|_6d|_16|_13|_15|_12|_a|userAgent|_d8|unicode|_d5|_112|process|get|TypeError|_de|_dd|one|_140|_d1|brushNotHtmlScript|parentNode|pP|_12d|character|addEvent|escapeChar|_106|_f7|_c9|_c7|Highlighter|_df|decorate|table|_11c|_f1|plain|_f8|classLeft|_11b|classRight|tr|_f2|padNumber|numbers|typeof|_e2|_e0|toBoolean|_e4|matchesSortCallback|pad|first|parseInt|removeNestedMatches|match|light|tabs|processSmartTabs|processTabs|args|smart|toArray|stripBrs|matchRecursive|regexLib|findMatches|arguments|auto|links|processUrls|defaultAdd|_a9|_a8|_a1|_a4|tagName|createDisplayLines|debug|getSyntaxHighlighterScriptTags|_93|insertSpaces|processMatches|when|_90|bloggerMode|trimFirstAndLastLines|_9a|_b7|multiline|_117|parseParams|stripCData|_bd|Copyright|subject|Alex|2004|development|_1c|keep|donate|Gorbatchev|_1b|syntax|JavaScript|active|highlighter|multiLineSingleQuotedString|delimiters|_12f|string|scriptScriptTags|aspScriptTags|another|constructing|sgi|try|catch|replaceVar|flags|apply|phpScriptTags|singleLineCComments|singleLinePerlComments|getKeywords|multiLineCComments|_131|forHtmlScript|doubleQuotedString|xmlComments|onclick|multiLineDoubleQuotedString|singleQuotedString|spaceWidth|bottom|addPlugin|contains|1999|xmlns|dtd|TR|transitional|xhtml|meta|utf|About|sx|charset|Type|equiv|Content|EN|Transitional|your|now|Can|is|The|view|copy|find|Brush|PUBLIC|W3C|XHTML|DOCTYPE|option|wasn|configured|family|Geneva|you|like|please|If|sticky|October|target|https|paypal|_s|xclick|hosted_button_id|cmd|webscr|cgi|bin|364|4em|background|fff|000|serif|sans|Arial|Helvetica|1em|data|unbalanced|75em|large|xx|ignoreCase|3em|2930402|always|about|_42|sort|SyntaxError|printing|shCore|_43|_44|max|round|than|250|more|500|alt|absolute|error|highlighted|ok|number|amp|setData|printSource|_39|cssText|position|IFRAME|_3b|_1f|random|1000000|_a5|block|CDATA|flag|the|htmlscript|1000|getElementById|getPropertyValue|offsetWidth|getComputedStyle|_99|opera|Array|using|textarea|open|load|Xml|_cf|lastIndexOf|_d4|all||replaceChild|70em|aliases|addEventListener|on|30em|spaces|_3a|flashVars|nogutter|transparent|wmode|allowScriptAccess|_8a|msie|classid|96b8|444553540000|11cf|ae6d|clsid|d27cdb6e|no|Error|location|resizable|400|750|_20|_21|menubar|onmouseout|_clipboard|application|onmouseover|param|_26|codebase|menu|valueNames|movie|cab|swflash|cabs|embed|conf||command|_34|_33|src|_10c|_10a|macromedia|download|highlighter_|pub|important'.split('|'),0,{})) diff --git a/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js b/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js deleted file mode 100644 index 126b9ee..0000000 --- a/html/lib/syntaxhighlighter_2.1.364/scripts/shLegacy.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/ - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate - * - * @version - * 2.1.364 (October 15 2009) - * - * @copyright - * Copyright (C) 2004-2009 Alex Gorbatchev. - * - * @license - * This file is part of SyntaxHighlighter. - * - * SyntaxHighlighter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * SyntaxHighlighter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with SyntaxHighlighter. If not, see . - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 y={d:{}};y.d={F:6(S,l,q,k,m,n){6 J(z,Y){1 V=16 15("^"+Y+"\\\\[(?\\\\w+)\\\\]$","14"),x=2;h(1 i=0;i. - */ -// -// Begin anonymous function. This is used to contain local scope variables without polutting global scope. -// -if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { - -// Shortcut object which will be assigned to the SyntaxHighlighter variable. -// This is a shorthand for local reference in order to avoid long namespace -// references to SyntaxHighlighter.whatever... -var sh = { - defaults : { - /** Additional CSS class names to be added to highlighter elements. */ - 'class-name' : '', - - /** First line number. */ - 'first-line' : 1, - - /** - * Pads line numbers. Possible values are: - * - * false - don't pad line numbers. - * true - automaticaly pad numbers with minimum required number of leading zeroes. - * [int] - length up to which pad line numbers. - */ - 'pad-line-numbers' : true, - - /** Lines to highlight. */ - 'highlight' : null, - - /** Enables or disables smart tabs. */ - 'smart-tabs' : true, - - /** Gets or sets tab size. */ - 'tab-size' : 4, - - /** Enables or disables gutter. */ - 'gutter' : true, - - /** Enables or disables toolbar. */ - 'toolbar' : true, - - /** Forces code view to be collapsed. */ - 'collapse' : false, - - /** Enables or disables automatic links. */ - 'auto-links' : true, - - /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ - 'light' : false, - - /** Enables or disables automatic line wrapping. */ - 'wrap-lines' : true, - - 'html-script' : false - }, - - config : { - /** Enables use of tags. */ - scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } - }, - - toolbar : { - /** - * Creates new toolbar for a highlighter. - * @param {Highlighter} highlighter Target highlighter. - */ - create : function(highlighter) - { - var div = document.createElement('DIV'), - items = sh.toolbar.items - ; - - div.className = 'toolbar'; - - for (var name in items) - { - var constructor = items[name], - command = new constructor(highlighter), - element = command.create() - ; - - highlighter.toolbarCommands[name] = command; - - if (element == null) - continue; - - if (typeof(element) == 'string') - element = sh.toolbar.createButton(element, highlighter.id, name); - - element.className += 'item ' + name; - div.appendChild(element); - } - - return div; - }, - - /** - * Create a standard anchor button for the toolbar. - * @param {String} label Label text to display. - * @param {String} highlighterId Highlighter ID that this button would belong to. - * @param {String} commandName Command name that would be executed. - * @return {Element} Returns an 'A' element. - */ - createButton : function(label, highlighterId, commandName) - { - var a = document.createElement('a'), - style = a.style, - config = sh.config, - width = config.toolbarItemWidth, - height = config.toolbarItemHeight - ; - - a.href = '#' + commandName; - a.title = label; - a.highlighterId = highlighterId; - a.commandName = commandName; - a.innerHTML = label; - - if (isNaN(width) == false) - style.width = width + 'px'; - - if (isNaN(height) == false) - style.height = height + 'px'; - - a.onclick = function(e) - { - try - { - sh.toolbar.executeCommand( - this, - e || window.event, - this.highlighterId, - this.commandName - ); - } - catch(e) - { - sh.utils.alert(e.message); - } - - return false; - }; - - return a; - }, - - /** - * Executes a toolbar command. - * @param {Element} sender Sender element. - * @param {MouseEvent} event Original mouse event object. - * @param {String} highlighterId Highlighter DIV element ID. - * @param {String} commandName Name of the command to execute. - * @return {Object} Passes out return value from command execution. - */ - executeCommand : function(sender, event, highlighterId, commandName, args) - { - var highlighter = sh.vars.highlighters[highlighterId], - command - ; - - if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null) - return null; - - return command.execute(sender, event, args); - }, - - /** Collection of toolbar items. */ - items : { - expandSource : function(highlighter) - { - this.create = function() - { - if (highlighter.getParam('collapse') != true) - return; - - return sh.config.strings.expandSource; - }; - - this.execute = function(sender, event, args) - { - var div = highlighter.div; - - sender.parentNode.removeChild(sender); - div.className = div.className.replace('collapsed', ''); - }; - }, - - /** - * Command to open a new window and display the original unformatted source code inside. - */ - viewSource : function(highlighter) - { - this.create = function() - { - return sh.config.strings.viewSource; - }; - - this.execute = function(sender, event, args) - { - var code = sh.utils.fixInputString(highlighter.originalCode).replace(/' + code + ''); - wnd.document.close(); - }; - }, - - /** - * Command to copy the original source code in to the clipboard. - * Uses Flash method if clipboardSwf is configured. - */ - copyToClipboard : function(highlighter) - { - var flashDiv, flashSwf, - highlighterId = highlighter.id - ; - - this.create = function() - { - var config = sh.config; - - // disable functionality if running locally - if (config.clipboardSwf == null) - return null; - - function params(list) - { - var result = ''; - - for (var name in list) - result += ""; - - return result; - }; - - function attributes(list) - { - var result = ''; - - for (var name in list) - result += " " + name + "='" + list[name] + "'"; - - return result; - }; - - var args1 = { - width : config.toolbarItemWidth, - height : config.toolbarItemHeight, - id : highlighterId + '_clipboard', - type : 'application/x-shockwave-flash', - title : sh.config.strings.copyToClipboard - }, - - // these arguments are used in IE's collection - args2 = { - allowScriptAccess : 'always', - wmode : 'transparent', - flashVars : 'highlighterId=' + highlighterId, - menu : 'false' - }, - swf = config.clipboardSwf, - html - ; - - if (/msie/i.test(navigator.userAgent)) - { - html = '' - + params(args2) - + params({ movie : swf }) - + '
    ' - ; - } - else - { - html = '' - ; - } - - flashDiv = document.createElement('div'); - flashDiv.innerHTML = html; - - return flashDiv; - }; - - this.execute = function(sender, event, args) - { - var command = args.command; - - switch (command) - { - case 'get': - var code = sh.utils.unindent( - sh.utils.fixInputString(highlighter.originalCode) - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/&/g, '&') - ); - - if(window.clipboardData) - // will fall through to the confirmation because there isn't a break - window.clipboardData.setData('text', code); - else - return sh.utils.unindent(code); - - case 'ok': - sh.utils.alert(sh.config.strings.copyToClipboardConfirmation); - break; - - case 'error': - sh.utils.alert(args.message); - break; - } - }; - }, - - /** Command to print the colored source code. */ - printSource : function(highlighter) - { - this.create = function() - { - return sh.config.strings.print; - }; - - this.execute = function(sender, event, args) - { - var iframe = document.createElement('IFRAME'), - doc = null - ; - - // make sure there is never more than one hidden iframe created by SH - if (sh.vars.printFrame != null) - document.body.removeChild(sh.vars.printFrame); - - sh.vars.printFrame = iframe; - - // this hides the iframe - iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; - - document.body.appendChild(iframe); - doc = iframe.contentWindow.document; - - copyStyles(doc, window.document); - doc.write('
    ' + highlighter.div.innerHTML + '
    '); - doc.close(); - - iframe.contentWindow.focus(); - iframe.contentWindow.print(); - - function copyStyles(destDoc, sourceDoc) - { - var links = sourceDoc.getElementsByTagName('link'); - - for(var i = 0; i < links.length; i++) - if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href)) - destDoc.write(''); - }; - }; - }, - - /** Command to display the about dialog window. */ - about : function(highlighter) - { - this.create = function() - { - return sh.config.strings.help; - }; - - this.execute = function(sender, event) - { - var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'), - doc = wnd.document - ; - - doc.write(sh.config.strings.aboutDialog); - doc.close(); - wnd.focus(); - }; - } - } - }, - - utils : { - /** - * Finds an index of element in the array. - * @ignore - * @param {Object} searchElement - * @param {Number} fromIndex - * @return {Number} Returns index of element if found; -1 otherwise. - */ - indexOf : function(array, searchElement, fromIndex) - { - fromIndex = Math.max(fromIndex || 0, 0); - - for (var i = fromIndex; i < array.length; i++) - if(array[i] == searchElement) - return i; - - return -1; - }, - - /** - * Generates a unique element ID. - */ - guid : function(prefix) - { - return prefix + Math.round(Math.random() * 1000000).toString(); - }, - - /** - * Merges two objects. Values from obj2 override values in obj1. - * Function is NOT recursive and works only for one dimensional objects. - * @param {Object} obj1 First object. - * @param {Object} obj2 Second object. - * @return {Object} Returns combination of both objects. - */ - merge: function(obj1, obj2) - { - var result = {}, name; - - for (name in obj1) - result[name] = obj1[name]; - - for (name in obj2) - result[name] = obj2[name]; - - return result; - }, - - /** - * Attempts to convert string to boolean. - * @param {String} value Input string. - * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise. - */ - toBoolean: function(value) - { - switch (value) - { - case "true": - return true; - - case "false": - return false; - } - - return value; - }, - - /** - * Opens up a centered popup window. - * @param {String} url URL to open in the window. - * @param {String} name Popup name. - * @param {int} width Popup width. - * @param {int} height Popup height. - * @param {String} options window.open() options. - * @return {Window} Returns window instance. - */ - popup: function(url, name, width, height, options) - { - var x = (screen.width - width) / 2, - y = (screen.height - height) / 2 - ; - - options += ', left=' + x + - ', top=' + y + - ', width=' + width + - ', height=' + height - ; - options = options.replace(/^,/, ''); - - var win = window.open(url, name, options); - win.focus(); - return win; - }, - - /** - * Adds event handler to the target object. - * @param {Object} obj Target object. - * @param {String} type Name of the event. - * @param {Function} func Handling function. - */ - addEvent: function(obj, type, func) - { - if (obj.attachEvent) - { - obj['e' + type + func] = func; - obj[type + func] = function() - { - obj['e' + type + func](window.event); - } - obj.attachEvent('on' + type, obj[type + func]); - } - else - { - obj.addEventListener(type, func, false); - } - }, - - /** - * Displays an alert. - * @param {String} str String to display. - */ - alert: function(str) - { - alert(sh.config.strings.alert + str) - }, - - /** - * Finds a brush by its alias. - * - * @param {String} alias Brush alias. - * @param {Boolean} alert Suppresses the alert if false. - * @return {Brush} Returns bursh constructor if found, null otherwise. - */ - findBrush: function(alias, alert) - { - var brushes = sh.vars.discoveredBrushes, - result = null - ; - - if (brushes == null) - { - brushes = {}; - - // Find all brushes - for (var brush in sh.brushes) - { - var aliases = sh.brushes[brush].aliases; - - if (aliases == null) - continue; - - // keep the brush name - sh.brushes[brush].name = brush.toLowerCase(); - - for (var i = 0; i < aliases.length; i++) - brushes[aliases[i]] = brush; - } - - sh.vars.discoveredBrushes = brushes; - } - - result = sh.brushes[brushes[alias]]; - - if (result == null && alert != false) - sh.utils.alert(sh.config.strings.noBrush + alias); - - return result; - }, - - /** - * Executes a callback on each line and replaces each line with result from the callback. - * @param {Object} str Input string. - * @param {Object} callback Callback function taking one string argument and returning a string. - */ - eachLine: function(str, callback) - { - var lines = str.split('\n'); - - for (var i = 0; i < lines.length; i++) - lines[i] = callback(lines[i]); - - return lines.join('\n'); - }, - - /** - * This is a special trim which only removes first and last empty lines - * and doesn't affect valid leading space on the first line. - * - * @param {String} str Input string - * @return {String} Returns string without empty first and last lines. - */ - trimFirstAndLastLines: function(str) - { - return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, ''); - }, - - /** - * Parses key/value pairs into hash object. - * - * Understands the following formats: - * - name: word; - * - name: [word, word]; - * - name: "string"; - * - name: 'string'; - * - * For example: - * name1: value; name2: [value, value]; name3: 'value' - * - * @param {String} str Input string. - * @return {Object} Returns deserialized object. - */ - parseParams: function(str) - { - var match, - result = {}, - arrayRegex = new XRegExp("^\\[(?(.*?))\\]$"), - regex = new XRegExp( - "(?[\\w-]+)" + - "\\s*:\\s*" + - "(?" + - "[\\w-%#]+|" + // word - "\\[.*?\\]|" + // [] array - '".*?"|' + // "" string - "'.*?'" + // '' string - ")\\s*;?", - "g" - ) - ; - - while ((match = regex.exec(str)) != null) - { - var value = match.value - .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings - ; - - // try to parse array value - if (value != null && arrayRegex.test(value)) - { - var m = arrayRegex.exec(value); - value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []; - } - - result[match.name] = value; - } - - return result; - }, - - /** - * Wraps each line of the string into tag with given style applied to it. - * - * @param {String} str Input string. - * @param {String} css Style name to apply to the string. - * @return {String} Returns input string with each line surrounded by tag. - */ - decorate: function(str, css) - { - if (str == null || str.length == 0 || str == '\n') - return str; - - str = str.replace(/... to them so that - // leading spaces aren't included. - if (css != null) - str = sh.utils.eachLine(str, function(line) - { - if (line.length == 0) - return ''; - - var spaces = ''; - - line = line.replace(/^( | )+/, function(s) - { - spaces = s; - return ''; - }); - - if (line.length == 0) - return spaces; - - return spaces + '' + line + ''; - }); - - return str; - }, - - /** - * Pads number with zeros until it's length is the same as given length. - * - * @param {Number} number Number to pad. - * @param {Number} length Max string length with. - * @return {String} Returns a string padded with proper amount of '0'. - */ - padNumber : function(number, length) - { - var result = number.toString(); - - while (result.length < length) - result = '0' + result; - - return result; - }, - - /** - * Measures width of a single space character. - * @return {Number} Returns width of a single space character. - */ - measureSpace : function() - { - var container = document.createElement('div'), - span, - result = 0, - body = document.body, - id = sh.utils.guid('measureSpace'), - - // variable names will be compressed, so it's better than a plain string - divOpen = '
    ' - + divOpen + 'lines">' - + divOpen + 'line">' - + divOpen + 'content' - + '"> ' + closeSpan + closeSpan - + closeDiv - + closeDiv - + closeDiv - + closeDiv - ; - - body.appendChild(container); - span = document.getElementById(id); - - if (/opera/i.test(navigator.userAgent)) - { - var style = window.getComputedStyle(span, null); - result = parseInt(style.getPropertyValue("width")); - } - else - { - result = span.offsetWidth; - } - - body.removeChild(container); - - return result; - }, - - /** - * Replaces tabs with spaces. - * - * @param {String} code Source code. - * @param {Number} tabSize Size of the tab. - * @return {String} Returns code with all tabs replaces by spaces. - */ - processTabs : function(code, tabSize) - { - var tab = ''; - - for (var i = 0; i < tabSize; i++) - tab += ' '; - - return code.replace(/\t/g, tab); - }, - - /** - * Replaces tabs with smart spaces. - * - * @param {String} code Code to fix the tabs in. - * @param {Number} tabSize Number of spaces in a column. - * @return {String} Returns code with all tabs replaces with roper amount of spaces. - */ - processSmartTabs : function(code, tabSize) - { - var lines = code.split('\n'), - tab = '\t', - spaces = '' - ; - - // Create a string with 1000 spaces to copy spaces from... - // It's assumed that there would be no indentation longer than that. - for (var i = 0; i < 50; i++) - spaces += ' '; // 20 spaces * 50 - - // This function inserts specified amount of spaces in the string - // where a tab is while removing that given tab. - function insertSpaces(line, pos, count) - { - return line.substr(0, pos) - + spaces.substr(0, count) - + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab - ; - }; - - // Go through all the lines and do the 'smart tabs' magic. - code = sh.utils.eachLine(code, function(line) - { - if (line.indexOf(tab) == -1) - return line; - - var pos = 0; - - while ((pos = line.indexOf(tab)) != -1) - { - // This is pretty much all there is to the 'smart tabs' logic. - // Based on the position within the line and size of a tab, - // calculate the amount of spaces we need to insert. - var spaces = tabSize - pos % tabSize; - line = insertSpaces(line, pos, spaces); - } - - return line; - }); - - return code; - }, - - /** - * Performs various string fixes based on configuration. - */ - fixInputString : function(str) - { - var br = /|<br\s*\/?>/gi; - - if (sh.config.bloggerMode == true) - str = str.replace(br, '\n'); - - if (sh.config.stripBrs == true) - str = str.replace(br, ''); - - return str; - }, - - /** - * Removes all white space at the begining and end of a string. - * - * @param {String} str String to trim. - * @return {String} Returns string without leading and following white space characters. - */ - trim: function(str) - { - return str.replace(/^\s+|\s+$/g, ''); - }, - - /** - * Unindents a block of text by the lowest common indent amount. - * @param {String} str Text to unindent. - * @return {String} Returns unindented text block. - */ - unindent: function(str) - { - var lines = sh.utils.fixInputString(str).split('\n'), - indents = new Array(), - regex = /^\s*/, - min = 1000 - ; - - // go through every line and check for common number of indents - for (var i = 0; i < lines.length && min > 0; i++) - { - var line = lines[i]; - - if (sh.utils.trim(line).length == 0) - continue; - - var matches = regex.exec(line); - - // In the event that just one line doesn't have leading white space - // we can't unindent anything, so bail completely. - if (matches == null) - return str; - - min = Math.min(matches[0].length, min); - } - - // trim minimum common number of white space from the begining of every line - if (min > 0) - for (var i = 0; i < lines.length; i++) - lines[i] = lines[i].substr(min); - - return lines.join('\n'); - }, - - /** - * Callback method for Array.sort() which sorts matches by - * index position and then by length. - * - * @param {Match} m1 Left object. - * @param {Match} m2 Right object. - * @return {Number} Returns -1, 0 or -1 as a comparison result. - */ - matchesSortCallback: function(m1, m2) - { - // sort matches by index first - if(m1.index < m2.index) - return -1; - else if(m1.index > m2.index) - return 1; - else - { - // if index is the same, sort by length - if(m1.length < m2.length) - return -1; - else if(m1.length > m2.length) - return 1; - } - - return 0; - }, - - /** - * Executes given regular expression on provided code and returns all - * matches that are found. - * - * @param {String} code Code to execute regular expression on. - * @param {Object} regex Regular expression item info from regexList collection. - * @return {Array} Returns a list of Match objects. - */ - getMatches: function(code, regexInfo) - { - function defaultAdd(match, regexInfo) - { - return [new sh.Match(match[0], match.index, regexInfo.css)]; - }; - - var index = 0, - match = null, - result = [], - func = regexInfo.func ? regexInfo.func : defaultAdd - ; - - while((match = regexInfo.regex.exec(code)) != null) - result = result.concat(func(match, regexInfo)); - - return result; - }, - - processUrls: function(code) - { - var lt = '<', - gt = '>' - ; - - return code.replace(sh.regexLib.url, function(m) - { - var suffix = '', prefix = ''; - - // We include < and > in the URL for the common cases like - // The problem is that they get transformed into <http://google.com> - // Where as > easily looks like part of the URL string. - - if (m.indexOf(lt) == 0) - { - prefix = lt; - m = m.substring(lt.length); - } - - if (m.indexOf(gt) == m.length - gt.length) - { - m = m.substring(0, m.length - gt.length); - suffix = gt; - } - - return prefix + '' + m + '' + suffix; - }); - }, - - /** - * Finds all - - - - - - - - - - - - - - - - - - - - - - - -

    SyntaxHihglighter Test

    -

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

    - -
    -function test() : String
    -{
    -	return 10;
    -}
    -
    - diff --git a/html/views/blame/blame.css b/html/views/blame/blame.css index a020e8a..615575b 100644 --- a/html/views/blame/blame.css +++ b/html/views/blame/blame.css @@ -1,54 +1,54 @@ table { - border-collapse: collapse; - border-spacing: 0; + border-collapse: collapse !important; + border-spacing: 0 !important; } body,th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; + margin: 0 !important; + padding: 0 !important; + border: 0 !important; + outline: 0 !important; + font-size: 100% !important; + vertical-align: baseline !important; + background: transparent !important; } p{ - margin: 0; - padding: 0; + margin: 0 !important; + padding: 0 !important; } tr.block.l2 p.summary, tr.block.l3 p.summary, tr.block.l1 p.summary{ - display: none; + display: none !important; } table.blocks td { - vertical-align: top; + vertical-align: top !important; } p.author { - white-space: nowrap; + white-space: nowrap !important; } table.blocks { - font: 11px "Menlo" !important; + font: 11px "Menlo" !important !important; } table tr.block{ - border-top: 1px solid #c9c9c9; + border-top: 1px solid #c9c9c9 !important; } table.blocks{ - border-bottom: 1px solid #c9c9c9; - width: 100%; + border-bottom: 1px solid #c9c9c9 !important; + width: 100% !important; } table.blocks tr td:nth-of-type(2) { - width: 100%; + width: 100% !important; } table.blocks tr.block td:nth-of-type(1){ - padding-right: 5px; - padding-left: 5px; + padding-right: 5px !important; + padding-left: 5px !important; } \ No newline at end of file diff --git a/html/views/blame/index.html b/html/views/blame/index.html index 8be6a6f..a2d4801 100644 --- a/html/views/blame/index.html +++ b/html/views/blame/index.html @@ -1,12 +1,12 @@ - - + + - - + +
    hola diff --git a/html/views/fileview/index.html b/html/views/fileview/index.html index 888eba5..3f4c63d 100644 --- a/html/views/fileview/index.html +++ b/html/views/fileview/index.html @@ -1,12 +1,12 @@ - - + + - - + +
    diff --git a/html/views/fileview/index_test.html b/html/views/fileview/index_test.html new file mode 100644 index 0000000..3eb1f44 --- /dev/null +++ b/html/views/fileview/index_test.html @@ -0,0 +1,48 @@ + + + + + + + + + + + +
    +
    +//
    +//  AppController.h
    +//  MGScopeBar
    +//
    +//  Created by Matt Gemmell on 16/03/2008.
    +//
    +
    +/* dhfas fldsa */
    +
    +/*
    +fjdsahf dsaf dlsaf jd;sa
    +fdjksal; fjhdsa
    +*/
    +
    +#import <Cocoa/Cocoa.h>
    +#import "MGScopeBarDelegateProtocol.h"
    +
    +
    +/* dhfas fldsa */
    +
    +@interface AppController : NSObject  {
    +	IBOutlet NSTextField *labelField;
    +	IBOutlet MGScopeBar *scopeBar;
    +	IBOutlet NSView *accessoryView;
    +	NSMutableArray *groups;
    +}
    +
    +@property(retain) NSMutableArray *groups;
    +
    +@end
    +
    + +
    + + \ No newline at end of file From cbf7cd3fbf061d9a97c59fe8d0c6f79c4e876db9 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Sun, 19 Sep 2010 13:18:40 -0700 Subject: [PATCH 104/110] cosmetic --- GLFileView.m | 1 + html/css/shCoreGitX.css | 225 ++++++++++++++++++++++++++++ html/views/blame/index.html | 2 +- html/views/fileview/index.html | 2 +- html/views/fileview/index_test.html | 2 +- 5 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 html/css/shCoreGitX.css diff --git a/GLFileView.m b/GLFileView.m index bc7b0f3..b374146 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -199,6 +199,7 @@ do{ line=[lines objectAtIndex:i++]; }while([line characterAtIndex:0]!='\t'); + line=[line substringFromIndex:1]; line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"    "]; [code appendString:line]; [code appendString:@"\n"]; diff --git a/html/css/shCoreGitX.css b/html/css/shCoreGitX.css new file mode 100644 index 0000000..a7fc58f --- /dev/null +++ b/html/css/shCoreGitX.css @@ -0,0 +1,225 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +.syntaxhighlighter a, +.syntaxhighlighter div, +.syntaxhighlighter code, +.syntaxhighlighter table, +.syntaxhighlighter table td, +.syntaxhighlighter table tr, +.syntaxhighlighter table tbody, +.syntaxhighlighter table thead, +.syntaxhighlighter table caption, +.syntaxhighlighter textarea { + -moz-border-radius: 0 0 0 0 !important; + -webkit-border-radius: 0 0 0 0 !important; + background: none !important; + border: 0 !important; + bottom: auto !important; + float: none !important; + height: auto !important; + left: auto !important; + line-height: 1.1em !important; + margin: 0 !important; + outline: 0 !important; + overflow: visible !important; + padding: 0 !important; + position: static !important; + right: auto !important; + text-align: left !important; + top: auto !important; + vertical-align: baseline !important; + width: auto !important; + box-sizing: content-box !important; + font-family: "Menlo" , "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; + font-weight: normal !important; + font-style: normal !important; + font-size: 1em !important; + min-height: inherit !important; + min-height: auto !important; +} + +.syntaxhighlighter { + width: 100% !important; + margin: 0 !important; + position: relative !important; + font-size: 1em !important; +} +.syntaxhighlighter.source { + overflow: hidden !important; +} +.syntaxhighlighter .bold { + font-weight: bold !important; +} +.syntaxhighlighter .italic { + font-style: italic !important; +} +.syntaxhighlighter .line { + white-space: pre !important; +} +.syntaxhighlighter table { + width: 100% !important; +} +.syntaxhighlighter table caption { + text-align: left !important; + padding: .5em 0 0.5em 1em !important; +} +.syntaxhighlighter table td.code { + width: 100% !important; +} +.syntaxhighlighter table td.code .container { + position: relative !important; +} +.syntaxhighlighter table td.code .container textarea { + box-sizing: border-box !important; + position: absolute !important; + left: 0 !important; + top: 0 !important; + width: 100% !important; + height: 100% !important; + border: none !important; + background: white !important; + padding-left: 1em !important; + overflow: hidden !important; + white-space: pre !important; +} +.syntaxhighlighter table td.gutter .line { + text-align: right !important; + padding: 0 0.5em 0 1em !important; +} +.syntaxhighlighter table td.code .line { + padding: 0 1em !important; +} +.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { + padding-left: 0em !important; +} +.syntaxhighlighter.show { + display: block !important; +} +.syntaxhighlighter.collapsed table { + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar { + padding: 0.1em 0.8em 0em 0.8em !important; + font-size: 1em !important; + position: static !important; + width: auto !important; + height: auto !important; +} +.syntaxhighlighter.collapsed .toolbar span { + display: inline !important; + margin-right: 1em !important; +} +.syntaxhighlighter.collapsed .toolbar span a { + padding: 0 !important; + display: none !important; +} +.syntaxhighlighter.collapsed .toolbar span a.expandSource { + display: inline !important; +} +.syntaxhighlighter .toolbar { + position: absolute !important; + right: 1px !important; + top: 1px !important; + width: 11px !important; + height: 11px !important; + font-size: 10px !important; + z-index: 10 !important; +} +.syntaxhighlighter .toolbar span.title { + display: inline !important; +} +.syntaxhighlighter .toolbar a { + display: block !important; + text-align: center !important; + text-decoration: none !important; + padding-top: 1px !important; +} +.syntaxhighlighter .toolbar a.expandSource { + display: none !important; +} +.syntaxhighlighter.ie { + font-size: .9em !important; + padding: 1px 0 1px 0 !important; +} +.syntaxhighlighter.ie .toolbar { + line-height: 8px !important; +} +.syntaxhighlighter.ie .toolbar a { + padding-top: 0px !important; +} +.syntaxhighlighter.printing .line.alt1 .content, +.syntaxhighlighter.printing .line.alt2 .content, +.syntaxhighlighter.printing .line.highlighted .number, +.syntaxhighlighter.printing .line.highlighted.alt1 .content, +.syntaxhighlighter.printing .line.highlighted.alt2 .content { + background: none !important; +} +.syntaxhighlighter.printing .line .number { + color: #bbbbbb !important; +} +.syntaxhighlighter.printing .line .content { + color: black !important; +} +.syntaxhighlighter.printing .toolbar { + display: none !important; +} +.syntaxhighlighter.printing a { + text-decoration: none !important; +} +.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { + color: black !important; +} +.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { + color: #008200 !important; +} +.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { + color: blue !important; +} +.syntaxhighlighter.printing .keyword { + color: #006699 !important; + font-weight: bold !important; +} +.syntaxhighlighter.printing .preprocessor { + color: gray !important; +} +.syntaxhighlighter.printing .variable { + color: #aa7700 !important; +} +.syntaxhighlighter.printing .value { + color: #009900 !important; +} +.syntaxhighlighter.printing .functions { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .constants { + color: #0066cc !important; +} +.syntaxhighlighter.printing .script { + font-weight: bold !important; +} +.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { + color: gray !important; +} +.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { + color: #ff1493 !important; +} +.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { + color: red !important; +} +.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { + color: black !important; +} diff --git a/html/views/blame/index.html b/html/views/blame/index.html index a2d4801..5efde8e 100644 --- a/html/views/blame/index.html +++ b/html/views/blame/index.html @@ -5,7 +5,7 @@ - + diff --git a/html/views/fileview/index.html b/html/views/fileview/index.html index 3f4c63d..6dfb4cd 100644 --- a/html/views/fileview/index.html +++ b/html/views/fileview/index.html @@ -5,7 +5,7 @@ - + diff --git a/html/views/fileview/index_test.html b/html/views/fileview/index_test.html index 3eb1f44..c49766e 100644 --- a/html/views/fileview/index_test.html +++ b/html/views/fileview/index_test.html @@ -5,7 +5,7 @@ - + From 6f83f2382cb4e02b205b19d7bb0ba09b505f4ded Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 19 Sep 2010 10:51:03 -0600 Subject: [PATCH 105/110] Bugfix: Rebasing the head ref Only use the ref being rebased onto otherwise git will create a detached HEAD. --- PBGitHistoryController.m | 6 ++---- PBRefController.m | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index c61a464..a8bf5ac 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -671,10 +671,8 @@ - (IBAction) rebase:(id)sender { - if (selectedCommit) { - PBGitRef *headRef = [[repository headRef] ref]; - [repository rebaseBranch:headRef onRefish:selectedCommit]; - } + if (selectedCommit) + [repository rebaseBranch:nil onRefish:selectedCommit]; } #pragma mark - diff --git a/PBRefController.m b/PBRefController.m index 1b07f00..c9b8c2e 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -147,9 +147,8 @@ - (void) rebaseHeadBranch:(PBRefMenuItem *)sender { id refish = [sender refish]; - PBGitRef *headRef = [[historyController.repository headRef] ref]; - [historyController.repository rebaseBranch:headRef onRefish:refish]; + [historyController.repository rebaseBranch:nil onRefish:refish]; } From 929f9fc0f59389f422c280333dbdd41b2844b42e Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 19 Sep 2010 12:46:13 -0600 Subject: [PATCH 106/110] Show the branch that will be tracked when creating a tracking branch --- PBRefMenuItem.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 4b47fdc..cfbe710 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -59,7 +59,8 @@ [items addObject:[PBRefMenuItem separatorItem]]; // create branch - [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; + NSString *createBranchTitle = [ref isRemoteBranch] ? [NSString stringWithFormat:@"Create branch that tracks %@…", targetRefName] : @"Create branch…"; + [items addObject:[PBRefMenuItem itemWithTitle:createBranchTitle action:@selector(createBranch:) enabled:YES]]; // create tag [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; From e388434a493b74386fbefdbab0f9c57f51004fe2 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 19 Sep 2010 12:47:06 -0600 Subject: [PATCH 107/110] When creating a tracking branch pre-fill the branch name in the create branch sheet --- PBCreateBranchSheet.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PBCreateBranchSheet.m b/PBCreateBranchSheet.m index ebd2643..0eb8d2a 100644 --- a/PBCreateBranchSheet.m +++ b/PBCreateBranchSheet.m @@ -51,6 +51,16 @@ [self.errorMessageField setStringValue:@""]; self.shouldCheckoutBranch = [PBGitDefaults shouldCheckoutBranch]; + // when creating a local branch tracking a remote branch preset the branch name to the name of the remote branch + if ([self.startRefish refishType] == kGitXRemoteBranchType) { + NSMutableArray *components = [[[self.startRefish shortName] componentsSeparatedByString:@"/"] mutableCopy]; + if ([components count] > 1) { + [components removeObjectAtIndex:0]; + NSString *branchName = [components componentsJoinedByString:@"/"]; + [self.branchNameField setStringValue:branchName]; + } + } + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; } From d00dbe42b3c03d69164426e36418c9dba5552ae0 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 19 Sep 2010 14:31:30 -0600 Subject: [PATCH 108/110] Always pull all tracking branches from the remote 'git pull remote branch' will not update the remote's tracking branches, only the selected local branch. It may not be readily apparent that this happened. So remove the cases where GitX would pull just a single branch and always pull all the tracking branches. The current checked out branch will still be updated as normal. --- PBGitRepository.m | 19 +------------------ PBRefMenuItem.m | 3 +-- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/PBGitRepository.m b/PBGitRepository.m index cd1e143..3d4489b 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -625,24 +625,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; NSString *remoteName = [remoteRef remoteName]; [arguments addObject:remoteName]; - NSString *branchName = nil; - NSString *refSpec = nil; - if ([ref isRemoteBranch]) { - branchName = [ref shortName]; - refSpec = [ref remoteBranchName]; - } - else if ([ref isRemote] || !ref) { - branchName = @"all tracking branches"; - } - else { - branchName = [ref shortName]; - refSpec = [NSString stringWithFormat:@"%@:%@", branchName, branchName]; - } - if (refSpec) - [arguments addObject:refSpec]; - - NSString *headRefName = [[[self headRef] ref] shortName]; - NSString *description = [NSString stringWithFormat:@"Pulling %@ from %@ and updating %@", branchName, remoteName, headRefName]; + NSString *description = [NSString stringWithFormat:@"Pulling all tracking branches from %@", remoteName]; NSString *title = @"Pulling from remote"; [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; } diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index cfbe710..083de7b 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -90,8 +90,7 @@ [items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]]; // pull - NSString *pullRemoteName = [ref isRemoteBranch] ? [ref shortName] : remoteName; - NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull"; + NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", remoteName, headRefName] : @"Pull"; [items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]]; // push From 59c4983b5125a6ac27d961a20ab27f59fa1f3155 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Mon, 20 Sep 2010 22:36:06 -0600 Subject: [PATCH 109/110] Bugfix: only exit the handleSTDINDiff() if there is an actual diff --- gitx.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitx.m b/gitx.m index 05f2aa8..3230d01 100644 --- a/gitx.m +++ b/gitx.m @@ -120,9 +120,8 @@ void handleSTDINDiff() if (diff && [diff length] > 0) { GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier]; [gitXApp showDiff:diff]; + exit(0); } - - exit(0); } void handleDiffWithArguments(NSURL *repositoryURL, NSMutableArray *arguments) From a78a2c238c7598ba199af5ba308c8e690398d450 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Fri, 24 Sep 2010 10:17:04 -0700 Subject: [PATCH 110/110] blame cosmetics save the html for debug and CSS edit --- GLFileView.m | 19 ++++++++++++++++++- GitX.xcodeproj/project.pbxproj | 1 + html/css/shThemeGitX.css | 2 ++ html/views/blame/blame.css | 8 +++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/GLFileView.m b/GLFileView.m index b374146..90b05ec 100644 --- a/GLFileView.m +++ b/GLFileView.m @@ -77,6 +77,12 @@ id script = [view windowScriptObject]; [script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]]; } + +#ifdef DEBUG + NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML]; + NSString *tmpFile=@"~/tmp/test.html"; + [dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil]; +#endif } #pragma mark JavaScript log.js methods @@ -147,6 +153,7 @@ - (NSString *) parseHTML:(NSString *)txt { + txt=[txt stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; txt=[txt stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; txt=[txt stringByReplacingOccurrencesOfString:@">" withString:@">"]; @@ -180,7 +187,16 @@ summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""]; } } - NSString *block=[NSString stringWithFormat:@"

    %@

    %@

    \n\n",author,summary]; + NSRange trunc={0,30}; + NSString *truncate_a=author; + if([author length]>30){ + truncate_a=[author substringWithRange:trunc]; + } + NSString *truncate_s=summary; + if([summary length]>30){ + truncate_s=[summary substringWithRange:trunc]; + } + NSString *block=[NSString stringWithFormat:@"

    %@

    %@

    \n\n",truncate_a,truncate_s]; [headers setObject:block forKey:[header objectAtIndex:0]]; } [res appendString:[headers objectForKey:[header objectAtIndex:0]]]; @@ -189,6 +205,7 @@ do{ line=[lines objectAtIndex:i++]; }while([line characterAtIndex:0]!='\t'); + line=[line substringFromIndex:1]; line=[line stringByReplacingOccurrencesOfString:@"\t" withString:@"    "]; [code appendString:line]; [code appendString:@"\n"]; diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index ff2820e..ea765bb 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -1590,6 +1590,7 @@ buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; GCC_ENABLE_OBJC_GC = required; + GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/html/css/shThemeGitX.css b/html/css/shThemeGitX.css index fda832c..e134c46 100644 --- a/html/css/shThemeGitX.css +++ b/html/css/shThemeGitX.css @@ -38,6 +38,8 @@ } .syntaxhighlighter .gutter .line { border-right: 3px solid #6ce26c !important; + display: block !important; + width: 30px !important; } .syntaxhighlighter .gutter .line.highlighted { background-color: #6ce26c !important; diff --git a/html/views/blame/blame.css b/html/views/blame/blame.css index 615575b..c16ffc0 100644 --- a/html/views/blame/blame.css +++ b/html/views/blame/blame.css @@ -13,13 +13,19 @@ body,th, td { background: transparent !important; } +p.summary { +} + p{ margin: 0 !important; padding: 0 !important; + font-size: 11px; + font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + white-space: nowrap; } -tr.block.l2 p.summary, tr.block.l3 p.summary, +tr.block.l2 p.summary, tr.block.l1 p.summary{ display: none !important; }