You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mw...@apache.org on 2013/07/31 22:01:09 UTC
[14/15] docs commit: [CB-3962] bullet lists for non-procedures
[CB-3962] bullet lists for non-procedures
Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/8f334ec8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/8f334ec8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/8f334ec8
Branch: refs/heads/master
Commit: 8f334ec84a856515612b770f9f87681f333eed6a
Parents: e6efa33
Author: Mike Sierra <le...@gmail.com>
Authored: Wed Jul 31 14:29:24 2013 -0400
Committer: Michael Brooks <mi...@michaelbrooks.ca>
Committed: Wed Jul 31 13:00:35 2013 -0700
----------------------------------------------------------------------
docs/en/edge/guide/hybrid/plugins/index.md | 56 +++++++++++---------
docs/en/edge/guide/platforms/android/webview.md | 4 +-
docs/en/edge/guide/platforms/ios/plugin.md | 4 +-
docs/en/edge/guide/platforms/ios/webview.md | 18 +++----
docs/en/edge/guide/platforms/wp8/plugin.md | 2 +-
5 files changed, 44 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8f334ec8/docs/en/edge/guide/hybrid/plugins/index.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/hybrid/plugins/index.md b/docs/en/edge/guide/hybrid/plugins/index.md
index 1b7efb3..cb4d01b 100644
--- a/docs/en/edge/guide/hybrid/plugins/index.md
+++ b/docs/en/edge/guide/hybrid/plugins/index.md
@@ -44,44 +44,48 @@ front-facing and arguably most important part of your Cordova plugin.
You can structure your plugin's JavaScript however you like. The one
thing you _must_ use to communicate between the Cordova JavaScript
- and native environments is the `cordova.exec` function. Here is an example:
+and native environments is the `cordova.exec` function. Here is an example:
- cordova.exec(function(winParam) {}, function(error) {}, "service",
- "action", ["firstArgument", "secondArgument", 42,
- false]);
+ cordova.exec(function(winParam) {}, function(error) {}, "service",
+ "action", ["firstArgument", "secondArgument", 42,
+ false]);
The parameters are detailed below:
-1. `function(winParam) {}` - Success function callback. Assuming your
- `exec` call completes successfully, this function is invoked
- (optionally with any parameters you pass back to it).
-2. `function(error) {}` - Error function callback. If the operation does
- not complete successfully, this function is invoked (optionally
- with an error parameter).
-3. `"service"` - The service name to call into on the native side. This
- is mapped to a native class, about which more information is
- available in the native guides listed below.
-4. `"action"` - The action name to call into. This is picked up by the
- native class receiving the `exec` call, and, depending on the
- platform, essentially maps to a class's method.
- The native guides listed below provide details.
-5. `[/* arguments */]` - Arguments to pass into the native environment.
+* `function(winParam) {}`: Success function callback. Assuming your
+ `exec` call completes successfully, this function is invoked
+ (optionally with any parameters you pass back to it).
+
+* `function(error) {}`: Error function callback. If the operation does
+ not complete successfully, this function is invoked (optionally with
+ an error parameter).
+
+* `"service"`: The service name to call into on the native side. This
+ is mapped to a native class, about which more information is
+ available in the native guides listed below.
+
+* `"action"`: The action name to call into. This is picked up by the
+ native class receiving the `exec` call, and, depending on the
+ platform, essentially maps to a class's method. The native guides
+ listed below provide details.
+
+* `[/* arguments */]`: Arguments to pass into the native environment.
### Echo Plugin JavaScript Example
- window.echo = function(str, callback) {
- cordova.exec(callback, function(err) {
- callback('Nothing to echo.');
- }, "Echo", "echo", [str]);
- };
+ window.echo = function(str, callback) {
+ cordova.exec(callback, function(err) {
+ callback('Nothing to echo.');
+ }, "Echo", "echo", [str]);
+ };
Let's dive into this. The plugin attaches itself to `window`,
specifically to the `echo` function. Plugin users would then use it as
follows:
- window.echo("echome", function(echoValue) {
- alert(echoValue == "echome"); // should alert true.
- });
+ window.echo("echome", function(echoValue) {
+ alert(echoValue == "echome"); // should alert true.
+ });
First, let's take a look at the last three arguments to the `exec`
function. We will be calling the `Echo` "service", requesting the `echo`
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8f334ec8/docs/en/edge/guide/platforms/android/webview.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/android/webview.md b/docs/en/edge/guide/platforms/android/webview.md
index 8bed446..30aa4ed 100644
--- a/docs/en/edge/guide/platforms/android/webview.md
+++ b/docs/en/edge/guide/platforms/android/webview.md
@@ -34,9 +34,9 @@ but may be eventually be automated.
## Prerequisites
-1. Cordova 1.9 or greater
+* Cordova 1.9 or greater
-2. Android SDK updated with 15
+* Android SDK updated with 15
## Guide to using CordovaWebView in an Android Project
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8f334ec8/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 2ad548b..59c01cb 100644
--- a/docs/en/edge/guide/platforms/ios/plugin.md
+++ b/docs/en/edge/guide/platforms/ios/plugin.md
@@ -197,9 +197,9 @@ call, you should use a background thread. For example:
See other methods that you can override in:
-1. [CDVPlugin.h](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.h)
+* [CDVPlugin.h](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.h)
-2. [CDVPlugin.m](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.m)
+* [CDVPlugin.m](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/CDVPlugin.m)
For example, you can hook into the `pause`, `resume`, app terminate and `handleOpenURL` events.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8f334ec8/docs/en/edge/guide/platforms/ios/webview.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/ios/webview.md b/docs/en/edge/guide/platforms/ios/webview.md
index 26d176f..31de972 100644
--- a/docs/en/edge/guide/platforms/ios/webview.md
+++ b/docs/en/edge/guide/platforms/ios/webview.md
@@ -31,11 +31,11 @@ based Cleaver implementation.
## Prerequisites
-1. Cordova 2.3.0 or greater
+* Cordova 2.3.0 or greater
-2. Xcode 4.5 or greater
+* Xcode 4.5 or greater
-3. `config.xml` file (from a newly created iOS project)
+* `config.xml` file (from a newly created iOS project)
## Adding Cleaver to your Xcode project (CordovaLib sub-project)
@@ -103,11 +103,11 @@ based Cleaver implementation.
## Using CDVViewController in your code
-1. Add this **header**:
+1. Add this header:
#import <Cordova/CDVViewController.h>
-2. Instantiate a **new** `CDVViewController`, and **retain it somewhere** (e.g. to a property in your class):
+2. Instantiate a new `CDVViewController`, and retain it somewhere (e.g. to a property in your class):
CDVViewController* viewController = [CDVViewController new];
@@ -137,15 +137,15 @@ based Cleaver implementation.
## Adding your HTML, CSS and JavaScript assets
-1. Create a **new folder** in your project **on disk**, `www` for example.
+1. Create a new folder in your project on disk, `www` for example.
-2. Put your **HTML, CSS and JavaScript** assets into this folder.
+2. Put your HTML, CSS and JavaScript assets into this folder.
3. Drag and drop the folder into the Project Navigator of Xcode.
-4. Choose the **Create folder references for any added folders** radio button.
+4. Choose the __Create folder references for any added folders__ radio button.
-5. Set the appropriate `wwwFolderName` and `startPage` properties for the folder you created in **(1)** or use the defaults (see previous section) when you instantiate the `CDVViewController`.
+5. Set the appropriate `wwwFolderName` and `startPage` properties for the folder you initially created, or use the defaults (see previous section) when you instantiate the `CDVViewController`.
/*
if you created a folder called 'myfolder' and
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/8f334ec8/docs/en/edge/guide/platforms/wp8/plugin.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/guide/platforms/wp8/plugin.md b/docs/en/edge/guide/platforms/wp8/plugin.md
index 139436d..2b7c732 100644
--- a/docs/en/edge/guide/platforms/wp8/plugin.md
+++ b/docs/en/edge/guide/platforms/wp8/plugin.md
@@ -173,7 +173,7 @@ If we wanted to add the contacts capability to the WMAppManifest.xml, it would l
See other methods that you can override in:
-1. [BaseCommand.cs](https://github.com/apache/cordova-wp7/blob/master/templates/standalone/cordovalib/Commands/BaseCommand.cs)
+* [BaseCommand.cs](https://github.com/apache/cordova-wp7/blob/master/templates/standalone/cordovalib/Commands/BaseCommand.cs)
For example, you can hook into the 'pause' and 'resume' application events.