You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/09/19 01:53:12 UTC

[01/10] git commit: Append Windows 8.1 proxy using x-ms-webview

Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master 6e0ea336f -> ac0bdee8e


Append Windows 8.1 proxy using x-ms-webview


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

Branch: refs/heads/master
Commit: ef9ca5ad3ee121efb22f0dfceef6628805ff0c49
Parents: 4d4d479
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 23:01:13 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 23:01:13 2013 +0200

----------------------------------------------------------------------
 src/windows81/InAppBrowserProxy.js | 151 ++++++++++++++++++++++++++++++++
 1 file changed, 151 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ef9ca5ad/src/windows81/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/windows81/InAppBrowserProxy.js b/src/windows81/InAppBrowserProxy.js
new file mode 100644
index 0000000..860f739
--- /dev/null
+++ b/src/windows81/InAppBrowserProxy.js
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*jslint sloppy:true */
+/*global Windows:true, require, document, setTimeout, window, module */
+
+
+
+var cordova = require('cordova'),
+    channel = require('cordova/channel');
+
+var browserWrap,
+    popup,
+    cb;
+
+var IAB = {
+    close: function (win, lose) {
+        if (browserWrap) {
+            if (cb) cb({ type: "exit" });
+
+            browserWrap.parentNode.removeChild(browserWrap);
+            browserWrap = null;
+            popup = null;
+            cb = null;
+        }
+    },
+    show: function (win, lose) {
+        if (browserWrap) {
+            browserWrap.style.display = "block";
+        }
+    },
+    open: function (win, lose, args) {
+        var strUrl = args[0],
+            target = args[1],
+            features = args[2],
+            url;
+
+        if (target === "_system") {
+            url = new Windows.Foundation.Uri(strUrl);
+            Windows.System.Launcher.launchUriAsync(url);
+        }
+        else if (target === "_blank") {
+            cb = win;
+            if (!browserWrap) {
+                browserWrap = document.createElement("div");
+                browserWrap.style.position = "absolute";
+                browserWrap.style.width = (window.innerWidth - 80) + "px";
+                browserWrap.style.height = (window.innerHeight - 80) + "px";
+                browserWrap.style.borderWidth = "40px";
+                browserWrap.style.borderStyle = "solid";
+                browserWrap.style.borderColor = "rgba(0,0,0,0.25)";
+
+                browserWrap.onclick = function () {
+                    setTimeout(function () {
+                        IAB.close();
+                    }, 0);
+                };
+
+                document.body.appendChild(browserWrap);
+            }
+
+            if (features.indexOf("hidden=yes") !== -1) {
+                browserWrap.style.display = "none";
+            }
+
+            popup = document.createElement("x-ms-webview");
+            popup.style.width = (window.innerWidth - 80) + "px";
+            popup.style.height = (window.innerHeight - 80) + "px";
+            popup.src = strUrl;
+
+            popup.addEventListener("MSWebViewNavigationStarting", function (e) {
+                win({ type: "loadstart", url: e.uri });
+            });
+            popup.addEventListener("MSWebViewNavigationCompleted", function (e) {
+                if (e.isSuccess) {
+                    win({ type: "loadstop", url: e.uri });
+                }
+                else {
+                    win({ type: "loaderror", url: e.uri });
+                }
+            });
+            popup.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
+                win({ type: "loaderror", url: e.uri });
+            });
+
+            window.addEventListener("resize", function () {
+                if (browserWrap && popup) {
+                    browserWrap.style.width = (window.innerWidth - 80) + "px";
+                    browserWrap.style.height = (window.innerHeight - 80) + "px";
+
+                    popup.style.width = (window.innerWidth - 80) + "px";
+                    popup.style.height = (window.innerHeight - 80) + "px";
+                }
+            });
+
+            browserWrap.appendChild(popup);
+        }
+        else {
+            window.location = strUrl;
+        }
+    },
+
+    injectScriptCode: function (win, fail, args) {
+        var code = args[0],
+            hasCallback = args[1];
+
+        if (browserWrap && popup) {
+            var op = popup.invokeScriptAsync("eval", code);
+            op.oncomplete = function () { hasCallback && win([]); };
+            op.onerror = function () { };
+            op.start();
+        }
+        // "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"
+    },
+    injectScriptFile: function (win, fail, args) {
+        var file = args[0],
+            hasCallback = args[1];
+
+        if (browserWrap && popup) {
+            Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
+                var op = popup.invokeScriptAsync("eval", code);
+                op.oncomplete = function () { hasCallback && win([]); };
+                op.onerror = function () { };
+                op.start();
+            });
+        }
+    }
+};
+
+module.exports = IAB;
+
+
+require("cordova/windows8/commandProxy").add("InAppBrowser", module.exports);


[06/10] git commit: Update doc to add Windows 8

Posted by pu...@apache.org.
Update doc to add Windows 8


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

Branch: refs/heads/master
Commit: ea6a4fc80a2bc5b1cc74964e921df8b367e5876f
Parents: ac9c649
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 21:48:21 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 21:48:21 2014 +0200

----------------------------------------------------------------------
 doc/index.md | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ea6a4fc8/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index d59cd99..1f4c823 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -77,6 +77,10 @@ instance, or the system browser.
     - __transitionstyle__: Set to `fliphorizontal`, `crossdissolve` or `coververtical` to set the [transition style](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle) (defaults to `coververtical`).
     - __toolbarposition__: Set to `top` or `bottom` (default is `bottom`). Causes the toolbar to be at the top or bottom of the window.
 
+    Windows only:
+
+    - __hidden__: set to `yes` to create the browser and load the page, but not show it. The loadstop event fires when loading is complete. Omit or set to `no` (default) to have the browser open and load normally.
+
 ### Supported Platforms
 
 - Amazon Fire OS
@@ -84,6 +88,7 @@ instance, or the system browser.
 - BlackBerry 10
 - Firefox OS
 - iOS
+- Windows 8 and 8.1
 - Windows Phone 7 and 8
 
 ### Example
@@ -169,6 +174,7 @@ The object returned from a call to `window.open`.
 - Amazon Fire OS
 - Android
 - iOS
+- Windows 8 and 8.1
 - Windows Phone 7 and 8
 
 ### Quick Example
