cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1745411 [11/26] - in /cordova/site/public: ./ announcements/2016/04/27/ blog/ docs/de/3.1.0/cordova/contacts/ContactField/ docs/de/3.1.0/cordova/media/ docs/de/3.1.0/cordova/notification/ docs/en/1.5.0/phonegap/contacts/ContactField/ docs/...
Date Tue, 24 May 2016 23:29:27 GMT
Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-dialogs/index.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-dialogs/index.html?rev=1745411&r1=1745410&r2=1745411&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/reference/cordova-plugin-dialogs/index.html (original)
+++ cordova/site/public/docs/en/dev/reference/cordova-plugin-dialogs/index.html Tue May 24 23:29:23 2016
@@ -6,12 +6,12 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <meta name="format-detection" content="telephone=no">
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
-    <meta name="description" content="Use native dialog UI elements ">
+    <meta name="description" content=" ">
 
     <title>
         
             
-                Dialogs - Apache Cordova
+                cordova-plugin-dialogs - Apache Cordova
             
         
     </title>
@@ -732,7 +732,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-                Battery Status
+                cordova-plugin-battery-status
             </a>
             
         
@@ -747,7 +747,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-camera/index.html">
-                Camera
+                cordova-plugin-camera
             </a>
             
         
@@ -762,7 +762,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-console/index.html">
-                Console
+                cordova-plugin-console
             </a>
             
         
@@ -777,7 +777,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-                Contacts
+                cordova-plugin-contacts
             </a>
             
         
@@ -792,7 +792,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device/index.html">
-                Device
+                cordova-plugin-device
             </a>
             
         
@@ -807,7 +807,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-                Device Motion
+                cordova-plugin-device-motion
             </a>
             
         
@@ -822,7 +822,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-                Device Orientation
+                cordova-plugin-device-orientation
             </a>
             
         
@@ -837,7 +837,7 @@
     <li>
         
             <a class="this-page" href="../../reference/cordova-plugin-dialogs/index.html">
-                Dialogs
+                cordova-plugin-dialogs
             </a>
             
                 <span class="entry-highlight"></span>
@@ -854,7 +854,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file/index.html">
-                File
+                cordova-plugin-file
             </a>
             
         
@@ -869,7 +869,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-                File Transfer
+                cordova-plugin-file-transfer
             </a>
             
         
@@ -884,7 +884,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-                Geolocation
+                cordova-plugin-geolocation
             </a>
             
         
@@ -899,7 +899,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-                Globalization
+                cordova-plugin-globalization
             </a>
             
         
@@ -914,7 +914,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-                Inappbrowser
+                cordova-plugin-inappbrowser
             </a>
             
         
@@ -929,7 +929,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media/index.html">
-                Media
+                cordova-plugin-media
             </a>
             
         
@@ -944,7 +944,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-                Media Capture
+                cordova-plugin-media-capture
             </a>
             
         
@@ -959,7 +959,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-                Network Information
+                cordova-plugin-network-information
             </a>
             
         
@@ -974,7 +974,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-                Splashscreen
+                cordova-plugin-splashscreen
             </a>
             
         
@@ -989,7 +989,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-                Vibration
+                cordova-plugin-vibration
             </a>
             
         
@@ -1004,7 +1004,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-                Statusbar
+                cordova-plugin-statusbar
             </a>
             
         
@@ -1019,7 +1019,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-                Whitelist
+                cordova-plugin-whitelist
             </a>
             
         
@@ -1034,7 +1034,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-                Legacy Whitelist
+                cordova-plugin-legacy-whitelist
             </a>
             
         
@@ -1388,7 +1388,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-        Battery Status
+        cordova-plugin-battery-status
     </a>
 </li>
 
@@ -1397,7 +1397,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-camera/index.html">
-        Camera
+        cordova-plugin-camera
     </a>
 </li>
 
@@ -1406,7 +1406,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-console/index.html">
-        Console
+        cordova-plugin-console
     </a>
 </li>
 
@@ -1415,7 +1415,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-        Contacts
+        cordova-plugin-contacts
     </a>
 </li>
 
@@ -1424,7 +1424,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device/index.html">
-        Device
+        cordova-plugin-device
     </a>
 </li>
 
@@ -1433,7 +1433,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-        Device Motion
+        cordova-plugin-device-motion
     </a>
 </li>
 
@@ -1442,7 +1442,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-        Device Orientation
+        cordova-plugin-device-orientation
     </a>
 </li>
 
@@ -1451,7 +1451,7 @@
 
 <li>
     <a class="this-page" href="../../reference/cordova-plugin-dialogs/index.html">
-        Dialogs
+        cordova-plugin-dialogs
     </a>
 </li>
 
@@ -1460,7 +1460,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file/index.html">
-        File
+        cordova-plugin-file
     </a>
 </li>
 
@@ -1469,7 +1469,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file-transfer/index.html">
-        File Transfer
+        cordova-plugin-file-transfer
     </a>
 </li>
 
@@ -1478,7 +1478,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-        Geolocation
+        cordova-plugin-geolocation
     </a>
 </li>
 
@@ -1487,7 +1487,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-        Globalization
+        cordova-plugin-globalization
     </a>
 </li>
 
