Skip to content

Commit 54cd5d0

Browse files
committed
代码文件中对 sym_link 的处理
1 parent a68bde2 commit 54cd5d0

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Coding_iOS/Controllers/CodeListViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ - (void)goToVCWith:(CodeTree_File *)codeTreeFile andRef:(NSString *)ref{
9999
vc.myProject = _myProject;
100100
vc.myCodeTree = nextCodeTree;
101101
[self.navigationController pushViewController:vc animated:YES];
102-
}else if ([codeTreeFile.mode isEqualToString:@"file"] || [codeTreeFile.mode isEqualToString:@"image"]){//文件
102+
}else if ([@[@"file", @"image", @"sym_link"] containsObject:codeTreeFile.mode]){//文件
103103
CodeFile *nextCodeFile = [CodeFile codeFileWithRef:ref andPath:codeTreeFile.path];
104104
CodeViewController *vc = [CodeViewController codeVCWithProject:_myProject andCodeFile:nextCodeFile];
105105
[self.navigationController pushViewController:vc animated:YES];

Coding_iOS/Controllers/CodeViewController.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ - (void)refreshCodeViewData{
103103
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@u/%@/p/%@/git/raw/%@", [NSObject baseURLStr], _myProject.owner_user_name, _myProject.name, [NSString handelRef:_myCodeFile.ref path:_myCodeFile.file.path]]];
104104
DebugLog(@"imageUrl: %@", imageUrl);
105105
[self.webContentView loadRequest:[NSURLRequest requestWithURL:imageUrl]];
106-
}else if ([_myCodeFile.file.mode isEqualToString:@"file"]){
106+
}else if ([_myCodeFile.file.mode isEqualToString:@"file"] ||
107+
[_myCodeFile.file.mode isEqualToString:@"sym_link"]){
107108
NSString *contentStr = [WebContentManager codePatternedWithContent:_myCodeFile];
108109
[self.webContentView loadHTMLString:contentStr baseURL:nil];
109110
}

Coding_iOS/Controllers/ProjectViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ - (void)goToVCWith:(CodeTree_File *)codeTreeFile andRef:(NSString *)ref{
325325
vc.myProject = _myProject;
326326
vc.myCodeTree = nextCodeTree;
327327
[self.navigationController pushViewController:vc animated:YES];
328-
}else if ([codeTreeFile.mode isEqualToString:@"file"] || [codeTreeFile.mode isEqualToString:@"image"]){//文件
328+
}else if ([@[@"file", @"image", @"sym_link"] containsObject:codeTreeFile.mode]){//文件
329329
CodeFile *nextCodeFile = [CodeFile codeFileWithRef:ref andPath:codeTreeFile.path];
330330
CodeViewController *vc = [CodeViewController codeVCWithProject:_myProject andCodeFile:nextCodeFile];
331331
[self.navigationController pushViewController:vc animated:YES];

Coding_iOS/Models/CodeTree.m

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ @implementation CodeTree_Committer
6767
@end
6868

6969
@implementation CodeTree_File
70-
70+
- (NSString *)mode{
71+
if (!_mode) {
72+
_mode = @"";
73+
}
74+
return _mode;
75+
}
7176
@end
7277

7378
@implementation CodeTree_CommitInfo

0 commit comments

Comments
 (0)