@@ -199,6 +205,7 @@ The function is passed an `InAppBrowserEvent` object.
 - Amazon Fire OS
 - Android
 - iOS
+- Windows 8 and 8.1
 - Windows Phone 7 and 8
 
 ### Quick Example
@@ -222,6 +229,7 @@ The function is passed an `InAppBrowserEvent` object.
 - Android
 - Firefox OS
 - iOS
+- Windows 8 and 8.1
 - Windows Phone 7 and 8
 
 ### Quick Example
@@ -242,6 +250,7 @@ The function is passed an `InAppBrowserEvent` object.
 - Amazon Fire OS
 - Android
 - iOS
+- Windows 8 and 8.1
 
 ### Quick Example
 
@@ -273,6 +282,7 @@ The function is passed an `InAppBrowserEvent` object.
 - Amazon Fire OS
 - Android
 - iOS
+- Windows 8 and 8.1
 
 ### Quick Example
 


[03/10] git commit: Update code from remote apache repository

Posted by pu...@apache.org.
Update code from remote apache repository


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

Branch: refs/heads/master
Commit: e5d07f14e8419dea67ec6c13d9f18a096f20a939
Parents: 8633863 f866e0e
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 17:05:24 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 17:05:24 2014 +0200

----------------------------------------------------------------------
 CONTRIBUTING.md                                 |  37 +
 NOTICE                                          |   5 +
 README.md                                       |  25 +-
 RELEASENOTES.md                                 |  78 +-
 doc/de/index.md                                 | 320 ++++++++
 doc/es/index.md                                 | 320 ++++++++
 doc/fr/index.md                                 | 320 ++++++++
 doc/index.md                                    | 310 ++++++++
 doc/it/index.md                                 | 320 ++++++++
 doc/ja/index.md                                 | 320 ++++++++
 doc/ko/index.md                                 | 320 ++++++++
 doc/pl/index.md                                 | 299 +++++++
 doc/ru/index.md                                 | 320 ++++++++
 doc/zh/index.md                                 | 320 ++++++++
 docs/inappbrowser.md                            | 427 ----------
 docs/window.open.md                             | 100 ---
 plugin.xml                                      | 138 +++-
 src/amazon/InAppBrowser.java                    | 769 +++++++++++++++++++
 src/amazon/InAppChromeClient.java               | 146 ++++
 src/android/InAppBrowser.java                   | 403 +++++-----
 src/android/InAppBrowserDialog.java             |  54 ++
 src/android/InAppChromeClient.java              |  33 +-
 .../res/drawable-hdpi/ic_action_next_item.png   | Bin 0 -> 593 bytes
 .../drawable-hdpi/ic_action_previous_item.png   | Bin 0 -> 599 bytes
 .../res/drawable-hdpi/ic_action_remove.png      | Bin 0 -> 438 bytes
 .../res/drawable-mdpi/ic_action_next_item.png   | Bin 0 -> 427 bytes
 .../drawable-mdpi/ic_action_previous_item.png   | Bin 0 -> 438 bytes
 .../res/drawable-mdpi/ic_action_remove.png      | Bin 0 -> 328 bytes
 .../res/drawable-xhdpi/ic_action_next_item.png  | Bin 0 -> 727 bytes
 .../drawable-xhdpi/ic_action_previous_item.png  | Bin 0 -> 744 bytes
 .../res/drawable-xhdpi/ic_action_remove.png     | Bin 0 -> 536 bytes
 .../res/drawable-xxhdpi/ic_action_next_item.png | Bin 0 -> 1021 bytes
 .../drawable-xxhdpi/ic_action_previous_item.png | Bin 0 -> 1038 bytes
 .../res/drawable-xxhdpi/ic_action_remove.png    | Bin 0 -> 681 bytes
 src/blackberry10/README.md                      |  18 +
 src/firefoxos/InAppBrowserProxy.js              | 171 +++++
 src/ios/CDVInAppBrowser.h                       |  51 +-
 src/ios/CDVInAppBrowser.m                       | 314 ++++++--
 src/ubuntu/InAppBrowser.qml                     |  69 ++
 src/ubuntu/close.png                            | Bin 0 -> 461 bytes
 src/ubuntu/inappbrowser.cpp                     | 106 +++
 src/ubuntu/inappbrowser.h                       |  61 ++
 src/wp/InAppBrowser.cs                          | 288 ++++++-
 test/.DS_Store                                  | Bin 6148 -> 0 bytes
 test/cordova-incl.js                            |  70 --
 test/inappbrowser/index.html                    | 258 -------
 test/inappbrowser/inject.css                    |  21 -
 test/inappbrowser/inject.html                   |  43 --
 test/inappbrowser/inject.js                     |  20 -
 test/inappbrowser/local.html                    |  51 --
 test/inappbrowser/local.pdf                     | Bin 8568 -> 0 bytes
 test/index.html                                 |  65 --
 test/main.js                                    | 163 ----
 test/master.css                                 | 164 ----
 www/InAppBrowser.js                             |  14 +-
 www/windows8/InAppBrowserProxy.js               |   2 +-
 56 files changed, 5617 insertions(+), 1716 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/e5d07f14/plugin.xml
----------------------------------------------------------------------
diff --cc plugin.xml
index 0bb6616,9c47e0b..4f146dd
--- a/plugin.xml
+++ b/plugin.xml
@@@ -7,14 -26,18 +26,18 @@@
      <description>Cordova InAppBrowser Plugin</description>
      <license>Apache 2.0</license>
      <keywords>cordova,in,app,browser,inappbrowser</keywords>
+     <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git</repo>
+     <issue>https://issues.apache.org/jira/browse/CB/component/12320641</issue>
  
+     <engines>
+       <engine name="cordova" version=">=3.1.0" /><!-- Needs cordova/urlutil -->
+     </engines>
 -    
 +
-     <js-module src="www/InAppBrowser.js" name="InAppBrowser">
-         <clobbers target="window.open" />
-     </js-module>
-     
      <!-- android -->
      <platform name="android">
+         <js-module src="www/inappbrowser.js" name="inappbrowser">
 -            <clobbers target="window.open" />
 -        </js-module>
++        <clobbers target="window.open" />
++    </js-module>
          <config-file target="res/xml/config.xml" parent="/*">
              <feature name="InAppBrowser"> 
                  <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
