Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-6775 added support for autoload, splashscreen uses this
  • Loading branch information
purplecabbage committed May 30, 2014
1 parent 64fe2f6 commit f13708f2756b80c42ebbbf70f70150a40e631bc4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
@@ -176,7 +176,7 @@ public string[] AutoloadPlugins
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 @@ private void LoadPluginFeatures(XDocument document)
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;


}


}
}

@@ -392,7 +392,7 @@ void CordovaBrowser_LoadCompleted(object sender, System.Windows.Navigation.Navig
string[] autoloadPlugs = this.configHandler.AutoloadPlugins;
foreach (string plugName in autoloadPlugs)
{
//nativeExecution.ProcessCommand(commandCallParams);
nativeExecution.AutoLoadCommand(plugName);
}

// send js code to fire ready event

0 comments on commit f13708f

Please sign in to comment.