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/05/30 02:45:59 UTC

git commit: CB-6775 added support for autoload, splashscreen uses this

Repository: cordova-wp8
Updated Branches:
  refs/heads/master 64fe2f60f -> f13708f27


CB-6775 added support for autoload, splashscreen uses this


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

Branch: refs/heads/master
Commit: f13708f2756b80c42ebbbf70f70150a40e631bc4
Parents: 64fe2f6
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu May 29 17:45:30 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu May 29 17:45:30 2014 -0700

----------------------------------------------------------------------
 wp8/template/cordovalib/ConfigHandler.cs    | 24 +++++++++++++++++-------
 wp8/template/cordovalib/CordovaView.xaml.cs |  2 +-
 2 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/f13708f2/wp8/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/ConfigHandler.cs b/wp8/template/cordovalib/ConfigHandler.cs
index aa3b428..6884104 100644
--- a/wp8/template/cordovalib/ConfigHandler.cs
+++ b/wp8/template/cordovalib/ConfigHandler.cs
@@ -176,7 +176,7 @@ namespace WPCordovaClassLib.CordovaLib
                 var res = from results in AllowedPlugins.TakeWhile(p => p.Value.isAutoLoad)
                           select results.Value.Name;
 
-                return new string[] { "", "" };
+                return res.ToArray<string>();
             }
         }
 
@@ -189,20 +189,30 @@ namespace WPCordovaClassLib.CordovaLib
             foreach (var feature in features)
             {
                 string name = (string)feature.Attribute("name");
-                var values = from results in feature.Descendants()
+                var value = (from results in feature.Descendants()
                              where results.Name.LocalName == "param" && ((string)results.Attribute("name") == "wp-package")
-                             select results;
+                             select results).FirstOrDefault();
+
+                var autoloadNode = (from results in feature.Descendants()
+                                    where results.Name.LocalName == "param" && ((string)results.Attribute("name") == "onload")
+                                    select results).FirstOrDefault();
+                bool isAutoLoad = false;
+                if (autoloadNode != null)
+                {
+                    isAutoLoad = ((string)autoloadNode.Attribute("value") == "true");
+                }
 
-                var value = values.FirstOrDefault();
                 if (value != null)
                 {
                     string key = (string)value.Attribute("value");
                     Debug.WriteLine("Adding feature.value=" + key);
-                    var onload = value.Attribute("onload");
-                  
-                    PluginConfig pConfig = new PluginConfig(key, onload != null && onload.Value == "true");
+                    PluginConfig pConfig = new PluginConfig(key, isAutoLoad);
                     AllowedPlugins[name] = pConfig;
+                  
+
                 }
+
+
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/f13708f2/wp8/template/cordovalib/CordovaView.xaml.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordovalib/CordovaView.xaml.cs b/wp8/template/cordovalib/CordovaView.xaml.cs
index fa3aba6..1872a91 100644
--- a/wp8/template/cordovalib/CordovaView.xaml.cs
+++ b/wp8/template/cordovalib/CordovaView.xaml.cs
@@ -392,7 +392,7 @@ namespace WPCordovaClassLib
             string[] autoloadPlugs = this.configHandler.AutoloadPlugins;
             foreach (string plugName in autoloadPlugs)
             {
-                //nativeExecution.ProcessCommand(commandCallParams);
+                nativeExecution.AutoLoadCommand(plugName);
             }
 
             // send js code to fire ready event