summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-03-29 18:25:18 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2016-08-15 19:46:48 +0200
commit9139039b98545523887a407607ac77509e273918 (patch)
tree59cec4198c3147ec053aa6ee96db80c767ee8474
parentfc1e96b179f88032594284a6fb026b3bd04d7f9f (diff)
downloadwvs-vplan-9139039b98545523887a407607ac77509e273918.tar.gz
wvs-vplan-9139039b98545523887a407607ac77509e273918.zip
mache Code platformunabhängiger
-rw-r--r--config.xml1
-rw-r--r--js/index.js9
2 files changed, 9 insertions, 1 deletions
diff --git a/config.xml b/config.xml
index ad934fa..4fbe863 100644
--- a/config.xml
+++ b/config.xml
@@ -62,6 +62,7 @@
-->
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.file" />
+ <gap:plugin name="org.apache.cordova.device" />
<!-- Define app icon for each platform. -->
<icon src="icon.png" />
diff --git a/js/index.js b/js/index.js
index 3a5605b..4c8f926 100644
--- a/js/index.js
+++ b/js/index.js
@@ -94,7 +94,14 @@ function download_pdf(link, id){
fileSystem.root.getFile(
filename, {create: true, exclusive: false},
function gotFileEntry(fileEntry){
- var sPath = "/storage/sdcard0" + fileEntry.fullPath; // !!! TODO Unterstützung anderer Geräte
+ var sPath;
+
+ if(device.platform == "Android"){
+ sPath = "/storage/sdcard0" + fileEntry.fullPath;
+ }else{
+ sPath = fileEntry.fullPath;
+ }
+
console.log('Pfad: ' + sPath);
var fileTransfer = new FileTransfer();
fileEntry.remove();