@@@ -22,11 -45,58 +45,58 @@@
          </config-file>
  
          <source-file src="src/android/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
+         <source-file src="src/android/InAppBrowserDialog.java" target-dir="src/org/apache/cordova/inappbrowser" />
          <source-file src="src/android/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
+ 
+         <!--  drawable src/android/resources -->
+         <resource-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target="res/drawable-hdpi/ic_action_next_item.png" />
+         <resource-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target="res/drawable-mdpi/ic_action_next_item.png" />
+         <resource-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target="res/drawable-xhdpi/ic_action_next_item.png" />
+         <resource-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target="res/drawable-xxhdpi/ic_action_next_item.png" />
+ 
+         <resource-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target="res/drawable-hdpi/ic_action_previous_item.png" />
+         <resource-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target="res/drawable-mdpi/ic_action_previous_item.png" />
+         <resource-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target="res/drawable-xhdpi/ic_action_previous_item.png" />
+         <resource-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target="res/drawable-xxhdpi/ic_action_previous_item.png" />
+ 
+         <resource-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target="res/drawable-hdpi/ic_action_remove.png" />
+         <resource-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target="res/drawable-mdpi/ic_action_remove.png" />
+         <resource-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target="res/drawable-xhdpi/ic_action_remove.png" />
+         <resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
+ 
+     </platform>
+     
+     <!-- amazon-fireos -->
+     <platform name="amazon-fireos">
+         <js-module src="www/inappbrowser.js" name="inappbrowser">
+             <clobbers target="window.open" />
+         </js-module>
+         <config-file target="res/xml/config.xml" parent="/*">
+             <feature name="InAppBrowser"> 
+                 <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
+             </feature>
+         </config-file>
+ 
+         <source-file src="src/amazon/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
+         <source-file src="src/amazon/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
      </platform>
 -
 +    
+     <!-- ubuntu -->
+     <platform name="ubuntu">
+         <js-module src="www/inappbrowser.js" name="inappbrowser">
+             <clobbers target="window.open" />
+         </js-module>
+         <header-file src="src/ubuntu/inappbrowser.h" />
+         <source-file src="src/ubuntu/inappbrowser.cpp" />
+         <resource-file src="src/ubuntu/InAppBrowser.qml" />
+         <resource-file src="src/ubuntu/close.png" />
+     </platform>
+ 
      <!-- ios -->
 -    <platform name="ios">
 +    <platform name="ios">    
+         <js-module src="www/inappbrowser.js" name="inappbrowser">
+             <clobbers target="window.open" />
+         </js-module>  
          <config-file target="config.xml" parent="/*">
              <feature name="InAppBrowser">
                  <param name="ios-package" value="CDVInAppBrowser" /> 
@@@ -74,13 -162,18 +162,29 @@@
              <merges target="" />
          </js-module>
      </platform>
 -        
 +
-     <!-- windows81 -->
-     <platform name="windows81">
-       <js-module src="src/windows81/InAppBrowserProxy.js" name="InAppBrowserProxy">
-         <merges target="" />
-       </js-module>
++    <!-- windows universal apps (Windows 8.1, Windows Phone 8.1, Windows 8.0) -->
++    <platform name="windows">
++        <js-module src="www/inappbrowser.js" name="inappbrowser">
++            <clobbers target="window.open" />
++        </js-module>
++        <js-module src="src/windows/InAppBrowserProxy.js" name="InAppBrowserProxy">
++            <merges target="" />
++        </js-module>
++    </platform>
++  
+     <!-- firefoxos -->
+     <platform name="firefoxos">
+         <config-file target="config.xml" parent="/*">
+             <permission name="browser" description="Enables the app to implement a browser in an iframe." />
+         </config-file>
+         <js-module src="www/inappbrowser.js" name="inappbrowser">
+             <clobbers target="window.open" />
+         </js-module>
+         <js-module src="src/firefoxos/InAppBrowserProxy.js" name="InAppBrowserProxy">
+             <merges target="" />
+         </js-module>
 -    </platform>    
 +    </platform>
 +
  
  </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/e5d07f14/www/InAppBrowser.js
----------------------------------------------------------------------
diff --cc www/InAppBrowser.js
index 5da53fd,0000000..3535b6f
mode 100644,000000..100644
--- a/www/InAppBrowser.js
+++ b/www/InAppBrowser.js
@@@ -1,94 -1,0 +1,98 @@@
 +/*
 + *
 + * 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.
 + *
 +*/
 +
 +var exec = require('cordova/exec');
 +var channel = require('cordova/channel');
 +var modulemapper = require('cordova/modulemapper');
++var urlutil = require('cordova/urlutil');
 +
 +function InAppBrowser() {
 +   this.channels = {
 +        'loadstart': channel.create('loadstart'),
 +        'loadstop' : channel.create('loadstop'),
 +        'loaderror' : channel.create('loaderror'),
 +        'exit' : channel.create('exit')
 +   };
 +}
 +
 +InAppBrowser.prototype = {
 +    _eventHandler: function (event) {
 +        if (event.type in this.channels) {
 +            this.channels[event.type].fire(event);
 +        }
 +    },
 +    close: function (eventname) {
 +        exec(null, null, "InAppBrowser", "close", []);
 +    },
 +    show: function (eventname) {
 +      exec(null, null, "InAppBrowser", "show", []);
 +    },
 +    addEventListener: function (eventname,f) {
 +        if (eventname in this.channels) {
 +            this.channels[eventname].subscribe(f);
 +        }
 +    },
 +    removeEventListener: function(eventname, f) {
 +        if (eventname in this.channels) {
 +            this.channels[eventname].unsubscribe(f);
 +        }
 +    },
 +
 +    executeScript: function(injectDetails, cb) {
 +        if (injectDetails.code) {
 +            exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]);
 +        } else if (injectDetails.file) {
 +            exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]);
 +        } else {
 +            throw new Error('executeScript requires exactly one of code or file to be specified');
 +        }
 +    },
 +
 +    insertCSS: function(injectDetails, cb) {
 +        if (injectDetails.code) {
 +            exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]);
 +        } else if (injectDetails.file) {
 +            exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]);
 +        } else {
 +            throw new Error('insertCSS requires exactly one of code or file to be specified');
 +        }
 +    }
 +};
 +
 +module.exports = function(strUrl, strWindowName, strWindowFeatures) {
-     var iab = new InAppBrowser();
-     var cb = function(eventname) {
-        iab._eventHandler(eventname);
-     };
- 
 +    // Don't catch calls that write to existing frames (e.g. named iframes).
 +    if (window.frames && window.frames[strWindowName]) {
 +        var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
 +        return origOpenFunc.apply(window, arguments);
 +    }
 +
++    strUrl = urlutil.makeAbsolute(strUrl);
++    var iab = new InAppBrowser();
++    var cb = function(eventname) {
++       iab._eventHandler(eventname);
++    };
++
++    strWindowFeatures = strWindowFeatures || "";
++
 +    exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
 +    return iab;
 +};
 +


