Skip to content
This repository was archived by the owner on Dec 13, 2017. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Classes/WPEditorFormatbarView.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "WPEditorFormatbarView.h"

#import <CocoaLumberjack/CocoaLumberjack.h>
#import "WPDeviceIdentification.h"
#import <WordPressShared/WPDeviceIdentification.h>
#import "WPEditorToolbarButton.h"
#import "ZSSBarButtonItem.h"

Expand Down Expand Up @@ -274,9 +274,11 @@ - (void)initBarButtonItem:(ZSSBarButtonItem*)barButtonItem
barButtonItem.tag = tag;
barButtonItem.htmlProperty = htmlProperty;
barButtonItem.accessibilityLabel = accessibilityLabel;

UIImage* buttonImage = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];


NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
UIImage* image = [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
UIImage* buttonImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

WPEditorToolbarButton* customButton = [[WPEditorToolbarButton alloc] initWithFrame:CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height)];
[customButton setImage:buttonImage forState:UIControlStateNormal];
customButton.normalTintColor = self.itemTintColor;
Expand Down
1 change: 1 addition & 0 deletions Classes/WPEditorLoggingConfiguration.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

#ifdef LOG_LEVEL_DEF
#undef LOG_LEVEL_DEF
Expand Down
2 changes: 1 addition & 1 deletion Classes/WPEditorToolbarButton.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "WPEditorToolbarButton.h"
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPressShared/WPStyleGuide.h>

static NSString* const CircleLayerKey = @"circleLayer";
static CGFloat TouchAnimationCircleRadius = 15.0;
Expand Down
6 changes: 3 additions & 3 deletions Classes/WPEditorView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#import "WPEditorField.h"
#import "WPImageMeta.h"
#import "ZSSTextView.h"
#import <WordPress-iOS-Shared/WPDeviceIdentification.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPressShared/WPDeviceIdentification.h>
#import <WordPressShared/WPFontManager.h>
#import <WordPressShared/WPStyleGuide.h>

typedef void(^WPEditorViewCallbackParameterProcessingBlock)(NSString* parameterName, NSString* parameterValue);
typedef void(^WPEditorViewNoParamsCompletionBlock)();
Expand Down
19 changes: 10 additions & 9 deletions Classes/WPEditorViewController.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#import "WPEditorViewController.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import <UIKit/UIKit.h>
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
#import <WordPress-iOS-Shared/WPFontManager.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
#import <WordPress-iOS-Shared/WPDeviceIdentification.h>
#import <WordPressComAnalytics/WPAnalytics.h>
#import <WordPressShared/WPFontManager.h>
#import <WordPressShared/WPStyleGuide.h>
#import <WordPressShared/WPTableViewCell.h>
#import <WordPressShared/UIImage+Util.h>
#import <WordPressShared/UIColor+Helpers.h>
#import <WordPressShared/WPDeviceIdentification.h>

#import "WPEditorField.h"
#import "WPEditorToolbarButton.h"
Expand Down Expand Up @@ -103,8 +103,9 @@ - (void)sharedInitializationWithEditing:(BOOL)editing
- (void)createToolbarView
{
NSAssert(!_toolbarView, @"The toolbar view should not exist here.");

_toolbarView = (WPEditorFormatbarView *)[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([WPEditorFormatbarView class]) owner:nil options:nil] firstObject];

NSBundle *editorBundle = [NSBundle bundleForClass:[WPEditorFormatbarView class]];
_toolbarView = (WPEditorFormatbarView *)[[editorBundle loadNibNamed:NSStringFromClass([WPEditorFormatbarView class]) owner:nil options:nil] firstObject];
_toolbarView.delegate = self;
_toolbarView.borderColor = [WPStyleGuide greyLighten10];
_toolbarView.itemTintColor = [WPStyleGuide greyLighten10];
Expand Down
17 changes: 11 additions & 6 deletions Classes/WPLegacyEditorViewController.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "WPLegacyEditorViewController.h"
#import "WPLegacyKeyboardToolbarBase.h"
#import "WPLegacyKeyboardToolbarDone.h"
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPress-iOS-Shared/WPTableViewCell.h>
#import <WordPress-iOS-Shared/UIImage+Util.h>
#import <WordPressComAnalytics/WPAnalytics.h>
#import <WordPressShared/WPStyleGuide.h>
#import <WordPressShared/WPTableViewCell.h>
#import <WordPressShared/UIImage+Util.h>

CGFloat const WPLegacyEPVCTextfieldHeight = 44.0f;
CGFloat const WPLegacyEPVCOptionsHeight = 44.0f;
Expand Down Expand Up @@ -138,11 +138,11 @@ - (void)setupToolbar
return;
}

