Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
Version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mwbrooks committed Sep 13, 2012
1 parent 939d30b commit f8894a3
Show file tree
Hide file tree
Showing 167 changed files with 16,391 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0rc2
2.1.0
171 changes: 171 additions & 0 deletions docs/en/2.1.0/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"language": "English",
"merge": {
"accelerometer.md": [
"cordova/accelerometer/accelerometer.md",
"cordova/accelerometer/accelerometer.getCurrentAcceleration.md",
"cordova/accelerometer/accelerometer.watchAcceleration.md",
"cordova/accelerometer/accelerometer.clearWatch.md",
"cordova/accelerometer/acceleration/acceleration.md",
"cordova/accelerometer/parameters/accelerometerSuccess.md",
"cordova/accelerometer/parameters/accelerometerError.md",
"cordova/accelerometer/parameters/accelerometerOptions.md"
],
"camera.md": [
"cordova/camera/camera.md",
"cordova/camera/camera.getPicture.md",
"cordova/camera/parameter/cameraSuccess.md",
"cordova/camera/parameter/cameraError.md",
"cordova/camera/parameter/cameraOptions.md",
"cordova/camera/parameter/CameraPopoverOptions.md"
],
"capture.md": [
"cordova/media/capture/capture.md",
"cordova/media/capture/captureAudio.md",
"cordova/media/capture/captureAudioOptions.md",
"cordova/media/capture/captureImage.md",
"cordova/media/capture/captureImageOptions.md",
"cordova/media/capture/captureVideo.md",
"cordova/media/capture/captureVideoOptions.md",
"cordova/media/capture/CaptureError.md",
"cordova/media/capture/CaptureCB.md",
"cordova/media/capture/CaptureErrorCB.md",
"cordova/media/capture/ConfigurationData.md",
"cordova/media/capture/MediaFile.md",
"cordova/media/capture/MediaFile.getFormatData.md",
"cordova/media/capture/MediaFileData.md"
],
"compass.md": [
"cordova/compass/compass.md",
"cordova/compass/compass.getCurrentHeading.md",
"cordova/compass/compass.watchHeading.md",
"cordova/compass/compass.clearWatch.md",
"cordova/compass/compass.watchHeadingFilter.md",
"cordova/compass/compass.clearWatchFilter.md",
"cordova/compass/parameters/compassSuccess.md",
"cordova/compass/parameters/compassError.md",
"cordova/compass/parameters/compassOptions.md",
"cordova/compass/parameters/compassHeading.md",
"cordova/compass/compassError/compassError.md"
],
"contacts.md": [
"cordova/contacts/contacts.md",
"cordova/contacts/contacts.create.md",
"cordova/contacts/contacts.find.md",
"cordova/contacts/Contact/contact.md",
"cordova/contacts/ContactAddress/contactaddress.md",
"cordova/contacts/ContactField/contactfield.md",
"cordova/contacts/ContactFindOptions/contactfindoptions.md",
"cordova/contacts/ContactName/contactname.md",
"cordova/contacts/ContactOrganization/contactorganization.md",
"cordova/contacts/ContactError/contactError.md",
"cordova/contacts/parameters/contactSuccess.md",
"cordova/contacts/parameters/contactError.md",
"cordova/contacts/parameters/contactFields.md",
"cordova/contacts/parameters/contactFindOptions.md"
],
"device.md": [
"cordova/device/device.md",
"cordova/device/device.name.md",
"cordova/device/device.cordova.md",
"cordova/device/device.platform.md",
"cordova/device/device.uuid.md",
"cordova/device/device.version.md"
],
"events.md": [
"cordova/events/events.md",
"cordova/events/events.deviceready.md",
"cordova/events/events.pause.md",
"cordova/events/events.resume.md",
"cordova/events/events.online.md",
"cordova/events/events.offline.md",
"cordova/events/events.backbutton.md",
"cordova/events/events.batterycritical.md",
"cordova/events/events.batterylow.md",
"cordova/events/events.batterystatus.md",
"cordova/events/events.menubutton.md",
"cordova/events/events.searchbutton.md",
"cordova/events/events.startcallbutton.md",
"cordova/events/events.endcallbutton.md",
"cordova/events/events.volumedownbutton.md",
"cordova/events/events.volumeupbutton.md"
],
"file.md": [
"cordova/file/file.md",
"cordova/file/fileobj/fileobj.md",
"cordova/file/filereader/filereader.md",
"cordova/file/filewriter/filewriter.md",
"cordova/file/filesystem/filesystem.md",
"cordova/file/fileentry/fileentry.md",
"cordova/file/directoryentry/directoryentry.md",
"cordova/file/directoryreader/directoryreader.md",
"cordova/file/filetransfer/filetransfer.md",
"cordova/file/fileuploadoptions/fileuploadoptions.md",
"cordova/file/fileuploadresult/fileuploadresult.md",
"cordova/file/flags/flags.md",
"cordova/file/localfilesystem/localfilesystem.md",
"cordova/file/metadata/metadata.md",
"cordova/file/fileerror/fileerror.md",
"cordova/file/filetransfererror/filetransfererror.md"
],
"geolocation.md": [
"cordova/geolocation/geolocation.md",
"cordova/geolocation/geolocation.getCurrentPosition.md",
"cordova/geolocation/geolocation.watchPosition.md",
"cordova/geolocation/geolocation.clearWatch.md",
"cordova/geolocation/Coordinates/coordinates.md",
"cordova/geolocation/Position/position.md",
"cordova/geolocation/PositionError/positionError.md",
"cordova/geolocation/parameters/geolocationSuccess.md",
"cordova/geolocation/parameters/geolocationError.md",
"cordova/geolocation/parameters/geolocation.options.md"
],
"media.md": [
"cordova/media/media.md",
"cordova/media/media.getCurrentPosition.md",
"cordova/media/media.getDuration.md",
"cordova/media/media.pause.md",
"cordova/media/media.play.md",
"cordova/media/media.release.md",
"cordova/media/media.seekTo.md",
"cordova/media/media.startRecord.md",
"cordova/media/media.stop.md",
"cordova/media/media.stopRecord.md",
"cordova/media/MediaError/mediaError.md",
"cordova/media/Parameters/mediaError.md"
],
"network.md": [
"cordova/network/network.md",
"cordova/network/network.isReachable.md",
"cordova/network/NetworkStatus/NetworkStatus.md",
"cordova/network/parameters/reachableCallback.md",
"cordova/network/parameters/reachableHostname.md",
"cordova/network/parameters/reachableOptions.md"
],
"connection.md": [
"cordova/connection/connection.md",
"cordova/connection/connection.type.md"
],
"notification.md": [
"cordova/notification/notification.md",
"cordova/notification/notification.alert.md",
"cordova/notification/notification.confirm.md",
"cordova/notification/notification.beep.md",
"cordova/notification/notification.vibrate.md"
],
"storage.md": [
"cordova/storage/storage.md",
"cordova/storage/storage.opendatabase.md",
"cordova/storage/parameters/name.md",
"cordova/storage/parameters/version.md",
"cordova/storage/parameters/display_name.md",
"cordova/storage/parameters/size.md",
"cordova/storage/database/database.md",
"cordova/storage/sqltransaction/sqltransaction.md",
"cordova/storage/sqlresultset/sqlresultset.md",
"cordova/storage/sqlresultsetlist/sqlresultsetlist.md",
"cordova/storage/sqlerror/sqlerror.md",
"cordova/storage/localstorage/localstorage.md"
]
}
}
107 changes: 107 additions & 0 deletions docs/en/2.1.0/cordova/accelerometer/acceleration/acceleration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---

