Skip to content

Commit a4ec392

Browse files
committed
Make GTOID accessible from javascript and use the SHA method to display the parent link in history.js.
1 parent 7775d5a commit a4ec392

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

Classes/git/GTOID+JavaScript.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// GTOID+JavaScript.h
3+
// GitX
4+
//
5+
// Created by Sven Weidauer on 18.05.14.
6+
//
7+
//
8+
9+
#import <ObjectiveGit/ObjectiveGit.h>
10+
11+
@interface GTOID (JavaScript)
12+
13+
@end

Classes/git/GTOID+JavaScript.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// GTOID+JavaScript.m
3+
// GitX
4+
//
5+
// Created by Sven Weidauer on 18.05.14.
6+
//
7+
//
8+
9+
#import "GTOID+JavaScript.h"
10+
11+
@implementation GTOID (JavaScript)
12+
13+
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
14+
{
15+
return NO;
16+
}
17+
18+
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name {
19+
return NO;
20+
}
21+
22+
@end

GitX.xcodeproj/project.pbxproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
0A6858C711F7EA8A00AC2BE4 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A6858C611F7EA8A00AC2BE4 /* CoreServices.framework */; };
11+
2682AABB1929140E00271A4D /* GTOID+JavaScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 2682AABA1929140E00271A4D /* GTOID+JavaScript.m */; };
1112
4A0B5BD315FE2DA600ACCB61 /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A0B5BD215FE2DA600ACCB61 /* libssl.dylib */; };
1213
4A0B5BD515FE2DC900ACCB61 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A0B5BD415FE2DC900ACCB61 /* libcrypto.dylib */; };
1314
4A1F4E6917AFE969004D51E9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
@@ -361,6 +362,8 @@
361362
/* Begin PBXFileReference section */
362363
0A6858C611F7EA8A00AC2BE4 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
363364
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
365+
2682AAB91929140E00271A4D /* GTOID+JavaScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTOID+JavaScript.h"; sourceTree = "<group>"; };
366+
2682AABA1929140E00271A4D /* GTOID+JavaScript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTOID+JavaScript.m"; sourceTree = "<group>"; };
364367
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
365368
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
366369
4A0B5BD215FE2DA600ACCB61 /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = usr/lib/libssl.dylib; sourceTree = SDKROOT; };
@@ -756,7 +759,6 @@
756759
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
757760
isa = PBXGroup;
758761
children = (
759-
4AC42F7B16BFBAD2007CCA3A /* Foundation.framework */,
760762
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
761763
4A40159814067B7A00DB9C07 /* AppKit.framework */,
762764
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
@@ -1086,6 +1088,8 @@
10861088
643952761603EF9B00BB7AFF /* PBGitSVSubmoduleItem.m */,
10871089
4AB057E11652652000DE751D /* GitRepoFinder.h */,
10881090
4AB057E21652652000DE751D /* GitRepoFinder.m */,
1091+
2682AAB91929140E00271A4D /* GTOID+JavaScript.h */,
1092+
2682AABA1929140E00271A4D /* GTOID+JavaScript.m */,
10891093
);
10901094
path = git;
10911095
sourceTree = "<group>";
@@ -1587,6 +1591,7 @@
15871591
4A5D770E14A9A9CC00DF6C68 /* PBGitXProtocol.m in Sources */,
15881592
4A5D771114A9A9CC00DF6C68 /* GitXRelativeDateFormatter.m in Sources */,
15891593
4A5D771214A9A9CC00DF6C68 /* main.m in Sources */,
1594+
2682AABB1929140E00271A4D /* GTOID+JavaScript.m in Sources */,
15901595
4A5D771314A9A9CC00DF6C68 /* PBChangedFile.m in Sources */,
15911596
4A5D771414A9A9CC00DF6C68 /* PBCLIProxy.m in Sources */,
15921597
4A5D771514A9A9CC00DF6C68 /* PBCommitList.m in Sources */,

html/views/history/history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ var loadCommit = function(commitObject, currentRef) {
198198
var newRow = $("commit_header").insertRow(-1);
199199
newRow.innerHTML = "<td class='property_name'>Parent:</td><td>" +
200200
"<a class=\"SHA\" href='' onclick='selectCommit(this.innerHTML); return false;'>" +
201-
commit.parents[i].string() + "</a></td>";
201+
commit.parents[i].SHA() + "</a></td>";
202202
}
203203

204204
commit.notificationID = setTimeout(function() {

0 commit comments

Comments
 (0)