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/06/12 19:51:16 UTC
[41/46] sanitize code & trim xtra Cordova refs
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.endcallbutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.endcallbutton.md b/docs/en/edge/cordova/events/events.endcallbutton.md
index 1372e25..764c04e 100644
--- a/docs/en/edge/cordova/events/events.endcallbutton.md
+++ b/docs/en/edge/cordova/events/events.endcallbutton.md
@@ -30,7 +30,7 @@ Details
The event overrides the default end call behavior.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -53,22 +53,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova End Call Button Example</title>
+ <title>End Call Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.menubutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.menubutton.md b/docs/en/edge/cordova/events/events.menubutton.md
index ae97e43..fc0da76 100644
--- a/docs/en/edge/cordova/events/events.menubutton.md
+++ b/docs/en/edge/cordova/events/events.menubutton.md
@@ -30,7 +30,7 @@ Details
Applying an event handler overrides the default menu button behavior.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -54,22 +54,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova Menu Button Example</title>
+ <title>Menu Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.offline.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.offline.md b/docs/en/edge/cordova/events/events.offline.md
index 0f2abe6..7eaeac1 100644
--- a/docs/en/edge/cordova/events/events.offline.md
+++ b/docs/en/edge/cordova/events/events.offline.md
@@ -35,7 +35,7 @@ and fires when the `connection.type` changes from `NONE` to any other
value.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -62,25 +62,21 @@ Full Example
<!DOCTYPE html>
<html>
<head>
- <title>Cordova Offline Example</title>
+ <title>Offline Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
- document.addEventListener("offline", onOffline, false);
+ document.addEventListener("offline", onOffline, false);
}
// Handle the offline event
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.online.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.online.md b/docs/en/edge/cordova/events/events.online.md
index 6230f95..fd6dcaf 100644
--- a/docs/en/edge/cordova/events/events.online.md
+++ b/docs/en/edge/cordova/events/events.online.md
@@ -20,8 +20,8 @@ license: Licensed to the Apache Software Foundation (ASF) under one
online
===========
-This event fires when a Cordova application goes online, and the
-device becomes connected to the Internet.
+This event fires when an application goes online, and the device
+becomes connected to the Internet.
document.addEventListener("online", yourCallbackFunction, false);
@@ -34,7 +34,7 @@ It relies on the same information as the Connection API, and fires
when the value of `connection.type` becomes `NONE`.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -61,23 +61,19 @@ Full Example
<!DOCTYPE html>
<html>
<head>
- <title>Cordova Online Example</title>
+ <title>Online Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("online", onOnline, false);
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
}
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.pause.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.pause.md b/docs/en/edge/cordova/events/events.pause.md
index 3dc7a33..f7c23cc 100644
--- a/docs/en/edge/cordova/events/events.pause.md
+++ b/docs/en/edge/cordova/events/events.pause.md
@@ -20,7 +20,7 @@ license: Licensed to the Apache Software Foundation (ASF) under one
pause
===========
-The event fires when a Cordova application is put into the background.
+The event fires when an application is put into the background.
document.addEventListener("pause", yourCallbackFunction, false);
@@ -32,7 +32,7 @@ into the background, typically when the user switches to a different
application.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -58,25 +58,21 @@ Full Example
<!DOCTYPE html>
<html>
<head>
- <title>Cordova Pause Example</title>
+ <title>Pause Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
- document.addEventListener("pause", onPause, false);
+ document.addEventListener("pause", onPause, false);
}
// Handle the pause event
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.resume.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.resume.md b/docs/en/edge/cordova/events/events.resume.md
index d9c99d9..ac3a7b2 100644
--- a/docs/en/edge/cordova/events/events.resume.md
+++ b/docs/en/edge/cordova/events/events.resume.md
@@ -20,7 +20,7 @@ license: Licensed to the Apache Software Foundation (ASF) under one
resume
===========
-The event fires when a Cordova application is retrieved from the background.
+The event fires when an application is retrieved from the background.
document.addEventListener("resume", yourCallbackFunction, false);
@@ -31,7 +31,7 @@ The `resume` event fires when the native platform pulls the
application out from the background.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -57,22 +57,18 @@ Full Example
<!DOCTYPE html>
<html>
<head>
- <title>Cordova Resume Example</title>
+ <title>Resume Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
document.addEventListener("resume", onResume, false);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.searchbutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.searchbutton.md b/docs/en/edge/cordova/events/events.searchbutton.md
index da54bcd..68dc4d1 100644
--- a/docs/en/edge/cordova/events/events.searchbutton.md
+++ b/docs/en/edge/cordova/events/events.searchbutton.md
@@ -31,7 +31,7 @@ If you need to override the default search button behavior on Android
you can register an event listener for the 'searchbutton' event.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -54,22 +54,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova Search Button Example</title>
+ <title>Search Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.startcallbutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.startcallbutton.md b/docs/en/edge/cordova/events/events.startcallbutton.md
index 6720823..5f277ba 100644
--- a/docs/en/edge/cordova/events/events.startcallbutton.md
+++ b/docs/en/edge/cordova/events/events.startcallbutton.md
@@ -31,7 +31,7 @@ If you need to override the default start call behavior you can
register an event listener for the `startcallbutton` event.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -54,22 +54,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova Start Call Button Example</title>
+ <title>Start Call Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.volumedownbutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.volumedownbutton.md b/docs/en/edge/cordova/events/events.volumedownbutton.md
index 0704318..f50020e 100644
--- a/docs/en/edge/cordova/events/events.volumedownbutton.md
+++ b/docs/en/edge/cordova/events/events.volumedownbutton.md
@@ -31,7 +31,7 @@ If you need to override the default volume down behavior you can
register an event listener for the `volumedownbutton` event.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -54,22 +54,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova Volume Down Button Example</title>
+ <title>Volume Down Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/events/events.volumeupbutton.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/events/events.volumeupbutton.md b/docs/en/edge/cordova/events/events.volumeupbutton.md
index 73f64a9..d3db477 100644
--- a/docs/en/edge/cordova/events/events.volumeupbutton.md
+++ b/docs/en/edge/cordova/events/events.volumeupbutton.md
@@ -31,7 +31,7 @@ If you need to override the default volume up behavior you can
register an event listener for the `volumeupbutton` event.
Applications typically should use `document.addEventListener` to
-attach an event listener once the Cordova `deviceready` event fires.
+attach an event listener once the `deviceready` event fires.
Supported Platforms
-------------------
@@ -54,22 +54,18 @@ Full Example
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>Cordova Volume Up Button Example</title>
+ <title>Volume Up Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Call onDeviceReady when Cordova is loaded.
- //
- // At this point, the document has loaded but cordova-x.x.x.js has not.
- // When Cordova is loaded and talking with the native device,
- // it will call the event `deviceready`.
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is loaded and it is now safe to make calls Cordova methods
+ // device APIs are available
//
function onDeviceReady() {
// Register the event listener
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/directoryentry/directoryentry.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/directoryentry/directoryentry.md b/docs/en/edge/cordova/file/directoryentry/directoryentry.md
index a5b54e3..dd5142e 100644
--- a/docs/en/edge/cordova/file/directoryentry/directoryentry.md
+++ b/docs/en/edge/cordova/file/directoryentry/directoryentry.md
@@ -32,8 +32,8 @@ Properties
- __name__: The name of the `DirectoryEntry`, excluding the path leading to it. _(DOMString)_
- __fullPath__: The full absolute path from the root to the `DirectoryEntry`. _(DOMString)_
-__NOTE:__ The following attributes are defined by the W3C
-specification, but are _not_ supported by Cordova:
+__NOTE:__ The following attribute is defined by the W3C specification,
+but is _not_ supported:
- __filesystem__: The file system on which the `DirectoryEntry` resides. _(FileSystem)_
@@ -119,34 +119,34 @@ __Quick Example__
function setFolderMetadata(localFileSystem, subFolder, metadataKey, metadataValue)
{
- var onSetMetadataWin = function() {
- console.log("success setting metadata")
- }
+ var onSetMetadataWin = function() {
+ console.log("success setting metadata")
+ }
var onSetMetadataFail = function() {
- console.log("error setting metadata")
+ console.log("error setting metadata")
}
- var onGetDirectoryWin = function(parent) {
- var data = {};
- data[metadataKey] = metadataValue;
- parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data);
- }
- var onGetDirectoryFail = function() {
- console.log("error getting dir")
- }
+ var onGetDirectoryWin = function(parent) {
+ var data = {};
+ data[metadataKey] = metadataValue;
+ parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data);
+ }
+ var onGetDirectoryFail = function() {
+ console.log("error getting dir")
+ }
- var onFSWin = function(fileSystem) {
- fileSystem.root.getDirectory(subFolder, {create: true, exclusive: false}, onGetDirectoryWin, onGetDirectoryFail);
- }
+ var onFSWin = function(fileSystem) {
+ fileSystem.root.getDirectory(subFolder, {create: true, exclusive: false}, onGetDirectoryWin, onGetDirectoryFail);
+ }
- var onFSFail = function(evt) {
- console.log(evt.target.error.code);
- }
+ var onFSFail = function(evt) {
+ console.log(evt.target.error.code);
+ }
- window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail);
+ window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail);
}
- setFolderMetadata(LocalFileSystem.PERSISTENT, "Backups", "com.apple.MobileBackup", 1);
+ setFolderMetadata(LocalFileSystem.PERSISTENT, "Backups", "com.apple.MobileBackup", 1);
moveTo
------
@@ -178,7 +178,7 @@ __Quick Example__
alert(error.code);
}
- function moveDir(entry) {
+ function moveDir(entry) {
var parent = document.getElementById('parent').value,
parentName = parent.substring(parent.lastIndexOf('/')+1),
newName = document.getElementById('newName').value,
@@ -207,15 +207,15 @@ __Parameters:__
__Quick Example__
- function win(entry) {
- console.log("New Path: " + entry.fullPath);
- }
+ function win(entry) {
+ console.log("New Path: " + entry.fullPath);
+ }
- function fail(error) {
- alert(error.code);
- }
+ function fail(error) {
+ alert(error.code);
+ }
- function copyDir(entry) {
+ function copyDir(entry) {
var parent = document.getElementById('parent').value,
parentName = parent.substring(parent.lastIndexOf('/')+1),
newName = document.getElementById('newName').value,
@@ -282,8 +282,8 @@ __Quick Example__
alert('Failed to get parent directory: ' + error.code);
}
- // Get the parent DirectoryEntry
- entry.getParent(success, fail);
+ // Get the parent DirectoryEntry
+ entry.getParent(success, fail);
createReader
------------
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/directoryreader/directoryreader.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/directoryreader/directoryreader.md b/docs/en/edge/cordova/file/directoryreader/directoryreader.md
index dcddd3a..b37edb9 100644
--- a/docs/en/edge/cordova/file/directoryreader/directoryreader.md
+++ b/docs/en/edge/cordova/file/directoryreader/directoryreader.md
@@ -50,7 +50,7 @@ __Parameters:__
- __errorCallback__: A callback that executes if an error occurs when retrieving the directory listing. Invoked with a `FileError` object. _(Function)_
__Quick Example__
-
+
function success(entries) {
var i;
for (i=0; i<entries.length; i++) {
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/fileentry/fileentry.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/fileentry/fileentry.md b/docs/en/edge/cordova/file/fileentry/fileentry.md
index 4b6f651..f362833 100644
--- a/docs/en/edge/cordova/file/fileentry/fileentry.md
+++ b/docs/en/edge/cordova/file/fileentry/fileentry.md
@@ -32,8 +32,8 @@ Properties
- __name__: The name of the `FileEntry`, excluding the path leading to it. _(DOMString)_
- __fullPath__: The full absolute path from the root to the `FileEntry`. _(DOMString)_
-__NOTE:__ The following attributes are defined by the W3C
-specification, but are _not_ supported by Cordova:
+__NOTE:__ The following attribute is defined by the W3C specification,
+but is _not_ supported:
- __filesystem__: The file system on which the `FileEntry` resides. _(FileSystem)_
@@ -117,34 +117,34 @@ __Quick Example__
function setFileMetadata(localFileSystem, filePath, metadataKey, metadataValue)
{
- var onSetMetadataWin = function() {
- console.log("success setting metadata")
- }
+ var onSetMetadataWin = function() {
+ console.log("success setting metadata")
+ }
var onSetMetadataFail = function() {
- console.log("error setting metadata")
+ console.log("error setting metadata")
}
- var onGetFileWin = function(parent) {
- var data = {};
- data[metadataKey] = metadataValue;
- parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data);
- }
- var onGetFileFail = function() {
- console.log("error getting file")
- }
+ var onGetFileWin = function(parent) {
+ var data = {};
+ data[metadataKey] = metadataValue;
+ parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data);
+ }
+ var onGetFileFail = function() {
+ console.log("error getting file")
+ }
- var onFSWin = function(fileSystem) {
- fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail);
- }
+ var onFSWin = function(fileSystem) {
+ fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail);
+ }
- var onFSFail = function(evt) {
- console.log(evt.target.error.code);
- }
+ var onFSFail = function(evt) {
+ console.log(evt.target.error.code);
+ }
- window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail);
+ window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail);
}
- setFileMetadata(LocalFileSystem.PERSISTENT, "Backups/sqlite.db", "com.apple.MobileBackup", 1);
+ setFileMetadata(LocalFileSystem.PERSISTENT, "Backups/sqlite.db", "com.apple.MobileBackup", 1);
moveTo
------
@@ -202,11 +202,11 @@ __Parameters:__
__Quick Example__
function win(entry) {
- console.log("New Path: " + entry.fullPath);
+ console.log("New Path: " + entry.fullPath);
}
function fail(error) {
- alert(error.code);
+ alert(error.code);
}
function copyFile(entry) {
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/fileobj/fileobj.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/fileobj/fileobj.md b/docs/en/edge/cordova/file/fileobj/fileobj.md
index c343383..ee5f1d4 100644
--- a/docs/en/edge/cordova/file/fileobj/fileobj.md
+++ b/docs/en/edge/cordova/file/fileobj/fileobj.md
@@ -73,7 +73,7 @@ __Full Example__
var slice1 = file.slice(100, 400);
var slice2 = slice1.slice(20, 35);
-
+
var slice3 = file.slice(120, 135);
// slice2 and slice3 are equivalent.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/filereader/filereader.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/filereader/filereader.md b/docs/en/edge/cordova/file/filereader/filereader.md
index f7e9f98..d888999 100644
--- a/docs/en/edge/cordova/file/filereader/filereader.md
+++ b/docs/en/edge/cordova/file/filereader/filereader.md
@@ -74,19 +74,19 @@ __Parameters:__
Quick Example
-------------
- function win(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- console.log("read success");
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function (evt) {
+ console.log("read success");
console.log(evt.target.result);
};
- reader.readAsDataURL(file);
- };
+ reader.readAsDataURL(file);
+ };
+
+ var fail = function (evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.file(win, fail);
Read As Text
@@ -100,38 +100,38 @@ __Parameters:__
Quick Example
-------------
- function win(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- console.log("read success");
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function (evt) {
+ console.log("read success");
console.log(evt.target.result);
};
- reader.readAsText(file);
- };
+ reader.readAsText(file);
+ };
+
+ var fail = function (evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.file(win, fail);
Abort Quick Example
-------------------
- function win(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- console.log("read success");
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("read success");
console.log(evt.target.result);
};
- reader.readAsText(file);
- reader.abort();
- };
+ reader.readAsText(file);
+ reader.abort();
+ };
function fail(error) {
- console.log(error.code);
+ console.log(error.code);
}
-
+
entry.file(win, fail);
Full Example
@@ -145,31 +145,31 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
+ }
+
+ function gotFS(fileSystem) {
+ fileSystem.root.getFile("readme.txt", null, gotFileEntry, fail);
}
-
- function gotFS(fileSystem) {
- fileSystem.root.getFile("readme.txt", null, gotFileEntry, fail);
- }
-
- function gotFileEntry(fileEntry) {
- fileEntry.file(gotFile, fail);
- }
-
+
+ function gotFileEntry(fileEntry) {
+ fileEntry.file(gotFile, fail);
+ }
+
function gotFile(file){
- readDataUrl(file);
- readAsText(file);
- }
-
+ readDataUrl(file);
+ readAsText(file);
+ }
+
function readDataUrl(file) {
var reader = new FileReader();
reader.onloadend = function(evt) {
@@ -178,7 +178,7 @@ Full Example
};
reader.readAsDataURL(file);
}
-
+
function readAsText(file) {
var reader = new FileReader();
reader.onloadend = function(evt) {
@@ -187,11 +187,11 @@ Full Example
};
reader.readAsText(file);
}
-
+
function fail(evt) {
console.log(evt.target.error.code);
}
-
+
</script>
</head>
<body>
@@ -216,20 +216,20 @@ __Parameters:__
Quick Example
-------------
- function win(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- console.log("read success");
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function (evt) {
+ console.log("read success");
console.log(evt.target.result);
};
- reader.readAsBinaryString(file);
- };
+ reader.readAsBinaryString(file);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
- entry.file(win, fail);
+ var fail = function (evt) {
+ console.log(error.code);
+ };
+
+entry.file(win, fail);
Read As Array Buffer
--------------------
@@ -242,18 +242,17 @@ __Parameters:__
Quick Example
-------------
- function win(file) {
- var reader = new FileReader();
- reader.onloadend = function(evt) {
- console.log("read success");
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function (evt) {
+ console.log("read success");
console.log(new Uint8Array(evt.target.result));
};
- reader.readAsArrayBuffer(file);
- };
+ reader.readAsArrayBuffer(file);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
- entry.file(win, fail);
+ var fail = function (evt) {
+ console.log(error.code);
+ };
+ entry.file(win, fail);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/filesystem/filesystem.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/filesystem/filesystem.md b/docs/en/edge/cordova/file/filesystem/filesystem.md
index 4510d12..c8eaa2c 100644
--- a/docs/en/edge/cordova/file/filesystem/filesystem.md
+++ b/docs/en/edge/cordova/file/filesystem/filesystem.md
@@ -48,13 +48,13 @@ Supported Platforms
File System Quick Example
-------------------------
- function onSuccess(fileSystem) {
- console.log(fileSystem.name);
- console.log(fileSystem.root.name);
- }
-
- // request the persistent file system
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null);
+ function onSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ console.log(fileSystem.root.name);
+ }
+
+ // request the persistent file system
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null);
Full Example
------------
@@ -67,25 +67,25 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
+ }
+
+ function onFileSystemSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ console.log(fileSystem.root.name);
+ }
+
+ function fail(evt) {
+ console.log(evt.target.error.code);
}
- function onFileSystemSuccess(fileSystem) {
- console.log(fileSystem.name);
- console.log(fileSystem.root.name);
- }
-
- function fail(evt) {
- console.log(evt.target.error.code);
- }
-
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/filetransfer/filetransfer.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/filetransfer/filetransfer.md b/docs/en/edge/cordova/file/filetransfer/filetransfer.md
index 46aca45..8230216 100644
--- a/docs/en/edge/cordova/file/filetransfer/filetransfer.md
+++ b/docs/en/edge/cordova/file/filetransfer/filetransfer.md
@@ -70,33 +70,33 @@ __Parameters:__
- __trustAllHosts__: Optional parameter, defaults to `false`. If set to true, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
__Quick Example__
-
+
// !! Assumes variable fileURI contains a valid URI to a text file on the device
-
- var win = function(r) {
+
+ var win = function (r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function(error) {
+ }
+
+ var fail = function (error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
+
+ var options = new FileUploadOptions();
+ options.fileKey = "file";
+ options.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
+ options.mimeType = "text/plain";
+
+ var params = {};
+ params.value1 = "test";
+ params.value2 = "param";
+
+ options.params = params;
+
+ var ft = new FileTransfer();
ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
__Full Example__
@@ -105,56 +105,57 @@ __Full Example__
<html>
<head>
<title>File Transfer Example</title>
-
+
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
- // Wait for Cordova to load
+
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
-
- // Cordova is ready
+
+ // device APIs are available
//
function onDeviceReady() {
-
// Retrieve image file location from specified source
- navigator.camera.getPicture(uploadPhoto,
- function(message) { alert('get picture failed'); },
- { quality: 50,
- destinationType: navigator.camera.DestinationType.FILE_URI,
- sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY }
- );
-
+ navigator.camera.getPicture(
+ uploadPhoto,
+ function(message) { alert('get picture failed'); },
+ {
+ quality : 50,
+ destinationType : navigator.camera.DestinationType.FILE_URI,
+ sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY
+ }
+ );
}
-
+
function uploadPhoto(imageURI) {
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType="image/jpeg";
-
+
var params = {};
params.value1 = "test";
params.value2 = "param";
-
+
options.params = params;
-
+
var ft = new FileTransfer();
ft.upload(imageURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
}
-
+
function win(r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
}
-
+
function fail(error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}
-
+
</script>
</head>
<body>
@@ -172,24 +173,24 @@ Supported on Android and iOS
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
}
-
+
function fail(error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}
-
+
var uri = encodeURI("http://some.server.com/upload.php");
-
+
var options = new FileUploadOptions();
options.fileKey="file";
options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
options.mimeType="text/plain";
-
+
var headers={'headerParam':'headerValue'};
-
+
options.headers = headers;
-
+
var ft = new FileTransfer();
ft.upload(fileURI, uri, win, fail, options);
@@ -201,7 +202,7 @@ to a Nginx server.
download
--------------
-__Parameters:__
+__Parameters:__
- __source__: URL of the server to download the file, as encoded by `encodeURI()`.
- __target__: Full path of the file on the device.
@@ -216,7 +217,7 @@ __Quick Example__
var fileTransfer = new FileTransfer();
var uri = encodeURI("http://some.server.com/download.php");
-
+
fileTransfer.download(
uri,
filePath,
@@ -247,33 +248,33 @@ __Supported Platforms__
- iOS
__Quick Example__
-
+
// !! Assumes variable fileURI contains a valid URI to a text file on the device
-
- var win = function(r) {
+
+ var win = function(r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
- }
-
+ }
+
var fail = function(error) {
alert("An error has occurred: Code = " + error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
- options.mimeType="text/plain";
+
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
+ options.mimeType="text/plain";
var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
+ params.value1 = "test";
+ params.value2 = "param";
+
+ options.params = params;
+
+ var ft = new FileTransfer();
ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
ft.abort(win, fail);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/filewriter/filewriter.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/filewriter/filewriter.md b/docs/en/edge/cordova/file/filewriter/filewriter.md
index d86ce86..75e275b 100644
--- a/docs/en/edge/cordova/file/filewriter/filewriter.md
+++ b/docs/en/edge/cordova/file/filewriter/filewriter.md
@@ -59,7 +59,7 @@ written many times. The `FileWriter` maintains the file's `position`
and `length` attributes, which allow the app to `seek` and `write`
anywhere in the file. By default, the `FileWriter` writes to the
beginning of the file, overwriting existing data. Set the optional
-`append` boolean to `true` in the `FileWriter`'s constructor to
+`append` boolean to `true` in the `FileWriter`'s constructor to
write to the end of the file.
Supported Platforms
@@ -74,78 +74,78 @@ Supported Platforms
Seek Quick Example
------------------------------
- function win(writer) {
- // fast forwards file pointer to end of file
- writer.seek(writer.length);
- };
+ function win(writer) {
+ // fast forwards file pointer to end of file
+ writer.seek(writer.length);
+ };
+
+ var fail = function(evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.createWriter(win, fail);
Truncate Quick Example
--------------------------
- function win(writer) {
- writer.truncate(10);
- };
+ function win(writer) {
+ writer.truncate(10);
+ };
+
+ var fail = function(evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.createWriter(win, fail);
Write Quick Example
--------------------
+-------------------
- function win(writer) {
- writer.onwrite = function(evt) {
- console.log("write success");
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("write success");
};
- writer.write("some sample text");
- };
+ writer.write("some sample text");
+ };
+
+ var fail = function(evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.createWriter(win, fail);
Append Quick Example
---------------------
+--------------------
- function win(writer) {
- writer.onwrite = function(evt) {
- console.log("write success");
- };
- writer.seek(writer.length);
- writer.write("appended text");
- };
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("write success");
+ };
+ writer.seek(writer.length);
+ writer.write("appended text");
+ };
+
+ var fail = function(evt) {
+ console.log(error.code);
+ };
- var fail = function(evt) {
- console.log(error.code);
- };
-
entry.createWriter(win, fail);
-
+
Abort Quick Example
-------------------
- function win(writer) {
- writer.onwrite = function(evt) {
- console.log("write success");
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("write success");
};
- writer.write("some sample text");
- writer.abort();
- };
-
- var fail = function(evt) {
- console.log(error.code);
- };
-
+ writer.write("some sample text");
+ writer.abort();
+ };
+
+ var fail = function(evt) {
+ console.log(error.code);
+ };
+
entry.createWriter(win, fail);
Full Example
@@ -154,28 +154,28 @@ Full Example
<html>
<head>
<title>FileWriter Example</title>
-
+
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
- // Wait for Cordova to load
+
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
-
- // Cordova is ready
+
+ // device APIs are available
//
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
-
+
function gotFS(fileSystem) {
fileSystem.root.getFile("readme.txt", {create: true, exclusive: false}, gotFileEntry, fail);
}
-
+
function gotFileEntry(fileEntry) {
fileEntry.createWriter(gotFileWriter, fail);
}
-
+
function gotFileWriter(writer) {
writer.onwriteend = function(evt) {
console.log("contents of file now 'some sample text'");
@@ -191,11 +191,11 @@ Full Example
};
writer.write("some sample text");
}
-
+
function fail(error) {
console.log(error.code);
}
-
+
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/localfilesystem/localfilesystem.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/localfilesystem/localfilesystem.md b/docs/en/edge/cordova/file/localfilesystem/localfilesystem.md
index 3578bb1..2b933c9 100644
--- a/docs/en/edge/cordova/file/localfilesystem/localfilesystem.md
+++ b/docs/en/edge/cordova/file/localfilesystem/localfilesystem.md
@@ -51,22 +51,22 @@ Supported Platforms
Request File System Quick Example
---------------------------------
- function onSuccess(fileSystem) {
- console.log(fileSystem.name);
- }
-
- // request the persistent file system
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);
+ function onSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ }
+
+ // request the persistent file system
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);
Resolve Local File System URI Quick Example
-------------------------------------------
- function onSuccess(fileEntry) {
- console.log(fileEntry.name);
- }
+ function onSuccess(fileEntry) {
+ console.log(fileEntry.name);
+ }
+
+ window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError);
- window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError);
-
Full Example
------------
@@ -78,29 +78,29 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
- window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
- window.resolveLocalFileSystemURI("file:///example.txt", onResolveSuccess, fail);
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
+ window.resolveLocalFileSystemURI("file:///example.txt", onResolveSuccess, fail);
+ }
+
+ function onFileSystemSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ }
+
+ function onResolveSuccess(fileEntry) {
+ console.log(fileEntry.name);
+ }
+
+ function fail(evt) {
+ console.log(evt.target.error.code);
}
- function onFileSystemSuccess(fileSystem) {
- console.log(fileSystem.name);
- }
-
- function onResolveSuccess(fileEntry) {
- console.log(fileEntry.name);
- }
-
- function fail(evt) {
- console.log(evt.target.error.code);
- }
-
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/file/metadata/metadata.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/metadata/metadata.md b/docs/en/edge/cordova/file/metadata/metadata.md
index 3c6ebdc..bfa3a46 100644
--- a/docs/en/edge/cordova/file/metadata/metadata.md
+++ b/docs/en/edge/cordova/file/metadata/metadata.md
@@ -46,9 +46,9 @@ Supported Platforms
Quick Example
-------------
- function win(metadata) {
- console.log("Last Modified: " + metadata.modificationTime);
- }
-
- // Request the metadata object for this entry
- entry.getMetadata(win, null);
+ function win(metadata) {
+ console.log("Last Modified: " + metadata.modificationTime);
+ }
+
+ // Request the metadata object for this entry
+ entry.getMetadata(win, null);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/geolocation/Coordinates/coordinates.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/geolocation/Coordinates/coordinates.md b/docs/en/edge/cordova/geolocation/Coordinates/coordinates.md
index 201076a..b043130 100644
--- a/docs/en/edge/cordova/geolocation/Coordinates/coordinates.md
+++ b/docs/en/edge/cordova/geolocation/Coordinates/coordinates.md
@@ -85,30 +85,30 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Set an event to wait for Cordova to load
+ // wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is loaded and Ready
+ // device APIs are available
//
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
-
+
// Display `Position` properties from the geolocation
//
function onSuccess(position) {
var div = document.getElementById('myDiv');
-
- div.innerHTML = 'Latitude: ' + position.coords.latitude + '<br/>' +
- 'Longitude: ' + position.coords.longitude + '<br/>' +
- 'Altitude: ' + position.coords.altitude + '<br/>' +
- 'Accuracy: ' + position.coords.accuracy + '<br/>' +
- 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br/>' +
- 'Heading: ' + position.coords.heading + '<br/>' +
- 'Speed: ' + position.coords.speed + '<br/>';
+
+ div.innerHTML = 'Latitude: ' + position.coords.latitude + '<br/>' +
+ 'Longitude: ' + position.coords.longitude + '<br/>' +
+ 'Altitude: ' + position.coords.altitude + '<br/>' +
+ 'Accuracy: ' + position.coords.accuracy + '<br/>' +
+ 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br/>' +
+ 'Heading: ' + position.coords.heading + '<br/>' +
+ 'Speed: ' + position.coords.speed + '<br/>';
}
-
+
// Show an alert if there is a problem getting the geolocation
//
function onError() {
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/geolocation/Position/position.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/geolocation/Position/position.md b/docs/en/edge/cordova/geolocation/Position/position.md
index e1db6ff..a69e8ca 100644
--- a/docs/en/edge/cordova/geolocation/Position/position.md
+++ b/docs/en/edge/cordova/geolocation/Position/position.md
@@ -81,36 +81,36 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
-
+
// onSuccess Geolocation
//
function onSuccess(position) {
var element = document.getElementById('geolocation');
- element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
- 'Longitude: ' + position.coords.longitude + '<br />' +
- 'Altitude: ' + position.coords.altitude + '<br />' +
- 'Accuracy: ' + position.coords.accuracy + '<br />' +
- 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' +
- 'Heading: ' + position.coords.heading + '<br />' +
- 'Speed: ' + position.coords.speed + '<br />' +
- 'Timestamp: ' + position.timestamp + '<br />';
+ element.innerHTML = 'Latitude: ' + position.coords.latitude + '<br />' +
+ 'Longitude: ' + position.coords.longitude + '<br />' +
+ 'Altitude: ' + position.coords.altitude + '<br />' +
+ 'Accuracy: ' + position.coords.accuracy + '<br />' +
+ 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '<br />' +
+ 'Heading: ' + position.coords.heading + '<br />' +
+ 'Speed: ' + position.coords.speed + '<br />' +
+ 'Timestamp: ' + position.timestamp + '<br />';
}
-
- // onError Callback receives a PositionError object
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
+
+ // onError Callback receives a PositionError object
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
</script>
</head>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/geolocation/geolocation.clearWatch.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/geolocation/geolocation.clearWatch.md b/docs/en/edge/cordova/geolocation/geolocation.clearWatch.md
index a92da7c..a87d3a2 100644
--- a/docs/en/edge/cordova/geolocation/geolocation.clearWatch.md
+++ b/docs/en/edge/cordova/geolocation/geolocation.clearWatch.md
@@ -72,13 +72,13 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
var watchID = null;
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
// Get the most accurate position updates available on the
@@ -86,7 +86,7 @@ Full Example
var options = { enableHighAccuracy: true };
watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
}
-
+
// onSuccess Geolocation
//
function onSuccess(position) {
@@ -104,18 +104,18 @@ Full Example
watchID = null;
}
}
-
- // onError Callback receives a PositionError object
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
+
+ // onError Callback receives a PositionError object
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
</script>
</head>
<body>
<p id="geolocation">Watching geolocation...</p>
- <button onclick="clearWatch();">Clear Watch</button>
+ <button onclick="clearWatch();">Clear Watch</button>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/geolocation/geolocation.getCurrentPosition.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/geolocation/geolocation.getCurrentPosition.md b/docs/en/edge/cordova/geolocation/geolocation.getCurrentPosition.md
index 51beb4a..5266c60 100644
--- a/docs/en/edge/cordova/geolocation/geolocation.getCurrentPosition.md
+++ b/docs/en/edge/cordova/geolocation/geolocation.getCurrentPosition.md
@@ -58,8 +58,8 @@ Quick Example
-------------
// onSuccess Callback
- // This method accepts a `Position` object, which contains
- // the current GPS coordinates
+ // This method accepts a Position object, which contains the
+ // current GPS coordinates
//
var onSuccess = function(position) {
alert('Latitude: ' + position.coords.latitude + '\n' +
@@ -92,16 +92,16 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
-
+
// onSuccess Geolocation
//
function onSuccess(position) {
@@ -115,12 +115,12 @@ Full Example
'Speed: ' + position.coords.speed + '<br />' +
'Timestamp: ' + position.timestamp + '<br />';
}
-
+
// onError Callback receives a PositionError object
//
function onError(error) {
alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
+ 'message: ' + error.message + '\n');
}
</script>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/geolocation/geolocation.watchPosition.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/geolocation/geolocation.watchPosition.md b/docs/en/edge/cordova/geolocation/geolocation.watchPosition.md
index 21877dc..a4c7053 100644
--- a/docs/en/edge/cordova/geolocation/geolocation.watchPosition.md
+++ b/docs/en/edge/cordova/geolocation/geolocation.watchPosition.md
@@ -96,20 +96,20 @@ Full Example
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
- // Wait for Cordova to load
+ // Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
var watchID = null;
- // Cordova is ready
+ // device APIs are available
//
function onDeviceReady() {
// Throw an error if no update is received every 30 seconds
var options = { timeout: 30000 };
watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
}
-
+
// onSuccess Geolocation
//
function onSuccess(position) {
@@ -118,13 +118,13 @@ Full Example
'Longitude: ' + position.coords.longitude + '<br />' +
'<hr />' + element.innerHTML;
}
-
- // onError Callback receives a PositionError object
- //
- function onError(error) {
- alert('code: ' + error.code + '\n' +
- 'message: ' + error.message + '\n');
- }
+
+ // onError Callback receives a PositionError object
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
</script>
</head>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/GlobalizationError/globalizationerror.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/GlobalizationError/globalizationerror.md b/docs/en/edge/cordova/globalization/GlobalizationError/globalizationerror.md
index 9916d7f..015510b 100644
--- a/docs/en/edge/cordova/globalization/GlobalizationError/globalizationerror.md
+++ b/docs/en/edge/cordova/globalization/GlobalizationError/globalizationerror.md
@@ -61,21 +61,21 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>GlobalizationError Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function successCallback(date) {
alert('month:' + date.month +
' day:' + date.day +
' year:' + date.year + '\n');
}
-
+
function errorCallback(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
};
-
+
function checkError() {
navigator.globalization.stringToDate(
'notADate',
@@ -84,7 +84,7 @@ Full Example
{selector:'foobar'}
);
}
-
+
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.dateToString.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.dateToString.md b/docs/en/edge/cordova/globalization/globalization.dateToString.md
index 2a762c3..dceb57c 100644
--- a/docs/en/edge/cordova/globalization/globalization.dateToString.md
+++ b/docs/en/edge/cordova/globalization/globalization.dateToString.md
@@ -59,10 +59,10 @@ dialog with text similar to `date: 9/25/2012 4:21PM` using the default
options:
navigator.globalization.dateToString(
- new Date(),
- function (date) {alert('date: ' + date.value + '\n');},
- function () {alert('Error getting dateString\n');},
- {formatLength:'short', selector:'date and time'}
+ new Date(),
+ function (date) { alert('date: ' + date.value + '\n'); },
+ function () { alert('Error getting dateString\n'); },
+ { formatLength: 'short', selector: 'date and time' }
);
Full Example
@@ -71,10 +71,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>dateToString Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkDateString() {
navigator.globalization.dateToString(
new Date(),
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getCurrencyPattern.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getCurrencyPattern.md b/docs/en/edge/cordova/globalization/globalization.getCurrencyPattern.md
index 5b0cf93..f02f1e5 100644
--- a/docs/en/edge/cordova/globalization/globalization.getCurrencyPattern.md
+++ b/docs/en/edge/cordova/globalization/globalization.getCurrencyPattern.md
@@ -60,14 +60,16 @@ currency is United States Dollars, this example displays a popup
dialog with text similar to the results that follow:
navigator.globalization.getCurrencyPattern(
- 'USD',
- function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
- 'code: ' + pattern.code + '\n' +
- 'fraction: ' + pattern.fraction + '\n' +
- 'rounding: ' + pattern.rounding + '\n' +
- 'decimal: ' + pattern.decimal + '\n' +
- 'grouping: ' + pattern.grouping);},
- function () {alert('Error getting pattern\n');}
+ 'USD',
+ function (pattern) {
+ alert('pattern: ' + pattern.pattern + '\n' +
+ 'code: ' + pattern.code + '\n' +
+ 'fraction: ' + pattern.fraction + '\n' +
+ 'rounding: ' + pattern.rounding + '\n' +
+ 'decimal: ' + pattern.decimal + '\n' +
+ 'grouping: ' + pattern.grouping);
+ },
+ function () { alert('Error getting pattern\n'); }
);
Expected result:
@@ -85,23 +87,23 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getCurrencyPattern Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkPattern() {
navigator.globalization.getCurrencyPattern(
'USD',
- function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
- 'code: ' + pattern.code + '\n' +
+ function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
+ 'code: ' + pattern.code + '\n' +
'fraction: ' + pattern.fraction + '\n' +
'rounding: ' + pattern.rounding + '\n' +
- 'decimal: ' + pattern.decimal + '\n' +
+ 'decimal: ' + pattern.decimal + '\n' +
'grouping: ' + pattern.grouping);},
function () {alert('Error getting pattern\n');}
);
}
-
+
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getDateNames.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getDateNames.md b/docs/en/edge/cordova/globalization/globalization.getDateNames.md
index 95a0abe..88d9a66 100644
--- a/docs/en/edge/cordova/globalization/globalization.getDateNames.md
+++ b/docs/en/edge/cordova/globalization/globalization.getDateNames.md
@@ -24,7 +24,7 @@ Returns an array of the names of the months or days of the week,
depending on the client's user preferences and calendar.
navigator.globalization.getDateNames(successCallback, errorCallback, options);
-
+
Description
-----------
@@ -61,13 +61,13 @@ a series of twelve popup dialogs, one per month, with text similar to
`month: January`:
navigator.globalization.getDateNames(
- function (names) {
- for (var i=0; i<names.value.length; i++) {
- alert('month: ' + names.value[i] + '\n');
- }
- },
- function () {alert('Error getting names\n');},
- {type:'wide', item:'months'}
+ function (names) {
+ for (var i = 0; i < names.value.length; i++) {
+ alert('month: ' + names.value[i] + '\n');
+ }
+ },
+ function () { alert('Error getting names\n'); },
+ { type: 'wide', item: 'months' }
);
Full Example
@@ -76,10 +76,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getDateNames Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkDateNames() {
navigator.globalization.getDateNames(
function (names) {
@@ -91,7 +91,7 @@ Full Example
{type:'wide', item:'months'}
);
}
-
+
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getDatePattern.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getDatePattern.md b/docs/en/edge/cordova/globalization/globalization.getDatePattern.md
index 6e8da83..14ee0a6 100644
--- a/docs/en/edge/cordova/globalization/globalization.getDatePattern.md
+++ b/docs/en/edge/cordova/globalization/globalization.getDatePattern.md
@@ -24,7 +24,7 @@ Returns a pattern string to format and parse dates according to the
client's user preferences.
navigator.globalization.getDatePattern(successCallback, errorCallback, options);
-
+
Description
-----------
@@ -37,7 +37,7 @@ a parameter contains the following properties:
- __dst\_offset__: The current daylight saving time offset in seconds between the client's non-daylight saving's time zone and the client's daylight saving's time zone. _(Number)_
If there is an error obtaining the pattern, the `errorCallback`
-executes with a `GlobalizationError` object as a parameter. The
+executes with a `GlobalizationError` object as a parameter. The
error's expected code is `GlobalizationError.PATTERN\_ERROR`.
The `options` parameter is optional, and defaults to the following values:
@@ -63,11 +63,11 @@ When the browser is set to the `en\_US` locale, this example displays
a popup dialog with text such as `pattern: M/d/yyyy h:mm a`:
function checkDatePattern() {
- navigator.globalization.getDatePattern(
- function (date) {alert('pattern: ' + date.pattern + '\n');},
- function () {alert('Error getting pattern\n');},
- {formatLength:'short', selector:'date and time'}
- );
+ navigator.globalization.getDatePattern(
+ function (date) { alert('pattern: ' + date.pattern + '\n'); },
+ function () { alert('Error getting pattern\n'); },
+ { formatLength: 'short', selector: 'date and time' }
+ );
}
Full Example
@@ -76,10 +76,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getDatePattern Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkDatePattern() {
navigator.globalization.getDatePattern(
function (date) {alert('pattern: ' + date.pattern + '\n');},
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getFirstDayOfWeek.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getFirstDayOfWeek.md b/docs/en/edge/cordova/globalization/globalization.getFirstDayOfWeek.md
index 3e24523..cb095e9 100644
--- a/docs/en/edge/cordova/globalization/globalization.getFirstDayOfWeek.md
+++ b/docs/en/edge/cordova/globalization/globalization.getFirstDayOfWeek.md
@@ -24,7 +24,7 @@ Returns the first day of the week according to the client's user
preferences and calendar.
navigator.globalization.getFirstDayOfWeek(successCallback, errorCallback);
-
+
Description
-----------
@@ -52,8 +52,8 @@ When the browser is set to the `en\_US` locale, this displays a
popup dialog with text similar to `day: 1`.
navigator.globalization.getFirstDayOfWeek(
- function (day) {alert('day: ' + day.value + '\n');},
- function () {alert('Error getting day\n');}
+ function (day) {alert('day: ' + day.value + '\n');},
+ function () {alert('Error getting day\n');}
);
Full Example
@@ -62,17 +62,17 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getFirstDayOfWeek Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkFirstDay() {
navigator.globalization.getFirstDayOfWeek(
function (day) {alert('day: ' + day.value + '\n');},
function () {alert('Error getting day\n');}
);
}
-
+
</script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getLocaleName.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getLocaleName.md b/docs/en/edge/cordova/globalization/globalization.getLocaleName.md
index 204a634..52a0226 100644
--- a/docs/en/edge/cordova/globalization/globalization.getLocaleName.md
+++ b/docs/en/edge/cordova/globalization/globalization.getLocaleName.md
@@ -24,7 +24,7 @@ Get the string identifier for the client's current locale setting.
navigator.globalization.getLocaleName(successCallback, errorCallback);
-
+
Description
-----------
@@ -51,8 +51,8 @@ When the browser is set to the `en\_US` locale, this displays a popup
dialog with the text `locale: en\_US`.
navigator.globalization.getLocaleName(
- function (locale) {alert('locale: ' + locale.value + '\n');},
- function () {alert('Error getting locale\n');}
+ function (locale) {alert('locale: ' + locale.value + '\n');},
+ function () {alert('Error getting locale\n');}
);
Full Example
@@ -61,10 +61,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getLocaleName Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkLocale() {
navigator.globalization.getLocaleName(
function (locale) {alert('locale: ' + locale.value + '\n');},
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getNumberPattern.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getNumberPattern.md b/docs/en/edge/cordova/globalization/globalization.getNumberPattern.md
index 0b59354..70f0027 100644
--- a/docs/en/edge/cordova/globalization/globalization.getNumberPattern.md
+++ b/docs/en/edge/cordova/globalization/globalization.getNumberPattern.md
@@ -23,7 +23,7 @@ globalization.getNumberPattern
Returns a pattern string to format and parse numbers according to the client's user preferences.
navigator.globalization.getNumberPattern(successCallback, errorCallback, options);
-
+
Description
-----------
@@ -64,16 +64,16 @@ When the browser is set to the `en\_US` locale, this should display a
popup dialog with text similar to the results that follow:
navigator.globalization.getNumberPattern(
- function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
- 'symbol: ' + pattern.symbol + '\n' +
- 'fraction: ' + pattern.fraction + '\n' +
- 'rounding: ' + pattern.rounding + '\n' +
- 'positive: ' + pattern.positive + '\n' +
- 'negative: ' + pattern.negative + '\n' +
- 'decimal: ' + pattern.decimal + '\n' +
- 'grouping: ' + pattern.grouping);},
- function () {alert('Error getting pattern\n');},
- {type:'decimal'}
+ function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
+ 'symbol: ' + pattern.symbol + '\n' +
+ 'fraction: ' + pattern.fraction + '\n' +
+ 'rounding: ' + pattern.rounding + '\n' +
+ 'positive: ' + pattern.positive + '\n' +
+ 'negative: ' + pattern.negative + '\n' +
+ 'decimal: ' + pattern.decimal + '\n' +
+ 'grouping: ' + pattern.grouping);},
+ function () {alert('Error getting pattern\n');},
+ {type:'decimal'}
);
Results:
@@ -93,32 +93,32 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getNumberPattern Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkPattern() {
navigator.globalization.getNumberPattern(
- function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
- 'symbol: ' + pattern.symbol + '\n' +
+ function (pattern) {alert('pattern: ' + pattern.pattern + '\n' +
+ 'symbol: ' + pattern.symbol + '\n' +
'fraction: ' + pattern.fraction + '\n' +
'rounding: ' + pattern.rounding + '\n' +
'positive: ' + pattern.positive + '\n' +
'negative: ' + pattern.negative + '\n' +
- 'decimal: ' + pattern.decimal + '\n' +
+ 'decimal: ' + pattern.decimal + '\n' +
'grouping: ' + pattern.grouping);},
function () {alert('Error getting pattern\n');},
{type:'decimal'}
);
}
-
+
</script>
</head>
<body>
<button onclick="checkPattern()">Click for pattern</button>
</body>
</html>
-
+
Windows Phone 8 Quirks
----------------
- The `pattern` property is not supported, and retuens an empty string.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.getPreferredLanguage.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.getPreferredLanguage.md b/docs/en/edge/cordova/globalization/globalization.getPreferredLanguage.md
index 64328f8..4e3b54b 100644
--- a/docs/en/edge/cordova/globalization/globalization.getPreferredLanguage.md
+++ b/docs/en/edge/cordova/globalization/globalization.getPreferredLanguage.md
@@ -24,7 +24,7 @@ Get the string identifier for the client's current language.
navigator.globalization.getPreferredLanguage(successCallback, errorCallback);
-
+
Description
-----------
@@ -51,8 +51,8 @@ When the browser is set to the `en\_US` locale, this should display a
popup dialog with the text `language: English`:
navigator.globalization.getPreferredLanguage(
- function (language) {alert('language: ' + language.value + '\n');},
- function () {alert('Error getting language\n');}
+ function (language) {alert('language: ' + language.value + '\n');},
+ function () {alert('Error getting language\n');}
);
Full Example
@@ -61,10 +61,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>getPreferredLanguage Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkLanguage() {
navigator.globalization.getPreferredLanguage(
function (language) {alert('language: ' + language.value + '\n');},
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.isDayLightSavingsTime.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.isDayLightSavingsTime.md b/docs/en/edge/cordova/globalization/globalization.isDayLightSavingsTime.md
index 63156f0..e6d3f2f 100644
--- a/docs/en/edge/cordova/globalization/globalization.isDayLightSavingsTime.md
+++ b/docs/en/edge/cordova/globalization/globalization.isDayLightSavingsTime.md
@@ -24,7 +24,7 @@ Indicates whether daylight savings time is in effect for a given date
using the client's time zone and calendar.
navigator.globalization.isDayLightSavingsTime(date, successCallback, errorCallback);
-
+
Description
-----------
@@ -55,9 +55,9 @@ timezone, this should display a popup dialog with text similar to
`dst: true`:
navigator.globalization.isDayLightSavingsTime(
- new Date(),
- function (date) {alert('dst: ' + date.dst + '\n');},
- function () {alert('Error getting names\n');}
+ new Date(),
+ function (date) {alert('dst: ' + date.dst + '\n');},
+ function () {alert('Error getting names\n');}
);
Full Example
@@ -66,10 +66,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>isDayLightSavingsTime Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkDayLightSavings() {
navigator.globalization.isDayLightSavingsTime(
new Date(),
@@ -77,11 +77,11 @@ Full Example
function () {alert('Error getting names\n');}
);
}
-
+
</script>
</head>
<body>
<button onclick="checkDayLightSavings()">Click for daylight savings</button>
</body>
</html>
-
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/f98807e7/docs/en/edge/cordova/globalization/globalization.numberToString.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/globalization/globalization.numberToString.md b/docs/en/edge/cordova/globalization/globalization.numberToString.md
index 070e42e..800955e 100644
--- a/docs/en/edge/cordova/globalization/globalization.numberToString.md
+++ b/docs/en/edge/cordova/globalization/globalization.numberToString.md
@@ -23,7 +23,7 @@ globalization.numberToString
Returns a number formatted as a string according to the client's user preferences.
navigator.globalization.numberToString(number, successCallback, errorCallback, options);
-
+
Description
-----------
@@ -56,10 +56,10 @@ When the browser is set to the `en\_US` locale, this displays a popup
dialog with text similar to `number: 3.142`:
navigator.globalization.numberToString(
- 3.1415926,
- function (number) {alert('number: ' + number.value + '\n');},
- function () {alert('Error getting number\n');},
- {type:'decimal'}
+ 3.1415926,
+ function (number) {alert('number: ' + number.value + '\n');},
+ function () {alert('Error getting number\n');},
+ {type:'decimal'}
);
Full Example
@@ -68,10 +68,10 @@ Full Example
<!DOCTYPE HTML>
<html>
<head>
- <title>Cordova</title>
+ <title>numberToString Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
-
+
function checkNumber() {
navigator.globalization.numberToString(
3.1415926,
@@ -80,7 +80,7 @@ Full Example
{type:'decimal'}
);
}
-
+
</script>
</head>
<body>