UIBarButtonItem *previewButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-posts-editor-preview"]
UIBarButtonItem *previewButton = [[UIBarButtonItem alloc] initWithImage:[self imageNamed:@"icon-posts-editor-preview"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didTouchPreview)];
UIBarButtonItem *photoButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-posts-editor-media"]
UIBarButtonItem *photoButton = [[UIBarButtonItem alloc] initWithImage:[self imageNamed:@"icon-posts-editor-media"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didTouchMediaOptions)];
Expand Down Expand Up @@ -494,6 +494,11 @@ - (NSString *)validateNewLinkInfo:(NSString *)urlText
}
}

- (UIImage *)imageNamed:(NSString *)imageName {
NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
return [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
}

#pragma mark - Formatting

- (void)wrapSelectionWithTag:(NSString *)tag
Expand Down
11 changes: 8 additions & 3 deletions Classes/WPLegacyKeyboardToolbarButtonItem.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "WPLegacyKeyboardToolbarButtonItem.h"
#import <QuartzCore/QuartzCore.h>
#import <WordPress-iOS-Shared/WPStyleGuide.h>
#import <WordPressShared/WPStyleGuide.h>

@implementation WPLegacyKeyboardToolbarButtonItem
@synthesize actionTag, actionName;
Expand All @@ -19,13 +19,18 @@ - (id)initWithFrame:(CGRect)frame {
return self;
}

- (UIImage *)imageNamed:(NSString *)imageName {
NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
return [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
}

- (void)setImageName:(NSString *)imageName {
[self setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@", imageName]] forState:UIControlStateNormal];
[self setImage:[self imageNamed:[NSString stringWithFormat:@"%@", imageName]] forState:UIControlStateNormal];
self.imageView.contentMode = UIViewContentModeCenter;
}

- (void)setImageName:(NSString *)imageName withColor:(UIColor *)tintColor highlightColor:(UIColor *)highlightColor {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@", imageName]];
UIImage *image = [self imageNamed:[NSString stringWithFormat:@"%@", imageName]];
if (tintColor) {
image = [self createImage:image withColor:tintColor];
}
Expand Down
16 changes: 8 additions & 8 deletions Example/EditorDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
15E849FD13EC454FA48CFC80 /* libPods-EditorDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */; };
59F15AD219E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 59F15AD119E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m */; };
5D24FEF91A3C9E8B009E1932 /* WPImageMetaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D24FEF81A3C9E8B009E1932 /* WPImageMetaViewController.m */; };
74291D0A1940C859004230D4 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 74291D091940C859004230D4 /* content.html */; };
Expand All @@ -28,7 +27,8 @@
748D2AB5193E516000D5ACC8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 748D2AB3193E516000D5ACC8 /* InfoPlist.strings */; };
748D2AB7193E516000D5ACC8 /* EditorDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 748D2AB6193E516000D5ACC8 /* EditorDemoTests.m */; };
74991B601BF10E7500AFA57B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 74991B5F1BF10E7500AFA57B /* LaunchScreen.storyboard */; };
B1341A871FF54DCCAEE52D3A /* libPods-EditorDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */; };
9B748FC06BB5833078779F06 /* Pods_EditorDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */; };
FF4B4D4C28B2EE2360630A8A /* Pods_EditorDemoTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -42,7 +42,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EditorDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
59F15AD019E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPEditorDemoLoggingConfiguration.h; sourceTree = "<group>"; };
59F15AD119E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPEditorDemoLoggingConfiguration.m; sourceTree = "<group>"; };
5D24FEF71A3C9E8B009E1932 /* WPImageMetaViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPImageMetaViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -72,9 +71,10 @@
748D2AB6193E516000D5ACC8 /* EditorDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EditorDemoTests.m; sourceTree = "<group>"; };
74991B5F1BF10E7500AFA57B /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
7DB5B4BB7BD920939EF39DA4 /* Pods-EditorDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemo/Pods-EditorDemo.release.xcconfig"; sourceTree = "<group>"; };
986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EditorDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A92C5705CA55DA4FE6C241C2 /* Pods-EditorDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemo/Pods-EditorDemo.debug.xcconfig"; sourceTree = "<group>"; };
C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EditorDemoTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E3905FE0E04F3570F2A87958 /* Pods-EditorDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemoTests/Pods-EditorDemoTests.debug.xcconfig"; sourceTree = "<group>"; };
E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EditorDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -86,7 +86,7 @@
748D2A8B193E516000D5ACC8 /* CoreGraphics.framework in Frameworks */,
748D2A8D193E516000D5ACC8 /* UIKit.framework in Frameworks */,
748D2A89193E516000D5ACC8 /* Foundation.framework in Frameworks */,
B1341A871FF54DCCAEE52D3A /* libPods-EditorDemo.a in Frameworks */,
9B748FC06BB5833078779F06 /* Pods_EditorDemo.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -97,7 +97,7 @@
748D2AAB193E516000D5ACC8 /* XCTest.framework in Frameworks */,
748D2AAD193E516000D5ACC8 /* UIKit.framework in Frameworks */,
748D2AAC193E516000D5ACC8 /* Foundation.framework in Frameworks */,
15E849FD13EC454FA48CFC80 /* libPods-EditorDemoTests.a in Frameworks */,
FF4B4D4C28B2EE2360630A8A /* Pods_EditorDemoTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -143,8 +143,8 @@
748D2A8A193E516000D5ACC8 /* CoreGraphics.framework */,
748D2A8C193E516000D5ACC8 /* UIKit.framework */,
748D2AAA193E516000D5ACC8 /* XCTest.framework */,
986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */,
290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */,
E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */,
C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion Example/EditorDemo/WPAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "WPAppDelegate.h"

