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/05 02:49:57 UTC
[1/3] cordova-plugin-inappbrowser git commit: Added option to
disable/enable zoom controls
Repository: cordova-plugin-inappbrowser
Updated Branches:
refs/heads/master a45dbc80b -> 00809a3c5
Added option to disable/enable zoom controls
This change supports Android and Amazon Fire OS
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/72012371
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/72012371
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/72012371
Branch: refs/heads/master
Commit: 720123718e924914176f3baf143d46d14fefa3ea
Parents: f90e571
Author: Jelle Kralt <je...@jellekralt.nl>
Authored: Thu Sep 11 10:46:47 2014 +0200
Committer: Jelle Kralt <je...@jellekralt.nl>
Committed: Thu Sep 11 10:46:47 2014 +0200
----------------------------------------------------------------------
src/amazon/InAppBrowser.java | 18 +++++++++++++++++-
src/android/InAppBrowser.java | 18 +++++++++++++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/72012371/src/amazon/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/amazon/InAppBrowser.java b/src/amazon/InAppBrowser.java
index 25f593c..5c6ed76 100644
--- a/src/amazon/InAppBrowser.java
+++ b/src/amazon/InAppBrowser.java
@@ -78,6 +78,7 @@ public class InAppBrowser extends CordovaPlugin {
private static final String EXIT_EVENT = "exit";
private static final String LOCATION = "location";
private static final String HIDDEN = "hidden";
+ private static final String ZOOM = "zoom";
private static final String LOAD_START_EVENT = "loadstart";
private static final String LOAD_STOP_EVENT = "loadstop";
private static final String LOAD_ERROR_EVENT = "loaderror";
@@ -90,6 +91,7 @@ public class InAppBrowser extends CordovaPlugin {
private EditText edittext;
private CallbackContext callbackContext;
private boolean showLocationBar = true;
+ private boolean showZoomControls = true;
private boolean openWindowHidden = false;
private String buttonLabel = "Done";
private boolean clearAllCache= false;
@@ -422,6 +424,15 @@ public class InAppBrowser extends CordovaPlugin {
return this.showLocationBar;
}
+ /**
+ * Should we show the zoom controls?
+ *
+ * @return boolean
+ */
+ private boolean getShowZoomControls() {
+ return this.showZoomControls;
+ }
+
private InAppBrowser getInAppBrowser(){
return this;
}
@@ -435,12 +446,17 @@ public class InAppBrowser extends CordovaPlugin {
public String showWebPage(final String url, HashMap<String, Boolean> features) {
// Determine if we should hide the location bar.
showLocationBar = true;
+ showZoomControls = true;
openWindowHidden = false;
if (features != null) {
Boolean show = features.get(LOCATION);
if (show != null) {
showLocationBar = show.booleanValue();
}
+ Boolean zoom = features.get(ZOOM);
+ if (zoom != null) {
+ showZoomControls = zoom.booleanValue();
+ }
Boolean hidden = features.get(HIDDEN);
if (hidden != null) {
openWindowHidden = hidden.booleanValue();
@@ -614,7 +630,7 @@ public class InAppBrowser extends CordovaPlugin {
AmazonWebSettings settings = inAppWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setBuiltInZoomControls(true);
+ settings.setBuiltInZoomControls(getShowZoomControls());
settings.setPluginState(com.amazon.android.webkit.AmazonWebSettings.PluginState.ON);
//Toggle whether this is enabled or not!
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/72012371/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index f97e0b2..2f07db0 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -71,6 +71,7 @@ public class InAppBrowser extends CordovaPlugin {
// private static final String BLANK = "_blank";
private static final String EXIT_EVENT = "exit";
private static final String LOCATION = "location";
+ private static final String ZOOM = "zoom";
private static final String HIDDEN = "hidden";
private static final String LOAD_START_EVENT = "loadstart";
private static final String LOAD_STOP_EVENT = "loadstop";
@@ -84,6 +85,7 @@ public class InAppBrowser extends CordovaPlugin {
private EditText edittext;
private CallbackContext callbackContext;
private boolean showLocationBar = true;
+ private boolean showZoomControls = true;
private boolean openWindowHidden = false;
private String buttonLabel = "Done";
private boolean clearAllCache= false;
@@ -408,6 +410,15 @@ public class InAppBrowser extends CordovaPlugin {
return this.showLocationBar;
}
+ /**
+ * Should we show the zoom controls?
+ *
+ * @return boolean
+ */
+ private boolean getShowZoomControls() {
+ return this.showZoomControls;
+ }
+
private InAppBrowser getInAppBrowser(){
return this;
}
@@ -421,12 +432,17 @@ public class InAppBrowser extends CordovaPlugin {
public String showWebPage(final String url, HashMap<String, Boolean> features) {
// Determine if we should hide the location bar.
showLocationBar = true;
+ showZoomControls = true;
openWindowHidden = false;
if (features != null) {
Boolean show = features.get(LOCATION);
if (show != null) {
showLocationBar = show.booleanValue();
}
+ Boolean zoom = features.get(ZOOM);
+ if (zoom != null) {
+ showZoomControls = zoom.booleanValue();
+ }
Boolean hidden = features.get(HIDDEN);
if (hidden != null) {
openWindowHidden = hidden.booleanValue();
@@ -595,7 +611,7 @@ public class InAppBrowser extends CordovaPlugin {
WebSettings settings = inAppWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setBuiltInZoomControls(true);
+ settings.setBuiltInZoomControls(getShowZoomControls());
settings.setPluginState(android.webkit.WebSettings.PluginState.ON);
//Toggle whether this is enabled or not!
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/3] cordova-plugin-inappbrowser git commit: Update docs for Android
zoom=no option
Posted by pu...@apache.org.
Update docs for Android zoom=no option
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/00809a3c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/00809a3c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/00809a3c
Branch: refs/heads/master
Commit: 00809a3c5184d08f1b7ce9fa05e8f19c19343c46
Parents: b96c4a7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 4 17:49:49 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 4 17:49:49 2015 -0800
----------------------------------------------------------------------
doc/index.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/00809a3c/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index c607d89..40828bc 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
+ - __zoom__: set to `yes` to show Android browser's zoom controls, set to `no` to hide them. Default value is `yes`.
- __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:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/3] cordova-plugin-inappbrowser git commit: Merge branch 'master'
of https://github.com/jellekralt/cordova-plugin-inappbrowser
Posted by pu...@apache.org.
Merge branch 'master' of https://github.com/jellekralt/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/b96c4a7d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/b96c4a7d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/b96c4a7d
Branch: refs/heads/master
Commit: b96c4a7d9af70ddda5121317b029d9829aac2cd9
Parents: a45dbc8 7201237
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 4 17:42:43 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 4 17:42:43 2015 -0800
----------------------------------------------------------------------
src/amazon/InAppBrowser.java | 18 +++++++++++++++++-
src/android/InAppBrowser.java | 18 +++++++++++++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/b96c4a7d/src/amazon/InAppBrowser.java
----------------------------------------------------------------------
diff --cc src/amazon/InAppBrowser.java
index cdcf49e,5c6ed76..0263ea2
--- a/src/amazon/InAppBrowser.java
+++ b/src/amazon/InAppBrowser.java
@@@ -89,7 -91,9 +90,8 @@@ public class InAppBrowser extends Cordo
private EditText edittext;
private CallbackContext callbackContext;
private boolean showLocationBar = true;
+ private boolean showZoomControls = true;
private boolean openWindowHidden = false;
- private String buttonLabel = "Done";
private boolean clearAllCache= false;
private boolean clearSessionCache=false;
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/b96c4a7d/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --cc src/android/InAppBrowser.java
index f90bdc7,2f07db0..217e48e
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@@ -88,10 -85,11 +89,11 @@@ public class InAppBrowser extends Cordo
private EditText edittext;
private CallbackContext callbackContext;
private boolean showLocationBar = true;
+ private boolean showZoomControls = true;
private boolean openWindowHidden = false;
- private String buttonLabel = "Done";
private boolean clearAllCache= false;
private boolean clearSessionCache=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