cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [6/9] docs commit: [CB-4379] replace plugin tag w/feature in guide content, rm plugins tag
Date Mon, 29 Jul 2013 18:58:24 GMT
[CB-4379] replace plugin tag w/feature in guide content, rm plugins tag

Conflicts:

	docs/en/edge/guide/platforms/android/plugin.md


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

Branch: refs/heads/master
Commit: 93d94106a2998aef03090bf8e0ccd96cd0f887af
Parents: 7e5cc86
Author: Mike Sierra <letmespellitoutforyou@gmail.com>
Authored: Mon Jul 29 11:54:55 2013 -0400
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Mon Jul 29 11:57:09 2013 -0700

----------------------------------------------------------------------
 docs/en/edge/config_ref/index.md                |  9 +++---
 docs/en/edge/guide/platforms/android/plugin.md  | 29 +++++++++++++-------
 .../edge/guide/platforms/blackberry/plugin.md   | 12 ++++----
 docs/en/edge/guide/platforms/ios/plugin.md      | 25 ++++++++++++-----
 4 files changed, 46 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/93d94106/docs/en/edge/config_ref/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/config_ref/index.md b/docs/en/edge/config_ref/index.md
index 5c5403f..311a0ec 100644
--- a/docs/en/edge/config_ref/index.md
+++ b/docs/en/edge/config_ref/index.md
@@ -58,13 +58,12 @@ An example:
 
 A list of supported elements across major platforms which are supported in Apache Cordova
follow.
 
-### `<plugin>`
+### `<feature>`
 
 These elements map to native APIs that the application accesses. At
-runtime, the Apache Cordova framework checks the `<plugin>` elements
-and maps them to native code to enable your Cordova application to
-access device APIs otherwise unavailable to typical web-based
-applications.
+runtime, the Apache Cordova framework maps `<feature>` elements to
+native code to enable your Cordova application to access device APIs
+otherwise unavailable to typical web-based applications.
 
 ### `<access>`
 

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/93d94106/docs/en/edge/guide/platforms/android/plugin.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/android/plugin.md b/docs/en/edge/guide/platforms/android/plugin.md
index 9658ffa..7a4b512 100644
--- a/docs/en/edge/guide/platforms/android/plugin.md
+++ b/docs/en/edge/guide/platforms/android/plugin.md
@@ -19,14 +19,19 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 
 # Android Plugins
 
-Writing a plugin requires an understanding of the architecture of Cordova-Android. Cordova-Android
consists
-of an Android WebView with hooks attached to it. These plugins are represented as class mappings
in the config.xml
-file.
-
-A plugin consists of at least one Java class that extends the `CordovaPlugin` class. A plugin
must override one
-of the `execute` methods from `CordovaPlugin`.
-As best practice, the plugin should handle `pause` and `resume` events, and any message passing
between plugins.
-Plugins with long-running requests, background activity such as media playback, listeners,
or internal state should implement the `onReset()` method as well. This method is run when
the `WebView` navigates to a new page or refreshes, which reloads the JavaScript.
+Writing a plugin requires an understanding of the architecture of
+Cordova-Android. Cordova-Android consists of an Android WebView with
+hooks attached to it. These plugins are represented as class mappings
+in the `config.xml` file.
+
+A plugin consists of at least one Java class that extends the
+`CordovaPlugin` class. A plugin must override one of the `execute`
+methods from `CordovaPlugin`.  As best practice, the plugin should
+handle `pause` and `resume` events, and any message passing between
+plugins.  Plugins with long-running requests, background activity such
+as media playback, listeners, or internal state should implement the
+`onReset()` method as well. It executeswhen the `WebView` navigates to
+a new page or refreshes, which reloads the JavaScript.
 
 ## Plugin Class Mapping
 
@@ -38,9 +43,13 @@ This marshals a request from the WebView to the Android native side,
 more or less boiling down to calling the `action` method on the
 `service` class, with the arguments passed in the `args` Array.
 
-Whether you distribute your plugin as Java file or as a JAR of its own, the plugin must be
added to the `config.xml` file in your Cordova-Android application's `res/xml/` directory.
+Whether you distribute your plugin as Java file or as a JAR of its
+own, the plugin must be added to the `config.xml` file in your
+Cordova-Android application's `res/xml/` directory.
 