Acceleration
============

Contains `Accelerometer` data captured at a specific point in time.

Properties
----------

- __x:__ Amount of acceleration on the x-axis. (in m/s^2) (`Number`)
- __y:__ Amount of acceleration on the y-axis. (in m/s^2) (`Number`)
- __z:__ Amount of acceleration on the z-axis. (in m/s^2) (`Number`)
- __timestamp:__ Creation timestamp in milliseconds. (`DOMTimeStamp`)

Description
-----------

This object is created and populated by Cordova, and returned by an `Accelerometer` method. The x, y, z acceleration values include the effect of gravity (9.81 m/s^2), so at when a device is lying flat on a table facing up, the value returned should be x=0, y=0, z=9.81.

Supported Platforms
-------------------

- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- iOS
- Windows Phone 7 (Mango)
- Bada 1.2 & 2.x
- webOS
- Tizen

Quick Example
-------------

function onSuccess(acceleration) {
alert('Acceleration X: ' + acceleration.x + '\n' +
'Acceleration Y: ' + acceleration.y + '\n' +
'Acceleration Z: ' + acceleration.z + '\n' +
'Timestamp: ' + acceleration.timestamp + '\n');
};

function onError() {
alert('onError!');
};

navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);

Full Example
------------

<!DOCTYPE html>
<html>
<head>
<title>Acceleration Example</title>