@@ -1496,7 +1496,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-        Inappbrowser
+        cordova-plugin-inappbrowser
     </a>
 </li>
 
@@ -1505,7 +1505,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media/index.html">
-        Media
+        cordova-plugin-media
     </a>
 </li>
 
@@ -1514,7 +1514,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-        Media Capture
+        cordova-plugin-media-capture
     </a>
 </li>
 
@@ -1523,7 +1523,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-        Network Information
+        cordova-plugin-network-information
     </a>
 </li>
 
@@ -1532,7 +1532,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-        Splashscreen
+        cordova-plugin-splashscreen
     </a>
 </li>
 
@@ -1541,7 +1541,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-        Vibration
+        cordova-plugin-vibration
     </a>
 </li>
 
@@ -1550,7 +1550,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-        Statusbar
+        cordova-plugin-statusbar
     </a>
 </li>
 
@@ -1559,7 +1559,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-        Whitelist
+        cordova-plugin-whitelist
     </a>
 </li>
 
@@ -1568,7 +1568,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-        Legacy Whitelist
+        cordova-plugin-legacy-whitelist
     </a>
 </li>
 
@@ -2747,7 +2747,6 @@ navigator.notification.alert(
 <li>Amazon Fire OS</li>
 <li>Android</li>
 <li>BlackBerry 10</li>
-<li>Browser</li>
 <li>Firefox OS</li>
 <li>iOS</li>
 <li>Tizen</li>
@@ -2812,7 +2811,6 @@ navigator.notification.confirm(
 <li>Amazon Fire OS</li>
 <li>Android</li>
 <li>BlackBerry 10</li>
-<li>Browser</li>
 <li>Firefox OS</li>
 <li>iOS</li>
 <li>Tizen</li>
@@ -2883,7 +2881,6 @@ navigator.notification.prompt(
 <ul>
 <li>Amazon Fire OS</li>
 <li>Android</li>
-<li>Browser</li>
 <li>Firefox OS</li>
 <li>iOS</li>
 <li>Windows Phone 7 and 8</li>
@@ -2927,7 +2924,6 @@ navigator.notification.beep(2);
 <li>Amazon Fire OS</li>
 <li>Android</li>
 <li>BlackBerry 10</li>
-<li>Browser</li>
 <li>iOS</li>
 <li>Tizen</li>
 <li>Windows Phone 7 and 8</li>

Modified: cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html
URL: http://svn.apache.org/viewvc/cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html?rev=1745411&r1=1745410&r2=1745411&view=diff
==============================================================================
--- cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html (original)
+++ cordova/site/public/docs/en/dev/reference/cordova-plugin-file-transfer/index.html Tue May 24 23:29:23 2016
@@ -6,12 +6,12 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <meta name="format-detection" content="telephone=no">
     <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
-    <meta name="description" content="Upload and download files. ">
+    <meta name="description" content=" ">
 
     <title>
         
             
-                File Transfer - Apache Cordova
+                cordova-plugin-file-transfer - Apache Cordova
             
         
     </title>
@@ -732,7 +732,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-                Battery Status
+                cordova-plugin-battery-status
             </a>
             
         
@@ -747,7 +747,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-camera/index.html">
-                Camera
+                cordova-plugin-camera
             </a>
             
         
@@ -762,7 +762,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-console/index.html">
-                Console
+                cordova-plugin-console
             </a>
             
         
@@ -777,7 +777,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-                Contacts
+                cordova-plugin-contacts
             </a>
             
         
@@ -792,7 +792,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device/index.html">
-                Device
+                cordova-plugin-device
             </a>
             
         
@@ -807,7 +807,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-                Device Motion
+                cordova-plugin-device-motion
             </a>
             
         
@@ -822,7 +822,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-                Device Orientation
+                cordova-plugin-device-orientation
             </a>
             
         
@@ -837,7 +837,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-                Dialogs
+                cordova-plugin-dialogs
             </a>
             
         
@@ -852,7 +852,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-file/index.html">
-                File
+                cordova-plugin-file
             </a>
             
         
@@ -867,7 +867,7 @@
     <li>
         
             <a class="this-page" href="../../reference/cordova-plugin-file-transfer/index.html">
-                File Transfer
+                cordova-plugin-file-transfer
             </a>
             
                 <span class="entry-highlight"></span>
@@ -884,7 +884,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-                Geolocation
+                cordova-plugin-geolocation
             </a>
             
         
@@ -899,7 +899,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-                Globalization
+                cordova-plugin-globalization
             </a>
             
         
@@ -914,7 +914,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-                Inappbrowser
+                cordova-plugin-inappbrowser
             </a>
             
         
@@ -929,7 +929,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media/index.html">
-                Media
+                cordova-plugin-media
             </a>
             
         
@@ -944,7 +944,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-                Media Capture
+                cordova-plugin-media-capture
             </a>
             
         
@@ -959,7 +959,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-                Network Information
+                cordova-plugin-network-information
             </a>
             
         
@@ -974,7 +974,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-                Splashscreen
+                cordova-plugin-splashscreen
             </a>
             
         
@@ -989,7 +989,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-                Vibration
+                cordova-plugin-vibration
             </a>
             
         
@@ -1004,7 +1004,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-                Statusbar
+                cordova-plugin-statusbar
             </a>
             
         
@@ -1019,7 +1019,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-                Whitelist
+                cordova-plugin-whitelist
             </a>
             
         
@@ -1034,7 +1034,7 @@
     <li>
         
             <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-                Legacy Whitelist
+                cordova-plugin-legacy-whitelist
             </a>
             
         
@@ -1388,7 +1388,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-battery-status/index.html">
-        Battery Status
+        cordova-plugin-battery-status
     </a>
 </li>
 
@@ -1397,7 +1397,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-camera/index.html">
-        Camera
+        cordova-plugin-camera
     </a>
 </li>
 
@@ -1406,7 +1406,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-console/index.html">
-        Console
+        cordova-plugin-console
     </a>
 </li>
 
@@ -1415,7 +1415,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-contacts/index.html">
-        Contacts
+        cordova-plugin-contacts
     </a>
 </li>
 
@@ -1424,7 +1424,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device/index.html">
-        Device
+        cordova-plugin-device
     </a>
 </li>
 
@@ -1433,7 +1433,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-motion/index.html">
-        Device Motion
+        cordova-plugin-device-motion
     </a>
 </li>
 
@@ -1442,7 +1442,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-device-orientation/index.html">
-        Device Orientation
+        cordova-plugin-device-orientation
     </a>
 </li>
 
@@ -1451,7 +1451,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-dialogs/index.html">
-        Dialogs
+        cordova-plugin-dialogs
     </a>
 </li>
 
@@ -1460,7 +1460,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-file/index.html">
-        File
+        cordova-plugin-file
     </a>
 </li>
 
@@ -1469,7 +1469,7 @@
 
 <li>
     <a class="this-page" href="../../reference/cordova-plugin-file-transfer/index.html">
-        File Transfer
+        cordova-plugin-file-transfer
     </a>
 </li>
 
@@ -1478,7 +1478,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-geolocation/index.html">
-        Geolocation
+        cordova-plugin-geolocation
     </a>
 </li>
 
@@ -1487,7 +1487,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-globalization/index.html">
-        Globalization
+        cordova-plugin-globalization
     </a>
 </li>
 
@@ -1496,7 +1496,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-inappbrowser/index.html">
-        Inappbrowser
+        cordova-plugin-inappbrowser
     </a>
 </li>
 
@@ -1505,7 +1505,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media/index.html">
-        Media
+        cordova-plugin-media
     </a>
 </li>
 
@@ -1514,7 +1514,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-media-capture/index.html">
-        Media Capture
+        cordova-plugin-media-capture
     </a>
 </li>
 
@@ -1523,7 +1523,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-network-information/index.html">
-        Network Information
+        cordova-plugin-network-information
     </a>
 </li>
 
@@ -1532,7 +1532,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-splashscreen/index.html">
-        Splashscreen
+        cordova-plugin-splashscreen
     </a>
 </li>
 
@@ -1541,7 +1541,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-vibration/index.html">
-        Vibration
+        cordova-plugin-vibration
     </a>
 </li>
 
@@ -1550,7 +1550,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-statusbar/index.html">
-        Statusbar
+        cordova-plugin-statusbar
     </a>
 </li>
 
@@ -1559,7 +1559,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-whitelist/index.html">
-        Whitelist
+        cordova-plugin-whitelist
     </a>
 </li>
 
@@ -1568,7 +1568,7 @@
 
 <li>
     <a class="" href="../../reference/cordova-plugin-legacy-whitelist/index.html">
-        Legacy Whitelist
+        cordova-plugin-legacy-whitelist
     </a>
 </li>
 
@@ -2695,15 +2695,15 @@
 <p>This plugin allows you to upload and download files.</p>
 
 <p>This plugin defines global <code>FileTransfer</code>, <code>FileUploadOptions</code> constructors. Although in the global scope, they are not available until after the <code>deviceready</code> event.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s2">"deviceready"</span><span class="p">,</span> <span class="nx">onDeviceReady</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
-<span class="kd">function</span> <span class="nx">onDeviceReady</span><span class="p">()</span> <span class="p">{</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">FileTransfer</span><span class="p">);</span>
-<span class="p">}</span>
+<div class="highlight"><pre><code class="language-" data-lang="">document.addEventListener("deviceready", onDeviceReady, false);
+function onDeviceReady() {
+    console.log(FileTransfer);
+}
 </code></pre></div>
 <p>Report issues with this plugin on the <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20File%20Transfer%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC">Apache Cordova issue tracker</a></p>
 
 <h2>Installation</h2>
-<div class="highlight"><pre><code class="language-bash" data-lang="bash">cordova plugin add cordova-plugin-file-transfer
+<div class="highlight"><pre><code class="language-" data-lang="">cordova plugin add cordova-plugin-file-transfer
 </code></pre></div>
 <h2>Supported Platforms</h2>
 
@@ -2765,68 +2765,68 @@ multi-part POST or PUT request, and to d
 </ul>
 
 <h3>Example</h3>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// !! Assumes variable fileURL contains a valid URL to a text file on the device,</span>
-<span class="c1">//    for example, cdvfile://localhost/persistent/path/to/file.txt</span>
+<div class="highlight"><pre><code class="language-" data-lang="">// !! Assumes variable fileURL contains a valid URL to a text file on the device,
+//    for example, cdvfile://localhost/persistent/path/to/file.txt
 
-<span class="kd">var</span> <span class="nx">win</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Code = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">responseCode</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Response = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">response</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Sent = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">bytesSent</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">var</span> <span class="nx">fail</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">alert</span><span class="p">(</span><span class="s2">"An error has occurred: Code = "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileUploadOptions</span><span class="p">();</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileKey</span> <span class="o">=</span> <span class="s2">"file"</span><span class="p">;</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileName</span> <span class="o">=</span> <span class="nx">fileURL</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">'/'</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">mimeType</span> <span class="o">=</span> <span class="s2">"text/plain"</span><span class="p">;</span>
-
-<span class="kd">var</span> <span class="nx">params</span> <span class="o">=</span> <span class="p">{};</span>
-<span class="nx">params</span><span class="p">.</span><span class="nx">value1</span> <span class="o">=</span> <span class="s2">"test"</span><span class="p">;</span>
-<span class="nx">params</span><span class="p">.</span><span class="nx">value2</span> <span class="o">=</span> <span class="s2">"param"</span><span class="p">;</span>
+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 = fileURL.substr(fileURL.lastIndexOf('/') + 1);
+options.mimeType = "text/plain";
+
+var params = {};
+params.value1 = "test";
+params.value2 = "param";
 
-<span class="nx">options</span><span class="p">.</span><span class="nx">params</span> <span class="o">=</span> <span class="nx">params</span><span class="p">;</span>
+options.params = params;
 
-<span class="kd">var</span> <span class="nx">ft</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-<span class="nx">ft</span><span class="p">.</span><span class="nx">upload</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">,</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="s2">"http://some.server.com/upload.php"</span><span class="p">),</span> <span class="nx">win</span><span class="p">,</span> <span class="nx">fail</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
+var ft = new FileTransfer();
+ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
 </code></pre></div>
 <h3>Example with Upload Headers and Progress Events (Android and iOS only)</h3>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">win</span><span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Code = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">responseCode</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Response = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">response</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Sent = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">bytesSent</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">function</span> <span class="nx">fail</span><span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">alert</span><span class="p">(</span><span class="s2">"An error has occurred: Code = "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">var</span> <span class="nx">uri</span> <span class="o">=</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="s2">"http://some.server.com/upload.php"</span><span class="p">);</span>
-
-<span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileUploadOptions</span><span class="p">();</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileKey</span><span class="o">=</span><span class="s2">"file"</span><span class="p">;</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileName</span><span class="o">=</span><span class="nx">fileURL</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">'/'</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">);</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">mimeType</span><span class="o">=</span><span class="s2">"text/plain"</span><span class="p">;</span>
-
-<span class="kd">var</span> <span class="nx">headers</span><span class="o">=</span><span class="p">{</span><span class="s1">'headerParam'</span><span class="p">:</span><span class="s1">'headerValue'</span><span class="p">};</span>
-
-<span class="nx">options</span><span class="p">.</span><span class="nx">headers</span> <span class="o">=</span> <span class="nx">headers</span><span class="p">;</span>
-
-<span class="kd">var</span> <span class="nx">ft</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-<span class="nx">ft</span><span class="p">.</span><span class="nx">onprogress</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">progressEvent</span><span class="p">)</span> <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="nx">progressEvent</span><span class="p">.</span><span class="nx">lengthComputable</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">loadingStatus</span><span class="p">.</span><span class="nx">setPercentage</span><span class="p">(</span><span class="nx">progressEvent</span><span class="p">.</span><span class="nx">loaded</span> <span class="o">/</span> <span class="nx">progressEvent</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
-        <span class="nx">loadingStatus</span><span class="p">.</span><span class="nx">increment</span><span class="p">();</span>
-    <span class="p">}</span>
-<span class="p">};</span>
-<span class="nx">ft</span><span class="p">.</span><span class="nx">upload</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">,</span> <span class="nx">uri</span><span class="p">,</span> <span class="nx">win</span><span class="p">,</span> <span class="nx">fail</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
+<div class="highlight"><pre><code class="language-" data-lang="">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);
+}
+
+var uri = encodeURI("http://some.server.com/upload.php");
+
+var options = new FileUploadOptions();
+options.fileKey="file";
+options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
+options.mimeType="text/plain";
+
+var headers={'headerParam':'headerValue'};
+
+options.headers = headers;
+
+var ft = new FileTransfer();
+ft.onprogress = function(progressEvent) {
+    if (progressEvent.lengthComputable) {
+      loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
+    } else {
+      loadingStatus.increment();
+    }
+};
+ft.upload(fileURL, uri, win, fail, options);
 </code></pre></div>
 <h2>FileUploadResult</h2>
 
