Skip to content

Commit ee5d82e

Browse files
committed
mark 3.2.201508290030
1 parent 3cdec42 commit ee5d82e

19 files changed

Lines changed: 124 additions & 40 deletions

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</dict>
3333
</array>
3434
<key>CFBundleVersion</key>
35-
<string>3.2.201508282030</string>
35+
<string>3.2.201508290030</string>
3636
<key>LSRequiresIPhoneOS</key>
3737
<true/>
3838
<key>NSAppTransportSecurity</key>

Coding_iOS/Controllers/CodeViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ - (void)doSomethingWithResponse:(id)data andError:(NSError *)error{
100100

101101
- (void)refreshCodeViewData{
102102
if ([_myCodeFile.file.mode isEqualToString:@"image"]) {
103-
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@u/%@/p/%@/git/raw/%@/%@", [NSObject baseURLStr], _myProject.owner_user_name, _myProject.name, [_myCodeFile.ref URLEncoding_Coding], [_myCodeFile.file.path URLEncoding_Coding]]];
103+
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]];
106106
}else if ([_myCodeFile.file.mode isEqualToString:@"file"]){

Coding_iOS/Controllers/CommitFilesViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
274274
FileChange *curFileChange = [curList objectAtIndex:indexPath.row];
275275

276276
FileChangeDetailViewController *vc = [FileChangeDetailViewController new];
277-
vc.linkUrlStr = [NSString stringWithFormat:@"api/user/%@/project/%@/git/commitDiffContent/%@/%@", _ownerGK, _projectName, _commitId, [curFileChange.path URLEncoding_Coding]];
277+
vc.linkUrlStr = [NSString stringWithFormat:@"api/user/%@/project/%@/git/commitDiffContent/%@", _ownerGK, _projectName, [NSString handelRef:_commitId path:curFileChange.path]];
278278

279279
vc.curProject = _curProject;
280280
vc.commitId = curFileChange.commitId;

Coding_iOS/Controllers/FileViewController.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import "Coding_NetAPIManager.h"
1313
#import "Coding_FileManager.h"
1414
#import "WebContentManager.h"
15+
#import "FunctionTipsManager.h"
1516
#import <MMMarkdown/MMMarkdown.h>
1617
#import "EaseToolBar.h"
1718

@@ -73,6 +74,17 @@ - (EaseToolBar *)myToolBar{
7374
make.size.mas_equalTo(_myToolBar.frame.size);
7475
}];
7576
}
77+
if (_myToolBar) {
78+
FunctionTipsManager *ftM = [FunctionTipsManager shareManager];
79+
if ([ftM needToTip:kFunctionTipStr_File_2V_Activity]) {
80+
EaseToolBarItem *item = [_myToolBar itemOfIndex:0];
81+
[item addTipIcon];
82+
}
83+
if ([ftM needToTip:kFunctionTipStr_File_2V_Version]) {
84+
EaseToolBarItem *item = [_myToolBar itemOfIndex:1];
85+
[item addTipIcon];
86+
}
87+
}
7688
return _myToolBar;
7789
}
7890

@@ -503,12 +515,20 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
503515

504516
#pragma mark EaseToolBarDelegate
505517
- (void)easeToolBar:(EaseToolBar *)toolBar didClickedIndex:(NSInteger)index{
518+
EaseToolBarItem *item = [toolBar itemOfIndex:index];
519+
NSString *tipStr = nil;
506520
if (index == 0) {
507521
FileActivitiesViewController *vc = [FileActivitiesViewController vcWithFile:_curFile];
508522
[self.navigationController pushViewController:vc animated:YES];
523+
tipStr = kFunctionTipStr_File_2V_Activity;
509524
}else if (index == 1){
510525
FileVersionsViewController *vc = [FileVersionsViewController vcWithFile:_curFile];
511526
[self.navigationController pushViewController:vc animated:YES];
527+
tipStr = kFunctionTipStr_File_2V_Version;
528+
}
529+
if ([[FunctionTipsManager shareManager] needToTip:tipStr]) {
530+
[[FunctionTipsManager shareManager] markTiped:tipStr];
531+
[item removeTipIcon];
512532
}
513533
}
514534
#pragma mark Data Value

