cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [12/15] git commit: fetch tests in jasmine
Date Mon, 22 Apr 2013 20:18:48 GMT
fetch tests in jasmine


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/e29b0233
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/e29b0233
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/e29b0233

Branch: refs/heads/future
Commit: e29b0233c79b3b510adc98e293e07c57f673434c
Parents: 7f9eca0
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Apr 19 16:06:35 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Apr 19 16:06:35 2013 -0700

----------------------------------------------------------------------
 package.json                                       |    4 +-
 spec/fetch.spec.js                                 |   42 +
 spec/plugins/DummyPlugin/plugin.xml                |  100 +
 .../DummyPlugin/src/android/DummyPlugin.java       |   19 +
 spec/plugins/DummyPlugin/src/blackberry/client.js  |   19 +
 spec/plugins/DummyPlugin/src/blackberry/index.js   |   19 +
 spec/plugins/DummyPlugin/www/dummyplugin.js        |   19 +
 spec/plugins/DummyPlugin/www/dummyplugin/image.jpg |    1 +
 spec/plugins/FaultyPlugin/plugin.xml               |   73 +
 .../FaultyPlugin/src/android/FaultyPlugin.java     |   19 +
 spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.h   |   49 +
 spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.m   |   86 +
 spec/plugins/WebNotifications/plugin.xml           |   45 +
 .../WebNotifications/src/ios/AppDelegate.m.diff    |   18 +
 .../WebNotifications/src/ios/WebNotifications.h    |   35 +
 .../WebNotifications/src/ios/WebNotifications.m    |  124 +
 .../WebNotifications/www/webnotifications.js       |  123 +
 spec/plugins/WeblessPlugin/plugin.xml              |   81 +
 .../WeblessPlugin/src/android/WeblessPlugin.java   |   19 +
 .../src/ios/WeblessPlugin.bundle/arrow_left.png    |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/arrow_left@2x.png |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/arrow_right.png   |  Bin 0 -> 2946 bytes
 .../ios/WeblessPlugin.bundle/arrow_right@2x.png    |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/but_refresh.png   |  Bin 0 -> 3369 bytes
 .../ios/WeblessPlugin.bundle/but_refresh@2x.png    |  Bin 0 -> 3369 bytes
 .../src/ios/WeblessPlugin.bundle/compass.png       |  Bin 0 -> 3035 bytes
 .../src/ios/WeblessPlugin.bundle/compass@2x.png    |  Bin 0 -> 3035 bytes
 .../WeblessPlugin/src/ios/WeblessPluginCommand.h   |   49 +
 .../WeblessPlugin/src/ios/WeblessPluginCommand.m   |   86 +
 .../src/ios/WeblessPluginViewController.h          |   73 +
 .../src/ios/WeblessPluginViewController.m          |  239 ++
 .../src/ios/WeblessPluginViewController.xib        |  875 ++++++++
 spec/plugins/cordova.echo/.gitignore               |    1 +
 spec/plugins/cordova.echo/plugin.xml               |   24 +
 spec/plugins/cordova.echo/src/blackberry/client.js |   53 +
 .../src/blackberry/device/echoJnext.so             |  Bin 0 -> 1291818 bytes
 spec/plugins/cordova.echo/src/blackberry/index.js  |   85 +
 .../cordova.echo/src/blackberry/manifest.json      |    5 +
 .../src/blackberry/public/json/autolink.h          |   19 +
 .../src/blackberry/public/json/config.h            |   43 +
 .../src/blackberry/public/json/features.h          |   42 +
 .../src/blackberry/public/json/forwards.h          |   39 +
 .../cordova.echo/src/blackberry/public/json/json.h |   10 +
 .../src/blackberry/public/json/reader.h            |  196 ++
 .../src/blackberry/public/json/value.h             | 1069 +++++++++
 .../src/blackberry/public/json/writer.h            |  174 ++
 .../src/blackberry/public/json_batchallocator.h    |  125 ++
 .../src/blackberry/public/json_internalarray.inl   |  448 ++++
 .../src/blackberry/public/json_internalmap.inl     |  607 +++++
 .../src/blackberry/public/json_reader.cpp          |  894 ++++++++
 .../src/blackberry/public/json_value.cpp           | 1726 +++++++++++++++
 .../src/blackberry/public/json_valueiterator.inl   |  292 +++
 .../src/blackberry/public/json_writer.cpp          |  829 +++++++
 .../cordova.echo/src/blackberry/public/plugin.cpp  |  320 +++
 .../cordova.echo/src/blackberry/public/plugin.h    |   70 +
 .../src/blackberry/public/tokenizer.cpp            |  222 ++
 .../cordova.echo/src/blackberry/public/tokenizer.h |   55 +
 .../src/blackberry/simulator/echoJnext.so          |  Bin 0 -> 231778 bytes
 .../cordova.echo/src/blackberry/src/echo.cpp       |  121 +
 .../cordova.echo/src/blackberry/src/echo.hpp       |   45 +
 spec/plugins/cordova.echo/src/device/echoJnext.so  |  Bin 0 -> 1291818 bytes
 .../cordova.echo/src/simulator/echoJnext.so        |  Bin 0 -> 231778 bytes
 spec/plugins/multiple-children/plugin.xml          |  109 +
 spec/projects/FriendSting-Info.plist               |   78 +
 spec/projects/android_one/AndroidManifest.xml      |   71 +
 spec/projects/android_one/res/xml/plugins.xml      |   38 +
 spec/projects/android_two/AndroidManifest.xml      |   69 +
 spec/projects/android_two/res/xml/config.xml       |   54 +
 spec/projects/blackberry/www/config.xml            |   97 +
 spec/projects/blackberry/www/plugins.xml           |   35 +
 .../CordovaLib.xcodeproj/project.pbxproj           |  636 ++++++
 spec/projects/ios-config-xml/SampleApp-Info.plist  |   78 +
 .../SampleApp.xcodeproj/project.orig.pbxproj       |  498 +++++
 .../SampleApp.xcodeproj/project.pbxproj            |  498 +++++
 .../ios-config-xml/SampleApp/SampleApp-Info.plist  |   78 +
 spec/projects/ios-config-xml/SampleApp/config.xml  |   59 +
 .../CordovaLib.xcodeproj/project.pbxproj           |  636 ++++++
 .../SampleApp.xcodeproj/project.orig.pbxproj       |  498 +++++
 .../ios-plist/SampleApp.xcodeproj/project.pbxproj  |  498 +++++
 spec/projects/ios-plist/SampleApp/PhoneGap.plist   |   53 +
 .../ios-plist/SampleApp/SampleApp-Info.plist       |   80 +
 .../projects/multiple-children/AndroidManifest.xml |   69 +
 .../projects/multiple-children/res/xml/plugins.xml |   38 +
 src/fetch.js                                       |   10 +-
 84 files changed, 14005 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 691e829..3ace78a 100644