<script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8">

// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);

// Cordova is ready
//
function onDeviceReady() {
navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
}

// onSuccess: Get a snapshot of the current acceleration
//
function onSuccess(acceleration) {
alert('Acceleration X: ' + acceleration.x + '\n' +
'Acceleration Y: ' + acceleration.y + '\n' +
'Acceleration Z: ' + acceleration.z + '\n' +
'Timestamp: ' + acceleration.timestamp + '\n');
}

// onError: Failed to get the acceleration
//
function onError() {
alert('onError!');
}

</script>
</head>
<body>
<h1>Example</h1>
<p>getCurrentAcceleration</p>
</body>
</html>
113 changes: 113 additions & 0 deletions docs/en/2.1.0/cordova/accelerometer/accelerometer.clearWatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---

accelerometer.clearWatch
========================

Stop watching the `Acceleration` referenced by the watch ID parameter.

navigator.accelerometer.clearWatch(watchID);

- __watchID__: The ID returned by `accelerometer.watchAcceleration`.

Supported Platforms
-------------------

- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- iPhone
- Windows Phone 7 (Mango)
- Bada 1.2 & 2.x
- Tizen

Quick Example
-------------

var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);

// ... later on ...

navigator.accelerometer.clearWatch(watchID);

Full Example
------------

<!DOCTYPE html>
<html>
<head>
<title>Acceleration Example</title>

<script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8">

// The watch id references the current `watchAcceleration`
var watchID = null;
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);

// Cordova is ready
//
function onDeviceReady() {
startWatch();
}

// Start watching the acceleration
//
function startWatch() {
// Update acceleration every 3 seconds
var options = { frequency: 3000 };
watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);
}
// Stop watching the acceleration
//
function stopWatch() {
if (watchID) {
navigator.accelerometer.clearWatch(watchID);
watchID = null;
}
}
// onSuccess: Get a snapshot of the current acceleration
//
function onSuccess(acceleration) {
var element = document.getElementById('accelerometer');
element.innerHTML = 'Acceleration X: ' + acceleration.x + '<br />' +
'Acceleration Y: ' + acceleration.y + '<br />' +
'Acceleration Z: ' + acceleration.z + '<br />' +
'Timestamp: ' + acceleration.timestamp + '<br />';
}

// onError: Failed to get the acceleration
//
function onError() {
alert('onError!');
}

</script>
</head>
<body>
<div id="accelerometer">Waiting for accelerometer...</div>
<button onclick="stopWatch();">Stop Watching</button>
</body>
</html>
Loading

0 comments on commit f8894a3

Please sign in to comment.