@@ -2858,12 +2858,6 @@ multi-part POST or PUT request, and to d
 <li><strong>withCredentials</strong>: <em>boolean</em> that tells the browser to set the withCredentials flag on the XMLHttpRequest</li>
 </ul>
 
-<h3>Windows Quirks</h3>
-
-<ul>
-<li>An option parameter with empty/null value is excluded in the upload operation due to the Windows API design.</li>
-</ul>
-
 <h2>download</h2>
 
 <p><strong>Parameters</strong>:</p>
@@ -2878,30 +2872,30 @@ multi-part POST or PUT request, and to d
 </ul>
 
 <h3>Example</h3>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// !! Assumes variable fileURL contains a valid URL to a path on the device,</span>
-<span class="c1">//    for example, cdvfile://localhost/persistent/path/to/downloads/</span>
+<div class="highlight"><pre><code class="language-" data-lang="">// !! Assumes variable fileURL contains a valid URL to a path on the device,
+//    for example, cdvfile://localhost/persistent/path/to/downloads/
 
-<span class="kd">var</span> <span class="nx">fileTransfer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-<span class="kd">var</span> <span class="nx">uri</span> <span class="o">=</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="s2">"http://some.server.com/download.php"</span><span class="p">);</span>
+var fileTransfer = new FileTransfer();
+var uri = encodeURI("http://some.server.com/download.php");
 
