Skip to content

Commit

Permalink
Merge branch 'release-1.6.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Jul 7, 2015
2 parents 3015e13 + 4c29f1a commit 8ea347a
Show file tree
Hide file tree
Showing 51 changed files with 638 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "Core/Externals/DTLoupe"]
path = Core/Externals/DTLoupe
url = [email protected].com:parts/dtloupe.git
url = https://github.com/Cocoanetics/DTLoupe.git
[submodule "Core/Externals/DTCoreText"]
path = Core/Externals/DTCoreText
url = https://github.com/Cocoanetics/DTCoreText.git
Expand Down
1 change: 0 additions & 1 deletion Core/DTRichTextEditor-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DTCoreText.h"
#endif
4 changes: 0 additions & 4 deletions Core/DTRichTextEditor.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// everything is based on this
#import "DTCoreText.h"

#import "DTRichTextEditorConstants.h"

// utility categories
#import "NSAttributedString+DTRichText.h"
#import "NSMutableAttributedString+DTRichText.h"
#import "NSMutableDictionary+DTRichText.h"
#import "UIPasteboard+DTWebArchive.h"

// specialized RTE subclasses
#import "DTTextRange.h"
Expand All @@ -27,7 +24,6 @@
#import "DTRichTextEditorView+Styles.h"

#import "DTTextSelectionView.h"
#import "DTDictationPlaceholderView.h"

#import "DTUndoManager.h"

Expand Down
2 changes: 1 addition & 1 deletion Core/Externals/DTCoreText
Submodule DTCoreText updated 74 files
+2 −0 .gitattributes
+3 −6 .travis.yml
+2 −1 Core/Source/DTAnchorHTMLElement.m
+1 −1 Core/Source/DTAttributedTextCell.h
+2 −1 Core/Source/DTAttributedTextCell.m
+1 −1 Core/Source/DTAttributedTextContentView.h
+11 −1 Core/Source/DTAttributedTextContentView.m
+4 −2 Core/Source/DTAttributedTextView.m
+2 −0 Core/Source/DTColor+Compatibility.h
+6 −6 Core/Source/DTCompatibility.h
+14 −0 Core/Source/DTCoreText.h
+1 −0 Core/Source/DTCoreTextConstants.h
+1 −0 Core/Source/DTCoreTextConstants.m
+1 −1 Core/Source/DTCoreTextFontDescriptor.h
+1 −1 Core/Source/DTCoreTextFontDescriptor.m
+3 −0 Core/Source/DTCoreTextFunctions.h
+20 −4 Core/Source/DTCoreTextLayoutFrame.m
+1 −1 Core/Source/DTCoreTextParagraphStyle.m
+1 −1 Core/Source/DTHTMLAttributedStringBuilder.h
+29 −11 Core/Source/DTHTMLAttributedStringBuilder.m
+1 −1 Core/Source/DTHTMLElement.h
+36 −13 Core/Source/DTHTMLElement.m
+1 −1 Core/Source/DTHTMLParserNode.h
+12 −2 Core/Source/DTHTMLWriter.m
+4 −1 Core/Source/DTIframeTextAttachment.m
+2 −0 Core/Source/DTImage+HTML.h
+18 −11 Core/Source/DTImageTextAttachment.m
+1 −1 Core/Source/DTLazyImageView.h
+3 −2 Core/Source/DTLazyImageView.m
+1 −1 Core/Source/DTListItemHTMLElement.h
+12 −0 Core/Source/DTListItemHTMLElement.m
+1 −1 Core/Source/DTObjectTextAttachment.h
+5 −2 Core/Source/DTObjectTextAttachment.m
+2 −1 Core/Source/DTTextAttachment.h
+9 −9 Core/Source/DTTextAttachment.m
+0 −1 Core/Source/DTTextBlock.m
+1 −1 Core/Source/DTTextHTMLElement.m
+4 −1 Core/Source/DTVideoTextAttachment.m
+33 −0 Core/Source/DTWeakSupport.h
+1 −1 Core/Source/DTWebVideoView.h
+15 −2 Core/Source/NSAttributedString+DTCoreText.m
+3 −2 Core/Source/NSAttributedString+HTML.m
+8 −1 Core/Source/NSAttributedString+SmallCaps.m
+1 −1 Core/Source/NSCoder+DTCompatibility.h
+32 −9 Core/Source/NSMutableAttributedString+HTML.m
+1 −1 Core/Source/NSScanner+HTML.m
+4 −1 Core/Source/NSString+CSS.m
+2 −2 Core/Source/NSString+HTML.m
+2 −0 Core/Source/UIFont+DTCoreText.h
+1 −1 DTCoreText.podspec
+587 −54 DTCoreText.xcodeproj/project.pbxproj
+33 −3 DTCoreText.xcodeproj/xcshareddata/xcschemes/DTCoreText (Mac).xcscheme
+99 −0 DTCoreText.xcodeproj/xcshareddata/xcschemes/DTCoreText (iOS).xcscheme
+22 −3 DTCoreText.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme
+13 −1 DTCoreText.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme
+13 −1 DTCoreText.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme
+4 −1 DTCoreText.xcodeproj/xcshareddata/xcschemes/UnitTest.xcscheme
+7 −0 Demo/DemoApp-Info.plist
+45 −0 Demo/Resources/Launch Screen.xib
+10 −0 Demo/Resources/Snippets.plist
+14 −0 Demo/Source/AutoLayoutDemoViewController.h
+27 −0 Demo/Source/AutoLayoutDemoViewController.m
+58 −0 Demo/Source/AutoLayoutDemoViewController.xib
+15 −7 Demo/Source/DemoSnippetsViewController.m
+2 −4 Demo/Source/DemoTextViewController.m
+1 −1 Externals/DTFoundation
+0 −1 Test/MacUnitTest-Prefix.pch
+1 −1 Test/Source/DTCoreTextFontDescriptorTest.m
+1 −1 Test/Source/DTCoreTextParagraphStyleTest.m
+1 −0 Test/Source/DTHTMLElementTest.m
+1 −0 Test/Source/MacUnitTest.m
+2 −2 Test/Source/NSAttributedStringHTMLTest.m
+1 −1 Test/Source/NSDictionaryDTCoreText.m
+55 −0 Test/Source/NSMutableAttributedStringHTMLTest.m
2 changes: 1 addition & 1 deletion Core/Externals/DTWebArchive
2 changes: 1 addition & 1 deletion Core/Source/DTCoreTextLayoutFrame+DTRichText.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright 2011 Cocoanetics. All rights reserved.
//

