Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
65 lines (51 loc) · 2.13 KB

File metadata and controls

executable file
·
65 lines (51 loc) · 2.13 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// HtmlMedia.h
// Coding_iOS
//
// Created by 王 原闯 on 14-9-5.
// Copyright (c) 2014年 Coding. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TFHpple.h"
#import "User.h"
typedef NS_ENUM(NSInteger, HtmlMediaItemType) {
HtmlMediaItemType_Image = 0,
HtmlMediaItemType_Code,
HtmlMediaItemType_EmotionEmoji,
HtmlMediaItemType_EmotionMonkey,
HtmlMediaItemType_ATUser,
HtmlMediaItemType_AutoLink,
HtmlMediaItemType_CustomLink
};
typedef NS_ENUM(NSInteger, MediaShowType) {
MediaShowTypeNone = 1,
MediaShowTypeCode = 2,
MediaShowTypeImage = 3,
MediaShowTypeMonkey = 5,
MediaShowTypeImageAndMonkey = 15,
MediaShowTypeAll = 30
};
@class HtmlMediaItem;
@interface HtmlMedia : NSObject
@property (readwrite, nonatomic, copy) NSString *contentOrigional;
@property (readwrite, nonatomic, strong) NSMutableString *contentDisplay;
@property (readwrite, nonatomic, strong) NSMutableArray *mediaItems;
@property (strong, nonatomic) NSArray *imageItems;
- (void)removeItem:(HtmlMediaItem *)item;
+ (instancetype)htmlMediaWithString:(NSString *)htmlString showType:(MediaShowType)showType;
- (instancetype)initWithString:(NSString *)htmlString showType:(MediaShowType)showType;
//在curString的末尾添加一个media元素
+ (void)addMediaItem:(HtmlMediaItem *)curItem toString:(NSMutableString *)curString andMediaItems:(NSMutableArray *)itemList;
+ (void)addLinkStr:(NSString *)linkStr type:(HtmlMediaItemType)type toString:(NSMutableString *)curString andMediaItems:(NSMutableArray *)itemList;
+ (void)addMediaItemUser:(User *)curUser toString:(NSMutableString *)curString andMediaItems:(NSMutableArray *)itemList;
@end
@interface HtmlMediaItem : NSObject
@property (assign, nonatomic) HtmlMediaItemType type;
@property (assign, nonatomic) MediaShowType showType;
@property (readwrite, nonatomic, strong) NSString *src, *title, *href, *name, *code, *linkStr;
@property (assign, nonatomic) NSRange range;
+ (instancetype)htmlMediaItemWithType:(HtmlMediaItemType)type;
+ (instancetype)htmlMediaItemWithTypeATUser:(User *)curUser mediaRange:(NSRange)curRange;
- (NSString *)displayStr;
- (BOOL)isGif;
@end
Morty Proxy This is a proxified and sanitized view of the page, visit original site.