-<span class="nx">fileTransfer</span><span class="p">.</span><span class="nx">download</span><span class="p">(</span>
-    <span class="nx">uri</span><span class="p">,</span>
-    <span class="nx">fileURL</span><span class="p">,</span>
-    <span class="kd">function</span><span class="p">(</span><span class="nx">entry</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download complete: "</span> <span class="o">+</span> <span class="nx">entry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">());</span>
-    <span class="p">},</span>
-    <span class="kd">function</span><span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error code"</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-    <span class="p">},</span>
-    <span class="kc">false</span><span class="p">,</span>
-    <span class="p">{</span>
-        <span class="na">headers</span><span class="p">:</span> <span class="p">{</span>
-            <span class="s2">"Authorization"</span><span class="p">:</span> <span class="s2">"Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="</span>
-        <span class="p">}</span>
-    <span class="p">}</span>
-<span class="p">);</span>
+fileTransfer.download(
+    uri,
+    fileURL,
+    function(entry) {
+        console.log("download complete: " + entry.toURL());
+    },
+    function(error) {
+        console.log("download error source " + error.source);
+        console.log("download error target " + error.target);
+        console.log("upload error code" + error.code);
+    },
+    false,
+    {
+        headers: {
+            "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
+        }
+    }
+);
 </code></pre></div>
 <h3>WP8 Quirks</h3>
 
