Permalink
Browse files

Merge branch 'travis-ci'

  • Loading branch information...
Naituw committed Mar 3, 2015
2 parents 20748f3 + 884d6c4 commit d7f2844dbae3d29cc27b4563822fe6ed4eed240e
@@ -0,0 +1,9 @@
language: objective-c
before_install:
- brew update
- brew reinstall xctool
- gem update cocoapods
xcode_workspace: WBWebViewConsole.xcworkspace
xcode_scheme: WBWebViewConsole
xcode_sdk:
- iphonesimulator8.1
@@ -1,5 +1,3 @@
platform :ios, '6.0'
pod 'JSONKit-NoWarning', '~> 1.2'
pod 'UIView+Positioning', '~> 1.1'
pod 'NSDictionary+Accessors', '~> 1.0'
@@ -1,16 +1,10 @@
PODS:
- JSONKit-NoWarning (1.2)
- NSDictionary+Accessors (1.0.0)
- UIView+Positioning (1.1)
DEPENDENCIES:
- JSONKit-NoWarning (~> 1.2)
- NSDictionary+Accessors (~> 1.0)
- UIView+Positioning (~> 1.1)
SPEC CHECKSUMS:
JSONKit-NoWarning: fc8d6dd8ec65e303867d1bd274632fc60a4a8ab9
NSDictionary+Accessors: 7bb473f1258ca37aef786c8d4f70f7880d2e9887
UIView+Positioning: a6265459fffba45e86d321aff09d4a0d92e5df06
COCOAPODS: 0.35.0
@@ -1,4 +1,4 @@
# WBWebViewConsole
# WBWebViewConsole [![Build Status](https://travis-ci.org/Naituw/WBWebViewConsole.svg)](https://travis-ci.org/Naituw/WBWebViewConsole)
WBWebViewConsole is an In-App debug console for your UIWebView && WKWebView
@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
4CC06A345E7F6C9699973E16 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E9EF876B744447A8DBF1CF8 /* libPods.a */; };
C608C5761AA04C450089301B /* WBWebBrowserJSBridge.bundle in Resources */ = {isa = PBXBuildFile; fileRef = C608C5751AA04C450089301B /* WBWebBrowserJSBridge.bundle */; };
C61EE3461AA5807200449F20 /* UIView+WBTSizes.m in Sources */ = {isa = PBXBuildFile; fileRef = C61EE3451AA5807200449F20 /* UIView+WBTSizes.m */; };
C61EE3491AA5815500449F20 /* NSObject+WBJSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = C61EE3481AA5815500449F20 /* NSObject+WBJSONKit.m */; };
C656B6681A8DE08900263FC0 /* WBJSBridgeMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = C656B6671A8DE08900263FC0 /* WBJSBridgeMessage.m */; };
C656B6731A8F682C00263FC0 /* WBJSBridgeActionPrivateConsoleLog.m in Sources */ = {isa = PBXBuildFile; fileRef = C656B6721A8F682C00263FC0 /* WBJSBridgeActionPrivateConsoleLog.m */; };
C6B12C541A8D9CAB004F2AD2 /* libWBWebViewConsole.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C6B12C481A8D9CAB004F2AD2 /* libWBWebViewConsole.a */; };
@@ -61,6 +63,10 @@
3F8EEC49B5777B1BF7725016 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
7858147BFF2CF9784421BD09 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
C608C5751AA04C450089301B /* WBWebBrowserJSBridge.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WBWebBrowserJSBridge.bundle; sourceTree = "<group>"; };
C61EE3441AA5807200449F20 /* UIView+WBTSizes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+WBTSizes.h"; sourceTree = "<group>"; };
C61EE3451AA5807200449F20 /* UIView+WBTSizes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+WBTSizes.m"; sourceTree = "<group>"; };
C61EE3471AA5815500449F20 /* NSObject+WBJSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+WBJSONKit.h"; sourceTree = "<group>"; };
C61EE3481AA5815500449F20 /* NSObject+WBJSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+WBJSONKit.m"; sourceTree = "<group>"; };
C656B6661A8DE08900263FC0 /* WBJSBridgeMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WBJSBridgeMessage.h; sourceTree = "<group>"; };
C656B6671A8DE08900263FC0 /* WBJSBridgeMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WBJSBridgeMessage.m; sourceTree = "<group>"; };
C656B6711A8F682C00263FC0 /* WBJSBridgeActionPrivateConsoleLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WBJSBridgeActionPrivateConsoleLog.h; sourceTree = "<group>"; };
@@ -294,6 +300,10 @@
C6B12C941A8DC6C5004F2AD2 /* UIColor+WBTHelpers.m */,
C6B12C971A8DC84E004F2AD2 /* UIScrollView+WBTUtilities.h */,
C6B12C981A8DC84E004F2AD2 /* UIScrollView+WBTUtilities.m */,
C61EE3441AA5807200449F20 /* UIView+WBTSizes.h */,
C61EE3451AA5807200449F20 /* UIView+WBTSizes.m */,
C61EE3471AA5815500449F20 /* NSObject+WBJSONKit.h */,
C61EE3481AA5815500449F20 /* NSObject+WBJSONKit.m */,
);
name = Extensions;
sourceTree = "<group>";
@@ -457,6 +467,7 @@
buildActionMask = 2147483647;
files = (
C6B12C6F1A8D9D64004F2AD2 /* WBWebViewConsole.m in Sources */,
C61EE3491AA5815500449F20 /* NSObject+WBJSONKit.m in Sources */,
C6B12C951A8DC6C5004F2AD2 /* UIColor+WBTHelpers.m in Sources */,
C656B6731A8F682C00263FC0 /* WBJSBridgeActionPrivateConsoleLog.m in Sources */,
C6B12C771A8D9D6B004F2AD2 /* WBWebViewConsoleUserPromptCompletionDatasource.m in Sources */,
@@ -475,6 +486,7 @@
C6B12C871A8D9EE9004F2AD2 /* WBWebViewUserScript.m in Sources */,
C6B12C7F1A8D9D73004F2AD2 /* WBWebViewConsoleInputViewActionButton.m in Sources */,
C6B12C921A8DC67D004F2AD2 /* WBKeyboardObserver.m in Sources */,
C61EE3461AA5807200449F20 /* UIView+WBTSizes.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4,7 +4,7 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>WBWebViewConsole.xcscheme</key>
<key>WBWebViewConsole.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
@@ -16,7 +16,7 @@
#import "WBWebViewConsoleMessageCell.h"
#import "WBWebViewConsoleInputView.h"
#import "UIScrollView+WBTUtilities.h"
#import <UIView+Positioning.h>
#import "UIView+WBTSizes.h"
#import "WBKeyboardObserver.h"
@interface WBWebDebugConsoleViewController () <UITableViewDataSource, UITableViewDelegate, WBWebViewConsoleInputViewDelegate, WBWebViewConsoleMessageCellDelegate>
@@ -140,8 +140,8 @@ - (void)relayoutViewsAnimated:(BOOL)animated
[UIView setAnimationDuration:keyboard.animationDuration ? : 0.15];
}
self.inputView.frame = CGRectMake(0, self.view.height - inputViewHeight - keyboardHeight, self.view.width, inputViewHeight);
self.tableView.frame = CGRectMake(0, 0, self.view.width, self.view.height - inputViewHeight - keyboardHeight);
self.inputView.frame = CGRectMake(0, self.view.wbtHeight - inputViewHeight - keyboardHeight, self.view.wbtWidth, inputViewHeight);
self.tableView.frame = CGRectMake(0, 0, self.view.wbtWidth, self.view.wbtHeight - inputViewHeight - keyboardHeight);
if (animated)
{
@@ -14,8 +14,8 @@
#import "WBWebViewConsoleUserPromptCompletionController.h"
#import "WBWebView.h"
#import "WBWebViewConsoleDefines.h"
#import "NSObject+WBJSONKit.h"
#import <NSDictionary+Accessors/NSDictionary+Accessors.h>
#import <JSONKit.h>
@interface WBWebViewConsoleUserPromptCompletionController ()
@@ -65,7 +65,7 @@ - (void)fetchSuggestionsWithPrompt:(NSString *)prompt cursorIndex:(NSInteger)cur
failedBlock();
return;
}
NSDictionary * resultDict = [result objectFromJSONString];
NSDictionary * resultDict = [result wb_objectFromJSONString];
NSArray * suggestions = [resultDict arrayForKey:@"completions"];
NSInteger tokenStart = [resultDict integerForKey:@"token_start"];
NSInteger tokenEnd = [resultDict integerForKey:@"token_end"];
@@ -15,7 +15,7 @@
#import "WBWebViewConsoleMessageCell.h"
#import "WBWebViewConsoleInputView.h"
#import "UIColor+WBTHelpers.h"
#import <UIView+Positioning.h>
#import "UIView+WBTSizes.h"
@interface WBWebViewConsoleUserPromptCompletionCell : UITableViewCell
@@ -88,7 +88,7 @@ - (void)layoutSubviews
[super layoutSubviews];
self.textLabel.backgroundColor = [UIColor clearColor];
self.textLabel.frame = CGRectMake(30, 0, self.width - 40, self.height);
self.textLabel.frame = CGRectMake(30, 0, self.wbtWidth - 40, self.wbtHeight);
}
- (void)setSuggestion:(NSString *)suggestion
@@ -16,7 +16,7 @@
#import "WBWebViewConsoleUserPromptCompletionController.h"
#import "WBWebView.h"
#import "WBWebViewJSBridge.h"
#import <JSONKit.h>
#import "NSObject+WBJSONKit.h"
NSString * const WBWebViewConsoleDidAddMessageNotification = @"WBWebViewConsoleDidAddMessageNotification";
NSString * const WBWebViewConsoleDidClearMessagesNotification = @"WBWebViewConsoleDidClearMessagesNotification";
@@ -144,7 +144,7 @@ - (void)sendMessage:(NSString *)message
NSString * string = result;
if (![string isKindOfClass:[NSString class]])
{
string = [result JSONString];
string = [result wb_JSONString];
}
if ([string isKindOfClass:[NSString class]] && string.length)
@@ -428,7 +428,7 @@ function __stringifyArgs(args) {
config[@"bridge"] = interface;
}
js = [js stringByAppendingFormat:@"(%@)", config.JSONString];
js = [js stringByAppendingFormat:@"(%@)", config.wb_JSONString];
WBWebViewUserScript * script = [WBWebViewUserScript scriptWithSource:js injectionTime:WBUserScriptInjectionTimeAtDocumentStart mainFrameOnly:NO];
@@ -0,0 +1,38 @@
//
// NSObject+WBJSONKit.h
// WBWebViewConsole
//
// Created by 吴天 on 15/3/3.
//
// Copyright (c) 2014-present, Weibo, Corp.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <Foundation/Foundation.h>
@interface NSObject (WBJSONKit)
@end
@interface NSString (WBJSONKit)
@property (nonatomic, copy, readonly) NSString * wb_JSONString;
@property (nonatomic, copy, readonly) id wb_objectFromJSONString;
@end
@interface NSArray (WBJSONKit)
@property (nonatomic, copy, readonly) NSString * wb_JSONString;
@end
@interface NSDictionary (WBJSONKit)
@property (nonatomic, copy, readonly) NSString * wb_JSONString;
@end
@@ -0,0 +1,55 @@
//
// NSObject+WBJSONKit.m
// WBWebViewConsole
//
// Created by 吴天 on 15/3/3.
//
// Copyright (c) 2014-present, Weibo, Corp.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import "NSObject+WBJSONKit.h"
@implementation NSObject (WBJSONKit)
@end
@implementation NSString (WBJSONKit)
- (NSString *)wb_JSONString
{
return [self copy];
}
- (id)wb_objectFromJSONString
{
NSData * data = [self dataUsingEncoding:NSUTF8StringEncoding];
return [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];
}
@end
@implementation NSArray (WBJSONKit)
- (NSString *)wb_JSONString
{
NSData * data = [NSJSONSerialization dataWithJSONObject:self options:0 error:NULL];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
@end
@implementation NSDictionary (WBJSONKit)
- (NSString *)wb_JSONString
{
NSData * data = [NSJSONSerialization dataWithJSONObject:self options:0 error:NULL];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
@end
@@ -0,0 +1,82 @@
// Copyright (c) 2014-present, Weibo, Corp.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
// Copyright 2009-2010 Facebook
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <UIKit/UIKit.h>
@interface UIView (WBTSizes)
/*!
* Shortcut for frame.origin.x.
*
* Sets frame.origin.x = left
*/
@property (nonatomic) CGFloat wbtLeft;
/*!
* Shortcut for frame.origin.y
*
* Sets frame.origin.y = top
*/
@property (nonatomic) CGFloat wbtTop;
/*!
* Shortcut for frame.origin.x + frame.size.width
*
* Sets frame.origin.x = right - frame.size.width
*/
@property (nonatomic) CGFloat wbtRight;
/*!
* Shortcut for frame.origin.y + frame.size.height
*
* Sets frame.origin.y = bottom - frame.size.height
*/
@property (nonatomic) CGFloat wbtBottom;
/*!
* Shortcut for frame.size.width
*
* Sets frame.size.width = width
*/
@property (nonatomic) CGFloat wbtWidth;
/*!
* Shortcut for frame.size.height
*
* Sets frame.size.height = height
*/
@property (nonatomic) CGFloat wbtHeight;
/*!
* Shortcut for center.x
*
* Sets center.x = centerX
*/
@property (nonatomic) CGFloat wbtCenterX;
/*!
* Shortcut for center.y
*
* Sets center.y = centerY
*/
@property (nonatomic) CGFloat wbtCenterY;
@end
Oops, something went wrong.

0 comments on commit d7f2844

Please sign in to comment.