Coding_iOS/Controllers/MRPRDetailViewController.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#import "MRPRDetailViewController.h"
1212
#import "Coding_NetAPIManager.h"
13+
#import "FunctionTipsManager.h"
1314
#import "ODRefreshControl.h"
1415

1516
#import "MRPRTopCell.h"
@@ -313,6 +314,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
313314
[cell setImageStr:@"mrpr_icon_commit" andTitle:@"提交记录"];
314315
}else{
315316
[cell setImageStr:@"mrpr_icon_fileChange" andTitle:@"文件改动"];
317+
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_LineNote_FileChange]) {
318+
[cell addTipIcon];
319+
}
316320
}
317321
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
318322
return cell;
@@ -363,6 +367,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
363367
vc.curMRPRInfo = _curMRPRInfo;
364368
vc.curProject = _curProject;
365369
[self.navigationController pushViewController:vc animated:YES];
370+
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_LineNote_FileChange]) {
371+
[[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_LineNote_FileChange];
372+
[[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_LineNote_MRPR];
373+
NProjectItemCell *cell = (NProjectItemCell *)[tableView cellForRowAtIndexPath:indexPath];
374+
[cell removeTip];
375+
}
366376
}
367377
}else if (_curMRPRInfo.discussions.count > 0 && indexPath.section == 2){//Comment
368378
ProjectLineNote *curCommentItem = [[_curMRPRInfo.discussions objectAtIndex:indexPath.row] firstObject];

Coding_iOS/Controllers/MRPRFilesViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
170170
FileChange *curFileChange = [curList objectAtIndex:indexPath.row];
171171

172172
FileChangeDetailViewController *vc = [FileChangeDetailViewController new];
173-
vc.linkUrlStr = [NSString stringWithFormat:@"%@?path=%@", [_curMRPR toFileLineChangesPath], [curFileChange.path URLEncoding_Coding]];
173+
vc.linkUrlStr = [NSString stringWithFormat:@"%@?path=%@", [_curMRPR toFileLineChangesPath], curFileChange.path];
174174
vc.curProject = _curProject;
175175
vc.commitId = curFileChange.commitId;
176176
vc.filePath = curFileChange.path;

Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -204,31 +204,14 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
204204
switch (indexPath.row) {
205205
case 0:
206206
[cell setImageStr:@"project_item_readme" andTitle:@"README"];
207-
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_ReadMe]) {
208-
[cell addTipIcon];
209-
}
210207
break;
211208
default:
212209
[cell setImageStr:@"project_item_mr_pr" andTitle:_myProject.is_public.boolValue? @"Pull Request": @"Merge Request"];
213-
if ((_myProject.is_public.boolValue &&
214-
[[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_PR]) ||
215-
(!_myProject.is_public.boolValue &&
216-
[[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_MR])) {
217-
[cell addTipIcon];
218-
}else
219210
break;
220211
}
221212
}
222213
FunctionTipsManager *ftm = [FunctionTipsManager shareManager];
223-
NSString *tipStr;
224-
if (indexPath.section == 1) {
225-
if ((_myProject.is_public.boolValue && indexPath.row == 2) ||
226-
(!_myProject.is_public.boolValue && indexPath.row == 4)) {
227-
tipStr = kFunctionTipStr_CommitList;
228-
}
229-
}else if (indexPath.section == 2){
230-
tipStr = indexPath.row == 0? kFunctionTipStr_ReadMe: _myProject.is_public.boolValue? kFunctionTipStr_PR: kFunctionTipStr_MR;
231-
}
214+
NSString *tipStr = [self p_TipStrForIndexPath:indexPath];
232215
if (tipStr && [ftm needToTip:tipStr]) {
233216
[cell addTipIcon];
234217
}
@@ -270,13 +253,26 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
270253
}
271254

