incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [38/50] git commit: Add onload attribute to plugin in plugins.xml to create the plugin at load time instead of lazy loading.
Date Tue, 03 Jan 2012 18:57:10 GMT
Add onload attribute to plugin in plugins.xml to create the plugin at load time instead of
lazy loading.


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

Branch: refs/heads/master
Commit: bfef72a7c44272562fc305fec9b94972b0e2595f
Parents: 7ce2a8c
Author: Bryce Curtis <curtis.bryce@gmail.com>
Authored: Tue Nov 15 14:29:32 2011 -0600
Committer: Bryce Curtis <curtis.bryce@gmail.com>
Committed: Tue Nov 15 14:29:32 2011 -0600

----------------------------------------------------------------------
 framework/src/com/phonegap/api/PluginManager.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/bfef72a7/framework/src/com/phonegap/api/PluginManager.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/api/PluginManager.java b/framework/src/com/phonegap/api/PluginManager.java
index 14e2449..db10d63 100755
--- a/framework/src/com/phonegap/api/PluginManager.java
+++ b/framework/src/com/phonegap/api/PluginManager.java
@@ -90,6 +90,11 @@ public final class PluginManager {
 					pluginName = xml.getAttributeValue(null, "name");
 					//System.out.println("Plugin: "+name+" => "+value);
 					this.addService(pluginName, pluginClass);
+					
+					// Create plugin at load time if attribute "onload"
+					if ("true".equals(xml.getAttributeValue(null, "onload"))) {
+					    this.getPlugin(pluginName);
+					}
 				} else if (strNode.equals("url-filter")) {
 					this.urlMap.put(xml.getAttributeValue(null, "value"), pluginName);
 				}


Mime
View raw message