-    <plugin name="<service_name>" value="<full_name_including_namespace>"/>
+    <feature name="<service_name>">
+        <param name="android-package" value="<full_name_including_namespace>" />
+    </feature>
 
 The service name should match the one used in the JavaScript `exec`
 call, and the value is the Java classes full name, including the

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/93d94106/docs/en/edge/guide/platforms/blackberry/plugin.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/blackberry/plugin.md b/docs/en/edge/guide/platforms/blackberry/plugin.md
index d919c8c..560d97d 100644
--- a/docs/en/edge/guide/platforms/blackberry/plugin.md
+++ b/docs/en/edge/guide/platforms/blackberry/plugin.md
@@ -43,17 +43,15 @@ to the `window.echo` function:
 
 ## Modifying plugins.xml
 
-Your project's `www/plugins.xml` directory contains all of the necessary
-references to your Cordova project's plugins. Add an
+Your project's `www/plugins.xml` directory contains all of the
+necessary references to your Cordova project's plugins. Add an
 additional reference so that when `cordova.exec` is called, Cordova
 knows how to map the `Echo` argument of `cordova.exec` to the `Echo`
 class that we want to write natively:
 
-    <plugins>
-      ...
-      <plugin name="Echo" value="org.apache.cordova.echo.Echo"/>
-      ...
-    </plugins>
+    <feature name="Echo">
+        <param name="blackberry-package" value="org.apache.cordova.echo.Echo" />
+    </feature>
 
 ## Adding Echo.java
 

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/93d94106/docs/en/edge/guide/platforms/ios/plugin.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/ios/plugin.md b/docs/en/edge/guide/platforms/ios/plugin.md
index c76bd86..5065997 100644
--- a/docs/en/edge/guide/platforms/ios/plugin.md
+++ b/docs/en/edge/guide/platforms/ios/plugin.md
@@ -21,7 +21,8 @@ license: Licensed to the Apache Software Foundation (ASF) under one
 
 A plugin is an Objective-C class that extends the `CDVPlugin` class.
 
-Each plugin class must be registered using the config.xml file, as a `<plugin>` tag
under the `<plugins>` key.
+Each plugin class must be registered as a `<feature>` tag in the
+`config.xml` file.
 
 ## Plugin Class Mapping
 
@@ -33,7 +34,7 @@ This marshals a request from the `UIWebView` to the iOS native side,
 more or less boiling down to calling the `action` method on the
 `service` class, with the arguments passed in the `args` array.
 
-The plugin must be added under the `<plugins>` tag of your Cordova-iOS
+Specifiy the plugin as a `<feature>` tag in your Cordova-iOS
 application's project's `config.xml` file.
 
     <feature name="LocalStorage">
@@ -48,13 +49,23 @@ reachable by Cordova.
 
 ## Plugin Initialization and Lifetime
 
-There is one instance of a plugin object that is created per-UIWebView, and the lifetime
of the instance is tied to the UIWebView. Plugins are not instantiated until they are first
referenced by a call from JavaScript, unless the `onload` attribute set within config.xml.
E.g.:
+One instance of a plugin object is created for the life of each
+`UIWebView`. Plugins are not instantiated until they are first
+referenced by a call from JavaScript, unless the `onload` attribute
+is set within `config.xml`. E.g.:
 
-    <plugin name="Echo" value="Echo" onload="true" />
+    <feature name="Echo" onload="true">
+        <param name="ios-package" value="Echo" />
+    </feature>
 
-There is *no* designated initializer for plugins. Instead, plugins should use the `pluginInitialize`
method for their start-up logic.
+There is _no_ designated initializer for plugins. Instead, plugins
+should use the `pluginInitialize` method for their start-up logic.
 
-Plugins with long-running requests, background activity (e.g. playing media), listeners or
internal state should implement the `onReset` method and stop or clean up those activities.
This method is run when the `UIWebView` navigates to a new page or refreshes, which reloads
the JavaScript.
+Plugins with long-running requests, background activity (e.g. playing
+media), listeners or internal state should implement the `onReset`
+method and stop or clean up those activities. This method is run when
+the `UIWebView` navigates to a new page or refreshes, which reloads
+the JavaScript.
 
 ## Writing an iOS Cordova Plugin
 
@@ -101,7 +112,7 @@ callback does not fire.
 
 ## Echo Plugin iOS Plugin
 
-We would add the following to the `<plugins>` tag of the project's `config.xml` file:
+We would add the following to the project's `config.xml` file:
 
     <feature name="Echo">
         <param name="ios-package" value="Echo" />


Mime
View raw message