272255
FunctionTipsManager *ftm = [FunctionTipsManager shareManager];
273-
NSString *tipStr;
274-
if (indexPath.section == 2) {
275-
tipStr = indexPath.row == 0? kFunctionTipStr_ReadMe: _myProject.is_public.boolValue? kFunctionTipStr_PR: kFunctionTipStr_MR;
276-
}
256+
NSString *tipStr = [self p_TipStrForIndexPath:indexPath];
277257
if (tipStr && [ftm needToTip:tipStr]) {
278258
[ftm markTiped:tipStr];
259+
NProjectItemCell *cell = (NProjectItemCell *)[tableView cellForRowAtIndexPath:indexPath];
260+
[cell removeTip];
261+
}
262+
}
263+
264+
- (NSString *)p_TipStrForIndexPath:(NSIndexPath *)indexPath{
265+
NSString *tipStr = nil;
266+
if (indexPath.section == 1) {
267+
if (!_myProject.is_public.boolValue && indexPath.row == 3) {
268+
tipStr = kFunctionTipStr_File_2V;
269+
}
270+
}else if (indexPath.section == 2){
271+
if (indexPath.row == 1) {
272+
tipStr = kFunctionTipStr_LineNote_MRPR;
273+
}
279274
}
275+
return tipStr;
280276
}
281277

282278
#pragma mark goTo VC

Coding_iOS/Controllers/UserInfoViewController.m

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

99
#import "UserInfoViewController.h"
1010
#import "Coding_NetAPIManager.h"
11+
#import "FunctionTipsManager.h"
1112

1213
#import "MJPhotoBrowser.h"
1314
#import "UsersViewController.h"
@@ -145,7 +146,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
145146
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
146147
NSInteger row = 0;
147148
if (section == 0) {
148-
row = 3;
149+
row = [self isMe]? 0: 3;
149150
}else if (section == 1){
150151
row = 1;
151152
}else if (section == 2){
@@ -187,6 +188,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
187188
}
188189
}else{
189190
[cell setTitle:@"我的码币" icon:@"user_info_point"];
191+
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_Me_Points]) {
192+
[cell addTipIcon];
193+
}
190194
}
191195
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
192196
return cell;
@@ -232,6 +236,11 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
232236
[self goToTopic];
233237
}
234238
}else if (indexPath.section == 3){
239+
if ([[FunctionTipsManager shareManager] needToTip:kFunctionTipStr_Me_Points]) {
240+
[[FunctionTipsManager shareManager] markTiped:kFunctionTipStr_Me_Points];
241+
UserInfoIconCell *cell = (UserInfoIconCell *)[tableView cellForRowAtIndexPath:indexPath];
242+
[cell removeTip];
243+
}
235244
[self goToPoint];
236245
}
237246
}

Coding_iOS/Util/Common/EaseToolBar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@
2828
@interface EaseToolBarItem : UIAwesomeButton
2929
+ (instancetype)easeToolBarItemWithTitle:(NSString *)title image:(NSString *)imageName disableImage:(NSString *)disableImageName;
3030
- (instancetype)initWithTitle:(NSString *)title image:(NSString *)imageName disableImage:(NSString *)disableImageName;
31+
- (void)addTipIcon;
32+
- (void)removeTipIcon;
3133
@end

Coding_iOS/Util/Common/EaseToolBar.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ + (instancetype)easeToolBarWithItems:(NSArray *)buttonItems{
2020
return [[EaseToolBar alloc] initWithItems:buttonItems];
2121
}
2222
- (id)itemOfIndex:(NSInteger)index{
23-
if (index > 0 && self.buttonItems && self.buttonItems.count >= index) {
23+
if (index >= 0 && self.buttonItems && self.buttonItems.count >= index) {
2424
return self.buttonItems[index];
2525
}else{
2626
return nil;
@@ -110,5 +110,12 @@ - (void)setEnabled:(BOOL)enabled{
110110
[self setIconImage:[UIImage imageNamed:imageName]];
111111
[self setAttributes:attributes forUIControlState:UIControlStateNormal];
112112
}
113+
- (void)addTipIcon{
114+
CGRect iconFrame = [self getIconImageView].frame;
115+
[self addBadgeTip:kBadgeTipStr withCenterPosition:CGPointMake(iconFrame.origin.x + iconFrame.size.width +2, 12)];
116+
}
117+
- (void)removeTipIcon{
118+
[self removeBadgeTips];
119+
}
113120
@end
114121

0 commit comments

Comments
 (0)