cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject git commit: CB-3280 Add support for start url on WP8
Date Tue, 14 May 2013 06:37:09 GMT
Updated Branches:
  refs/heads/master 9f0d74c12 -> bd0fc7300


CB-3280 Add support for start url on WP8


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

Branch: refs/heads/master
Commit: bd0fc730092f018c7781055e131db6b62de924c1
Parents: 9f0d74c
Author: reda <reda.abdi@backelite.com>
Authored: Mon Apr 29 10:21:42 2013 +0200
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon May 13 23:32:18 2013 -0700

----------------------------------------------------------------------
 templates/standalone/cordovalib/ConfigHandler.cs   |   12 ++++++++++++
 .../standalone/cordovalib/CordovaView.xaml.cs      |    9 +++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/bd0fc730/templates/standalone/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/ConfigHandler.cs b/templates/standalone/cordovalib/ConfigHandler.cs
index 06806d3..95c6663 100644
--- a/templates/standalone/cordovalib/ConfigHandler.cs
+++ b/templates/standalone/cordovalib/ConfigHandler.cs
@@ -29,6 +29,9 @@ namespace WPCordovaClassLib.CordovaLib
         protected List<string> AllowedDomains;
         protected Dictionary<string, string> Preferences;
 
+        public Dictionary<string, string> Content { get; private set; }
+
+
         protected bool AllowAllDomains = false;
         protected bool AllowAllPlugins = false;
 
@@ -37,6 +40,7 @@ namespace WPCordovaClassLib.CordovaLib
             AllowedPlugins = new Dictionary<string, PluginConfig>();
             AllowedDomains = new List<string>();
             Preferences = new Dictionary<string, string>();
+            Content = new Dictionary<string, string>();
         }
 
         public string GetPreference(string key)
@@ -230,6 +234,14 @@ namespace WPCordovaClassLib.CordovaLib
                 {
                     AddWhiteListEntry(accessElem.origin, accessElem.subdomains);
                 }
+
+                var contentsTag = document.Descendants("content");
+                if (contentsTag.Count() > 0)
+                {
+                    var first = contentsTag.First();                    
+                    var src = first.Attribute("src");
+                    Content.Add("src", src.Value);
+                }
             }
             else
             {

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/bd0fc730/templates/standalone/cordovalib/CordovaView.xaml.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/CordovaView.xaml.cs b/templates/standalone/cordovalib/CordovaView.xaml.cs
index 7b92f65..5bb92b1 100644
--- a/templates/standalone/cordovalib/CordovaView.xaml.cs
+++ b/templates/standalone/cordovalib/CordovaView.xaml.cs
@@ -106,6 +106,7 @@ namespace WPCordovaClassLib
                 if (_startPageUri == null)
                 {
                     // default
+
                     return new Uri(AppRoot + "www/index.html", UriKind.Relative);
                 }
                 else
@@ -162,6 +163,14 @@ namespace WPCordovaClassLib
             configHandler = new ConfigHandler();
             configHandler.LoadAppPackageConfig();
 
+            if (configHandler.Content.ContainsKey("src"))
+            {
+                var src = configHandler.Content["src"];
+                {
+                    this.StartPageUri = new Uri(src);
+                }
+            }         
+
             nativeExecution = new NativeExecution(ref this.CordovaBrowser);
             bmHelper = new BrowserMouseHelper(ref this.CordovaBrowser);
         }


Mime
View raw message