You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/04/24 01:00:57 UTC
[29/50] [abbrv] git commit: moar tests
moar tests
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/9e4033ca
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/9e4033ca
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/9e4033ca
Branch: refs/heads/master
Commit: 9e4033cac1500b7d752c21fd2ae87a855ea1cf8b
Parents: e29b023
Author: Fil Maj <ma...@gmail.com>
Authored: Fri Apr 19 17:20:25 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Apr 19 17:20:25 2013 -0700
----------------------------------------------------------------------
README.md | 2 +-
spec/install.spec.js | 89 ++
spec/plugins/ChildBrowser/plugin.xml | 95 ++
.../ChildBrowser/src/android/ChildBrowser.java | 19 +
.../src/ios/ChildBrowser.bundle/arrow_left.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/arrow_left@2x.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/arrow_right.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/arrow_right@2x.png | Bin 0 -> 2946 bytes
.../src/ios/ChildBrowser.bundle/but_refresh.png | Bin 0 -> 3369 bytes
.../src/ios/ChildBrowser.bundle/but_refresh@2x.png | Bin 0 -> 3369 bytes
.../src/ios/ChildBrowser.bundle/compass.png | Bin 0 -> 3035 bytes
.../src/ios/ChildBrowser.bundle/compass@2x.png | Bin 0 -> 3035 bytes
.../ChildBrowser/src/ios/ChildBrowserCommand.h | 49 +
.../ChildBrowser/src/ios/ChildBrowserCommand.m | 86 ++
.../src/ios/ChildBrowserViewController.h | 73 ++
.../src/ios/ChildBrowserViewController.m | 239 ++++
.../src/ios/ChildBrowserViewController.xib | 875 +++++++++++++++
spec/plugins/ChildBrowser/src/ios/TargetDirTest.h | 20 +
spec/plugins/ChildBrowser/src/ios/TargetDirTest.m | 1 +
.../src/ios/preserveDirs/PreserveDirsTest.h | 20 +
.../src/ios/preserveDirs/PreserveDirsTest.m | 1 +
spec/plugins/ChildBrowser/www/childbrowser.js | 19 +
.../ChildBrowser/www/childbrowser/image.jpg | 1 +
.../ChildBrowser/www/childbrowser_file.html | 1 +
spec/plugins/FaultyPlugin/plugin.xml | 3 +-
spec/plugins/VariablePlugin/plugin.xml | 37 +
spec/remove.spec.js | 30 +
src/platforms/android.js | 8 +-
src/platforms/blackberry.js | 2 +-
src/platforms/ios.js | 2 +-
30 files changed, 1666 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index f9c6b03..622aee1 100644
--- a/README.md
+++ b/README.md
@@ -444,7 +444,7 @@ plugman can request users to specify variables required by a plugin. For example
A preference tag will need to be present inside the platform tag to make the variable mandatory like so:
- <preference name="API_KEY">
+ <preference name="API_KEY" />
plugman should check that these required preferences are passed in, and if not, should warn the user on how to pass the variable in and exit with a non-zero code.
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
index e69de29..d368111 100644
--- a/spec/install.spec.js
+++ b/spec/install.spec.js
@@ -0,0 +1,89 @@
+var install = require('../src/install'),
+ android = require('../src/platforms/android'),
+ plugman = require('../plugman'),
+ fs = require('fs'),
+ os = require('osenv'),
+ path = require('path'),
+ shell = require('shelljs'),
+ temp = path.join(os.tmpdir(), 'plugman'),
+ childbrowser = path.join(__dirname, 'plugins', 'ChildBrowser'),
+ variableplugin = path.join(__dirname, 'plugins', 'VariablePlugin'),
+ faultyplugin = path.join(__dirname, 'plugins', 'FaultyPlugin'),
+ android_one_project = path.join(__dirname, 'projects', 'android_one', '*');
+ plugins_dir = path.join(temp, 'cordova', 'plugins');
+
+describe('install', function() {
+ var copied_plugin_path = path.join(temp,'ChildBrowser');
+
+ beforeEach(function() {
+ shell.mkdir('-p', temp);
+ shell.mkdir('-p', plugins_dir);
+ });
+ afterEach(function() {
+ shell.rm('-rf', temp);
+ });
+
+ describe('success', function() {
+ beforeEach(function() {
+ shell.cp('-rf', android_one_project, temp);
+ shell.cp('-rf', childbrowser, plugins_dir);
+ });
+
+ it('should call prepare after a successful install', function() {
+ var s = spyOn(plugman, 'prepare');
+ console.log(path.resolve(path.join(plugins_dir, 'ChildBrowser', 'src', 'android')));
+ install('android', temp, 'ChildBrowser', plugins_dir, {});
+ //expect(s).toHaveBeenCalled();
+ });
+ it('on an Android project should call into Android module\'s handleInstall');
+ it('on a BlackBerry project should call into BlackBerry module\'s handleInstall');
+ it('on an iOS project should call into iOS module\'s handleInstall');
+ });
+
+ describe('failure', function() {
+ it('should throw if platform is unrecognized', function() {
+ expect(function() {
+ install('atari', temp, 'SomePlugin', plugins_dir, {});
+ }).toThrow('atari not supported.');
+ });
+ it('should throw if variables are missing', function() {
+ shell.cp('-rf', variableplugin, plugins_dir);
+ expect(function() {
+ install('android', temp, 'VariablePlugin', plugins_dir, {});
+ }).toThrow('Variable(s) missing: API_KEY');
+ });
+ it('should throw if installation failed', function() {
+ shell.cp('-rf', android_one_project, temp);
+ shell.cp('-rf', faultyplugin, plugins_dir);
+ var didThrow = false;
+ try {
+ install('android', temp, 'FaultyPlugin', plugins_dir, {});
+ } catch(e) {
+ didThrow = true;
+ expect(e.message).toMatch(/does not exist/);
+ }
+ expect(didThrow).toBe(true);
+ });
+ it('should revert changes if installation failed', function() {
+ shell.cp('-rf', android_one_project, temp);
+ shell.cp('-rf', faultyplugin, plugins_dir);
+ var s = spyOn(android, 'forceUninstall');
+ expect(function() {
+ install('android', temp, 'FaultyPlugin', plugins_dir, {});
+ }).toThrow();
+ expect(s).toHaveBeenCalled();
+ });
+ it('should throw an extra-long error if both installation and reversion failed', function() {
+ shell.cp('-rf', android_one_project, temp);
+ shell.cp('-rf', faultyplugin, plugins_dir);
+ var didThrow = false;
+ try {
+ install('android', temp, 'FaultyPlugin', plugins_dir, {});
+ } catch(e) {
+ didThrow = true;
+ expect(e.message).toMatch(/reverting changes also caused issues!/);
+ }
+ expect(didThrow).toBe(true);
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/plugin.xml b/spec/plugins/ChildBrowser/plugin.xml
new file mode 100644
index 0000000..9c87b06
--- /dev/null
+++ b/spec/plugins/ChildBrowser/plugin.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ 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.
+
+-->
+
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="com.phonegap.plugins.childbrowser"
+ version="0.6.0">
+
+ <name>Child Browser</name>
+
+ <asset src="www/childbrowser" target="childbrowser" />
+ <asset src="www/childbrowser_file.html" target="childbrowser_file.html" />
+
+ <js-module src="www/childbrowser.js" name="ChildBrowser">
+ <clobbers target="childbrowser" />
+ </js-module>
+
+ <access origin="build.phonegap.com" />
+ <access origin="$APP_ID.s3.amazonaws.com" />
+
+ <!-- android -->
+ <platform name="android">
+ <config-file target="AndroidManifest.xml" parent="/manifest/application">
+ <activity android:name="com.phonegap.plugins.childBrowser.ChildBrowser"
+ android:label="@string/app_name">
+ <intent-filter>
+ </intent-filter>
+ </activity>
+ </config-file>
+
+ <!-- CDV < 2.0 -->
+ <config-file target="res/xml/plugins.xml" parent="/plugins">
+ <plugin name="ChildBrowser"
+ value="com.phonegap.plugins.childBrowser.ChildBrowser"/>
+ </config-file>
+
+ <!-- CDV 2.0+ (for now) -->
+ <config-file target="res/xml/config.xml" parent="/cordova/plugins">
+ <plugin name="ChildBrowser"
+ value="com.phonegap.plugins.childBrowser.ChildBrowser"/>
+ </config-file>
+
+ <source-file src="src/android/ChildBrowser.java"
+ target-dir="src/com/phonegap/plugins/childBrowser" />
+ <info>
+ Please make sure you read this because it is very important to complete the installation of your plugin
+ </info>
+ </platform>
+
+ <!-- ios -->
+ <platform name="ios">
+ <plugins-plist key="com.phonegap.plugins.childbrowser"
+ string="ChildBrowserCommand" />
+
+ <config-file target="config.xml" parent="/widget/plugins">
+ <plugin name="ChildBrowser"
+ value="ChildBrowserCommand" />
+ </config-file>
+
+ <resource-file src="src/ios/ChildBrowser.bundle" />
+ <resource-file src="src/ios/ChildBrowserViewController.xib" />
+
+ <header-file src="src/ios/ChildBrowserCommand.h" />
+ <header-file src="src/ios/ChildBrowserViewController.h" />
+ <header-file src="src/ios/preserveDirs/PreserveDirsTest.h" preserve-dirs="true" />
+ <header-file src="src/ios/TargetDirTest.h" target-dir="targetDir"/>
+
+ <source-file src="src/ios/ChildBrowserCommand.m" />
+ <source-file src="src/ios/ChildBrowserViewController.m" />
+ <source-file src="src/ios/preserveDirs/PreserveDirsTest.m" preserve-dirs="true" />
+ <header-file src="src/ios/TargetDirTest.m" target-dir="targetDir"/>
+
+ <!-- framework for testing (not actual dependency of ChildBrowser -->
+ <framework src="libsqlite3.dylib" />
+ <framework src="social.framework" weak="true" />
+ <framework src="music.framework" weak="rabbit" />
+ </platform>
+</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/android/ChildBrowser.java
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/android/ChildBrowser.java b/spec/plugins/ChildBrowser/src/android/ChildBrowser.java
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/android/ChildBrowser.java
@@ -0,0 +1,19 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left.png
new file mode 100644
index 0000000..530e12b
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left@2x.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left@2x.png
new file mode 100644
index 0000000..530e12b
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_left@2x.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right.png
new file mode 100644
index 0000000..8b3d855
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right@2x.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right@2x.png
new file mode 100644
index 0000000..8b3d855
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/arrow_right@2x.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh.png
new file mode 100644
index 0000000..309b6bd
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh@2x.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh@2x.png
new file mode 100644
index 0000000..309b6bd
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/but_refresh@2x.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass.png
new file mode 100644
index 0000000..46a8901
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass@2x.png b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass@2x.png
new file mode 100644
index 0000000..46a8901
Binary files /dev/null and b/spec/plugins/ChildBrowser/src/ios/ChildBrowser.bundle/compass@2x.png differ
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.h
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.h b/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.h
new file mode 100644
index 0000000..6a23ab6
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.h
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
+//
+// PhoneGap ! ChildBrowserCommand
+//
+//
+// Created by Jesse MacFadyen on 10-05-29.
+// Copyright 2010 Nitobi. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#ifdef PHONEGAP_FRAMEWORK
+ #import <PhoneGap/PGPlugin.h>
+#else
+ #import "PGPlugin.h"
+#endif
+#import "ChildBrowserViewController.h"
+
+
+
+@interface ChildBrowserCommand : PGPlugin <ChildBrowserDelegate> {
+
+ ChildBrowserViewController* childBrowser;
+}
+
+@property (nonatomic, retain) ChildBrowserViewController *childBrowser;
+
+
+- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+-(void) onChildLocationChange:(NSString*)newLoc;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.m
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.m b/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.m
new file mode 100644
index 0000000..38aaf64
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/ChildBrowserCommand.m
@@ -0,0 +1,86 @@
+//
+
+//
+//
+// Created by Jesse MacFadyen on 10-05-29.
+// Copyright 2010 Nitobi. All rights reserved.
+// Copyright (c) 2011, IBM Corporation
+// Copyright 2011, Randy McMillan
+//
+
+#import "ChildBrowserCommand.h"
+
+#ifdef PHONEGAP_FRAMEWORK
+ #import <PhoneGap/PhoneGapViewController.h>
+#else
+ #import "PhoneGapViewController.h"
+#endif
+
+
+@implementation ChildBrowserCommand
+
+@synthesize childBrowser;
+
+- (void) showWebPage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url
+{
+
+ if(childBrowser == NULL)
+ {
+ childBrowser = [[ ChildBrowserViewController alloc ] initWithScale:FALSE ];
+ childBrowser.delegate = self;
+ }
+
+/* // TODO: Work in progress
+ NSString* strOrientations = [ options objectForKey:@"supportedOrientations"];
+ NSArray* supportedOrientations = [strOrientations componentsSeparatedByString:@","];
+*/
+ PhoneGapViewController* cont = (PhoneGapViewController*)[ super appViewController ];
+ childBrowser.supportedOrientations = cont.supportedOrientations;
+
+ if ([cont respondsToSelector:@selector(presentViewController)]) {
+ //Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan
+ [cont presentViewController:childBrowser animated:YES completion:nil];
+ } else {
+ [ cont presentModalViewController:childBrowser animated:YES ];
+ }
+
+ NSString *url = (NSString*) [arguments objectAtIndex:0];
+
+ [childBrowser loadURL:url ];
+
+}
+
+-(void) close:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url
+{
+ [ childBrowser closeBrowser];
+
+}
+
+-(void) onClose
+{
+ NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onClose();",@""];
+ [self.webView stringByEvaluatingJavaScriptFromString:jsCallback];
+}
+
+-(void) onOpenInSafari
+{
+ NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onOpenExternal();",@""];
+ [self.webView stringByEvaluatingJavaScriptFromString:jsCallback];
+}
+
+
+-(void) onChildLocationChange:(NSString*)newLoc
+{
+
+ NSString* tempLoc = [NSString stringWithFormat:@"%@",newLoc];
+ NSString* encUrl = [tempLoc stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+
+ NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onLocationChange('%@');",encUrl];
+ [self.webView stringByEvaluatingJavaScriptFromString:jsCallback];
+
+}
+
+
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.h
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.h b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.h
new file mode 100644
index 0000000..d6fc139
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.h
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
+//
+// ChildBrowserViewController.h
+//
+// Created by Jesse MacFadyen on 21/07/09.
+// Copyright 2009 Nitobi. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@protocol ChildBrowserDelegate<NSObject>
+
+
+
+/*
+ * onChildLocationChanging:newLoc
+ *
+ * Discussion:
+ * Invoked when a new page has loaded
+ */
+-(void) onChildLocationChange:(NSString*)newLoc;
+-(void) onOpenInSafari;
+-(void) onClose;
+@end
+
+
+@interface ChildBrowserViewController : UIViewController < UIWebViewDelegate > {
+ IBOutlet UIWebView* webView;
+ IBOutlet UIBarButtonItem* closeBtn;
+ IBOutlet UIBarButtonItem* refreshBtn;
+ IBOutlet UILabel* addressLabel;
+ IBOutlet UIBarButtonItem* backBtn;
+ IBOutlet UIBarButtonItem* fwdBtn;
+ IBOutlet UIBarButtonItem* safariBtn;
+ IBOutlet UIActivityIndicatorView* spinner;
+ BOOL scaleEnabled;
+ BOOL isImage;
+ NSString* imageURL;
+ NSArray* supportedOrientations;
+ id <ChildBrowserDelegate> delegate;
+}
+
+@property (nonatomic, retain)id <ChildBrowserDelegate> delegate;
+@property (nonatomic, retain) NSArray* supportedOrientations;
+@property(retain) NSString* imageURL;
+@property(assign) BOOL isImage;
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation;
+- (ChildBrowserViewController*)initWithScale:(BOOL)enabled;
+- (IBAction)onDoneButtonPress:(id)sender;
+- (IBAction)onSafariButtonPress:(id)sender;
+- (void)loadURL:(NSString*)url;
+-(void)closeBrowser;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.m
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.m b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.m
new file mode 100644
index 0000000..167ef98
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.m
@@ -0,0 +1,239 @@
+//
+// ChildBrowserViewController.m
+//
+// Created by Jesse MacFadyen on 21/07/09.
+// Copyright 2009 Nitobi. All rights reserved.
+// Copyright (c) 2011, IBM Corporation
+// Copyright 2011, Randy McMillan
+//
+
+#import "ChildBrowserViewController.h"
+
+
+@implementation ChildBrowserViewController
+
+@synthesize imageURL;
+@synthesize supportedOrientations;
+@synthesize isImage;
+@synthesize delegate;
+
+/*
+ // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
++ (NSString*) resolveImageResource:(NSString*)resource
+{
+ NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
+ BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending);
+
+ // the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path
+ if (isLessThaniOS4)
+ {
+ return [NSString stringWithFormat:@"%@.png", resource];
+ }
+
+ return resource;
+}
+
+
+- (ChildBrowserViewController*)initWithScale:(BOOL)enabled
+{
+ self = [super init];
+
+
+ scaleEnabled = enabled;
+
+ return self;
+}
+
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ refreshBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/but_refresh"]];
+ backBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/arrow_left"]];
+ fwdBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/arrow_right"]];
+ safariBtn.image = [UIImage imageNamed:[[self class] resolveImageResource:@"ChildBrowser.bundle/compass"]];
+
+ webView.delegate = self;
+ webView.scalesPageToFit = TRUE;
+ webView.backgroundColor = [UIColor whiteColor];
+ NSLog(@"View did load");
+}
+
+
+
+
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+ NSLog(@"View did UN-load");
+}
+
+
+- (void)dealloc {
+
+ webView.delegate = nil;
+
+ [webView release];
+ [closeBtn release];
+ [refreshBtn release];
+ [addressLabel release];
+ [backBtn release];
+ [fwdBtn release];
+ [safariBtn release];
+ [spinner release];
+ [ supportedOrientations release];
+ [super dealloc];
+}
+
+-(void)closeBrowser
+{
+
+ if(delegate != NULL)
+ {
+ [delegate onClose];
+ }
+ if ([self respondsToSelector:@selector(presentingViewController)]) {
+ //Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan
+ [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+ } else {
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+ }
+}
+
+-(IBAction) onDoneButtonPress:(id)sender
+{
+ [ self closeBrowser];
+
+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]];
+ [webView loadRequest:request];
+}
+
+
+-(IBAction) onSafariButtonPress:(id)sender
+{
+
+ if(delegate != NULL)
+ {
+ [delegate onOpenInSafari];
+ }
+
+ if(isImage)
+ {
+ NSURL* pURL = [[ [NSURL alloc] initWithString:imageURL ] autorelease];
+ [ [ UIApplication sharedApplication ] openURL:pURL ];
+ }
+ else
+ {
+ NSURLRequest *request = webView.request;
+ [[UIApplication sharedApplication] openURL:request.URL];
+ }
+
+
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation
+{
+ BOOL autoRotate = [self.supportedOrientations count] > 1; // autorotate if only more than 1 orientation supported
+ if (autoRotate)
+ {
+ if ([self.supportedOrientations containsObject:
+ [NSNumber numberWithInt:interfaceOrientation]]) {
+ return YES;
+ }
+ }
+
+ return NO;
+}
+
+
+
+
+- (void)loadURL:(NSString*)url
+{
+ NSLog(@"Opening Url : %@",url);
+
+ if( [url hasSuffix:@".png" ] ||
+ [url hasSuffix:@".jpg" ] ||
+ [url hasSuffix:@".jpeg" ] ||
+ [url hasSuffix:@".bmp" ] ||
+ [url hasSuffix:@".gif" ] )
+ {
+ [ imageURL release ];
+ imageURL = [url copy];
+ isImage = YES;
+ NSString* htmlText = @"<html><body style='background-color:#333;margin:0px;padding:0px;'><img style='min-height:200px;margin:0px;padding:0px;width:100%;height:auto;' alt='' src='IMGSRC'/></body></html>";
+ htmlText = [ htmlText stringByReplacingOccurrencesOfString:@"IMGSRC" withString:url ];
+
+ [webView loadHTMLString:htmlText baseURL:[NSURL URLWithString:@""]];
+
+ }
+ else
+ {
+ imageURL = @"";
+ isImage = NO;
+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
+ [webView loadRequest:request];
+ }
+ webView.hidden = NO;
+}
+
+
+- (void)webViewDidStartLoad:(UIWebView *)sender {
+ addressLabel.text = @"Loading...";
+ backBtn.enabled = webView.canGoBack;
+ fwdBtn.enabled = webView.canGoForward;
+
+ [ spinner startAnimating ];
+
+}
+
+- (void)webViewDidFinishLoad:(UIWebView *)sender
+{
+ NSURLRequest *request = webView.request;
+ NSLog(@"New Address is : %@",request.URL.absoluteString);
+ addressLabel.text = request.URL.absoluteString;
+ backBtn.enabled = webView.canGoBack;
+ fwdBtn.enabled = webView.canGoForward;
+ [ spinner stopAnimating ];
+
+ if(delegate != NULL)
+ {
+ [delegate onChildLocationChange:request.URL.absoluteString];
+ }
+
+}
+
+- (void)webView:(UIWebView *)wv didFailLoadWithError:(NSError *)error {
+ NSLog (@"webView:didFailLoadWithError");
+ [spinner stopAnimating];
+ addressLabel.text = @"Failed";
+ if (error != NULL) {
+ UIAlertView *errorAlert = [[UIAlertView alloc]
+ initWithTitle: [error localizedDescription]
+ message: [error localizedFailureReason]
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
+ [errorAlert show];
+ [errorAlert release];
+ }
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.xib
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.xib b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.xib
new file mode 100644
index 0000000..cc8dd65
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/ChildBrowserViewController.xib
@@ -0,0 +1,875 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">768</int>
+ <string key="IBDocument.SystemVersion">10K540</string>
+ <string key="IBDocument.InterfaceBuilderVersion">851</string>
+ <string key="IBDocument.AppKitVersion">1038.36</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">141</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIWebView" id="345761693">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">-2147483374</int>
+ <string key="NSFrameSize">{480, 229}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView" ref="471899933"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIDataDetectorTypes">1</int>
+ <bool key="IBUIDetectsPhoneNumbers">YES</bool>
+ </object>
+ <object class="IBUIToolbar" id="471899933">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{0, 256}, {480, 44}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView" ref="349240355"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIBarStyle">1</int>
+ <object class="NSMutableArray" key="IBUIItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIBarButtonItem" id="966737436">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIStyle">1</int>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">0</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="312951844">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="615970053">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ </object>
+ <object class="IBUIBarButtonItem" id="111711024">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="227415391">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <float key="IBUIWidth">32</float>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ </object>
+ <object class="IBUIBarButtonItem" id="766205236">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="283287216">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <float key="IBUIWidth">32</float>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ </object>
+ <object class="IBUIBarButtonItem" id="129413107">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="1046195837">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <float key="IBUIWidth">32</float>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ </object>
+ <object class="IBUIBarButtonItem" id="667527307">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="471899933"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ </object>
+ </object>
+ <object class="IBUILabel" id="349240355">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">270</int>
+ <string key="NSFrame">{{5, 230}, {418, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSNextKeyView" ref="89602979"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">4</int>
+ <bytes key="NSWhite">MC42NjY2NjY2OSAwAA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Loading...</string>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <bool key="IBUIAdjustsFontSizeToFit">NO</bool>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUIActivityIndicatorView" id="89602979">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">-2147483383</int>
+ <string key="NSFrame">{{454, 231}, {20, 20}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{0, 20}, {480, 300}}</string>
+ <reference key="NSNextKeyView" ref="345761693"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">3</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">webView</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="345761693"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">addressLabel</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="349240355"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">backBtn</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="227415391"/>
+ </object>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">fwdBtn</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="283287216"/>
+ </object>
+ <int key="connectionID">22</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">refreshBtn</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="615970053"/>
+ </object>
+ <int key="connectionID">23</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">onDoneButtonPress:</string>
+ <reference key="source" ref="966737436"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">26</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">reload</string>
+ <reference key="source" ref="615970053"/>
+ <reference key="destination" ref="345761693"/>
+ </object>
+ <int key="connectionID">27</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">goBack</string>
+ <reference key="source" ref="227415391"/>
+ <reference key="destination" ref="345761693"/>
+ </object>
+ <int key="connectionID">28</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">goForward</string>
+ <reference key="source" ref="283287216"/>
+ <reference key="destination" ref="345761693"/>
+ </object>
+ <int key="connectionID">29</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">onSafariButtonPress:</string>
+ <reference key="source" ref="1046195837"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">31</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">35</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">spinner</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="89602979"/>
+ </object>
+ <int key="connectionID">36</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">safariBtn</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="1046195837"/>
+ </object>
+ <int key="connectionID">40</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="471899933"/>
+ <reference ref="349240355"/>
+ <reference ref="89602979"/>
+ <reference ref="345761693"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="345761693"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="471899933"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="966737436"/>
+ <reference ref="615970053"/>
+ <reference ref="227415391"/>
+ <reference ref="283287216"/>
+ <reference ref="1046195837"/>
+ <reference ref="111711024"/>
+ <reference ref="129413107"/>
+ <reference ref="312951844"/>
+ <reference ref="667527307"/>
+ <reference ref="766205236"/>
+ </object>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="966737436"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="615970053"/>
+ <reference key="parent" ref="471899933"/>
+ <string key="objectName">Bar Button Item (Reload)</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="227415391"/>
+ <reference key="parent" ref="471899933"/>
+ <string key="objectName">Bar Button Item (Go Back)</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="283287216"/>
+ <reference key="parent" ref="471899933"/>
+ <string key="objectName">Bar Button Item (Go Forward)</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="1046195837"/>
+ <reference key="parent" ref="471899933"/>
+ <string key="objectName">Bar Button Item (Safari)</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">13</int>
+ <reference key="object" ref="349240355"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">14</int>
+ <reference key="object" ref="111711024"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">15</int>
+ <reference key="object" ref="129413107"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">32</int>
+ <reference key="object" ref="89602979"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">37</int>
+ <reference key="object" ref="312951844"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">38</int>
+ <reference key="object" ref="667527307"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">39</int>
+ <reference key="object" ref="766205236"/>
+ <reference key="parent" ref="471899933"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>10.IBPluginDependency</string>
+ <string>11.IBPluginDependency</string>
+ <string>13.IBPluginDependency</string>
+ <string>13.IBViewBoundsToFrameTransform</string>
+ <string>14.IBPluginDependency</string>
+ <string>15.IBPluginDependency</string>
+ <string>32.IBPluginDependency</string>
+ <string>32.IBViewBoundsToFrameTransform</string>
+ <string>37.IBPluginDependency</string>
+ <string>38.IBPluginDependency</string>
+ <string>39.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ <string>4.IBViewBoundsToFrameTransform</string>
+ <string>6.IBPluginDependency</string>
+ <string>6.IBViewBoundsToFrameTransform</string>
+ <string>7.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>ChildBrowserViewController</string>
+ <string>UIResponder</string>
+ <string>{{250, 643}, {480, 320}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABCoAAAwygAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABD5gAAw3kAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABB8AAAwwUAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw10AAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">40</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ChildBrowserViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>onDoneButtonPress:</string>
+ <string>onSafariButtonPress:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>onDoneButtonPress:</string>
+ <string>onSafariButtonPress:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">onDoneButtonPress:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">onSafariButtonPress:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>addressLabel</string>
+ <string>backBtn</string>
+ <string>closeBtn</string>
+ <string>delegate</string>
+ <string>fwdBtn</string>
+ <string>refreshBtn</string>
+ <string>safariBtn</string>
+ <string>spinner</string>
+ <string>webView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UILabel</string>
+ <string>UIBarButtonItem</string>
+ <string>UIBarButtonItem</string>
+ <string>id</string>
+ <string>UIBarButtonItem</string>
+ <string>UIBarButtonItem</string>
+ <string>UIBarButtonItem</string>
+ <string>UIActivityIndicatorView</string>
+ <string>UIWebView</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>addressLabel</string>
+ <string>backBtn</string>
+ <string>closeBtn</string>
+ <string>delegate</string>
+ <string>fwdBtn</string>
+ <string>refreshBtn</string>
+ <string>safariBtn</string>
+ <string>spinner</string>
+ <string>webView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">addressLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backBtn</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">closeBtn</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">delegate</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">fwdBtn</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">refreshBtn</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">safariBtn</string>
+ <string key="candidateClassName">UIBarButtonItem</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">spinner</string>
+ <string key="candidateClassName">UIActivityIndicatorView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">webView</string>
+ <string key="candidateClassName">UIWebView</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Plugins/ChildBrowser/ChildBrowserViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="485348283">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIActivityIndicatorView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIActivityIndicatorView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIBarButtonItem</string>
+ <string key="superclassName">UIBarItem</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIBarItem</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="485348283"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIToolbar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIToolbar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">MediaPlayer.framework/Headers/MPMoviePlayerViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIWebView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIWebView.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="768" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="1056" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <nil key="IBDocument.LastKnownRelativeProjectPath"/>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">141</string>
+ </data>
+</archive>
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/TargetDirTest.h
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/TargetDirTest.h b/spec/plugins/ChildBrowser/src/ios/TargetDirTest.h
new file mode 100644
index 0000000..60a1403
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/TargetDirTest.h
@@ -0,0 +1,20 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/TargetDirTest.m
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/TargetDirTest.m b/spec/plugins/ChildBrowser/src/ios/TargetDirTest.m
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/TargetDirTest.m
@@ -0,0 +1 @@
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.h
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.h b/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.h
new file mode 100644
index 0000000..60a1403
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.h
@@ -0,0 +1,20 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.m
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.m b/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.m
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/spec/plugins/ChildBrowser/src/ios/preserveDirs/PreserveDirsTest.m
@@ -0,0 +1 @@
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/www/childbrowser.js
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/www/childbrowser.js b/spec/plugins/ChildBrowser/www/childbrowser.js
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/ChildBrowser/www/childbrowser.js
@@ -0,0 +1,19 @@
+/*
+ *
+ * Copyright 2013 Anis Kadri
+ *
+ * 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.
+ *
+*/
+
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/www/childbrowser/image.jpg
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/www/childbrowser/image.jpg b/spec/plugins/ChildBrowser/www/childbrowser/image.jpg
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/spec/plugins/ChildBrowser/www/childbrowser/image.jpg
@@ -0,0 +1 @@
+foo
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/ChildBrowser/www/childbrowser_file.html
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/www/childbrowser_file.html b/spec/plugins/ChildBrowser/www/childbrowser_file.html
new file mode 100644
index 0000000..6de7b8c
--- /dev/null
+++ b/spec/plugins/ChildBrowser/www/childbrowser_file.html
@@ -0,0 +1 @@
+This is a test file.
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/FaultyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/FaultyPlugin/plugin.xml b/spec/plugins/FaultyPlugin/plugin.xml
index 26473d2..d7e21e9 100644
--- a/spec/plugins/FaultyPlugin/plugin.xml
+++ b/spec/plugins/FaultyPlugin/plugin.xml
@@ -50,7 +50,8 @@
value="com.phonegap.plugins.faultyplugin.FaultyPlugin"/>
</config-file>
- <source-file src="src/android/FaultyPlugin.java"
+ <!-- this file doesn't exist -->
+ <source-file src="src/android/NotHere.java"
target-dir="src/com/phonegap/plugins/faultyplugin" />
</platform>
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/plugins/VariablePlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/VariablePlugin/plugin.xml b/spec/plugins/VariablePlugin/plugin.xml
new file mode 100644
index 0000000..580c329
--- /dev/null
+++ b/spec/plugins/VariablePlugin/plugin.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ 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.
+
+-->
+
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+ xmlns="http://www.phonegap.com/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="com.pushwoosh.plugins.pushwoosh"
+ version="3.0.0">
+
+ <name>Use Variables</name>
+
+ <!-- android -->
+ <platform name="android">
+ <preference name="API_KEY" />
+ <config-file target="AndroidManifest.xml" parent="/manifest">
+ <poop name="GoogleMapsApiKey" value="$API_KEY" />
+ </config-file>
+
+ </platform>
+</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/spec/remove.spec.js
----------------------------------------------------------------------
diff --git a/spec/remove.spec.js b/spec/remove.spec.js
index e69de29..444f420 100644
--- a/spec/remove.spec.js
+++ b/spec/remove.spec.js
@@ -0,0 +1,30 @@
+var remove = require('../src/remove'),
+ fetch = require('../src/fetch'),
+ fs = require('fs'),
+ os = require('osenv'),
+ path = require('path'),
+ shell = require('shelljs'),
+ temp = path.join(os.tmpdir(), 'plugman'),
+ test_plugin = path.join(__dirname, 'plugins', 'ChildBrowser');
+
+describe('remove', function() {
+ var copied_plugin_path = path.join(temp,'ChildBrowser');
+
+ beforeEach(function() {
+ shell.mkdir('-p', temp);
+ });
+ afterEach(function() {
+ try{shell.rm('-rf', temp);}catch(e){}
+ });
+
+ it('should remove symbolically-linked plugins', function() {
+ fetch(test_plugin, temp, true);
+ remove('ChildBrowser', temp);
+ expect(fs.readdirSync(temp).length).toEqual(0);
+ });
+ it('should remove non-linked plugins', function() {
+ fetch(test_plugin, temp, false);
+ remove('ChildBrowser', temp);
+ expect(fs.readdirSync(temp).length).toEqual(0);
+ });
+});
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/src/platforms/android.js
----------------------------------------------------------------------
diff --git a/src/platforms/android.js b/src/platforms/android.js
index ac5bd3a..73b0b3a 100644
--- a/src/platforms/android.js
+++ b/src/platforms/android.js
@@ -200,9 +200,13 @@ function handlePlugin(action, project_dir, plugin_dir, plugin_et, variables) {
}
}
-
+// TODO: resolvePath, and should be used everywhere (even across platform impls)
function srcPath(pluginPath, filename) {
- return path.resolve(pluginPath, filename);
+ var file = path.resolve(pluginPath, filename);
+ if (!fs.existsSync(path)) {
+ throw new Error('Path "' + file + '" does not exist.');
+ }
+ return file;
}
// reads the package name out of the Android Manifest file
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/src/platforms/blackberry.js
----------------------------------------------------------------------
diff --git a/src/platforms/blackberry.js b/src/platforms/blackberry.js
index 0dff562..75b3c3a 100644
--- a/src/platforms/blackberry.js
+++ b/src/platforms/blackberry.js
@@ -43,7 +43,7 @@ module.exports = {
}
};
-function handlePlugin = (action, project_dir, plugin_dir, plugin_et, variables) {
+function handlePlugin(action, project_dir, plugin_dir, plugin_et, variables) {
var plugin_id = plugin_et._root.attrib['id']
, version = plugin_et._root.attrib['version']
, external_hosts = []
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/9e4033ca/src/platforms/ios.js
----------------------------------------------------------------------
diff --git a/src/platforms/ios.js b/src/platforms/ios.js
index d0fa2a2..3a23558 100644
--- a/src/platforms/ios.js
+++ b/src/platforms/ios.js
@@ -47,7 +47,7 @@ module.exports = {
}
};
-function handlePlugin (action, project_dir, plugin_dir, plugin_et, variables) {
+function handlePlugin(action, project_dir, plugin_dir, plugin_et, variables) {
var plugin_id = plugin_et._root.attrib['id']
, version = plugin_et._root.attrib['version']
, i = 0