#import "DTCoreTextLayoutFrame.h"
#import <DTCoreText/DTCoreTextLayoutFrame.h>

@class DTTextPosition, DTTextRange;

Expand Down
8 changes: 3 additions & 5 deletions Core/Source/DTCoreTextLayoutFrame+DTRichText.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
// Copyright 2011 Cocoanetics. All rights reserved.
//

#import "DTCoreTextLayoutFrame+DTRichText.h"
#import "DTCoreTextLayoutFrame+Cursor.h"
#import <DTCoreText/DTCoreText.h>

#import "DTTextPosition.h"
#import "DTTextRange.h"
#import "DTCoreTextLayoutLine.h"
#import "DTTextSelectionRect.h"

@implementation DTCoreTextLayoutFrame (DTRichText)
Expand All @@ -35,8 +33,8 @@ - (NSArray *)selectionRectsForRange:(NSRange)range
NSInteger fromIndex = range.location;
NSInteger toIndex = range.location + range.length;

CGFloat fromCaretOffset;
CGFloat toCaretOffset;
CGFloat fromCaretOffset = 0.0;
CGFloat toCaretOffset = 0.0;

BOOL haveStart = NO;
BOOL haveEnd = NO;
Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTHTMLWriter+DTWebArchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//

#import "DTHTMLWriter.h"
#import <DTCoreText/DTHTMLWriter.h>

@class DTWebArchive;

Expand Down
6 changes: 3 additions & 3 deletions Core/Source/DTHTMLWriter+DTWebArchive.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#import "DTHTMLWriter+DTWebArchive.h"

