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/04/22 02:45:55 UTC
[1/2] git commit: CB-6482 InAppBrowser calls incorrect callback on WP8
Repository: cordova-plugin-inappbrowser
Updated Branches:
refs/heads/dev 40778ba23 -> 907bba6cf
CB-6482 InAppBrowser calls incorrect callback on WP8
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/ab7494fa
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/ab7494fa
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/ab7494fa
Branch: refs/heads/dev
Commit: ab7494faa059a8e90fb8f88c5c5ef40e8a154478
Parents: e282cc9
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Apr 21 15:28:03 2014 -0700
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Apr 21 15:28:03 2014 -0700
----------------------------------------------------------------------
src/wp/InAppBrowser.cs | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ab7494fa/src/wp/InAppBrowser.cs
----------------------------------------------------------------------
diff --git a/src/wp/InAppBrowser.cs b/src/wp/InAppBrowser.cs
index 454464d..9d49165 100644
--- a/src/wp/InAppBrowser.cs
+++ b/src/wp/InAppBrowser.cs
@@ -41,6 +41,8 @@ namespace WPCordovaClassLib.Cordova.Commands
protected bool ShowLocation {get;set;}
protected bool StartHidden {get;set;}
+ protected string NavigationCallbackId { get; set; }
+
public void open(string options)
{
// reset defaults on ShowLocation + StartHidden features
@@ -52,6 +54,7 @@ namespace WPCordovaClassLib.Cordova.Commands
string urlLoc = args[0];
string target = args[1];
string featString = args[2];
+ this.NavigationCallbackId = args[3];
string[] features = featString.Split(',');
foreach (string str in features)
@@ -367,7 +370,7 @@ namespace WPCordovaClassLib.Cordova.Commands
string message = "{\"type\":\"exit\"}";
PluginResult result = new PluginResult(PluginResult.Status.OK, message);
result.KeepCallback = false;
- this.DispatchCommandResult(result);
+ this.DispatchCommandResult(result, NavigationCallbackId);
});
}
}
@@ -385,7 +388,7 @@ namespace WPCordovaClassLib.Cordova.Commands
string message = "{\"type\":\"loadstop\", \"url\":\"" + e.Uri.OriginalString + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.OK, message);
result.KeepCallback = true;
- this.DispatchCommandResult(result);
+ this.DispatchCommandResult(result, NavigationCallbackId);
}
void browser_NavigationFailed(object sender, System.Windows.Navigation.NavigationFailedEventArgs e)
@@ -393,7 +396,7 @@ namespace WPCordovaClassLib.Cordova.Commands
string message = "{\"type\":\"error\",\"url\":\"" + e.Uri.OriginalString + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.ERROR, message);
result.KeepCallback = true;
- this.DispatchCommandResult(result);
+ this.DispatchCommandResult(result, NavigationCallbackId);
}
void browser_Navigating(object sender, NavigatingEventArgs e)
@@ -401,7 +404,7 @@ namespace WPCordovaClassLib.Cordova.Commands
string message = "{\"type\":\"loadstart\",\"url\":\"" + e.Uri.OriginalString + "\"}";
PluginResult result = new PluginResult(PluginResult.Status.OK, message);
result.KeepCallback = true;
- this.DispatchCommandResult(result);
+ this.DispatchCommandResult(result, NavigationCallbackId);
}
}
[2/2] git commit: Merge branch 'CB-6482' of
https://github.com/sgrebnov/cordova-plugin-inappbrowser into dev
Posted by pu...@apache.org.
Merge branch 'CB-6482' of https://github.com/sgrebnov/cordova-plugin-inappbrowser into dev
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/907bba6c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/907bba6c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/907bba6c
Branch: refs/heads/dev
Commit: 907bba6cf68693658fac90b00f8df635ddb8a11b
Parents: 40778ba ab7494f
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Apr 21 17:44:47 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Apr 21 17:44:47 2014 -0700
----------------------------------------------------------------------
src/wp/InAppBrowser.cs | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/907bba6c/src/wp/InAppBrowser.cs
----------------------------------------------------------------------
diff --cc src/wp/InAppBrowser.cs
index cbd5d26,9d49165..fdf9ac7
--- a/src/wp/InAppBrowser.cs
+++ b/src/wp/InAppBrowser.cs
@@@ -69,30 -54,29 +71,31 @@@ namespace WPCordovaClassLib.Cordova.Com
string urlLoc = args[0];
string target = args[1];
string featString = args[2];
+ this.NavigationCallbackId = args[3];
- string[] features = featString.Split(',');
- foreach (string str in features)
+ if (!string.IsNullOrEmpty(featString))
{
- try
+ string[] features = featString.Split(',');
+ foreach (string str in features)
{
- string[] split = str.Split('=');
- switch (split[0])
+ try
+ {
+ string[] split = str.Split('=');
+ switch (split[0])
+ {
+ case "location":
+ ShowLocation = split[1].StartsWith("yes", StringComparison.OrdinalIgnoreCase);
+ break;
+ case "hidden":
+ StartHidden = split[1].StartsWith("yes", StringComparison.OrdinalIgnoreCase);
+ break;
+ }
+ }
+ catch (Exception)
{
- case "location":
- ShowLocation = split[1].ToLower().StartsWith("yes");
- break;
- case "hidden":
- StartHidden = split[1].ToLower().StartsWith("yes");
- break;
+ // some sort of invalid param was passed, moving on ...
}
}
- catch(Exception)
- {
- // some sort of invalid param was passed, moving on ...
- }
-
}
/*
_self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser