You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2013/10/01 05:31:55 UTC
[06/12] [CB-4830] create docs dir for 3.1.0
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.pause.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.pause.md b/docs/en/3.1.0/cordova/media/media.pause.md
new file mode 100644
index 0000000..d026370
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.pause.md
@@ -0,0 +1,162 @@
+---
+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.
+---
+
+# media.pause
+
+Pauses playing an audio file.
+
+ media.pause();
+
+## Description
+
+The `media.pause` method executes synchronously, and pauses playing an audio file.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Tizen
+- Windows 8
+
+## Quick Example
+
+ // Play audio
+ //
+ function playAudio(url) {
+ // Play the audio file at url
+ var my_media = new Media(url,
+ // success callback
+ function () { console.log("playAudio():Audio Success"); },
+ // error callback
+ function (err) { console.log("playAudio():Audio Error: " + err); }
+ );
+
+ // Play audio
+ my_media.play();
+
+ // Pause after 10 seconds
+ setTimeout(function () {
+ media.pause();
+ }, 10000);
+ }
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+
+ // Play audio
+ my_media.play();
+
+ // Update my_media position every second
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // get my_media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // Pause audio
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.play.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.play.md b/docs/en/3.1.0/cordova/media/media.play.md
new file mode 100644
index 0000000..d52adc2
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.play.md
@@ -0,0 +1,193 @@
+---
+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.
+---
+
+# media.play
+
+Starts or resumes playing an audio file.
+
+ media.play();
+
+## Description
+
+The `media.play` method executes synchronously, and starts or resumes
+playing an audio file.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Tizen
+- Windows 8
+
+## Quick Example
+
+ // Play audio
+ //
+ function playAudio(url) {
+ // Play the audio file at url
+ var my_media = new Media(url,
+ // success callback
+ function () {
+ console.log("playAudio():Audio Success");
+ },
+ // error callback
+ function (err) {
+ console.log("playAudio():Audio Error: " + err);
+ }
+ );
+ // Play audio
+ my_media.play();
+ }
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ if (my_media == null) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+ } // else play current audio
+ // Play audio
+ my_media.play();
+
+ // Update my_media position every second
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // get my_media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // Pause audio
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+## BlackBerry WebWorks Quirks
+
+- BlackBerry devices support a limited number of simultaneous audio
+ channels. CDMA devices only support a single audio channel. Other
+ devices support up to two simultaneous channels. An attempt to play
+ more audio files than the supported amount results in previous
+ playback being stopped.
+
+## iOS Quirks
+
+- __numberOfLoops__: Pass this option to the `play` method to specify
+ the number of times you want the media file to play, e.g.:
+
+ var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3")
+ myMedia.play({ numberOfLoops: 2 })
+
+- __playAudioWhenScreenIsLocked__: Pass in this option to the `play`
+ method to specify whether you want to allow playback when the screen
+ is locked. If set to `true` (the default value), the state of the
+ hardware mute button is ignored, e.g.:
+
+ var myMedia = new Media("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3")
+ myMedia.play({ playAudioWhenScreenIsLocked : false })
+
+- __order of file search__: When only a file name or simple path is
+ provided, iOS searches in the `www` directory for the file, then in
+ the application's `documents/tmp` directory:
+
+ var myMedia = new Media("audio/beer.mp3")
+ myMedia.play() // first looks for file in www/audio/beer.mp3 then in <application>/documents/tmp/audio/beer.mp3
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.release.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.release.md b/docs/en/3.1.0/cordova/media/media.release.md
new file mode 100644
index 0000000..e2b6c59
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.release.md
@@ -0,0 +1,154 @@
+---
+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.
+---
+
+# media.release
+
+Releases the underlying operating system's audio resources.
+
+ media.release();
+
+## Description
+
+The `media.release` method executes synchronously, releasing the
+underlying operating system's audio resources. This is particularly
+important for Android, since there are a finite amount of OpenCore
+instances for media playback. Applications should call the `release`
+function for any `Media` resource that is no longer needed.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Tizen
+- Windows 8
+
+## Quick Example
+
+ // Audio player
+ //
+ var my_media = new Media(src, onSuccess, onError);
+
+ my_media.play();
+ my_media.stop();
+ my_media.release();
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+
+ // Play audio
+ my_media.play();
+
+ // Update my_media position every second
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // get my_media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // Pause audio
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.seekTo.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.seekTo.md b/docs/en/3.1.0/cordova/media/media.seekTo.md
new file mode 100644
index 0000000..9727f63
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.seekTo.md
@@ -0,0 +1,154 @@
+---
+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.
+---
+
+# media.seekTo
+
+Sets the current position within an audio file.
+
+ media.seekTo(milliseconds);
+
+## Parameters
+
+- __milliseconds__: The position to set the playback position within the audio, in milliseconds.
+
+## Description
+
+The `media.seekTo` executes asynchronously, updating the current
+playback position within an audio file referenced by a `Media`
+object. Also updates the `Media` object's `position` parameter.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Tizen
+- Windows 8
+
+## Quick Example
+
+ // Audio player
+ //
+ var my_media = new Media(src, onSuccess, onError);
+ my_media.play();
+ // SeekTo to 10 seconds after 5 seconds
+ setTimeout(function() {
+ my_media.seekTo(10000);
+ }, 5000);
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+
+ // Play audio
+ my_media.play();
+
+ // Update media position every second
+ mediaTimer = setInterval(function() {
+ // get media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition(position + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ }
+ );
+ }, 1000);
+
+ // SeekTo to 10 seconds after 5 seconds
+ setTimeout(function() {
+ my_media.seekTo(10000);
+ }, 5000);
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+## BlackBerry WebWorks Quirks
+
+- Not supported on BlackBerry OS 5 devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.setVolume.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.setVolume.md b/docs/en/3.1.0/cordova/media/media.setVolume.md
new file mode 100644
index 0000000..403858e
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.setVolume.md
@@ -0,0 +1,171 @@
+---
+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.
+---
+
+# media.setVolume
+
+Set the volume for an audio file.
+
+ media.setVolume(volume);
+
+## Parameters
+
+- __volume__: The volume to set for playback. The value must be within the range of 0.0 to 1.0.
+
+## Description
+
+Function `media.setVolume` is an asynchronous function that sets the volume during audio playback.
+
+## Supported Platforms
+
+- Android
+- iOS
+
+## Quick Example
+
+ // Play audio
+ //
+ function playAudio(url) {
+ // Play the audio file at url
+ var my_media = new Media(url,
+ // success callback
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ // error callback
+ function(err) {
+ console.log("playAudio():Audio Error: "+err);
+ });
+
+ // Play audio
+ my_media.play();
+
+ // Mute volume after 2 seconds
+ setTimeout(function() {
+ my_media.setVolume('0.0');
+ }, 2000);
+
+ // Set volume to 1.0 after 5 seconds
+ setTimeout(function() {
+ my_media.setVolume('1.0');
+ }, 5000);
+ }
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for Cordova to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova is ready
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+
+ // Play audio
+ my_media.play();
+
+ // Update my_media position every second
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // get my_media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // Set audio volume
+ //
+ function setVolume(volume) {
+ if (my_media) {
+ my_media.setVolume(volume);
+ }
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="setVolume('0.0');">Mute Audio</a>
+ <a href="#" class="btn large" onclick="setVolume('1.0');">Unmute Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.startRecord.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.startRecord.md b/docs/en/3.1.0/cordova/media/media.startRecord.md
new file mode 100644
index 0000000..82d5fcf
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.startRecord.md
@@ -0,0 +1,148 @@
+---
+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.
+---
+
+# media.startRecord
+
+Starts recording an audio file.
+
+ media.startRecord();
+
+## Description
+
+The `media.startRecord` method executes synchronously, starts a
+recording for an audio file.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ // Record audio
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src,
+ // success callback
+ function() {
+ console.log("recordAudio():Audio Success");
+ },
+
+ // error callback
+ function(err) {
+ console.log("recordAudio():Audio Error: "+ err.code);
+ });
+
+ // Record audio
+ mediaRec.startRecord();
+ }
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Device Properties Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Record audio
+ //
+ function recordAudio() {
+ var src = "myrecording.amr";
+ var mediaRec = new Media(src, onSuccess, onError);
+
+ // Record audio
+ mediaRec.startRecord();
+
+ // Stop recording after 10 sec
+ var recTime = 0;
+ var recInterval = setInterval(function() {
+ recTime = recTime + 1;
+ setAudioPosition(recTime + " sec");
+ if (recTime >= 10) {
+ clearInterval(recInterval);
+ mediaRec.stopRecord();
+ }
+ }, 1000);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ recordAudio();
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("recordAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="media">Recording audio...</p>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+## Android Quirks
+
+- Android devices record audio in Adaptive Multi-Rate format. The specified file should end with a _.amr_ extension.
+
+## BlackBerry WebWorks Quirks
+
+- BlackBerry devices record audio in Adaptive Multi-Rate format. The specified file must end with a _.amr_ extension.
+
+## iOS Quirks
+
+- iOS only records to files of type _.wav_ and returns an error if the file name extension is not correct.
+
+- If a full path is not provided, the recording is placed in the application's `documents/tmp` directory. This can be accessed via the `File` API using `LocalFileSystem.TEMPORARY`. Any subdirectory specified at record time must already exist.
+
+- Files can be recorded and played back using the documents URI:
+
+ var myMedia = new Media("documents://beer.mp3")
+
+## Tizen Quirks
+
+- Not supported on Tizen devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.stop.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.stop.md b/docs/en/3.1.0/cordova/media/media.stop.md
new file mode 100644
index 0000000..493d16c
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.stop.md
@@ -0,0 +1,167 @@
+---
+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.
+---
+
+# media.stop
+
+Stops playing an audio file.
+
+ media.stop();
+
+## Description
+
+The `media.stop` method executes synchronously to stop playing an
+audio file.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Tizen
+- Windows 8
+
+## Quick Example
+
+ // Play audio
+ //
+ function playAudio(url) {
+ // Play the audio file at url
+ var my_media = new Media(url,
+ // success callback
+ function() {
+ console.log("playAudio():Audio Success");
+ },
+ // error callback
+ function(err) {
+ console.log("playAudio():Audio Error: "+err);
+ }
+ );
+
+ // Play audio
+ my_media.play();
+
+ // Pause after 10 seconds
+ setTimeout(function() {
+ my_media.stop();
+ }, 10000);
+ }
+
+## Full Example
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Media Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+ }
+
+ // Audio player
+ //
+ var my_media = null;
+ var mediaTimer = null;
+
+ // Play audio
+ //
+ function playAudio(src) {
+ // Create Media object from src
+ my_media = new Media(src, onSuccess, onError);
+
+ // Play audio
+ my_media.play();
+
+ // Update my_media position every second
+ if (mediaTimer == null) {
+ mediaTimer = setInterval(function() {
+ // get my_media position
+ my_media.getCurrentPosition(
+ // success callback
+ function(position) {
+ if (position > -1) {
+ setAudioPosition((position) + " sec");
+ }
+ },
+ // error callback
+ function(e) {
+ console.log("Error getting pos=" + e);
+ setAudioPosition("Error: " + e);
+ }
+ );
+ }, 1000);
+ }
+ }
+
+ // Pause audio
+ //
+ function pauseAudio() {
+ if (my_media) {
+ my_media.pause();
+ }
+ }
+
+ // Stop audio
+ //
+ function stopAudio() {
+ if (my_media) {
+ my_media.stop();
+ }
+ clearInterval(mediaTimer);
+ mediaTimer = null;
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("playAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
+ <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
+ <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+ <p id="audio_position"></p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/media/media.stopRecord.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/media/media.stopRecord.md b/docs/en/3.1.0/cordova/media/media.stopRecord.md
new file mode 100644
index 0000000..4aad9d1
--- /dev/null
+++ b/docs/en/3.1.0/cordova/media/media.stopRecord.md
@@ -0,0 +1,136 @@
+---
+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.
+---
+
+# media.stopRecord
+
+Stops recording an audio file.
+
+ media.stopRecord();
+
+## Description
+
+The `media.stopRecord` method executes synchronously, stopping the
+recording of an audio file.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ // Record audio
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src,
+ // success callback
+ function() {
+ console.log("recordAudio():Audio Success");
+ },
+
+ // error callback
+ function(err) {
+ console.log("recordAudio():Audio Error: "+ err.code);
+ }
+ );
+
+ // Record audio
+ mediaRec.startRecord();
+
+ // Stop recording after 10 seconds
+ setTimeout(function() {
+ mediaRec.stopRecord();
+ }, 10000);
+ }
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Device Properties Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Record audio
+ //
+ function recordAudio() {
+ var src = "myrecording.mp3";
+ var mediaRec = new Media(src, onSuccess, onError);
+
+ // Record audio
+ mediaRec.startRecord();
+
+ // Stop recording after 10 sec
+ var recTime = 0;
+ var recInterval = setInterval(function() {
+ recTime = recTime + 1;
+ setAudioPosition(recTime + " sec");
+ if (recTime >= 10) {
+ clearInterval(recInterval);
+ mediaRec.stopRecord();
+ }
+ }, 1000);
+ }
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ recordAudio();
+ }
+
+ // onSuccess Callback
+ //
+ function onSuccess() {
+ console.log("recordAudio():Audio Success");
+ }
+
+ // onError Callback
+ //
+ function onError(error) {
+ alert('code: ' + error.code + '\n' +
+ 'message: ' + error.message + '\n');
+ }
+
+ // Set audio position
+ //
+ function setAudioPosition(position) {
+ document.getElementById('audio_position').innerHTML = position;
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="media">Recording audio...</p>
+ <p id="audio_position"></p>
+ </body>
+ </html>
+
+## Tizen Quirks
+
+- Not supported on Tizen devices.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.alert.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.alert.md b/docs/en/3.1.0/cordova/notification/notification.alert.md
new file mode 100644
index 0000000..ccfd760
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.alert.md
@@ -0,0 +1,114 @@
+---
+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.
+---
+
+# notification.alert
+
+Shows a custom alert or dialog box.
+
+ navigator.notification.alert(message, alertCallback, [title], [buttonName])
+
+- __message__: Dialog message. _(String)_
+
+- __alertCallback__: Callback to invoke when alert dialog is dismissed. _(Function)_
+
+- __title__: Dialog title. _(String)_ (Optional, defaults to `Alert`)
+
+- __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`)
+
+## Description
+
+Most Cordova implementations use a native dialog box for this feature,
+but some platforms use the browser's `alert` function, which is
+typically less customizable.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Tizen
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ // Android / BlackBerry WebWorks (OS 5.0 and higher) / iOS / Tizen
+ //
+ function alertDismissed() {
+ // do something
+ }
+
+ navigator.notification.alert(
+ 'You are the winner!', // message
+ alertDismissed, // callback
+ 'Game Over', // title
+ 'Done' // buttonName
+ );
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Empty
+ }
+
+ // alert dialog dismissed
+ function alertDismissed() {
+ // do something
+ }
+
+ // Show a custom alertDismissed
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'You are the winner!', // message
+ alertDismissed, // callback
+ 'Game Over', // title
+ 'Done' // buttonName
+ );
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+ </body>
+ </html>
+
+## Windows Phone 7 and 8 Quirks
+
+- There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope:
+
+ window.alert = navigator.notification.alert;
+
+- Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously.
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.beep.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.beep.md b/docs/en/3.1.0/cordova/notification/notification.beep.md
new file mode 100644
index 0000000..19ebd2e
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.beep.md
@@ -0,0 +1,105 @@
+---
+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.
+---
+
+# notification.beep
+
+The device plays a beep sound.
+
+ navigator.notification.beep(times);
+
+- __times__: The number of times to repeat the beep. _(Number)_
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Tizen
+- Windows Phone 7 and 8
+
+## Quick Example
+
+ // Beep twice!
+ navigator.notification.beep(2);
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Empty
+ }
+
+ // Show a custom alert
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'You are the winner!', // message
+ 'Game Over', // title
+ 'Done' // buttonName
+ );
+ }
+
+ // Beep three times
+ //
+ function playBeep() {
+ navigator.notification.beep(3);
+ }
+
+ // Vibrate for 2 seconds
+ //
+ function vibrate() {
+ navigator.notification.vibrate(2000);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+ <p><a href="#" onclick="playBeep(); return false;">Play Beep</a></p>
+ <p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>
+ </body>
+ </html>
+
+## Android Quirks
+
+- Android plays the default __Notification ringtone__ specified under the __Settings/Sound & Display__ panel.
+
+## Windows Phone 7 and 8 Quirks
+
+- Relies on a generic beep file from the Cordova distribution.
+
+## Tizen Quirks
+
+- Tizen implements beeps by playing an audio file via the media API.
+
+- The beep file must be short, must be located in a `sounds` subdirectory of the application's root directory, and must be named `beep.wav`.
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.confirm.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.confirm.md b/docs/en/3.1.0/cordova/notification/notification.confirm.md
new file mode 100755
index 0000000..86874f6
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.confirm.md
@@ -0,0 +1,125 @@
+---
+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.
+---
+
+# notification.confirm
+
+Displays a customizable confirmation dialog box.
+
+ navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
+
+- __message__: Dialog message. _(String)_
+
+- __confirmCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_
+
+- __title__: Dialog title. _(String)_ (Optional, defaults to `Confirm`)
+
+- __buttonLabels__: Array of strings specifying button labels. _(Array)_ (Optional, defaults to [`OK,Cancel`])
+
+## Description
+
+The `notification.confirm` method displays a native dialog box that is
+more customizable than the browser's `confirm` function.
+
+## confirmCallback
+
+The `confirmCallback` executes when the user presses one of the
+buttons in the confirmation dialog box.
+
+The callback takes the argument `buttonIndex` _(Number)_, which is the
+index of the pressed button. Note that the index uses one-based
+indexing, so the value is `1`, `2`, `3`, etc.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Tizen
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ // process the confirmation dialog result
+ function onConfirm(buttonIndex) {
+ alert('You selected button ' + buttonIndex);
+ }
+
+ // Show a custom confirmation dialog
+ //
+ function showConfirm() {
+ navigator.notification.confirm(
+ 'You are the winner!', // message
+ onConfirm, // callback to invoke with index of button pressed
+ 'Game Over', // title
+ ['Restart','Exit'] // buttonLabels
+ );
+ }
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Empty
+ }
+
+ // process the confirmation dialog result
+ function onConfirm(buttonIndex) {
+ alert('You selected button ' + buttonIndex);
+ }
+
+ // Show a custom confirmation dialog
+ //
+ function showConfirm() {
+ navigator.notification.confirm(
+ 'You are the winner!', // message
+ onConfirm, // callback to invoke with index of button pressed
+ 'Game Over', // title
+ ['Restart','Exit'] // buttonLabels
+ );
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showConfirm(); return false;">Show Confirm</a></p>
+ </body>
+ </html>
+
+## Windows Phone 7 and 8 Quirks
+
+- There is no built-in browser function for `window.confirm`, but you can bind it by assigning:
+
+ window.confirm = navigator.notification.confirm;
+
+- Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously.
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.md b/docs/en/3.1.0/cordova/notification/notification.md
new file mode 100644
index 0000000..4380d9e
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.md
@@ -0,0 +1,76 @@
+---
+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.
+---
+
+# Notification
+
+> Visual, audible, and tactile device notifications.
+
+## Methods
+
+- `notification.alert`
+- `notification.confirm`
+- `notification.prompt`
+- `notification.beep`
+- `notification.vibrate`
+
+## Accessing the Feature
+
+As of version 3.0, Cordova implements device-level APIs as _plugins_.
+Use the CLI's `plugin` command, described in The Command-line
+Interface, to add or remove this feature for a project:
+
+ $ cordova plugin add org.apache.cordova.dialogs
+ $ cordova plugin add org.apache.cordova.vibration
+ $ cordova plugin ls
+ [ 'org.apache.cordova.dialogs',
+ 'org.apache.cordova.vibration' ]
+ $ cordova plugin rm org.apache.cordova.dialogs
+ $ cordova plugin rm org.apache.cordova.vibration
+
+These commands apply to all targeted platforms, but modify the
+platform-specific configuration settings described below:
+
+* Android
+
+ (in app/res/xml/config.xml)
+ <feature name="Notification">
+ <param name="android-package" value="org.apache.cordova.Notification" />
+ </feature>
+
+ (in app/AndroidManifest.xml)
+ <uses-permission android:name="android.permission.VIBRATE" />
+
+* BlackBerry WebWorks
+
+ (in www/plugins.xml)
+ <feature name="Notification">
+ <param name="blackberry-package" value="org.apache.cordova.notification.Notification" />
+ </feature>
+
+ (in www/config.xml)
+ <feature id="blackberry.ui.dialog" />
+
+* iOS (in `config.xml`)
+
+ <feature name="Notification">
+ <param name="ios-package" value="CDVNotification" />
+ </feature>
+
+Some platforms may support this feature without requiring any special
+configuration. See _Platform Support_ in the Overview section.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.prompt.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.prompt.md b/docs/en/3.1.0/cordova/notification/notification.prompt.md
new file mode 100644
index 0000000..e80911d
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.prompt.md
@@ -0,0 +1,123 @@
+---
+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.
+---
+
+# notification.prompt
+
+Shows a customizable prompt dialog box.
+
+ navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
+
+- __message__: Dialog message. _(String)_
+
+- __promptCallback__: Callback to invoke when a button is pressed. _(Function)_
+
+- __title__: Dialog title _(String)_ (Optional, defaults to `Prompt`)
+
+- __buttonLabels__: Array of strings specifying button labels _(Array)_ (Optional, defaults to `["OK","Cancel"]`)
+
+- __defaultText__: Default textbox input value (`String`) (Optional, Default: empty string)
+
+## Description
+
+The `notification.prompt` method displays a native dialog box that is
+more customizable than the browser's `prompt` function.
+
+## promptCallback
+
+The `promptCallback` executes when the user presses one of the buttons
+in the prompt dialog box. The `results` object passed to the callback
+contains the following properties:
+
+- __buttonIndex__: The index of the pressed button. _(Number)_ Note that the index uses one-based indexing, so the value is `1`, `2`, `3`, etc.
+
+- __input1__: The text entered in the prompt dialog box. _(String)_
+
+## Supported Platforms
+
+- Android
+- iOS
+
+## Quick Example
+
+ // process the promp dialog results
+ function onPrompt(results) {
+ alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
+ }
+
+ // Show a custom prompt dialog
+ //
+ function showPrompt() {
+ navigator.notification.prompt(
+ 'Please enter your name', // message
+ onPrompt, // callback to invoke
+ 'Registration', // title
+ ['Ok','Exit'], // buttonLabels
+ 'Jane Doe' // defaultText
+ );
+ }
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification Prompt Dialog Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Empty
+ }
+
+ // process the promptation dialog result
+ function onPrompt(results) {
+ alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
+ }
+
+ // Show a custom prompt dialog
+ //
+ function showPrompt() {
+ navigator.notification.prompt(
+ 'Please enter your name', // message
+ onPrompt, // callback to invoke
+ 'Registration', // title
+ ['Ok','Exit'], // buttonLabels
+ 'Jane Doe' // defaultText
+ );
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showPrompt(); return false;">Show Prompt</a></p>
+ </body>
+ </html>
+
+## Android Quirks
+
+- Android supports a maximum of three buttons, and ignores any more than that.
+
+- On Android 3.0 and later, buttons are displayed in reverse order for devices that use the Holo theme.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/notification/notification.vibrate.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/notification/notification.vibrate.md b/docs/en/3.1.0/cordova/notification/notification.vibrate.md
new file mode 100644
index 0000000..f3eb8d7
--- /dev/null
+++ b/docs/en/3.1.0/cordova/notification/notification.vibrate.md
@@ -0,0 +1,103 @@
+---
+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.
+---
+
+# notification.vibrate
+
+Vibrates the device for the specified amount of time.
+
+ navigator.notification.vibrate(milliseconds)
+
+- __time__: Milliseconds to vibrate the device, where 1000 milliseconds equals 1 second. _(Number)_
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iOS
+- Windows Phone 7 and 8
+
+## Quick Example
+
+ // Vibrate for 2.5 seconds
+ //
+ navigator.notification.vibrate(2500);
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Notification Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ // Empty
+ }
+
+ // Show a custom alert
+ //
+ function showAlert() {
+ navigator.notification.alert(
+ 'You are the winner!', // message
+ 'Game Over', // title
+ 'Done' // buttonName
+ );
+ }
+
+ // Beep three times
+ //
+ function playBeep() {
+ navigator.notification.beep(3);
+ }
+
+ // Vibrate for 2 seconds
+ //
+ function vibrate() {
+ navigator.notification.vibrate(2000);
+ }
+
+ </script>
+ </head>
+ <body>
+ <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+ <p><a href="#" onclick="playBeep(); return false;">Play Beep</a></p>
+ <p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>
+ </body>
+ </html>
+
+## iOS Quirks
+
+- __time__: Ignores the specified time and vibrates for a pre-set amount of time.
+
+ navigator.notification.vibrate();
+ navigator.notification.vibrate(2500); // 2500 is ignored
+
+## BB10 Quirks
+
+vibrate function owned by navigator object
+
+ navigator.vibrate(1000); // vibrate for 1 second
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/splashscreen/splashscreen.hide.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/splashscreen/splashscreen.hide.md b/docs/en/3.1.0/cordova/splashscreen/splashscreen.hide.md
new file mode 100644
index 0000000..14f9d0b
--- /dev/null
+++ b/docs/en/3.1.0/cordova/splashscreen/splashscreen.hide.md
@@ -0,0 +1,77 @@
+---
+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.
+---
+
+# splashscreen.hide
+
+Dismiss the splash screen.
+
+ navigator.splashscreen.hide();
+
+## Description
+
+This method dismisses the application's splash screen.
+
+## Supported Platforms
+
+- Android
+- BlackBerry 10
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ navigator.splashscreen.hide();
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Splashscreen Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ navigator.splashscreen.hide();
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ </body>
+ </html>
+
+## iOS Quirk
+
+The `config.xml` file's `AutoHideSplashScreen` setting must be
+`false`. To delay hiding the splash screen for two seconds, add a
+timer such as the following in the `deviceready` event handler:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/splashscreen/splashscreen.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/splashscreen/splashscreen.md b/docs/en/3.1.0/cordova/splashscreen/splashscreen.md
new file mode 100644
index 0000000..7146a66
--- /dev/null
+++ b/docs/en/3.1.0/cordova/splashscreen/splashscreen.md
@@ -0,0 +1,101 @@
+---
+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.
+---
+
+# Splashscreen
+
+> Displays and hides the application's splash screen.
+
+## Methods
+
+- splashscreen.show
+- splashscreen.hide
+
+## Accessing the Feature
+
+As of version 3.0, Cordova implements device-level APIs as _plugins_.
+Use the CLI's `plugin` command, described in The Command-line
+Interface, to add or remove this feature for a project:
+
+ $ cordova plugin add org.apache.cordova.splashscreen
+ $ cordova plugin ls
+ [ 'org.apache.cordova.splashscreen' ]
+ $ cordova plugin rm org.apache.cordova.splashscreen
+
+These commands apply to all targeted platforms, but modify the
+platform-specific configuration settings described below:
+
+* Android (in `app/res/xml/config.xml`)
+
+ <feature name="SplashScreen">
+ <param name="android-package" value="org.apache.cordova.SplashScreen" />
+ </feature>
+
+* iOS (in `config.xml`)
+
+ <feature name="SplashScreen">
+ <param name="ios-package" value="CDVSplashScreen" />
+ </feature>
+
+Some platforms may support this feature without requiring any special
+configuration. See _Platform Support_ in the Overview section.
+
+## Setup
+
+### Android
+
+1. Copy the splash screen image into the Android project's `res/drawable` directory. The size for each image should be:
+
+ - xlarge (xhdpi): at least 960 × 720
+ - large (hdpi): at least 640 × 480
+ - medium (mdpi): at least 470 × 320
+ - small (ldpi): at least 426 × 320
+
+ You should use a [9-patch image](https://developer.android.com/tools/help/draw9patch.html) for your splash screen.
+
+2. In config.xml, add the following preferences:
+
+ <preference name="splashscreen", "splash" />
+ <preference name="splashScreenDelay", 10000 />
+
+ The first line sets the image to display as the splash screen. If you name your image anything other than `splash.png`, you need to modify this line.
+ The second line sets the delay of how long the splashscreen appears in milliseconds. To dismiss the splash screen once the app receives the `deviceready` event, call the `navigator.splashscreen.hide()` method.
+
+### iOS
+
+Copy your splash screen images into the iOS project's
+`Resources/splash` directory. Only add the images for the devices you
+want to support, such as iPad or iPhone. The size of each image
+should be:
+
+- Default-568h@2x~iphone.png (640x1136 pixels)
+- Default-Landscape@2x~ipad.png (2048x1496 pixels)
+- Default-Landscape~ipad.png (1024x748 pixels)
+- Default-Portrait@2x~ipad.png (1536x2008 pixels)
+- Default-Portrait~ipad.png (768x1004 pixels)
+- Default@2x~iphone.png (640x960 pixels)
+- Default~iphone.png (320x480 pixels)
+
+### BlackBerry 10
+
+Copy your splash screen images into the project's
+'res/screen/blackberry10' directory. The file names should be:
+
+- splash-1280x768.png (1280x768 pixels)
+- splash-720x720.png (720x720 pixels)
+- splash-768x1280.png (768x1280 pixels)
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/splashscreen/splashscreen.show.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/splashscreen/splashscreen.show.md b/docs/en/3.1.0/cordova/splashscreen/splashscreen.show.md
new file mode 100644
index 0000000..b204f3e
--- /dev/null
+++ b/docs/en/3.1.0/cordova/splashscreen/splashscreen.show.md
@@ -0,0 +1,66 @@
+---
+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.
+---
+
+# splashscreen.show
+
+Displays the splash screen.
+
+ navigator.splashscreen.show();
+
+## Description
+
+This method displays the application's splash screen.
+
+## Supported Platforms
+
+- Android
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+
+## Quick Example
+
+ navigator.splashscreen.show();
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Splashscreen Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ navigator.splashscreen.show();
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/storage/database/database.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/storage/database/database.md b/docs/en/3.1.0/cordova/storage/database/database.md
new file mode 100644
index 0000000..c32adab
--- /dev/null
+++ b/docs/en/3.1.0/cordova/storage/database/database.md
@@ -0,0 +1,114 @@
+---
+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.
+---
+
+# Database
+
+Provides access to an SQL database.
+
+## Methods
+
+- __transaction__: Runs a database transaction.
+
+- __changeVersion__: Allows scripts to automatically verify the version number and change it when updating a schema.
+
+## Details
+
+The `window.openDatabase()` method returns a `Database` object.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iOS
+- Tizen
+
+## Transaction Quick Example
+
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ function errorCB(err) {
+ alert("Error processing SQL: "+err.code);
+ }
+
+ function successCB() {
+ alert("success!");
+ }
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+
+## Change Version Quick Example
+
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.changeVersion("1.0", "1.1");
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Storage Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ var db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
+ db.transaction(populateDB, errorCB, successCB);
+ }
+
+ // Populate the database
+ //
+ function populateDB(tx) {
+ tx.executeSql('DROP TABLE IF EXISTS DEMO');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+ tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+ }
+
+ // Transaction error callback
+ //
+ function errorCB(tx, err) {
+ alert("Error processing SQL: "+err);
+ }
+
+ // Transaction success callback
+ //
+ function successCB() {
+ alert("success!");
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ <p>Database</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/storage/localstorage/localstorage.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/storage/localstorage/localstorage.md b/docs/en/3.1.0/cordova/storage/localstorage/localstorage.md
new file mode 100644
index 0000000..82e3803
--- /dev/null
+++ b/docs/en/3.1.0/cordova/storage/localstorage/localstorage.md
@@ -0,0 +1,119 @@
+---
+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.
+---
+
+# localStorage
+
+Provides access to the W3C's
+[Web Storage interface](http://dev.w3.org/html5/webstorage/#the-localstorage-attribute)
+
+ var permanentStorage = window.localStorage;
+ var tempStorage = window.sessionStorage;
+
+## Methods
+
+- __key__: Returns the name of the key at the specified position.
+
+- __getItem__: Returns the item identified by the specified key.
+
+- __setItem__: Assigns a keyed item's value.
+
+- __removeItem__: Removes the item identified by the specified key.
+
+- __clear__: Removes all of the key/value pairs.
+
+## Details
+
+The `window.localStorage` interface implements the W3C's [Web Storage
+interface](http://dev.w3.org/html5/webstorage/). An app can use it to
+save persistent data using key-value pairs. The
+`window.sessionStorage` interface works the same way in every respect,
+except that all data is cleared each time the app closes. Each
+database provides a separate namespace.
+
+## Supported Platforms
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iOS
+- Tizen
+- Windows Phone 7 and 8
+
+## Key Quick Example
+
+ var keyName = window.localStorage.key(0);
+
+## Set Item Quick Example
+
+ window.localStorage.setItem("key", "value");
+
+## Get Item Quick Example
+
+ var value = window.localStorage.getItem("key");
+ // value is now equal to "value"
+
+## Remove Item Quick Example
+
+ window.localStorage.removeItem("key");
+
+## Clear Quick Example
+
+ window.localStorage.clear();
+
+## Full Example
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Storage Example</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Wait for device API libraries to load
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // device APIs are available
+ //
+ function onDeviceReady() {
+ window.localStorage.setItem("key", "value");
+ var keyname = window.localStorage.key(i);
+ // keyname is now equal to "key"
+ var value = window.localStorage.getItem("key");
+ // value is now equal to "value"
+ window.localStorage.removeItem("key");
+ window.localStorage.setItem("key2", "value2");
+ window.localStorage.clear();
+ // localStorage is now empty
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ <p>localStorage</p>
+ </body>
+ </html>
+
+## Windows Phone 7 Quirks
+
+Dot notation is _not_ available on Windows Phone 7. Be sure to use
+`setItem` or `getItem`, rather than accessing keys directly from the
+storage object, such as `window.localStorage.someKey`.
+
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/storage/parameters/display_name.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/storage/parameters/display_name.md b/docs/en/3.1.0/cordova/storage/parameters/display_name.md
new file mode 100644
index 0000000..7ea80ff
--- /dev/null
+++ b/docs/en/3.1.0/cordova/storage/parameters/display_name.md
@@ -0,0 +1,22 @@
+---
+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.
+---
+
+# database_displayname
+
+The display name of the database.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/4b231e9b/docs/en/3.1.0/cordova/storage/parameters/name.md
----------------------------------------------------------------------
diff --git a/docs/en/3.1.0/cordova/storage/parameters/name.md b/docs/en/3.1.0/cordova/storage/parameters/name.md
new file mode 100644
index 0000000..0e90c24
--- /dev/null
+++ b/docs/en/3.1.0/cordova/storage/parameters/name.md
@@ -0,0 +1,22 @@
+---
+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.
+---
+
+# database_name
+
+The name of the database.