[09/10] git commit: Merge branch 'CB-5109' of https://github.com/Touchit/cordova-plugin-inappbrowser

Posted by pu...@apache.org.
Merge branch 'CB-5109' of https://github.com/Touchit/cordova-plugin-inappbrowser


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/22b3f0cc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/22b3f0cc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/22b3f0cc

Branch: refs/heads/master
Commit: 22b3f0ccd469b690e1f6db015cafe085e80ecea0
Parents: 6e0ea33 d828197
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 18 16:44:04 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 18 16:44:04 2014 -0700

----------------------------------------------------------------------
 doc/fr/index.md                  |  14 ++-
 doc/index.md                     |  10 ++
 plugin.xml                       |  20 +++-
 src/windows/InAppBrowserProxy.js | 174 ++++++++++++++++++++++++++++++++++
 www/InAppBrowser.js              |  98 +++++++++++++++++++
 www/inappbrowser.js              |  98 -------------------
 6 files changed, 309 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/22b3f0cc/doc/fr/index.md
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/22b3f0cc/doc/index.md
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/22b3f0cc/plugin.xml
----------------------------------------------------------------------
diff --cc plugin.xml
index f190ba1,1ee223f..1983990
--- a/plugin.xml
+++ b/plugin.xml
@@@ -78,26 -78,9 +78,26 @@@
          </config-file>
  
          <source-file src="src/amazon/InAppBrowser.java" target-dir="src/org/apache/cordova/inappbrowser" />
 +        <source-file src="src/android/InAppBrowserDialog.java" target-dir="src/org/apache/cordova/inappbrowser" />
          <source-file src="src/amazon/InAppChromeClient.java" target-dir="src/org/apache/cordova/inappbrowser" />
 +        
 +        <!--  drawable src/android/resources -->
 +        <resource-file src="src/android/res/drawable-hdpi/ic_action_next_item.png" target="res/drawable-hdpi/ic_action_next_item.png" />
 +        <resource-file src="src/android/res/drawable-mdpi/ic_action_next_item.png" target="res/drawable-mdpi/ic_action_next_item.png" />
 +        <resource-file src="src/android/res/drawable-xhdpi/ic_action_next_item.png" target="res/drawable-xhdpi/ic_action_next_item.png" />
 +        <resource-file src="src/android/res/drawable-xxhdpi/ic_action_next_item.png" target="res/drawable-xxhdpi/ic_action_next_item.png" />
 +        
 +        <resource-file src="src/android/res/drawable-hdpi/ic_action_previous_item.png" target="res/drawable-hdpi/ic_action_previous_item.png" />
 +        <resource-file src="src/android/res/drawable-mdpi/ic_action_previous_item.png" target="res/drawable-mdpi/ic_action_previous_item.png" />
 +        <resource-file src="src/android/res/drawable-xhdpi/ic_action_previous_item.png" target="res/drawable-xhdpi/ic_action_previous_item.png" />
 +        <resource-file src="src/android/res/drawable-xxhdpi/ic_action_previous_item.png" target="res/drawable-xxhdpi/ic_action_previous_item.png" />
 +        
 +        <resource-file src="src/android/res/drawable-hdpi/ic_action_remove.png" target="res/drawable-hdpi/ic_action_remove.png" />
 +        <resource-file src="src/android/res/drawable-mdpi/ic_action_remove.png" target="res/drawable-mdpi/ic_action_remove.png" />
 +        <resource-file src="src/android/res/drawable-xhdpi/ic_action_remove.png" target="res/drawable-xhdpi/ic_action_remove.png" />
 +        <resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
      </platform>
- 
+     
      <!-- ubuntu -->
      <platform name="ubuntu">
          <js-module src="www/inappbrowser.js" name="inappbrowser">


[08/10] git commit: Clean plugin.xml

Posted by pu...@apache.org.
Clean plugin.xml


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

Branch: refs/heads/master
Commit: d828197de45f724ad41135c3ca8f0767a0990582
Parents: 6e38667
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 21:54:25 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 21:54:25 2014 +0200

----------------------------------------------------------------------
 plugin.xml | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/d828197d/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 4f146dd..1ee223f 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -36,8 +36,8 @@
     <!-- android -->
     <platform name="android">
         <js-module src="www/inappbrowser.js" name="inappbrowser">
-        <clobbers target="window.open" />
-    </js-module>
+            <clobbers target="window.open" />
+        </js-module>
         <config-file target="res/xml/config.xml" parent="/*">
             <feature name="InAppBrowser"> 
                 <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
@@ -65,7 +65,7 @@
         <resource-file src="src/android/res/drawable-xxhdpi/ic_action_remove.png" target="res/drawable-xxhdpi/ic_action_remove.png" />
 
     </platform>
-    
+
     <!-- amazon-fireos -->
     <platform name="amazon-fireos">
         <js-module src="www/inappbrowser.js" name="inappbrowser">
@@ -93,7 +93,7 @@
     </platform>
 
     <!-- ios -->
-    <platform name="ios">    
+    <platform name="ios">
         <js-module src="www/inappbrowser.js" name="inappbrowser">
             <clobbers target="window.open" />
         </js-module>  
@@ -186,5 +186,4 @@
         </js-module>
     </platform>
 
-
 </plugin>


[02/10] git commit: Append Windows 8.1 platform configuration in plugin.xml

Posted by pu...@apache.org.
Append Windows 8.1 platform configuration in plugin.xml


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

Branch: refs/heads/master
Commit: 863386398e6e595f103d593ab72c91712fcc373a
Parents: ef9ca5a
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 23:02:59 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 23:02:59 2013 +0200

