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 2015/03/04 09:35:16 UTC

[1/4] cordova-plugin-inappbrowser git commit: Add a hardwareback option to allow for the hardware back button to go back.

Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master f4879e9e5 -> a45dbc80b


Add a hardwareback option to allow for the hardware back button to go back.


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/392a73c2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/392a73c2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/392a73c2

Branch: refs/heads/master
Commit: 392a73c2cdcfc643622832cb6d2ac218f4da082a
Parents: a5dedae
Author: Kris Erickson <ks...@yahoo.ca>
Authored: Sun Mar 9 11:33:24 2014 -0700
Committer: Kris Erickson <ks...@yahoo.ca>
Committed: Sun Mar 9 11:33:24 2014 -0700

----------------------------------------------------------------------
 src/android/InAppBrowser.java       | 24 +++++++++++++++++++++++-
 src/android/InAppBrowserDialog.java |  6 +++++-
 2 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/392a73c2/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index 796036f..ab8c4fb 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -78,6 +78,7 @@ public class InAppBrowser extends CordovaPlugin {
     private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
     private static final String CLEAR_ALL_CACHE = "clearcache";
     private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
+    private static final String HARDWARE_BACK_BUTTON = "hardwareback";
 
     private InAppBrowserDialog dialog;
     private WebView inAppWebView;
@@ -88,6 +89,7 @@ public class InAppBrowser extends CordovaPlugin {
     private String buttonLabel = "Done";
     private boolean clearAllCache= false;
     private boolean clearSessionCache=false;
+    private boolean hadwareBackButton=false;
 
     /**
      * Executes the request and returns PluginResult.
@@ -363,13 +365,29 @@ public class InAppBrowser extends CordovaPlugin {
     /**
      * Checks to see if it is possible to go back one page in history, then does so.
      */
-    private void goBack() {
+    public void goBack() {
         if (this.inAppWebView.canGoBack()) {
             this.inAppWebView.goBack();
         }
     }
 
     /**
+     * Can the web browser go back?
+     * @return boolean
+     */
+    public boolean canGoBack() {
+        return this.inAppWebView.canGoBack();
+    }
+
+    /**
+     * Has the user set the hardware back button to go back
+     * @return boolean
+     */
+    public boolean hardwareBack() {
+        return hadwareBackButton;
+    }
+
+    /**
      * Checks to see if it is possible to go forward one page in history, then does so.
      */
     private void goForward() {
@@ -428,6 +446,10 @@ public class InAppBrowser extends CordovaPlugin {
             if (hidden != null) {
                 openWindowHidden = hidden.booleanValue();
             }
+            Boolean hardwareBack = features.get(HARDWARE_BACK_BUTTON);
+            if (hardwareBack != null) {
+                hadwareBackButton = hardwareBack.booleanValue();
+            }
             Boolean cache = features.get(CLEAR_ALL_CACHE);
             if (cache != null) {
                 clearAllCache = cache.booleanValue();

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/392a73c2/src/android/InAppBrowserDialog.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowserDialog.java b/src/android/InAppBrowserDialog.java
index 124e211..d701720 100644
--- a/src/android/InAppBrowserDialog.java
+++ b/src/android/InAppBrowserDialog.java
@@ -48,7 +48,11 @@ public class InAppBrowserDialog extends Dialog {
         } else {
             // better to go through the in inAppBrowser
             // because it does a clean up
-            this.inAppBrowser.closeDialog();
+            if (this.inAppBrowser.hardwareBack() && this.inAppBrowser.canGoBack()) {
+                this.inAppBrowser.goBack();
+            }  else {
+                this.inAppBrowser.closeDialog();
+            }
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/4] cordova-plugin-inappbrowser git commit: updated docs, set hardwareback default to true

Posted by pu...@apache.org.
updated docs, set hardwareback default to true


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/a45dbc80
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/a45dbc80
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/a45dbc80

Branch: refs/heads/master
Commit: a45dbc80b404933fe798127cba5d3668a2dbcad1
Parents: 9de15ac
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 4 00:26:57 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 4 00:26:57 2015 -0800

----------------------------------------------------------------------
 doc/index.md                  | 1 +
 src/android/InAppBrowser.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/a45dbc80/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index f396f4d..c607d89 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -94,6 +94,7 @@ instance, or the system browser.
     - __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.
     - __clearcache__: set to `yes` to have the browser's cookie cache cleared before the new window is opened
     - __clearsessioncache__: set to `yes` to have the session cookie cache cleared before the new window is opened
+    - __hardwareback__: set to `yes` to use the hardware back button to navigate backwards through the `InAppBrowser`'s history. If there is no previous page, the `InAppBrowser` will close.  The default value is `yes`, so you must set it to `no` if you want the back button to simply close the InAppBrowser.
 
     iOS only:
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/a45dbc80/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index 09bd55b..f90bdc7 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -91,7 +91,7 @@ public class InAppBrowser extends CordovaPlugin {
     private boolean openWindowHidden = false;
     private boolean clearAllCache= false;
     private boolean clearSessionCache=false;
-    private boolean hadwareBackButton=false;
+    private boolean hadwareBackButton=true;
 
     /**
      * Executes the request and returns PluginResult.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/4] cordova-plugin-inappbrowser git commit: Merge remote-tracking branch 'upstream/master'

Posted by pu...@apache.org.
Merge remote-tracking branch 'upstream/master'


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/fea1f982
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/fea1f982
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/fea1f982

Branch: refs/heads/master
Commit: fea1f9827c5519fb544104f7eb204fbb8d2ebc3b
Parents: 392a73c 6ee35a0
Author: Kris Erickson <ks...@yahoo.ca>
Authored: Sat Apr 26 17:04:53 2014 -0700
Committer: Kris Erickson <ks...@yahoo.ca>
Committed: Sat Apr 26 17:04:53 2014 -0700

----------------------------------------------------------------------
 RELEASENOTES.md                    |  15 +++
 doc/index.md                       |  27 +++--
 plugin.xml                         |  45 +++++++-
 src/amazon/InAppChromeClient.java  |  18 ++++
 src/android/InAppChromeClient.java |  18 ++++
 src/blackberry10/README.md         |  18 ++++
 src/firefoxos/InAppBrowserProxy.js | 108 +++++++++++++++++++
 src/ios/CDVInAppBrowser.h          |  10 +-
 src/ios/CDVInAppBrowser.m          |  81 ++++++++++++--
 src/wp/InAppBrowser.cs             | 183 +++++++++++++++++++++++++-------
 www/inappbrowser.js                |   2 +
 www/windows8/InAppBrowserProxy.js  |   2 +-
 12 files changed, 466 insertions(+), 61 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/4] cordova-plugin-inappbrowser git commit: Merge branch 'master' of https://github.com/kriserickson/cordova-plugin-inappbrowser

Posted by pu...@apache.org.
Merge branch 'master' of https://github.com/kriserickson/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/9de15ac8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/9de15ac8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/9de15ac8

Branch: refs/heads/master
Commit: 9de15ac8bf6fc12bbda274bc42a39fb8223ab979
Parents: f4879e9 fea1f98
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 4 00:13:29 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 4 00:13:29 2015 -0800

----------------------------------------------------------------------
 src/android/InAppBrowser.java       | 24 +++++++++++++++++++++++-
 src/android/InAppBrowserDialog.java |  6 +++++-
 2 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/9de15ac8/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --cc src/android/InAppBrowser.java
index 2cdb979,ab8c4fb..09bd55b
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@@ -79,8 -75,10 +79,9 @@@ public class InAppBrowser extends Cordo
      private static final String LOAD_START_EVENT = "loadstart";
      private static final String LOAD_STOP_EVENT = "loadstop";
      private static final String LOAD_ERROR_EVENT = "loaderror";
 -    private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
      private static final String CLEAR_ALL_CACHE = "clearcache";
      private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
+     private static final String HARDWARE_BACK_BUTTON = "hardwareback";
  
      private InAppBrowserDialog dialog;
      private WebView inAppWebView;
@@@ -88,8 -86,10 +89,9 @@@
      private CallbackContext callbackContext;
      private boolean showLocationBar = true;
      private boolean openWindowHidden = false;
 -    private String buttonLabel = "Done";
      private boolean clearAllCache= false;
      private boolean clearSessionCache=false;
+     private boolean hadwareBackButton=false;
  
      /**
       * Executes the request and returns PluginResult.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org