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 2013/04/03 21:07:46 UTC
[15/16] git commit: issues with InAppBrowser fixed in template
issues with InAppBrowser fixed in template
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/d8f1d209
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/d8f1d209
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/d8f1d209
Branch: refs/heads/master
Commit: d8f1d2091eb1473db18a2b97e16532a463db8ca5
Parents: 2922d08
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 3 10:02:38 2013 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 3 10:02:38 2013 -0700
----------------------------------------------------------------------
templates/standalone/CordovaAppProj.csproj | 7 +++
templates/standalone/Images/appbar.back.rest.png | Bin 0 -> 375 bytes
templates/standalone/Images/appbar.close.rest.png | Bin 0 -> 359 bytes
.../Images/appbar.feature.video.rest.png | Bin 0 -> 433 bytes
templates/standalone/Images/appbar.next.rest.png | Bin 0 -> 388 bytes
templates/standalone/Images/appbar.save.rest.png | Bin 0 -> 297 bytes
templates/standalone/Images/appbar.stop.rest.png | Bin 0 -> 350 bytes
templates/standalone/MainPage.xaml | 3 +-
templates/standalone/MainPage.xaml.cs | 8 ++--
.../standalone/cordovalib/Commands/InAppBrowser.cs | 37 ++++++++-------
templates/vs/description.txt | 4 +-
11 files changed, 35 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/CordovaAppProj.csproj
----------------------------------------------------------------------
diff --git a/templates/standalone/CordovaAppProj.csproj b/templates/standalone/CordovaAppProj.csproj
index 56bce52..359fb2a 100644
--- a/templates/standalone/CordovaAppProj.csproj
+++ b/templates/standalone/CordovaAppProj.csproj
@@ -139,6 +139,7 @@
<Compile Include="cordovalib\Commands\File.cs" />
<Compile Include="cordovalib\Commands\FileTransfer.cs" />
<Compile Include="cordovalib\Commands\GeoLocation.cs" />
+ <Compile Include="cordovalib\Commands\Globalization.cs" />
<Compile Include="cordovalib\Commands\ImageExifHelper.cs" />
<Compile Include="cordovalib\Commands\InAppBrowser.cs" />
<Compile Include="cordovalib\Commands\Media.cs" />
@@ -207,6 +208,12 @@
</ItemGroup>
<ItemGroup>
<Content Include="config.xml" />
+ <Content Include="Images\appbar.back.rest.png" />
+ <Content Include="Images\appbar.close.rest.png" />
+ <Content Include="Images\appbar.feature.video.rest.png" />
+ <Content Include="Images\appbar.next.rest.png" />
+ <Content Include="Images\appbar.save.rest.png" />
+ <Content Include="Images\appbar.stop.rest.png" />
<Content Include="resources\notification-beep.wav" />
<Content Include="www\cordova-2.6.0.js" />
<Content Include="www\img\logo.png" />
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.back.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.back.rest.png b/templates/standalone/Images/appbar.back.rest.png
new file mode 100644
index 0000000..4bc2b92
Binary files /dev/null and b/templates/standalone/Images/appbar.back.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.close.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.close.rest.png b/templates/standalone/Images/appbar.close.rest.png
new file mode 100644
index 0000000..8166a1c
Binary files /dev/null and b/templates/standalone/Images/appbar.close.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.feature.video.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.feature.video.rest.png b/templates/standalone/Images/appbar.feature.video.rest.png
new file mode 100644
index 0000000..baff565
Binary files /dev/null and b/templates/standalone/Images/appbar.feature.video.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.next.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.next.rest.png b/templates/standalone/Images/appbar.next.rest.png
new file mode 100644
index 0000000..ed577d7
Binary files /dev/null and b/templates/standalone/Images/appbar.next.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.save.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.save.rest.png b/templates/standalone/Images/appbar.save.rest.png
new file mode 100644
index 0000000..d49940e
Binary files /dev/null and b/templates/standalone/Images/appbar.save.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/Images/appbar.stop.rest.png
----------------------------------------------------------------------
diff --git a/templates/standalone/Images/appbar.stop.rest.png b/templates/standalone/Images/appbar.stop.rest.png
new file mode 100644
index 0000000..4dd724f
Binary files /dev/null and b/templates/standalone/Images/appbar.stop.rest.png differ
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/MainPage.xaml
----------------------------------------------------------------------
diff --git a/templates/standalone/MainPage.xaml b/templates/standalone/MainPage.xaml
index 079a863..db0d8e6 100644
--- a/templates/standalone/MainPage.xaml
+++ b/templates/standalone/MainPage.xaml
@@ -37,7 +37,7 @@
</Grid.RowDefinitions>
<my:CordovaView HorizontalAlignment="Stretch"
Margin="0,0,0,0"
- Name="CordovaView"
+ x:Name="CordovaView"
VerticalAlignment="Stretch" />
<Image Source="SplashScreenImage.jpg"
x:Name="SplashImage"
@@ -50,3 +50,4 @@
</Grid>
</phone:PhoneApplicationPage>
+
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/MainPage.xaml.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/MainPage.xaml.cs b/templates/standalone/MainPage.xaml.cs
index 88fa5ea..b9ec7e1 100644
--- a/templates/standalone/MainPage.xaml.cs
+++ b/templates/standalone/MainPage.xaml.cs
@@ -32,7 +32,6 @@ using Microsoft.Phone.Controls;
using System.IO;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
-using WPCordovaClassLib;
namespace $safeprojectname$
@@ -43,12 +42,13 @@ namespace $safeprojectname$
public MainPage()
{
InitializeComponent();
- this.PGView.Loaded += GapBrowser_Loaded;
+ this.CordovaView.Loaded += CordovaView_Loaded;
}
- private void GapBrowser_Loaded(object sender, RoutedEventArgs e)
+ private void CordovaView_Loaded(object sender, RoutedEventArgs e)
{
- this.PGView.Loaded -= GapBrowser_Loaded;
+ this.CordovaView.Loaded -= CordovaView_Loaded;
+ // first time load will have an animation
Storyboard _storyBoard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation()
{
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/standalone/cordovalib/Commands/InAppBrowser.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/InAppBrowser.cs b/templates/standalone/cordovalib/Commands/InAppBrowser.cs
index c91b1ab..ed4c6e1 100644
--- a/templates/standalone/cordovalib/Commands/InAppBrowser.cs
+++ b/templates/standalone/cordovalib/Commands/InAppBrowser.cs
@@ -42,20 +42,20 @@ namespace WPCordovaClassLib.Cordova.Commands
//BrowserOptions opts = JSON.JsonHelper.Deserialize<BrowserOptions>(options);
string urlLoc = args[0];
string target = args[1];
-/*
- _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser
- _blank - always open in the InAppBrowser
- _system - always open in the system web browser
-*/
- switch (target)
+ /*
+ _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser
+ _blank - always open in the InAppBrowser
+ _system - always open in the system web browser
+ */
+ switch (target)
{
- case "_blank" :
+ case "_blank":
ShowInAppBrowser(urlLoc);
break;
- case "_self" :
+ case "_self":
ShowCordovaBrowser(urlLoc);
break;
- case "_system" :
+ case "_system":
ShowSystemBrowser(urlLoc);
break;
}
@@ -65,7 +65,7 @@ namespace WPCordovaClassLib.Cordova.Commands
private void ShowCordovaBrowser(string url)
{
- Uri loc = new Uri(url,UriKind.RelativeOrAbsolute);
+ Uri loc = new Uri(url, UriKind.RelativeOrAbsolute);
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
@@ -75,7 +75,7 @@ namespace WPCordovaClassLib.Cordova.Commands
if (page != null)
{
CordovaView cView = page.FindName("CordovaView") as CordovaView;
- if(cView != null)
+ if (cView != null)
{
WebBrowser br = cView.Browser;
br.Navigate(loc);
@@ -113,6 +113,8 @@ namespace WPCordovaClassLib.Cordova.Commands
PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
WebBrowser br = (page.FindName("CordovaView") as CordovaView).Browser;
+ string baseImageUrl = "Images/";
+
if (page != null)
{
Grid grid = page.FindName("LayoutRoot") as Grid;
@@ -137,7 +139,8 @@ namespace WPCordovaClassLib.Cordova.Commands
backButton = new ApplicationBarIconButton();
backButton.Text = "Back";
- backButton.IconUri = new Uri("/Images/appbar.back.rest.png", UriKind.Relative);
+
+ backButton.IconUri = new Uri(baseImageUrl + "appbar.back.rest.png", UriKind.Relative);
backButton.Click += new EventHandler(backButton_Click);
backButton.IsEnabled = false;
bar.Buttons.Add(backButton);
@@ -145,14 +148,14 @@ namespace WPCordovaClassLib.Cordova.Commands
fwdButton = new ApplicationBarIconButton();
fwdButton.Text = "Forward";
- fwdButton.IconUri = new Uri("/Images/appbar.next.rest.png", UriKind.Relative);
+ fwdButton.IconUri = new Uri(baseImageUrl + "appbar.next.rest.png", UriKind.Relative);
fwdButton.Click += new EventHandler(fwdButton_Click);
fwdButton.IsEnabled = false;
bar.Buttons.Add(fwdButton);
ApplicationBarIconButton closeBtn = new ApplicationBarIconButton();
closeBtn.Text = "Close";
- closeBtn.IconUri = new Uri("/Images/appbar.close.rest.png", UriKind.Relative);
+ closeBtn.IconUri = new Uri(baseImageUrl + "appbar.close.rest.png", UriKind.Relative);
closeBtn.Click += new EventHandler(closeBtn_Click);
bar.Buttons.Add(closeBtn);
@@ -166,7 +169,7 @@ namespace WPCordovaClassLib.Cordova.Commands
void browser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
-
+
}
void fwdButton_Click(object sender, EventArgs e)
@@ -178,7 +181,7 @@ namespace WPCordovaClassLib.Cordova.Commands
browser.GoForward();
//browser.InvokeScript("execScript", "history.forward();");
}
- catch(Exception)
+ catch (Exception)
{
}
@@ -207,7 +210,7 @@ namespace WPCordovaClassLib.Cordova.Commands
}
- public void close(string options="")
+ public void close(string options = "")
{
if (browser != null)
{
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d8f1d209/templates/vs/description.txt
----------------------------------------------------------------------
diff --git a/templates/vs/description.txt b/templates/vs/description.txt
index 579f247..51cdf19 100644
--- a/templates/vs/description.txt
+++ b/templates/vs/description.txt
@@ -1,7 +1,7 @@
-CordovaWP8AppFull
+CordovaWP8_2_6_0_Full
Apache Cordova 2.6.0 Windows Phone 8 App using a pre-built dll.
-CordovaWP8AppStandalone
+CordovaWP8_2_6_0_StandAlone
Apache Cordova 2.6.0 Windows Phone 8 App including all framework source code.