----------------------------------------------------------------------
 plugin.xml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/86338639/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 03cb490..0bb6616 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -74,6 +74,13 @@
             <merges target="" />
         </js-module>
     </platform>
-        
+
+    <!-- windows81 -->
+    <platform name="windows81">
+      <js-module src="src/windows81/InAppBrowserProxy.js" name="InAppBrowserProxy">
+        <merges target="" />
+      </js-module>
+    </platform>
+
 
 </plugin>


[10/10] git commit: renamed InAppBrowser back to inappbrowser for case sensitive operating systems

Posted by pu...@apache.org.
renamed InAppBrowser back to inappbrowser for case sensitive operating systems


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

Branch: refs/heads/master
Commit: ac0bdee8e6f024be67df0331db9820b41d000054
Parents: 22b3f0c
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 18 16:52:40 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 18 16:52:40 2014 -0700

----------------------------------------------------------------------
 www/InAppBrowser.js | 98 ------------------------------------------------
 www/inappbrowser.js | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ac0bdee8/www/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/www/InAppBrowser.js b/www/InAppBrowser.js
deleted file mode 100644
index 3535b6f..0000000
--- a/www/InAppBrowser.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-var exec = require('cordova/exec');
-var channel = require('cordova/channel');
-var modulemapper = require('cordova/modulemapper');
-var urlutil = require('cordova/urlutil');
-
-function InAppBrowser() {
-   this.channels = {
-        'loadstart': channel.create('loadstart'),
-        'loadstop' : channel.create('loadstop'),
-        'loaderror' : channel.create('loaderror'),
-        'exit' : channel.create('exit')
-   };
-}
-
-InAppBrowser.prototype = {
-    _eventHandler: function (event) {
-        if (event.type in this.channels) {
-            this.channels[event.type].fire(event);
-        }
-    },
-    close: function (eventname) {
-        exec(null, null, "InAppBrowser", "close", []);
-    },
-    show: function (eventname) {
-      exec(null, null, "InAppBrowser", "show", []);
-    },
-    addEventListener: function (eventname,f) {
-        if (eventname in this.channels) {
-            this.channels[eventname].subscribe(f);
-        }
-    },
-    removeEventListener: function(eventname, f) {
-        if (eventname in this.channels) {
-            this.channels[eventname].unsubscribe(f);
-        }
-    },
-
-    executeScript: function(injectDetails, cb) {
-        if (injectDetails.code) {
-            exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]);
-        } else if (injectDetails.file) {
-            exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]);
-        } else {
-            throw new Error('executeScript requires exactly one of code or file to be specified');
-        }
-    },
-
-    insertCSS: function(injectDetails, cb) {
-        if (injectDetails.code) {
-            exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]);
-        } else if (injectDetails.file) {
-            exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]);
-        } else {
-            throw new Error('insertCSS requires exactly one of code or file to be specified');
-        }
-    }
-};
-
-module.exports = function(strUrl, strWindowName, strWindowFeatures) {
-    // Don't catch calls that write to existing frames (e.g. named iframes).
-    if (window.frames && window.frames[strWindowName]) {
-        var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
-        return origOpenFunc.apply(window, arguments);
-    }
-
-    strUrl = urlutil.makeAbsolute(strUrl);
-    var iab = new InAppBrowser();
-    var cb = function(eventname) {
-       iab._eventHandler(eventname);
-    };
-
-    strWindowFeatures = strWindowFeatures || "";
-
-    exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
-    return iab;
-};
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ac0bdee8/www/inappbrowser.js
----------------------------------------------------------------------
diff --git a/www/inappbrowser.js b/www/inappbrowser.js
new file mode 100644
index 0000000..3535b6f
--- /dev/null
+++ b/www/inappbrowser.js
@@ -0,0 +1,98 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+var exec = require('cordova/exec');
+var channel = require('cordova/channel');
+var modulemapper = require('cordova/modulemapper');
+var urlutil = require('cordova/urlutil');
+
+function InAppBrowser() {
+   this.channels = {
+        'loadstart': channel.create('loadstart'),
+        'loadstop' : channel.create('loadstop'),
+        'loaderror' : channel.create('loaderror'),
+        'exit' : channel.create('exit')
+   };
+}
+
+InAppBrowser.prototype = {
+    _eventHandler: function (event) {
+        if (event.type in this.channels) {
+            this.channels[event.type].fire(event);
+        }
+    },
+    close: function (eventname) {
+        exec(null, null, "InAppBrowser", "close", []);
+    },
+    show: function (eventname) {
+      exec(null, null, "InAppBrowser", "show", []);
+    },
+    addEventListener: function (eventname,f) {
+        if (eventname in this.channels) {
+            this.channels[eventname].subscribe(f);
+        }
+    },
+    removeEventListener: function(eventname, f) {
+        if (eventname in this.channels) {
+            this.channels[eventname].unsubscribe(f);
+        }
+    },
+
+    executeScript: function(injectDetails, cb) {
+        if (injectDetails.code) {
+            exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]);
+        } else if (injectDetails.file) {
+            exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]);
+        } else {
+            throw new Error('executeScript requires exactly one of code or file to be specified');
+        }
+    },
+
+    insertCSS: function(injectDetails, cb) {
+        if (injectDetails.code) {
+            exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]);
+        } else if (injectDetails.file) {
+            exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]);
+        } else {
+            throw new Error('insertCSS requires exactly one of code or file to be specified');
+        }
+    }
+};
+
+module.exports = function(strUrl, strWindowName, strWindowFeatures) {
+    // Don't catch calls that write to existing frames (e.g. named iframes).
+    if (window.frames && window.frames[strWindowName]) {
+        var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
+        return origOpenFunc.apply(window, arguments);
+    }
+
+    strUrl = urlutil.makeAbsolute(strUrl);
+    var iab = new InAppBrowser();
+    var cb = function(eventname) {
+       iab._eventHandler(eventname);
+    };
+
+    strWindowFeatures = strWindowFeatures || "";
+
+    exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
+    return iab;
+};
+


[04/10] git commit: Rename windows81 by windows8 in src directory

Posted by pu...@apache.org.
Rename windows81 by windows8 in src directory


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/225bde27
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/225bde27
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/225bde27

