mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-05 02:13:40 +00:00
Fixed: attachment support was missing in CPTextView (#2872)
This commit is contained in:
@@ -42,6 +42,11 @@ CPTextStorageDidProcessEditingNotification = @"CPTextStorageDidProcessEditingNot
|
||||
|
||||
@end
|
||||
|
||||
CPAttachmentCharacter = 65532; // "\ufffc";
|
||||
_CPAttachmentCharacterAsString = String.fromCharCode(CPAttachmentCharacter);
|
||||
|
||||
_CPAttachmentView = "_CPAttachmentView";
|
||||
_CPAttachmentInvisible = "_CPAttachmentInvisible";
|
||||
|
||||
var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1,
|
||||
CPTextStorageDelegate_textStorageDidProcessEditing_ = 1 << 2;
|
||||
@@ -257,6 +262,15 @@ var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1,
|
||||
return [super attributedSubstringFromRange:aRange];
|
||||
}
|
||||
|
||||
+ (id)attributedStringWithAttachment:(CPView)someView
|
||||
{
|
||||
var result = [[self alloc] initWithString:_CPAttachmentCharacterAsString];
|
||||
|
||||
[result setAttributes:@{_CPAttachmentView:someView} range:CPMakeRange(0, 1)];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -300,4 +314,4 @@ var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1,
|
||||
[super encodeWithCoder:aCoder];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user