@@ -2920,28 +2914,28 @@ multi-part POST or PUT request, and to d
 <p>Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object which has an error code of <code>FileTransferError.ABORT_ERR</code>.</p>
 
 <h3>Example</h3>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="c1">// !! Assumes variable fileURL contains a valid URL to a text file on the device,</span>
-<span class="c1">//    for example, cdvfile://localhost/persistent/path/to/file.txt</span>
+<div class="highlight"><pre><code class="language-" data-lang="">// !! Assumes variable fileURL contains a valid URL to a text file on the device,
+//    for example, cdvfile://localhost/persistent/path/to/file.txt
 
-<span class="kd">var</span> <span class="nx">win</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Should not be called."</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">var</span> <span class="nx">fail</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-    <span class="c1">// error.code == FileTransferError.ABORT_ERR</span>
-    <span class="nx">alert</span><span class="p">(</span><span class="s2">"An error has occurred: Code = "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-<span class="p">}</span>
-
-<span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileUploadOptions</span><span class="p">();</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileKey</span><span class="o">=</span><span class="s2">"file"</span><span class="p">;</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">fileName</span><span class="o">=</span><span class="s2">"myphoto.jpg"</span><span class="p">;</span>
-<span class="nx">options</span><span class="p">.</span><span class="nx">mimeType</span><span class="o">=</span><span class="s2">"image/jpeg"</span><span class="p">;</span>
-
-<span class="kd">var</span> <span class="nx">ft</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-<span class="nx">ft</span><span class="p">.</span><span class="nx">upload</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">,</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="s2">"http://some.server.com/upload.php"</span><span class="p">),</span> <span class="nx">win</span><span class="p">,</span> <span class="nx">fail</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
-<span class="nx">ft</span><span class="p">.</span><span class="nx">abort</span><span class="p">();</span>
+var win = function(r) {
+    console.log("Should not be called.");
+}
+
+var fail = function(error) {
+    // error.code == FileTransferError.ABORT_ERR
+    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="myphoto.jpg";
+options.mimeType="image/jpeg";
+
+var ft = new FileTransfer();
+ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
+ft.abort();
 </code></pre></div>
 <h2>FileTransferError</h2>
 
@@ -2991,229 +2985,6 @@ multi-part POST or PUT request, and to d
 </code></pre></div>
 <p>which can be used in place of the absolute file path in both <code>download()</code> and <code>upload()</code> methods.</p>
 
-<h2>Sample: Download and Upload Files <a name="sample"></a></h2>
-
-<p>Use the File-Transfer plugin to upload and download files. In these examples, we demonstrate several tasks like:</p>
-
-<ul>
-<li><a href="#binaryFile">Downloading a binary file to the application cache</a></li>
-<li><a href="#uploadFile">Uploading a file created in your application&#39;s root</a></li>
-<li><a href="#downloadFile">Downloading the uploaded file</a></li>
-</ul>
-
-<h2>Download a Binary File to the application cache <a name="binaryFile"></a></h2>
-
-<p>Use the File plugin with the File-Transfer plugin to provide a target for the files that you download (the target must be a FileEntry object). Before you download the file, create a DirectoryEntry object by using <code>resolveLocalFileSystemURL</code> and calling <code>fs.root</code> in the success callback. Use the <code>getFile</code> method of DirectoryEntry to create the target file.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nb">window</span><span class="p">.</span><span class="nx">requestFileSystem</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">TEMPORARY</span><span class="p">,</span> <span class="mi">5</span> <span class="o">*</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span>
-
-    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'file system open: '</span> <span class="o">+</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span>
-
-    <span class="c1">// Make sure you add the domain name to the Content-Security-Policy &lt;meta&gt; element.</span>
-    <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="s1">'http://cordova.apache.org/static/img/cordova_bot.png'</span><span class="p">;</span>
-    <span class="c1">// Parameters passed to getFile create a new file or return the file if it already exists.</span>
-    <span class="nx">fs</span><span class="p">.</span><span class="nx">root</span><span class="p">.</span><span class="nx">getFile</span><span class="p">(</span><span class="s1">'downloaded-image.png'</span><span class="p">,</span> <span class="p">{</span> <span class="na">create</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">exclusive</span><span class="p">:</span> <span class="kc">false</span> <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">download</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
-
-    <span class="p">},</span> <span class="nx">onErrorCreateFile</span><span class="p">);</span>
-
-<span class="p">},</span> <span class="nx">onErrorLoadFs</span><span class="p">);</span>
-</code></pre></div>
-<blockquote>
-<p><em>Note</em> For persistent storage, pass LocalFileSystem.PERSISTENT to requestFileSystem.</p>
-</blockquote>
-
-<p>When you have the FileEntry object, download the file using the <code>download</code> method of the FileTransfer object. The 3rd argument to the <code>download</code> function of FileTransfer is the success callback, which you can use to call the app&#39;s <code>readBinaryFile</code> function. In this code example, the <code>entry</code> variable is a new FileEntry object that receives the result of the download operation.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">download</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">,</span> <span class="nx">uri</span><span class="p">,</span> <span class="nx">readBinaryData</span><span class="p">)</span> <span class="p">{</span>
-
-    <span class="kd">var</span> <span class="nx">fileTransfer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-    <span class="kd">var</span> <span class="nx">fileURL</span> <span class="o">=</span> <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">();</span>
-
-    <span class="nx">fileTransfer</span><span class="p">.</span><span class="nx">download</span><span class="p">(</span>
-        <span class="nx">uri</span><span class="p">,</span>
-        <span class="nx">fileURL</span><span class="p">,</span>
-        <span class="kd">function</span> <span class="p">(</span><span class="nx">entry</span><span class="p">)</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful download..."</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download complete: "</span> <span class="o">+</span> <span class="nx">entry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">());</span>
-            <span class="k">if</span> <span class="p">(</span><span class="nx">readBinaryData</span><span class="p">)</span> <span class="p">{</span>
-              <span class="c1">// Read the file...</span>
-              <span class="nx">readBinaryFile</span><span class="p">(</span><span class="nx">entry</span><span class="p">);</span>
-            <span class="p">}</span>
-            <span class="k">else</span> <span class="p">{</span>
-              <span class="c1">// Or just display it.</span>
-              <span class="nx">displayImageByFileURL</span><span class="p">(</span><span class="nx">entry</span><span class="p">);</span>
-            <span class="p">}</span>
-        <span class="p">},</span>
-        <span class="kd">function</span> <span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error code"</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-        <span class="p">},</span>
-        <span class="kc">null</span><span class="p">,</span> <span class="c1">// or, pass false</span>
-        <span class="p">{</span>
-            <span class="c1">//headers: {</span>
-            <span class="c1">//    "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="</span>
-            <span class="c1">//}</span>
-        <span class="p">}</span>
-    <span class="p">);</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>If you just need to display the image, take the FileEntry to call its toURL() function.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">displayImageByFileURL</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-    <span class="kd">var</span> <span class="nx">elem</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'imageFile'</span><span class="p">);</span>
-    <span class="nx">elem</span><span class="p">.</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">();</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>Depending on your app requirements, you may want to read the file. To support operations with binary files, FileReader supports two methods, <code>readAsBinaryString</code> and <code>readAsArrayBuffer</code>. In this example, use <code>readAsArrayBuffer</code> and pass the FileEntry object to the method. Once you read the file successfully, construct a Blob object using the result of the read.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">readBinaryFile</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">file</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">file</span><span class="p">)</span> <span class="p">{</span>
-        <span class="kd">var</span> <span class="nx">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileReader</span><span class="p">();</span>
-
-        <span class="nx">reader</span><span class="p">.</span><span class="nx">onloadend</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
-
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful file read: "</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">result</span><span class="p">);</span>
-            <span class="c1">// displayFileData(fileEntry.fullPath + ": " + this.result);</span>
-
-            <span class="kd">var</span> <span class="nx">blob</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Blob</span><span class="p">([</span><span class="k">new</span> <span class="nx">Uint8Array</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">result</span><span class="p">)],</span> <span class="p">{</span> <span class="na">type</span><span class="p">:</span> <span class="s2">"image/png"</span> <span class="p">});</span>
-            <span class="nx">displayImage</span><span class="p">(</span><span class="nx">blob</span><span class="p">);</span>
-        <span class="p">};</span>
-
-        <span class="nx">reader</span><span class="p">.</span><span class="nx">readAsArrayBuffer</span><span class="p">(</span><span class="nx">file</span><span class="p">);</span>
-
-    <span class="p">},</span> <span class="nx">onErrorReadFile</span><span class="p">);</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>Once you read the file successfully, you can create a DOM URL string using <code>createObjectURL</code>, and then display the image.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">displayImage</span><span class="p">(</span><span class="nx">blob</span><span class="p">)</span> <span class="p">{</span>
-
-    <span class="c1">// Note: Use window.URL.revokeObjectURL when finished with image.</span>
-    <span class="kd">var</span> <span class="nx">objURL</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">URL</span><span class="p">.</span><span class="nx">createObjectURL</span><span class="p">(</span><span class="nx">blob</span><span class="p">);</span>
-
-    <span class="c1">// Displays image if result is a valid DOM string for an image.</span>
-    <span class="kd">var</span> <span class="nx">elem</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'imageFile'</span><span class="p">);</span>
-    <span class="nx">elem</span><span class="p">.</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">objURL</span><span class="p">;</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>As you saw previously, you can call FileEntry.toURL() instead to just display the downloaded image (skip the file read).</p>
-
-<h2>Upload a File <a name="uploadFile"></a>
-<p>When you upload a File using the File-Transfer plugin, use the File plugin to provide files for upload (again, they must be FileEntry objects). Before you can upload anything, create a file for upload using the <code>getFile</code> method of DirectoryEntry. In this example, create the file in the application&#39;s cache (fs.root). Then call the app&#39;s writeFile function so you have some content to upload.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">onUploadFile</span><span class="p">()</span> <span class="p">{</span>
-    <span class="nb">window</span><span class="p">.</span><span class="nx">requestFileSystem</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">TEMPORARY</span><span class="p">,</span> <span class="mi">5</span> <span class="o">*</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fs</span><span class="p">)</span> <span class="p">{</span>
-
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'file system open: '</span> <span class="o">+</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span>
-        <span class="kd">var</span> <span class="nx">fileName</span> <span class="o">=</span> <span class="s2">"uploadSource.txt"</span><span class="p">;</span>
-        <span class="kd">var</span> <span class="nx">dirEntry</span> <span class="o">=</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">root</span><span class="p">;</span>
-        <span class="nx">dirEntry</span><span class="p">.</span><span class="nx">getFile</span><span class="p">(</span><span class="nx">fileName</span><span class="p">,</span> <span class="p">{</span> <span class="na">create</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">exclusive</span><span class="p">:</span> <span class="kc">false</span> <span class="p">},</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-
-            <span class="c1">// Write something to the file before uploading it.</span>
-            <span class="nx">writeFile</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">);</span>
-
-        <span class="p">},</span> <span class="nx">onErrorCreateFile</span><span class="p">);</span>
-
-    <span class="p">},</span> <span class="nx">onErrorLoadFs</span><span class="p">);</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>In this example, create some simple content, and then call the app&#39;s upload function.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">writeFile</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">,</span> <span class="nx">dataObj</span><span class="p">)</span> <span class="p">{</span>
-    <span class="c1">// Create a FileWriter object for our FileEntry (log.txt).</span>
-    <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">createWriter</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">fileWriter</span><span class="p">)</span> <span class="p">{</span>
-
-        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">onwriteend</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful file write..."</span><span class="p">);</span>
-            <span class="nx">upload</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">);</span>
-        <span class="p">};</span>
-
-        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">onerror</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Failed file write: "</span> <span class="o">+</span> <span class="nx">e</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
-        <span class="p">};</span>
-
-        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">dataObj</span><span class="p">)</span> <span class="p">{</span>
-          <span class="nx">dataObj</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Blob</span><span class="p">([</span><span class="s1">'file data to upload'</span><span class="p">],</span> <span class="p">{</span> <span class="na">type</span><span class="p">:</span> <span class="s1">'text/plain'</span> <span class="p">});</span>
-        <span class="p">}</span>
-
-        <span class="nx">fileWriter</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">dataObj</span><span class="p">);</span>
-    <span class="p">});</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>Forward the FileEntry object to the upload function. To perform the actual upload, use the upload function of the FileTransfer object.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">upload</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-    <span class="c1">// !! Assumes variable fileURL contains a valid URL to a text file on the device,</span>
-    <span class="kd">var</span> <span class="nx">fileURL</span> <span class="o">=</span> <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">();</span>
-
-    <span class="kd">var</span> <span class="nx">success</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful upload..."</span><span class="p">);</span>
-        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Code = "</span> <span class="o">+</span> <span class="nx">r</span><span class="p">.</span><span class="nx">responseCode</span><span class="p">);</span>
-        <span class="nx">displayFileData</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">.</span><span class="nx">fullPath</span> <span class="o">+</span> <span class="s2">" (content uploaded to server)"</span><span class="p">);</span>
-    <span class="p">}</span>
-
-    <span class="kd">var</span> <span class="nx">fail</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-        <span class="nx">alert</span><span class="p">(</span><span class="s2">"An error has occurred: Code = "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-    <span class="p">}</span>
-
-    <span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileUploadOptions</span><span class="p">();</span>
-    <span class="nx">options</span><span class="p">.</span><span class="nx">fileKey</span> <span class="o">=</span> <span class="s2">"file"</span><span class="p">;</span>
-    <span class="nx">options</span><span class="p">.</span><span class="nx">fileName</span> <span class="o">=</span> <span class="nx">fileURL</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">'/'</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
-    <span class="nx">options</span><span class="p">.</span><span class="nx">mimeType</span> <span class="o">=</span> <span class="s2">"text/plain"</span><span class="p">;</span>
-
-    <span class="kd">var</span> <span class="nx">params</span> <span class="o">=</span> <span class="p">{};</span>
-    <span class="nx">params</span><span class="p">.</span><span class="nx">value1</span> <span class="o">=</span> <span class="s2">"test"</span><span class="p">;</span>
-    <span class="nx">params</span><span class="p">.</span><span class="nx">value2</span> <span class="o">=</span> <span class="s2">"param"</span><span class="p">;</span>
-
-    <span class="nx">options</span><span class="p">.</span><span class="nx">params</span> <span class="o">=</span> <span class="nx">params</span><span class="p">;</span>
-
-    <span class="kd">var</span> <span class="nx">ft</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-    <span class="c1">// SERVER must be a URL that can handle the request, like</span>
-    <span class="c1">// http://some.server.com/upload.php</span>
-    <span class="nx">ft</span><span class="p">.</span><span class="nx">upload</span><span class="p">(</span><span class="nx">fileURL</span><span class="p">,</span> <span class="nb">encodeURI</span><span class="p">(</span><span class="nx">SERVER</span><span class="p">),</span> <span class="nx">success</span><span class="p">,</span> <span class="nx">fail</span><span class="p">,</span> <span class="nx">options</span><span class="p">);</span>
-<span class="p">};</span>
-</code></pre></div>
-<h2>Download the uploaded file <a name="downloadFile"></a></h2>
-
-<p>To download the image you just uploaded, you will need a valid URL that can handle the request, for example, http://some.server.com/download.php. Again, the success handler for the FileTransfer.download method receives a FileEntry object. The main difference here from previous examples is that we call FileReader.readAsText to read the result of the download operation, because we uploaded a file with text content.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">download</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">,</span> <span class="nx">uri</span><span class="p">)</span> <span class="p">{</span>
-
-    <span class="kd">var</span> <span class="nx">fileTransfer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileTransfer</span><span class="p">();</span>
-    <span class="kd">var</span> <span class="nx">fileURL</span> <span class="o">=</span> <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">();</span>
-
-    <span class="nx">fileTransfer</span><span class="p">.</span><span class="nx">download</span><span class="p">(</span>
-        <span class="nx">uri</span><span class="p">,</span>
-        <span class="nx">fileURL</span><span class="p">,</span>
-        <span class="kd">function</span> <span class="p">(</span><span class="nx">entry</span><span class="p">)</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful download..."</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download complete: "</span> <span class="o">+</span> <span class="nx">entry</span><span class="p">.</span><span class="nx">toURL</span><span class="p">());</span>
-            <span class="nx">readFile</span><span class="p">(</span><span class="nx">entry</span><span class="p">);</span>
-        <span class="p">},</span>
-        <span class="kd">function</span> <span class="p">(</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error source "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">source</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"download error target "</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"upload error code"</span> <span class="o">+</span> <span class="nx">error</span><span class="p">.</span><span class="nx">code</span><span class="p">);</span>
-        <span class="p">},</span>
-        <span class="kc">null</span><span class="p">,</span> <span class="c1">// or, pass false</span>
-        <span class="p">{</span>
-            <span class="c1">//headers: {</span>
-            <span class="c1">//    "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="</span>
-            <span class="c1">//}</span>
-        <span class="p">}</span>
-    <span class="p">);</span>
-<span class="p">}</span>
-</code></pre></div>
-<p>In the readFile function, call the <code>readAsText</code> method of the FileReader object.</p>
-<div class="highlight"><pre><code class="language-js" data-lang="js"><span class="kd">function</span> <span class="nx">readFile</span><span class="p">(</span><span class="nx">fileEntry</span><span class="p">)</span> <span class="p">{</span>
-    <span class="nx">fileEntry</span><span class="p">.</span><span class="nx">file</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">file</span><span class="p">)</span> <span class="p">{</span>
-        <span class="kd">var</span> <span class="nx">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FileReader</span><span class="p">();</span>
-
-        <span class="nx">reader</span><span class="p">.</span><span class="nx">onloadend</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
-
-            <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Successful file read: "</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">result</span><span class="p">);</span>
-            <span class="c1">// displayFileData(fileEntry.fullPath + ": " + this.result);</span>
-
-        <span class="p">};</span>
-
-        <span class="nx">reader</span><span class="p">.</span><span class="nx">readAsText</span><span class="p">(</span><span class="nx">file</span><span class="p">);</span>
-
-    <span class="p">},</span> <span class="nx">onErrorReadFile</span><span class="p">);</span>
-<span class="p">}</span>
-</code></pre></div>
 
                 </div>
             </div>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message