Branch: refs/heads/master
Commit: 225bde271b03b39ab6bb6bac807bfae1d960f721
Parents: e5d07f1
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 17:06:39 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 17:06:39 2014 +0200

----------------------------------------------------------------------
 src/windows/InAppBrowserProxy.js   | 151 ++++++++++++++++++++++++++++++++
 src/windows81/InAppBrowserProxy.js | 151 --------------------------------
 2 files changed, 151 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/225bde27/src/windows/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/InAppBrowserProxy.js b/src/windows/InAppBrowserProxy.js
new file mode 100644
index 0000000..860f739
--- /dev/null
+++ b/src/windows/InAppBrowserProxy.js
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*jslint sloppy:true */
+/*global Windows:true, require, document, setTimeout, window, module */
+
+
+
+var cordova = require('cordova'),
+    channel = require('cordova/channel');
+
+var browserWrap,
+    popup,
+    cb;
+
+var IAB = {
+    close: function (win, lose) {
+        if (browserWrap) {
+            if (cb) cb({ type: "exit" });
+
+            browserWrap.parentNode.removeChild(browserWrap);
+            browserWrap = null;
+            popup = null;
+            cb = null;
+        }
+    },
+    show: function (win, lose) {
+        if (browserWrap) {
+            browserWrap.style.display = "block";
+        }
+    },
+    open: function (win, lose, args) {
+        var strUrl = args[0],
+            target = args[1],
+            features = args[2],
+            url;
+
+        if (target === "_system") {
+            url = new Windows.Foundation.Uri(strUrl);
+            Windows.System.Launcher.launchUriAsync(url);
+        }
+        else if (target === "_blank") {
+            cb = win;
+            if (!browserWrap) {
+                browserWrap = document.createElement("div");
+                browserWrap.style.position = "absolute";
+                browserWrap.style.width = (window.innerWidth - 80) + "px";
+                browserWrap.style.height = (window.innerHeight - 80) + "px";
+                browserWrap.style.borderWidth = "40px";
+                browserWrap.style.borderStyle = "solid";
+                browserWrap.style.borderColor = "rgba(0,0,0,0.25)";
+
+                browserWrap.onclick = function () {
+                    setTimeout(function () {
+                        IAB.close();
+                    }, 0);
+                };
+
+                document.body.appendChild(browserWrap);
+            }
+
+            if (features.indexOf("hidden=yes") !== -1) {
+                browserWrap.style.display = "none";
+            }
+
+            popup = document.createElement("x-ms-webview");
+            popup.style.width = (window.innerWidth - 80) + "px";
+            popup.style.height = (window.innerHeight - 80) + "px";
+            popup.src = strUrl;
+
+            popup.addEventListener("MSWebViewNavigationStarting", function (e) {
+                win({ type: "loadstart", url: e.uri });
+            });
+            popup.addEventListener("MSWebViewNavigationCompleted", function (e) {
+                if (e.isSuccess) {
+                    win({ type: "loadstop", url: e.uri });
+                }
+                else {
+                    win({ type: "loaderror", url: e.uri });
+                }
+            });
+            popup.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
+                win({ type: "loaderror", url: e.uri });
+            });
+
+            window.addEventListener("resize", function () {
+                if (browserWrap && popup) {
+                    browserWrap.style.width = (window.innerWidth - 80) + "px";
+                    browserWrap.style.height = (window.innerHeight - 80) + "px";
+
+                    popup.style.width = (window.innerWidth - 80) + "px";
+                    popup.style.height = (window.innerHeight - 80) + "px";
+                }
+            });
+
+            browserWrap.appendChild(popup);
+        }
+        else {
+            window.location = strUrl;
+        }
+    },
+
+    injectScriptCode: function (win, fail, args) {
+        var code = args[0],
+            hasCallback = args[1];
+
+        if (browserWrap && popup) {
+            var op = popup.invokeScriptAsync("eval", code);
+            op.oncomplete = function () { hasCallback && win([]); };
+            op.onerror = function () { };
+            op.start();
+        }
+        // "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"
+    },
+    injectScriptFile: function (win, fail, args) {
+        var file = args[0],
+            hasCallback = args[1];
+
+        if (browserWrap && popup) {
+            Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
+                var op = popup.invokeScriptAsync("eval", code);
+                op.oncomplete = function () { hasCallback && win([]); };
+                op.onerror = function () { };
+                op.start();
+            });
+        }
+    }
+};
+
+module.exports = IAB;
+
+
+require("cordova/windows8/commandProxy").add("InAppBrowser", module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/225bde27/src/windows81/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/windows81/InAppBrowserProxy.js b/src/windows81/InAppBrowserProxy.js
deleted file mode 100644
index 860f739..0000000
--- a/src/windows81/InAppBrowserProxy.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-/*jslint sloppy:true */
-/*global Windows:true, require, document, setTimeout, window, module */
-
-
-
-var cordova = require('cordova'),
-    channel = require('cordova/channel');
-
-var browserWrap,
-    popup,
-    cb;
-
-var IAB = {
-    close: function (win, lose) {
-        if (browserWrap) {
-            if (cb) cb({ type: "exit" });
-
-            browserWrap.parentNode.removeChild(browserWrap);
-            browserWrap = null;
-            popup = null;
-            cb = null;
-        }
-    },
-    show: function (win, lose) {
-        if (browserWrap) {
-            browserWrap.style.display = "block";
-        }
-    },
-    open: function (win, lose, args) {
-        var strUrl = args[0],
-            target = args[1],
-            features = args[2],
-            url;
-
-        if (target === "_system") {
-            url = new Windows.Foundation.Uri(strUrl);
-            Windows.System.Launcher.launchUriAsync(url);
-        }
-        else if (target === "_blank") {
-            cb = win;
-            if (!browserWrap) {
-                browserWrap = document.createElement("div");
-                browserWrap.style.position = "absolute";
-                browserWrap.style.width = (window.innerWidth - 80) + "px";
-                browserWrap.style.height = (window.innerHeight - 80) + "px";
-                browserWrap.style.borderWidth = "40px";
-                browserWrap.style.borderStyle = "solid";
-                browserWrap.style.borderColor = "rgba(0,0,0,0.25)";
-
-                browserWrap.onclick = function () {
-                    setTimeout(function () {
-                        IAB.close();
-                    }, 0);
-                };
-
-                document.body.appendChild(browserWrap);
-            }
-
-            if (features.indexOf("hidden=yes") !== -1) {
-                browserWrap.style.display = "none";
-            }
-
-            popup = document.createElement("x-ms-webview");
-            popup.style.width = (window.innerWidth - 80) + "px";
-            popup.style.height = (window.innerHeight - 80) + "px";
-            popup.src = strUrl;
-
-            popup.addEventListener("MSWebViewNavigationStarting", function (e) {
-                win({ type: "loadstart", url: e.uri });
-            });
-            popup.addEventListener("MSWebViewNavigationCompleted", function (e) {
-                if (e.isSuccess) {
-                    win({ type: "loadstop", url: e.uri });
-                }
-                else {
-                    win({ type: "loaderror", url: e.uri });
-                }
-            });
-            popup.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
-                win({ type: "loaderror", url: e.uri });
-            });
-
-            window.addEventListener("resize", function () {
-                if (browserWrap && popup) {
-                    browserWrap.style.width = (window.innerWidth - 80) + "px";
-                    browserWrap.style.height = (window.innerHeight - 80) + "px";
-
-                    popup.style.width = (window.innerWidth - 80) + "px";
-                    popup.style.height = (window.innerHeight - 80) + "px";
-                }
-            });
-
-            browserWrap.appendChild(popup);
-        }
-        else {
-            window.location = strUrl;
-        }
-    },
-
-    injectScriptCode: function (win, fail, args) {
-        var code = args[0],
-            hasCallback = args[1];
-
-        if (browserWrap && popup) {
-            var op = popup.invokeScriptAsync("eval", code);
-            op.oncomplete = function () { hasCallback && win([]); };
-            op.onerror = function () { };
-            op.start();
-        }
-        // "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"
-    },
-    injectScriptFile: function (win, fail, args) {
-        var file = args[0],
-            hasCallback = args[1];
-
-        if (browserWrap && popup) {
-            Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
-                var op = popup.invokeScriptAsync("eval", code);
-                op.oncomplete = function () { hasCallback && win([]); };
-                op.onerror = function () { };
-                op.start();
-            });
-        }
-    }
-};
-
-module.exports = IAB;
-
-
-require("cordova/windows8/commandProxy").add("InAppBrowser", module.exports);