#import <CocoaLumberjack/CocoaLumberjack.h>
#import <WordPress-iOS-Editor/WPEditorViewController.h>
#import <WordPressEditor/WPEditorViewController.h>

@implementation WPAppDelegate

Expand Down
2 changes: 1 addition & 1 deletion Example/EditorDemo/WPImageMetaViewController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "WPImageMetaViewController.h"
#import <WordPress-iOS-Editor/WPImageMeta.h>
#import <WordPressEditor/WPImageMeta.h>

@interface WPImageMetaViewController ()

Expand Down
2 changes: 1 addition & 1 deletion Example/EditorDemo/WPViewController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import <UIKit/UIKit.h>
#import <WordPress-iOS-Editor/WPEditorViewController.h>
#import <WordPressEditor/WPEditorViewController.h>

@interface WPViewController : WPEditorViewController <WPEditorViewControllerDelegate>

Expand Down
5 changes: 3 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
platform :ios, '9.0'
use_frameworks!
# Don't inhibit all warnings for all pods… do it individually. We need the editor
# POD to show all warnings.

target 'EditorDemo' do
pod 'WordPress-iOS-Editor', :path => '../'
pod 'CocoaLumberjack', '~>2.0.0', :inhibit_warnings => true
pod 'WordPress-iOS-Shared', '~>0.4.4', :inhibit_warnings => true
pod 'WordPressCom-Analytics-iOS', '~>0.0.38', :inhibit_warnings => true
pod 'WordPress-iOS-Shared', '~>0.5.0', :inhibit_warnings => true
pod 'WordPressCom-Analytics-iOS', '~>0.1.0', :inhibit_warnings => true
end

target 'EditorDemoTests' do
Expand Down
20 changes: 10 additions & 10 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ PODS:
- CocoaLumberjack/Extensions (2.0.0):
- CocoaLumberjack/Default
- NSObject-SafeExpectations (0.0.2)
- WordPress-iOS-Editor (1.0):
- WordPress-iOS-Editor (1.1):
- CocoaLumberjack (= 2.0.0)
- NSObject-SafeExpectations (~> 0.0.2)
- WordPress-iOS-Shared (~> 0.4.4)
- WordPressCom-Analytics-iOS (~> 0.0.38)
- WordPress-iOS-Shared (0.4.4):
- WordPress-iOS-Shared (~> 0.5.0)
- WordPressCom-Analytics-iOS (~> 0.1.0)
- WordPress-iOS-Shared (0.5.0):
- AFNetworking (~> 2.5)
- CocoaLumberjack (= 2.0.0)
- WordPressCom-Analytics-iOS (0.0.40)
- WordPressCom-Analytics-iOS (0.1.0)

DEPENDENCIES:
- CocoaLumberjack (~> 2.0.0)
- WordPress-iOS-Editor (from `../`)
- WordPress-iOS-Shared (~> 0.4.4)
- WordPressCom-Analytics-iOS (~> 0.0.38)
- WordPress-iOS-Shared (~> 0.5.0)
- WordPressCom-Analytics-iOS (~> 0.1.0)

EXTERNAL SOURCES:
WordPress-iOS-Editor:
Expand All @@ -53,8 +53,8 @@ SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
CocoaLumberjack: a6f77d987d65dc7ba86b0f84db7d0b9084f77bcb
NSObject-SafeExpectations: 7d7f48df90df4e11da7cfe86b64f45eff7a7f521
WordPress-iOS-Editor: 5d9939949c36613c7ab97451c921cf62af212baa
WordPress-iOS-Shared: 345f7c1c49d298114353c3856c53317f0d826078
WordPressCom-Analytics-iOS: 460c40e66cf4e75d19ca691f6a50c30cd16e8a79
WordPress-iOS-Editor: 71a7112d49e5d2ad817914bc72e50928901dd21f
WordPress-iOS-Shared: 5480e7b5c9c55158ea22c89ff44fca5597852224
WordPressCom-Analytics-iOS: 355b8c6cf1d50d64ca7667e6f9e94c989e466775

COCOAPODS: 0.39.0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading