Skip to content

Commit 5b57010

Browse files
committed
math & tip
1 parent 672aa0b commit 5b57010

19 files changed

+26
-14
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
4E53EB5A1AFB090E0034FE1C /* nav_page_unselected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E53EB581AFB090E0034FE1C /* nav_page_unselected@2x.png */; };
264264
4E54C24B1D8FE19100A61023 /* user_info_edit@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E54C2491D8FE19100A61023 /* user_info_edit@2x.png */; };
265265
4E54C24C1D8FE19100A61023 /* user_info_edit@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E54C24A1D8FE19100A61023 /* user_info_edit@3x.png */; };
266+
4E54C24E1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E54C24D1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png */; };
266267
4E554D6E1C9804F40008686A /* Close2FAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E554D6D1C9804F40008686A /* Close2FAViewController.m */; };
267268
4E59D32B1D3E106D008C914B /* tweetsBtn_Nav@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E59D3291D3E106D008C914B /* tweetsBtn_Nav@2x.png */; };
268269
4E59D32C1D3E106D008C914B /* tweetsBtn_Nav@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E59D32A1D3E106D008C914B /* tweetsBtn_Nav@3x.png */; };
@@ -1560,6 +1561,7 @@
15601561
4E53EB581AFB090E0034FE1C /* nav_page_unselected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nav_page_unselected@2x.png"; sourceTree = "<group>"; };
15611562
4E54C2491D8FE19100A61023 /* user_info_edit@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "user_info_edit@2x.png"; sourceTree = "<group>"; };
15621563
4E54C24A1D8FE19100A61023 /* user_info_edit@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "user_info_edit@3x.png"; sourceTree = "<group>"; };
1564+
4E54C24D1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_ProjectTopicCommentVote@2x.png"; sourceTree = "<group>"; };
15631565
4E554D6C1C9804F40008686A /* Close2FAViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Close2FAViewController.h; sourceTree = "<group>"; };
15641566
4E554D6D1C9804F40008686A /* Close2FAViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Close2FAViewController.m; sourceTree = "<group>"; };
15651567
4E59D3291D3E106D008C914B /* tweetsBtn_Nav@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweetsBtn_Nav@2x.png"; sourceTree = "<group>"; };
@@ -5077,6 +5079,7 @@
50775079
8EA6CFAF19E240C40076D59C /* tip_icons */ = {
50785080
isa = PBXGroup;
50795081
children = (
5082+
4E54C24D1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png */,
50805083
4EB862AC1CABB21E008074D1 /* tipIcon_TeamMember@2x.png */,
50815084
4E9F5D1F1C03051D007CCDCC /* tipIcon_tweetReward@2x.png */,
50825085
4E5C06E71AC2B34800F427C5 /* tipIcon_BranchMember@2x.png */,
@@ -6098,6 +6101,7 @@
60986101
8EA6D16919E240C40076D59C /* nav_project_task@2x.png in Resources */,
60996102
4E2BF3D11B96CDF800A5A0A8 /* share_btn_evernote@2x.png in Resources */,
61006103
13FB5D3A1CA17A6400EE127C /* PR_push@2x.png in Resources */,
6104+
4E54C24E1D90E05400A61023 /* tipIcon_ProjectTopicCommentVote@2x.png in Resources */,
61016105
4EF17EE41B3C3112003CDD2D /* intro_tip_4@2x.png in Resources */,
61026106
4EAE06C01B7B51AF00179F4B /* file_activity_icon_create@2x.png in Resources */,
61036107
8EA6D18F19E240C40076D59C /* tasks_all@2x.png in Resources */,

Coding_iOS/.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS/Controllers/DynamicCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ - (void)setCurComment:(ProjectLineNote *)curComment{
106106
NSString *contentStr = _curComment.content;
107107
[_contentLabel setLongString:contentStr withFitWidth:kTaskCommentCell_ContentWidth];
108108
for (HtmlMediaItem *item in _curComment.htmlMedia.mediaItems) {
109-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
109+
if (item.displayStr.length > 0 && item.href.length > 0) {
110110
[_contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
111111
}
112112
}

Coding_iOS/Controllers/Search/CSSearchCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ - (void)layoutSubviews {
142142
// [self.contentLabel setLongString:contentStr withFitWidth:kTweetCell_ContentWidth maxHeight:kTweet_ContentMaxHeight];
143143
//
144144
for (HtmlMediaItem *item in _tweet.htmlMedia.mediaItems) {
145-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
145+
if (item.displayStr.length > 0 && item.href.length > 0) {
146146
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
147147
}
148148
}

Coding_iOS/Controllers/Topic/CSHotTopicView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ - (void)updateDisplayByTopic:(NSDictionary*)data {
285285
[self.contentLabel setLongString:contentStr withFitWidth:self.contentLabel.width maxHeight:34];
286286
self.contentLabel.centerY = self.height / 2;
287287
for (HtmlMediaItem *item in tweet.htmlMedia.mediaItems) {
288-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
288+
if (item.displayStr.length > 0 && item.href.length > 0) {
289289
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
290290
}
291291
}
Loading

Coding_iOS/Models/CodingTip.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ + (NSDictionary *)p_color_dict{
9696
@"TweetLike" : @"0xFF5847",
9797
@"User" : @"0x496AB3",
9898
@"UserFollow" : @"0x3BBD79",
99+
@"ProjectTopicCommentVote": @"",
99100
};
100101
});
101102
return color_dict;

Coding_iOS/Models/HtmlMedia.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ typedef NS_ENUM(NSInteger, HtmlMediaItemType) {
1717
HtmlMediaItemType_EmotionMonkey,
1818
HtmlMediaItemType_ATUser,
1919
HtmlMediaItemType_AutoLink,
20-
HtmlMediaItemType_CustomLink
20+
HtmlMediaItemType_CustomLink,
21+
HtmlMediaItemType_Math
2122
};
2223

2324
typedef NS_ENUM(NSInteger, MediaShowType) {

Coding_iOS/Models/HtmlMedia.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ - (void)analyseHtmlElement:(TFHppleElement* )element withShowType:(MediaShowType
6262
if (![_contentDisplay hasSuffix:@"\n"] && _contentDisplay.length > 0) {
6363
[_contentDisplay appendString:@"\n"];
6464
}
65+
}else if ([element.attributes[@"class"] isEqualToString:@"kdmath"]) {
66+
item = [HtmlMediaItem htmlMediaItemWithType:HtmlMediaItemType_Math];
67+
item.code = [element.text trimWhitespace];
6568
}else if ([element.tagName isEqualToString:@"code"]) {
6669
item = [HtmlMediaItem htmlMediaItemWithType:HtmlMediaItemType_Code];
6770
item.code = [element.text trimWhitespace];
@@ -249,6 +252,9 @@ - (NSString *)displayStr{
249252
case HtmlMediaItemType_CustomLink:
250253
displayStr = [_linkStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
251254
break;
255+
case HtmlMediaItemType_Math:
256+
displayStr = @"[math]";
257+
break;
252258
default:
253259
displayStr = @"";
254260
break;

Coding_iOS/Views/Cell/CodingTipCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ - (void)setCurTip:(CodingTip *)curTip{
132132
//content
133133
[_contentLabel setLongString:_curTip.content withFitWidth:kCodingTipCell_WidthContent];
134134
for (HtmlMediaItem *item in _curTip.htmlMedia.mediaItems) {
135-
if (item.displayStr.length > 0) {
135+
if (item.displayStr.length > 0 && item.href.length > 0) {
136136
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
137137
}
138138
}

Coding_iOS/Views/Cell/MRPRCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ - (void)setCurItem:(ProjectLineNote *)curItem{
7878
[_contentLabel setLongString:_curItem.content withFitWidth:curWidth];
7979

8080
for (HtmlMediaItem *item in _curItem.htmlMedia.mediaItems) {
81-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
81+
if (item.displayStr.length > 0 && item.href.length > 0) {
8282
[_contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
8383
}
8484
}

Coding_iOS/Views/Cell/MessageCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ - (void)setCurPriMsg:(PrivateMessage *)curPriMsg andPrePriMsg:(PrivateMessage *)
158158
[_contentLabel sizeToFit];
159159

160160
for (HtmlMediaItem *item in _curPriMsg.htmlMedia.mediaItems) {
161-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
161+
if (item.displayStr.length > 0 && item.href.length > 0) {
162162
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
163163
}
164164
}

Coding_iOS/Views/Cell/ProjectActivityListCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (void)layoutSubviews{
135135

136136
[_actionLabel setLongString:_proAct.actionStr withFitWidth:kProjectActivityListCell_ContentWidth maxHeight:kProjectActivityListCell_MaxActionHeight];
137137
for (HtmlMediaItem *item in _proAct.actionMediaItems) {
138-
if (item.displayStr.length > 0) {
138+
if (item.displayStr.length > 0 && item.href.length > 0) {
139139
[self.actionLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
140140
}
141141
}

Coding_iOS/Views/Cell/TaskCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ - (void)setCurComment:(TaskComment *)curComment{
110110
[_contentLabel setLongString:contentStr withFitWidth:kTaskCommentCell_ContentWidth];
111111

112112
for (HtmlMediaItem *item in _curComment.htmlMedia.mediaItems) {
113-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
113+
if (item.displayStr.length > 0 && item.href.length > 0) {
114114
[_contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
115115
}
116116
}

Coding_iOS/Views/Cell/TopicCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
135135
[_ownerIconView sd_setImageWithURL:[_toComment.owner.avatar urlImageWithCodePathResizeToView:_ownerIconView] placeholderImage:kPlaceholderMonkeyRoundView(_ownerIconView)];
136136
[_contentLabel setLongString:_toComment.content withFitWidth:curWidth];
137137
for (HtmlMediaItem *item in _toComment.htmlMedia.mediaItems) {
138-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
138+
if (item.displayStr.length > 0 && item.href.length > 0) {
139139
[_contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
140140
}
141141
}

Coding_iOS/Views/Cell/TweetCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ - (void)setTweet:(Tweet *)tweet needTopView:(BOOL)needTopView{
256256
[self.contentLabel setY:curBottomY];
257257
[self.contentLabel setLongString:_tweet.content withFitWidth:kTweetCell_ContentWidth maxHeight:kTweet_ContentMaxHeight];
258258
for (HtmlMediaItem *item in _tweet.htmlMedia.mediaItems) {
259-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
259+
if (item.displayStr.length > 0 && item.href.length > 0) {
260260
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
261261
}
262262
}

Coding_iOS/Views/Cell/TweetCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ - (void)configWithComment:(Comment *)curComment topLine:(BOOL)has{
8686
[_commentLabel setLongString:_curComment.content withFitWidth:kTweetCommentCell_ContentWidth maxHeight:kTweetCommentCell_ContentMaxHeight];
8787

8888
for (HtmlMediaItem *item in _curComment.htmlMedia.mediaItems) {
89-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
89+
if (item.displayStr.length > 0 && item.href.length > 0) {
9090
[_commentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
9191
}
9292
}

Coding_iOS/Views/Cell/TweetDetailCommentCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (void)layoutSubviews{
7676
[_contentLabel sizeToFit];
7777

7878
for (HtmlMediaItem *item in _toComment.htmlMedia.mediaItems) {
79-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
79+
if (item.displayStr.length > 0 && item.href.length > 0) {
8080
[_contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
8181
}
8282
}

Coding_iOS/Views/Cell/TweetSearchCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ - (void)layoutSubviews {
141141
// [self.contentLabel setLongString:contentStr withFitWidth:kTweetCell_ContentWidth maxHeight:kTweet_ContentMaxHeight];
142142
//
143143
for (HtmlMediaItem *item in _tweet.htmlMedia.mediaItems) {
144-
if (item.displayStr.length > 0 && !(item.type == HtmlMediaItemType_Code ||item.type == HtmlMediaItemType_EmotionEmoji)) {
144+
if (item.displayStr.length > 0 && item.href.length > 0) {
145145
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
146146
}
147147
}

0 commit comments

Comments
 (0)