[07/10] git commit: Update french translation

Posted by pu...@apache.org.
Update french translation


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/6e386673
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/6e386673
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/6e386673

Branch: refs/heads/master
Commit: 6e38667320cda5f5c199a5d6a038a001be491bdd
Parents: ea6a4fc
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 21:48:31 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 21:48:31 2014 +0200

----------------------------------------------------------------------
 doc/fr/index.md | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/6e386673/doc/fr/index.md
----------------------------------------------------------------------
diff --git a/doc/fr/index.md b/doc/fr/index.md
index e9dc62e..7034e28 100644
--- a/doc/fr/index.md
+++ b/doc/fr/index.md
@@ -57,7 +57,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
     Android uniquement :
     
     *   **closebuttoncaption**: affectez une chaîne à utiliser comme la **fait** légende du bouton.
-    *   **caché**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
+    *   **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
     *   **ClearCache**: la valeur `yes` pour que le navigateur du cache de cookie effacé, avant l'ouverture de la nouvelle fenêtre
     *   **clearsessioncache**: la valeur `yes` pour avoir le cache de cookie de session autorisé avant l'ouverture de la nouvelle fenêtre
     
@@ -65,7 +65,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
     
     *   **closebuttoncaption**: affectez une chaîne à utiliser comme la **fait** légende du bouton. Notez que vous devrez localiser cette valeur vous-même.
     *   **disallowoverscroll**: la valeur `yes` ou `no` (valeur par défaut est `no` ). Active/désactive la propriété UIWebViewBounce.
-    *   **caché**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
+    *   **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
     *   **ClearCache**: la valeur `yes` pour que le navigateur du cache de cookie effacé, avant l'ouverture de la nouvelle fenêtre
     *   **clearsessioncache**: la valeur `yes` pour avoir le cache de cookie de session autorisé avant l'ouverture de la nouvelle fenêtre
     *   **barre d'outils**: la valeur `yes` ou `no` pour activer la barre d'outils ou désactiver pour le InAppBrowser (par défaut,`yes`)
@@ -77,6 +77,10 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
     *   **presentationstyle**: la valeur `pagesheet` , `formsheet` ou `fullscreen` pour définir le [style de présentation][1] (par défaut,`fullscreen`).
     *   **transitionstyle**: la valeur `fliphorizontal` , `crossdissolve` ou `coververtical` pour définir le [style de transition][2] (par défaut,`coververtical`).
     *   **toolbarposition**: la valeur `top` ou `bottom` (valeur par défaut est `bottom` ). Causes de la barre d'outils être en haut ou en bas de la fenêtre.
+    
+    Windows uniquement :
+    
+    *   **hidden**: la valeur `yes` pour créer le navigateur et charger la page, mais ne pas le montrer. L'événement loadstop est déclenché lorsque le chargement est terminé. Omettre ou la valeur `no` (par défaut) pour que le navigateur ouvrir et charger normalement.
 
  [1]: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle
  [2]: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle
@@ -88,6 +92,7 @@ Ouvre une URL dans une nouvelle `InAppBrowser` instance, l'instance de navigateu
 *   BlackBerry 10
 *   Firefox OS
 *   iOS
+*   Windows 8 et 8.1
 *   Windows Phone 7 et 8
 
 ### Exemple
@@ -172,6 +177,7 @@ L'objet retourné par un appel à`window.open`.
 *   Amazon Fire OS
 *   Android
 *   iOS
+*   Windows 8 et 8.1
 *   Windows Phone 7 et 8
 
 ### Petit exemple
@@ -203,6 +209,7 @@ L'objet retourné par un appel à`window.open`.
 *   Amazon Fire OS
 *   Android
 *   iOS
+*   Windows 8 et 8.1
 *   Windows Phone 7 et 8
 
 ### Petit exemple
@@ -228,6 +235,7 @@ L'objet retourné par un appel à`window.open`.
 *   Android
 *   Firefox OS
 *   iOS
+*   Windows 8 et 8.1
 *   Windows Phone 7 et 8
 
 ### Petit exemple