#import "DTWebArchive.h"
#import "DTWebResource.h"
#import <DTWebArchive/DTWebArchive.h>
#import <DTWebArchive/DTWebResource.h>

#import "DTCoreText.h"
#import <DTCoreText/DTCoreText.h>

@class DTWebArchive;

Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTMutableCoreTextLayoutFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2011 Cocoanetics. All rights reserved.
//

#import "DTCoreTextLayoutFrame.h"
#import <DTCoreText/DTCoreTextLayoutFrame.h>

/**
Mutable subclass of <DTCoreTextLayoutFrame> to allow editing
Expand Down
3 changes: 2 additions & 1 deletion Core/Source/DTMutableCoreTextLayoutFrame.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
// Copyright (c) 2011 Cocoanetics. All rights reserved.
//

#import <DTCoreText/DTCoreText.h>

#import "DTMutableCoreTextLayoutFrame.h"
#import "DTRichTextCategories.h"
#import "DTCoreText.h"
#import "DTCoreTextLayoutFrame+DTRichText.h"

@implementation DTMutableCoreTextLayoutFrame
Expand Down
4 changes: 2 additions & 2 deletions Core/Source/DTRichTextCategories.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// Copyright (c) 2011 Cocoanetics. All rights reserved.
//

#import "DTCoreTextGlyphRun.h"
#import "DTCoreTextLayoutLine.h"
#import <DTCoreText/DTCoreTextGlyphRun.h>
#import <DTCoreText/DTCoreTextLayoutLine.h>

/**
Editor-related extensions to <DTCoreTextGlyphRun>
Expand Down
1 change: 1 addition & 0 deletions Core/Source/DTRichTextEditorConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//

#import <Foundation/Foundation.h>

// for savekeeping paragraph spacing while this paragraph is in a list so that it can be restored if the paragraph is taken out of the list
extern NSString * const DTParagraphSpacingOverriddenByListAttribute;
Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTRichTextEditorContentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2011 Cocoanetics. All rights reserved.
//

#import "DTAttributedTextContentView.h"
#import <DTCoreText/DTAttributedTextContentView.h>

/**
This class represents the content view of a DTRichTextEditorView which itself is a UIScrollView subclass.
Expand Down
5 changes: 3 additions & 2 deletions Core/Source/DTRichTextEditorContentView.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

#import "DTRichTextEditorContentView.h"
#import "DTMutableCoreTextLayoutFrame.h"
#import "DTCoreTextLayoutFrame.h"
#import "DTTiledLayerWithoutFade.h"

#import <DTCoreText/DTCoreTextLayoutFrame.h>
#import <DTFoundation/DTTiledLayerWithoutFade.h>


@implementation DTRichTextEditorContentView
Expand Down
4 changes: 2 additions & 2 deletions Core/Source/DTRichTextEditorView+Attributes.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import "DTRichTextEditorView+Attributes.h"
#import "NSAttributedString+HTML.h"
#import "NSMutableAttributedString+HTML.h"
#import <DTCoreText/NSAttributedString+HTML.h>
#import <DTCoreText/NSMutableAttributedString+HTML.h>

#import "DTTextPosition.h"
#import "DTTextRange.h"
Expand Down
1 change: 1 addition & 0 deletions Core/Source/DTRichTextEditorView+DTCoreText.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "DTRichTextEditorView+DTCoreText.h"
#import <DTCoreText/DTCoreText.h>

@implementation DTRichTextEditorView (DTCoreText)

Expand Down
4 changes: 4 additions & 0 deletions Core/Source/DTRichTextEditorView+Dictation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//

#import <UIKit/UIKit.h>

@class DTDictationPlaceholderTextAttachment;

#import "DTRichTextEditorView.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTRichTextEditorView+Dictation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "DTRichTextEditor.h"
#import "DTDictationPlaceholderView.h"
#import <DTCoreText/DTCoreText.h>

@interface DTRichTextEditorView (private)

Expand Down
3 changes: 2 additions & 1 deletion Core/Source/DTRichTextEditorView+Lists.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#import "DTRichTextEditor.h"
#import "NSAttributedString+DTRichText.h"
#import "NSAttributedString+DTDebug.h"

#import <DTCoreText/DTCoreText.h>

@interface DTRichTextEditorView (private)

Expand Down
3 changes: 3 additions & 0 deletions Core/Source/DTRichTextEditorView+Manipulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <DTCoreText/DTCoreTextGlyphRun.h>

#import "DTRichTextEditorView.h"

/**
Expand Down
4 changes: 3 additions & 1 deletion Core/Source/DTRichTextEditorView+Manipulation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
//

#import "DTRichTextEditor.h"
#import "DTHTMLWriter.h"
#import "DTUndoManager.h"

#import <DTCoreText/DTCoreText.h>
#import <DTWebArchive/UIPasteboard+DTWebArchive.h>

@interface DTRichTextEditorView (private)

- (void)updateCursorAnimated:(BOOL)animated;
Expand Down
3 changes: 3 additions & 0 deletions Core/Source/DTRichTextEditorView+Ranges.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import "DTRichTextEditorView+Ranges.h"

#import <DTCoreText/DTAttributedTextContentView.h>
#import <DTCoreText/NSString+Paragraphs.h>

@implementation DTRichTextEditorView (Ranges)

#pragma mark - Working with Ranges
Expand Down
5 changes: 4 additions & 1 deletion Core/Source/DTRichTextEditorView+Styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// Copyright (c) 2013 Cocoanetics. All rights reserved.
//

#import "DTRichTextEditor.h"
#import "DTRichTextEditorView.h"
#import <DTCoreText/DTCoreTextFontDescriptor.h>
#import <DTCoreText/DTCoreTextParagraphStyle.h>
#import <DTCoreText/DTCSSListStyle.h>

/**
The **Ranges** category enhances DTRichTextEditorView with methods for retrieving CSS-like style information.
Expand Down
2 changes: 2 additions & 0 deletions Core/Source/DTRichTextEditorView+Styles.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "DTRichTextEditorView+Styles.h"

#import <DTCoreText/NSAttributedString+HTML.h>
#import <DTCoreText/NSDictionary+DTCoreText.h>

@implementation DTRichTextEditorView (Styles)

Expand Down
2 changes: 1 addition & 1 deletion Core/Source/DTRichTextEditorView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright 2011 Cocoanetics. All rights reserved.
//

#import "DTAttributedTextView.h"
#import <DTCoreText/DTAttributedTextView.h>

/**
Notifies observers that an editing session began in an editor view. The affected view is stored in the object parameter of the notification. The userInfo dictionary is not used.
Expand Down
42 changes: 25 additions & 17 deletions Core/Source/DTRichTextEditorView.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,49 @@

#import <QuartzCore/QuartzCore.h>

#import "DTLoupeView.h"
#import <DTLoupe/DTLoupeView.h>
#import <DTCoreText/DTCoreText.h>
#import <DTFoundation/DTCoreGraphicsUtils.h>
#import <DTFoundation/DTTiledLayerWithoutFade.h>
#import <DTFoundation/DTWeakSupport.h>

#import "DTRichTextEditor.h"

#import "DTCoreTextLayoutFrame+DTRichText.h"
#import "DTMutableCoreTextLayoutFrame.h"
#import "NSMutableAttributedString+HTML.h"
#import "NSMutableAttributedString+DTRichText.h"
#import "DTMutableCoreTextLayoutFrame.h"
#import "NSMutableDictionary+DTRichText.h"
#import "DTRichTextEditorView.h"
#import "DTRichTextEditorView+Manipulation.h"
#import "DTDictationPlaceholderView.h"

#import "DTCursorView.h"
#import "DTLoupeView.h"
#import "DTCoreTextLayouter.h"

#import "DTCoreGraphicsUtils.h"
#import "DTCoreTextFontDescriptor.h"
#import "DTTiledLayerWithoutFade.h"

#import "DTWebArchive.h"
#import "NSAttributedString+DTWebArchive.h"
#import "NSAttributedString+DTRichText.h"
#import "NSAttributedStringRunDelegates.h"
#import "UIPasteboard+DTWebArchive.h"
#import "DTRichTextEditorContentView.h"
#import "DTRichTextEditorView+Manipulation.h"
#import "DTUndoManager.h"
#import "DTHTMLWriter.h"
#import "DTHTMLWriter+DTWebArchive.h"


// defines for renamed attribute names, deprecated in iOS SDK 8

#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
#define DTTextInputTextColorKey NSForegroundColorAttributeName
#define DTTextInputTextFontKey NSFontAttributeName
#define DTTextInputTextBackgroundColorKey NSBackgroundColorAttributeName
#else
#define DTTextInputTextColorKey UITextInputTextColorKey
#define DTTextInputTextFontKey UITextInputTextFontKey
#define DTTextInputTextBackgroundColorKey UITextInputTextBackgroundColorKey
#endif


// string constants

NSString * const DTRichTextEditorTextDidBeginEditingNotification = @"DTRichTextEditorTextDidBeginEditingNotification";
NSString * const DTRichTextEditorTextDidChangeNotification = @"DTRichTextEditorTextDidChangeNotification";
NSString * const DTRichTextEditorTextDidEndEditingNotification = @"DTRichTextEditorTextDidEndEditingNotification";
Expand Down Expand Up @@ -103,7 +112,6 @@ @implementation DTRichTextEditorView

// private stuff
id<UITextInputTokenizer> tokenizer;
__unsafe_unretained id<UITextInputDelegate> inputDelegate;
DTTextRange *_selectedTextRange;
DTTextRange *_markedTextRange;
NSDictionary *_markedTextStyle;
Expand Down Expand Up @@ -304,7 +312,7 @@ - (void)setDefaults
[center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];

// style for displaying marked text
self.markedTextStyle = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor greenColor], UITextInputTextColorKey, nil];
self.markedTextStyle = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor greenColor], DTTextInputTextColorKey, nil];
}

- (id)initWithFrame:(CGRect)frame
Expand Down Expand Up @@ -2320,7 +2328,7 @@ - (void)replaceRange:(DTTextRange *)range withText:(id)text
if ([text isEqualToString:@"\n"])
{
// remove underline decoration from newline
[attributes removeObjectForKey:NSUnderlineStyleAttributeName];
[attributes removeUnderlineStyle];

// remove strike-through decoration from newline
[attributes removeObjectForKey:DTStrikeOutAttribute];
Expand Down Expand Up @@ -2921,18 +2929,18 @@ - (NSDictionary *)textStylingAtPosition:(DTTextPosition *)position inDirection:(
CFStringRef fontName = CTFontCopyPostScriptName(ctFont);
UIFont *uif = [UIFont fontWithName:(__bridge id)fontName size:CTFontGetSize(ctFont)];
CFRelease(fontName);
[uiStyles setObject:uif forKey:UITextInputTextFontKey];
[uiStyles setObject:uif forKey:DTTextInputTextFontKey];
}

CGColorRef cgColor = (__bridge CGColorRef)[ctStyles objectForKey:(id)kCTForegroundColorAttributeName];
if (cgColor)
{
[uiStyles setObject:[UIColor colorWithCGColor:cgColor] forKey:UITextInputTextColorKey];
[uiStyles setObject:[UIColor colorWithCGColor:cgColor] forKey:DTTextInputTextColorKey];
}

if (self.backgroundColor)
{
[uiStyles setObject:self.backgroundColor forKey:UITextInputTextBackgroundColorKey];
[uiStyles setObject:self.backgroundColor forKey:DTTextInputTextBackgroundColorKey];
}

return uiStyles;
Expand Down
2 changes: 2 additions & 0 deletions Core/Source/DTTextPosition.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright 2011 Cocoanetics. All rights reserved.
//

#import <UIKit/UIKIt.h>

/**
Class to represent a text position in DTRichTextEditorView
*/
Expand Down
Loading

0 comments on commit 8ea347a

Please sign in to comment.