--- a/package.json
+++ b/package.json
@@ -22,10 +22,10 @@
     "osenv": "0.0.x"
   },
   "devDependencies": {
-    "jasmine-node": "1.1.x"
+    "jasmine-node": "1.7.0"
   },
   "bin" : { "plugman" : "./main.js" },
   "scripts": {
-    "test": "./node_modules/jasmine-node/bin/jasmine-node --color test"
+    "test": "./node_modules/jasmine-node/bin/jasmine-node --color spec"
   }
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/fetch.spec.js
----------------------------------------------------------------------
diff --git a/spec/fetch.spec.js b/spec/fetch.spec.js
new file mode 100644
index 0000000..a3d8889
--- /dev/null
+++ b/spec/fetch.spec.js
@@ -0,0 +1,42 @@
+var 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'),
+    plugins = require('../src/util/plugins');
+
+describe('fetch', function() {
+    var copied_plugin_path = path.join(temp,'ChildBrowser');
+
+    beforeEach(function() {
+        shell.mkdir('-p', temp);
+    });
+    afterEach(function() {
+        try{shell.rm('-rf', temp);}catch(e){}
+    });
+
+    describe('local plugins', function() {
+        it('should copy locally-available plugin to plugins directory', function() {
+            fetch(test_plugin, temp, false);
+            expect(fs.existsSync(copied_plugin_path)).toBe(true);
+        });
+        it('should create a symlink if used with `link` param', function() {
+            fetch(test_plugin, temp, true);
+            expect(fs.lstatSync(copied_plugin_path).isSymbolicLink()).toBe(true);
+        });
+    });
+    describe('remote plugins', function() {
+        it('should call clonePluginGitRepo for https:// and git:// based urls', function() {
+            var s = spyOn(plugins, 'clonePluginGitRepo');
+            fetch("https://github.com/bobeast/GAPlugin.git", temp, false);
+            expect(s).toHaveBeenCalled();
+        });
+        it('should throw if used with `link` param', function() {
+            expect(function() {
+                fetch("https://github.com/bobeast/GAPlugin.git", temp, true);
+            }).toThrow();
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/.gitkeep
----------------------------------------------------------------------
diff --git a/spec/plugins/.gitkeep b/spec/plugins/.gitkeep
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/DummyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/plugin.xml b/spec/plugins/DummyPlugin/plugin.xml
new file mode 100644
index 0000000..d1bf38c
--- /dev/null
+++ b/spec/plugins/DummyPlugin/plugin.xml
@@ -0,0 +1,100 @@
+<?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.dummyplugin"
+    version="0.6.0">
+
+    <name>Dummy Plugin</name>
+
+    <asset src="www/dummyplugin.js" target="dummyplugin.js" />
+    <asset src="www/dummyplugin" target="dummyplugin" />
+
+	<access origin="build.phonegap.com" />
+	<access origin="s3.amazonaws.com" />
+	
+    <!-- android -->
+    <platform name="android">
+        <config-file target="AndroidManifest.xml" parent="/manifest/application">
+            <activity android:name="com.phonegap.plugins.dummyplugin.DummyPlugin"
+                      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="DummyPlugin"
+                value="com.phonegap.plugins.dummyplugin.DummyPlugin"/>
+        </config-file>
+
+        <!-- CDV 2.0+ (for now) -->
+        <config-file target="res/xml/config.xml" parent="/cordova/plugins">
+            <plugin name="DummyPlugin"
+                value="com.phonegap.plugins.dummyplugin.DummyPlugin"/>
+        </config-file>
+
+        <source-file src="src/android/DummyPlugin.java"
+                target-dir="src/com/phonegap/plugins/dummyplugin" />
+    </platform>
+
+    <!-- blackberry -->
+    <platform name="blackberry">
+        <config-file target="config.xml" parent="/widget">
+            <feature id="dummyPlugin" required="true" version="1.0.0.0"/>
+        </config-file>
+
+        <source-file src="src/blackberry/client.js" target-dir="ext-qnx/cordova.echo" />
+        <source-file src="src/blackberry/index.js" target-dir="ext-qnx/cordova.echo" />
+        <source-file src="src/blackberry/manifest.json" target-dir="ext-qnx/cordova.echo" />
+    </platform>
+
+        
+    <!-- ios -->
+    <platform name="ios">
+        <!-- CDV < 2.4 -->
+        <plugins-plist key="com.phonegap.plugins.dummyplugin"
+            string="DummyPluginCommand" />
+        
+        <!-- CDV 2.5+ -->
+        <config-file target="config.xml" parent="/widget/plugins">
+            <plugin name="DummyPlugin"
+                value="DummyPluginCommand"/>
+        </config-file>
+
+        <resource-file src="DummyPlugin.bundle" />
+        <resource-file src="DummyPluginViewController.xib" />
+
+        <header-file src="DummyPluginCommand.h" />
+        <header-file src="DummyPluginViewController.h" />
+        <header-file src="preserveDirs/PreserveDirsTest.h" preserve-dirs="true" />
+        <header-file src="TargetDirTest.h" target-dir="targetDir"/>
+
+        <source-file src="DummyPluginCommand.m" />
+        <source-file src="DummyPluginViewController.m" />
+        <source-file src="preserveDirs/PreserveDirsTest.m" preserve-dirs="true" />
+        <header-file src="TargetDirTest.m" target-dir="targetDir"/>
+
+        <!-- framework for testing (not actual dependency of DummyPlugin -->
+        <framework src="libsqlite3.dylib" />
+    </platform>
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/DummyPlugin/src/android/DummyPlugin.java
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/android/DummyPlugin.java b/spec/plugins/DummyPlugin/src/android/DummyPlugin.java
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/DummyPlugin/src/android/DummyPlugin.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/e29b0233/spec/plugins/DummyPlugin/src/blackberry/client.js
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/blackberry/client.js b/spec/plugins/DummyPlugin/src/blackberry/client.js
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/DummyPlugin/src/blackberry/client.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/e29b0233/spec/plugins/DummyPlugin/src/blackberry/index.js
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/blackberry/index.js b/spec/plugins/DummyPlugin/src/blackberry/index.js
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/DummyPlugin/src/blackberry/index.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/e29b0233/spec/plugins/DummyPlugin/src/blackberry/manifest.json
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/src/blackberry/manifest.json b/spec/plugins/DummyPlugin/src/blackberry/manifest.json
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/DummyPlugin/www/dummyplugin.js
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/www/dummyplugin.js b/spec/plugins/DummyPlugin/www/dummyplugin.js
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/DummyPlugin/www/dummyplugin.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/e29b0233/spec/plugins/DummyPlugin/www/dummyplugin/image.jpg
----------------------------------------------------------------------
diff --git a/spec/plugins/DummyPlugin/www/dummyplugin/image.jpg b/spec/plugins/DummyPlugin/www/dummyplugin/image.jpg
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/spec/plugins/DummyPlugin/www/dummyplugin/image.jpg
@@ -0,0 +1 @@
+foo

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/FaultyPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/FaultyPlugin/plugin.xml b/spec/plugins/FaultyPlugin/plugin.xml
new file mode 100644
index 0000000..26473d2
--- /dev/null
+++ b/spec/plugins/FaultyPlugin/plugin.xml
@@ -0,0 +1,73 @@
+<?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.faultyplugin"
+    version="0.6.0">
+
+    <name>Faulty Plugin</name>
+
+	<access origin="build.phonegap.com" />
+	<access origin="s3.amazonaws.com" />
+	
+    <!-- android -->
+    <platform name="android">
+        <config-file target="AndroidManifest.xml" parent="/manifest/application">
+            <activity android:name="com.phonegap.plugins.faultyplugin.FaultyPlugin"
+                      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="FaultyPlugin"
+                value="com.phonegap.plugins.faultyplugin.FaultyPlugin"/>
+        </config-file>
+
+        <!-- CDV 2.0+ (for now) -->
+        <config-file target="res/xml/config.xml" parent="/cordova/plugins">
+            <plugin name="FaultyPlugin"
+                value="com.phonegap.plugins.faultyplugin.FaultyPlugin"/>
+        </config-file>
+
+        <source-file src="src/android/FaultyPlugin.java"
+                target-dir="src/com/phonegap/plugins/faultyplugin" />
+    </platform>
+
+    <!-- ios -->
+    <platform name="ios">
+        <!-- /cordova/plugins no longer exists, it is now /widget/plugins -->
+        <!-- this should fail to install on ios -->
+        <config-file target="config.xml" parent="/cordova/plugins">
+            <plugin name="FaultyPlugin"
+                value="FaultyPlugin"/>
+        </config-file>
+
+        <header-file src="src/ios/FaultyPlugin.h" />
+        <source-file src="src/ios/FaultyPlugin.m" />
+        <!-- these files don't exist -->
+        <header-file src="src/ios/FaultyPluginCommand.h" />
+        <source-file src="src/ios/FaultyPluginCommand.m" />
+
+    </platform>
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/FaultyPlugin/src/android/FaultyPlugin.java
----------------------------------------------------------------------
diff --git a/spec/plugins/FaultyPlugin/src/android/FaultyPlugin.java b/spec/plugins/FaultyPlugin/src/android/FaultyPlugin.java
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/FaultyPlugin/src/android/FaultyPlugin.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/e29b0233/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.h
----------------------------------------------------------------------
diff --git a/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.h b/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.h
new file mode 100644
index 0000000..6a23ab6
--- /dev/null
+++ b/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.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/e29b0233/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.m
----------------------------------------------------------------------
diff --git a/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.m b/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.m
new file mode 100644
index 0000000..38aaf64
--- /dev/null
+++ b/spec/plugins/FaultyPlugin/src/ios/FaultyPlugin.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/e29b0233/spec/plugins/WebNotifications/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/WebNotifications/plugin.xml b/spec/plugins/WebNotifications/plugin.xml
new file mode 100644
index 0000000..d6528a0
--- /dev/null
+++ b/spec/plugins/WebNotifications/plugin.xml
@@ -0,0 +1,45 @@
+<?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.webnotifications"
+    version="0.0.1">
+
+    <name>Web Notifications</name>
+
+    <asset src="www/webnotifications.js" target="webnotifications.js" />
+
+	<access origin="build.phonegap.com" />
+	<access origin="s3.amazonaws.com" />
+	
+    <!-- ios -->
+    <platform name="ios">
+        <config-file target="config.xml" parent="/widget/plugins">
+            <plugin name="WebNotifications"
+                value="WebNotifications"/>
+        </config-file>
+
+        <header-file src="src/ios/WebNotifications.h" />
+
+        <source-file src="src/ios/WebNotifications.m" />
+
+    </platform>
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WebNotifications/src/ios/AppDelegate.m.diff
----------------------------------------------------------------------
diff --git a/spec/plugins/WebNotifications/src/ios/AppDelegate.m.diff b/spec/plugins/WebNotifications/src/ios/AppDelegate.m.diff
new file mode 100644
index 0000000..30a557c
--- /dev/null
+++ b/spec/plugins/WebNotifications/src/ios/AppDelegate.m.diff
@@ -0,0 +1,18 @@
+- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
+{
+    // Note: if app wasn't running, you can still get a LN and then it doesn't call this function,
+    // I think it calls app start but notifies you that LN caused the app start or something like that.
+    
+    //UIApplicationState state = [application applicationState];
+    //BOOL wasForeground = (state == UIApplicationStateActive);
+    
+    //NSString *title = [notification.userInfo objectForKey:@"title"];
+    //NSString *body = [notification.userInfo objectForKey:@"body"];
+    NSString *tag = [notification.userInfo objectForKey:@"tag"];
+    
+    [(WebNotifications*)[self.viewController getCommandInstance:@"WebNotifications"] clickNofification:tag];
+    
+    application.applicationIconBadgeNumber = 0;
+    application.scheduledLocalNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications]; // "hack" to clear seen notifications
+}
+

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WebNotifications/src/ios/WebNotifications.h
----------------------------------------------------------------------
diff --git a/spec/plugins/WebNotifications/src/ios/WebNotifications.h b/spec/plugins/WebNotifications/src/ios/WebNotifications.h
new file mode 100644
index 0000000..f0f158d
--- /dev/null
+++ b/spec/plugins/WebNotifications/src/ios/WebNotifications.h
@@ -0,0 +1,35 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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 <Foundation/Foundation.h>
+#import <Cordova/CDVPlugin.h>
+
+@interface WebNotifications : CDVPlugin {
+}
+
+@property (nonatomic, strong) NSMutableArray* activeNotifications;
+
+- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView;
+
+- (void)createNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+- (void)closeNotification:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+
+- (void)clickNofification:(NSString*)tag;
+
+@end

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WebNotifications/src/ios/WebNotifications.m
----------------------------------------------------------------------
diff --git a/spec/plugins/WebNotifications/src/ios/WebNotifications.m b/spec/plugins/WebNotifications/src/ios/WebNotifications.m
new file mode 100644
index 0000000..46f9f55
--- /dev/null
+++ b/spec/plugins/WebNotifications/src/ios/WebNotifications.m
@@ -0,0 +1,124 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+ */
+
+#define Log(fmt, ...) NSLog((@"%d: %s " fmt), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__);
+
+#import "WebNotifications.h"
+#import "MainViewController.h"
+
+@implementation WebNotifications
+
+@synthesize activeNotifications;
+
+- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView
+{
+    self = [super init];
+    if (self) {
+        self.activeNotifications = [NSMutableArray array];
+    }
+    return self;
+}
+
+- (void)createNotification:(CDVInvokedUrlCommand*)command
+{
+    NSDictionary* options = [command.arguments objectAtIndex:0];
+
+    // w3c options:
+	NSString *title = [options objectForKey:@"title"];
+	NSString *body = [options objectForKey:@"body"];
+	NSString *tag = [options objectForKey:@"tag"];
+    //NSString *iconUrl = [options objectForKey:@"iconUrl"]; // Not supported
+    
+    // cordova option extensions:
+    NSUInteger delay = [[options objectForKey:@"delay"] unsignedIntegerValue];
+    NSString *soundUrl = [options objectForKey:@"soundUrl"];
+    NSInteger badgeNumber = [[options objectForKey:@"badgeNumber"] intValue];
+    
+    Log(@"addNotification title: %@  body: %@  tag: %@  delay: %u  badge: %u", title, body, tag, delay, badgeNumber);
+    
+    //NSString *action = [options objectForKey:@"action"];
+    //bool hasAction = ([[options objectForKey:@"hasAction"] intValue] == 1) ? YES : NO;
+    //alertAction
+    
+	UILocalNotification *notif = [[UILocalNotification alloc] init];
+	notif.alertBody = [NSString stringWithFormat:@"[%@] %@: %@", tag, title, body];
+    notif.timeZone = [NSTimeZone defaultTimeZone];
+    
+    notif.soundName = soundUrl;
+    notif.applicationIconBadgeNumber = badgeNumber;
+	
+	NSDictionary *userDict = [NSDictionary dictionaryWithObjectsAndKeys:title,@"title",body,@"body",tag,@"tag",nil];
+    notif.userInfo = userDict;
+	
+    if (delay != 0) {
+        notif.fireDate = [[NSDate date] addTimeInterval:delay];
+        //notif.repeatInterval = [[repeatDict objectForKey: repeat] intValue];
+        
+        [[UIApplication sharedApplication] scheduleLocalNotification:notif];
+    } else {
+        [[UIApplication sharedApplication] presentLocalNotificationNow:notif];
+    }
+    
+    [self.activeNotifications addObject:notif];
+}
+
+- (void)closeNotification:(CDVInvokedUrlCommand*)command
+{
+//    command.callbackId;
+    NSDictionary* options = [command.arguments objectAtIndex:0];
+    NSString *tag = [options objectForKey:@"tag"];
+
+    NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications];
+    for (UILocalNotification *notification in notifications) {
+        if ([[notification.userInfo objectForKey:@"tag"] isEqualToString:tag]) {
+            Log(@"Cancelling notification with tag: %@", tag);
+            [[UIApplication sharedApplication] cancelLocalNotification:notification];
+            [self.activeNotifications removeObject:notification];
+            [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:0] callbackId:command.callbackId];
+        }
+    }
+    [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0] callbackId:command.callbackId];
+}
+
+- (void)clickNofification:(NSString*)tag {
+    NSString *jsCallBack;
+    
+    jsCallBack = [NSString stringWithFormat:@"window.Notification.callOnclickByTag('%@')", tag];
+    [((CDVViewController*)self.viewController).webView stringByEvaluatingJavaScriptFromString:jsCallBack];
+    
+    NSArray *scheduledNotifications = [[UIApplication sharedApplication] scheduledLocalNotifications];
+    NSMutableArray *toDiscard = [NSMutableArray array];
+    for (UILocalNotification *notification in self.activeNotifications) {
+        if (![scheduledNotifications containsObject:notification]) {
+            // This notification is active, but no longer scheduled, so it must be displayed
+            jsCallBack = [NSString stringWithFormat:@"window.Notification.callOncloseByTag('%@')", [notification.userInfo objectForKey:@"tag"]];
+            [((CDVViewController*)self.viewController).webView stringByEvaluatingJavaScriptFromString:jsCallBack];
+            [toDiscard addObject:notification];
+        }
+    }
+    [self.activeNotifications removeObjectsInArray:toDiscard];
+}
+
+/*
+- (void)cancelAllNotifications:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
+	[[UIApplication sharedApplication] cancelAllLocalNotifications];
+}
+*/
+
+@end

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WebNotifications/www/webnotifications.js
----------------------------------------------------------------------
diff --git a/spec/plugins/WebNotifications/www/webnotifications.js b/spec/plugins/WebNotifications/www/webnotifications.js
new file mode 100644
index 0000000..e2409b3
--- /dev/null
+++ b/spec/plugins/WebNotifications/www/webnotifications.js
@@ -0,0 +1,123 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+ */
+
+/*
+ * The W3C window.Notification API: http://www.w3.org/TR/notifications/
+ */
+if (typeof window.Notification == 'undefined') {
+
+    /**
+     * Creates and shows a new notification.
+     * @param title
+     * @param options
+     */
+    window.Notification = function(title, options) {
+        options = options || {};
+
+        this.title = title || 'defaultTitle';
+
+        // w3c options:
+        this.body = options.body || '';
+        this.tag = options.tag || 'defaultTag';
+        this.iconUrl = options.iconUrl || '';
+        // titleDir, bodyDir are not supported
+
+        // cordova option extensions:
+        this.delay = options.delay || 0;
+        this.soundUrl = options.soundUrl || '';
+        this.badgeNumber = options.badgeNumber || 0;
+
+        // there must be one unique notification per tag, so close any existing outstanting notifications
+        if (window.Notification.active[this.tag])
+            window.Notification.active[this.tag].close();
+        window.Notification.active[this.tag] = this;
+
+        // Spec claims these must be defined
+        this.onclick = options.onclick;
+        this.onerror = options.onerror;
+        this.onclose = options.onclose;
+        this.onshow = options.onshow;
+        if (this.onshow) {
+            console.log("Warning, WebNotifications plugin will never call onshow"); // this may change on other platforms
+        }
+
+        var self = this;
+        cordova.exec(null, function(error) {
+            if (self.onerror) {
+                self.onerror(error);
+            }
+        }, 'WebNotifications', 'createNotification', [{
+            tag: this.tag,
+            title: this.title,
+            body: this.body,
+            delay: this.delay,
+        }]);
+    };
+
+    // TODO: change name to something internal looking?
+    window.Notification.permission = 'granted';
+
+    window.Notification.requestPermission = function(callback) {
+        setTimeout(function() {
+            callback(window.Notification.permission);
+        }, 0);
+    };
+
+    // Not part of the W3C API. Used by the native side to call onclick handlers.
+    // TODO: change name to something internal looking?
+    window.Notification.callOnclickByTag = function(tag) {
+        var notification = window.Notification.active[tag];
+        if (notification && notification.onclick && typeof notification.onclick == 'function') {
+            notification.onclick(tag);
+        }
+        delete window.Notification.active[tag];
+    };
+
+    window.Notification.callOncloseByTag = function(tag) {
+        var notification = window.Notification.active[tag];
+        if (notification && notification.onclose && typeof notification.onclose == 'function') {
+            notification.onclose(tag);
+        }
+        delete window.Notification.active[tag];
+    };
+
+    // A global map of notifications by tag, so their onclick callbacks can be called.
+    // TODO: change name to something internal looking?
+    window.Notification.active = {};
+
+    /**
+     * Dismiss a notification.
+     */
+    window.Notification.prototype.close = function() {
+        var self = this;
+        cordova.exec(function() {
+            if (self.onclose) {
+                self.onclose();
+            }
+            delete window.Notification[self.tag];
+        }, function(error) {
+            if (self.onerror) {
+                self.onerror(error);
+            }
+            delete window.Notification[self.tag];
+        }, 'WebNotifications', 'closeNotification', [{
+            tag: this.tag,
+        }]);
+    };
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/plugin.xml b/spec/plugins/WeblessPlugin/plugin.xml
new file mode 100644
index 0000000..0056636
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/plugin.xml
@@ -0,0 +1,81 @@
+<?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.weblessplugin"
+    version="0.6.0">
+
+    <name>Webless Plugin</name>
+
+	<access origin="build.phonegap.com" />
+	<access origin="s3.amazonaws.com" />
+	
+    <!-- android -->
+    <platform name="android">
+        <config-file target="AndroidManifest.xml" parent="/manifest/application">
+            <activity android:name="com.phonegap.plugins.weblessplugin.WeblessPlugin"
+                      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="WeblessPlugin"
+                value="com.phonegap.plugins.weblessplugin.WeblessPlugin"/>
+        </config-file>
+
+        <!-- CDV 2.0+ (for now) -->
+        <config-file target="res/xml/config.xml" parent="/cordova/plugins">
+            <plugin name="WeblessPlugin"
+                value="com.phonegap.plugins.weblessplugin.WeblessPlugin"/>
+        </config-file>
+
+        <source-file src="src/android/WeblessPlugin.java"
+                target-dir="src/com/phonegap/plugins/weblessplugin" />
+    </platform>
+
+    <!-- ios -->
+    <platform name="ios">
+        <!-- CDV < 2.4 -->
+        <plugins-plist key="com.phonegap.plugins.weblessplugin"
+            string="WeblessPluginCommand" />
+        <!-- CDV 2.4 had a /cordova/plugins instead of /widget/plugins so ignored! -->
+        <!-- CDV 2.5+ -->
+        <config-file target="config.xml" parent="/widget/plugins">
+            <plugin name="WeblessPlugin"
+                value="WeblessPluginCommand"/>
+        </config-file>
+
+        <resource-file src="src/ios/WeblessPlugin.bundle" />
+        <resource-file src="src/ios/WeblessPluginViewController.xib" />
+
+        <header-file src="src/ios/WeblessPluginCommand.h" />
+        <header-file src="src/ios/WeblessPluginViewController.h" />
+
+        <source-file src="src/ios/WeblessPluginCommand.m" />
+        <source-file src="src/ios/WeblessPluginViewController.m" />
+
+        <!-- framework for testing (not actual dependency of WeblessPlugin -->
+        <framework src="libsqlite3.dylib" />
+    </platform>
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/android/WeblessPlugin.java
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/android/WeblessPlugin.java b/spec/plugins/WeblessPlugin/src/android/WeblessPlugin.java
new file mode 100644
index 0000000..5263b0c
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/src/android/WeblessPlugin.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/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png
new file mode 100644
index 0000000..530e12b
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png
new file mode 100644
index 0000000..530e12b
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png
new file mode 100644
index 0000000..8b3d855
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png
new file mode 100644
index 0000000..8b3d855
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png
new file mode 100644
index 0000000..309b6bd
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png
new file mode 100644
index 0000000..309b6bd
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png
new file mode 100644
index 0000000..46a8901
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png
new file mode 100644
index 0000000..46a8901
Binary files /dev/null and b/spec/plugins/WeblessPlugin/src/ios/WeblessPlugin.bundle/compass@2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.h
new file mode 100644
index 0000000..6a23ab6
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.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/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.m
new file mode 100644
index 0000000..38aaf64
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginCommand.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/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.h
new file mode 100644
index 0000000..d6fc139
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.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/e29b0233/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m
----------------------------------------------------------------------
diff --git a/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.m
new file mode 100644
index 0000000..167ef98
--- /dev/null
+++ b/spec/plugins/WeblessPlugin/src/ios/WeblessPluginViewController.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


Mime
View raw message