@@ -250,6 +258,7 @@ L'objet retourné par un appel à`window.open`.
 *   Amazon Fire OS
 *   Android
 *   iOS
+*   Windows 8 et 8.1
 
 ### Petit exemple
 
@@ -281,6 +290,7 @@ L'objet retourné par un appel à`window.open`.
 *   Amazon Fire OS
 *   Android
 *   iOS
+*   Windows 8 et 8.1
 
 ### Petit exemple
 


[05/10] git commit: Update windows proxy to be both compatible with windows 8 and 8.1

Posted by pu...@apache.org.
Update windows proxy to be both compatible with windows 8 and 8.1


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

Branch: refs/heads/master
Commit: ac9c64964e17e66075c8b9170a61916b5ac01acb
Parents: 225bde2
Author: SomaticIT <co...@somatic.fr>
Authored: Fri Jul 11 21:43:37 2014 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Fri Jul 11 21:43:37 2014 +0200

----------------------------------------------------------------------
 src/windows/InAppBrowserProxy.js | 81 ++++++++++++++++++++++-------------
 1 file changed, 52 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ac9c6496/src/windows/InAppBrowserProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/InAppBrowserProxy.js b/src/windows/InAppBrowserProxy.js
index 860f739..2bcef49 100644
--- a/src/windows/InAppBrowserProxy.js
+++ b/src/windows/InAppBrowserProxy.js
@@ -31,6 +31,16 @@ var browserWrap,
     popup,
     cb;
 
+function onResize() {
+    if (browserWrap && popup) {
+        browserWrap.style.width = (window.innerWidth - 80) + "px";
+        browserWrap.style.height = (window.innerHeight - 80) + "px";
+
+        popup.style.width = (window.innerWidth - 80) + "px";
+        popup.style.height = (window.innerHeight - 80) + "px";
+    }
+}
+
 var IAB = {
     close: function (win, lose) {
         if (browserWrap) {
@@ -40,6 +50,8 @@ var IAB = {
             browserWrap = null;
             popup = null;
             cb = null;
+
+            window.removeEventListener("resize", onResize);
         }
     },
     show: function (win, lose) {
@@ -51,6 +63,7 @@ var IAB = {
         var strUrl = args[0],
             target = args[1],
             features = args[2],
+            isWinJS2 = !!WinJS.Utilities.Scheduler && !!WinJS.Utilities.Scheduler.schedule,
             url;
 
         if (target === "_system") {
@@ -81,35 +94,45 @@ var IAB = {
                 browserWrap.style.display = "none";
             }
 
-            popup = document.createElement("x-ms-webview");
+            popup = document.createElement(isWinJS2 ? "x-ms-webview" : "iframe");
             popup.style.width = (window.innerWidth - 80) + "px";
             popup.style.height = (window.innerHeight - 80) + "px";
+            popup.style.borderWidth = "0px";
             popup.src = strUrl;
 
-            popup.addEventListener("MSWebViewNavigationStarting", function (e) {
-                win({ type: "loadstart", url: e.uri });
-            });
-            popup.addEventListener("MSWebViewNavigationCompleted", function (e) {
-                if (e.isSuccess) {
-                    win({ type: "loadstop", url: e.uri });
-                }
-                else {
+            if (isWinJS2) {
+                popup.addEventListener("MSWebViewNavigationStarting", function (e) {
+                    win({ type: "loadstart", url: e.uri });
+                });
+                popup.addEventListener("MSWebViewNavigationCompleted", function (e) {
+                    if (e.isSuccess) {
+                        win({ type: "loadstop", url: e.uri });
+                    }
+                    else {
+                        win({ type: "loaderror", url: e.uri });
+                    }
+                });
+                popup.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
                     win({ type: "loaderror", url: e.uri });
-                }
-            });
-            popup.addEventListener("MSWebViewUnviewableContentIdentified", function (e) {
-                win({ type: "loaderror", url: e.uri });
-            });
+                });
+            }
+            else {
+                var onError = function () {
+                    win({ type: "loaderror", url: this.contentWindow.location });
+                };
 
-            window.addEventListener("resize", function () {
-                if (browserWrap && popup) {
-                    browserWrap.style.width = (window.innerWidth - 80) + "px";
-                    browserWrap.style.height = (window.innerHeight - 80) + "px";
+                popup.addEventListener("unload", function () {
+                    win({ type: "loadstart", url: this.contentWindow.location });
+                });
+                popup.addEventListener("load", function () {
+                    win({ type: "loadstop", url: this.contentWindow.location });
+                });
 
-                    popup.style.width = (window.innerWidth - 80) + "px";
-                    popup.style.height = (window.innerHeight - 80) + "px";
-                }
-            });
+                popup.addEventListener("error", onError);
+                popup.addEventListener("abort", onError);
+            }
+
+            window.addEventListener("resize", onResize);
 
             browserWrap.appendChild(popup);
         }
@@ -120,21 +143,22 @@ var IAB = {
 
     injectScriptCode: function (win, fail, args) {
         var code = args[0],
-            hasCallback = args[1];
+            hasCallback = args[1],
+            isWinJS2 = !!WinJS.Utilities.Scheduler && !!WinJS.Utilities.Scheduler.schedule;
 
-        if (browserWrap && popup) {
+        if (isWinJS2 && browserWrap && popup) {
             var op = popup.invokeScriptAsync("eval", code);
             op.oncomplete = function () { hasCallback && win([]); };
             op.onerror = function () { };
             op.start();
         }
-        // "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)"
     },
     injectScriptFile: function (win, fail, args) {
         var file = args[0],
-            hasCallback = args[1];
+            hasCallback = args[1],
+            isWinJS2 = !!WinJS.Utilities.Scheduler && !!WinJS.Utilities.Scheduler.schedule;
 
-        if (browserWrap && popup) {
+        if (isWinJS2 && browserWrap && popup) {
             Windows.Storage.FileIO.readTextAsync(file).done(function (code) {
                 var op = popup.invokeScriptAsync("eval", code);
                 op.oncomplete = function () { hasCallback && win([]); };
@@ -147,5 +171,4 @@ var IAB = {
 
 module.exports = IAB;
 
-
-require("cordova/windows8/commandProxy").add("InAppBrowser", module.exports);
+require("cordova/exec/proxy").add("InAppBrowser", module.exports);