From 9a56238cd200874616b0cd8e133db1d795cc75f2 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 16 Mar 2014 17:57:03 +0100 Subject: versuche weiter Download [geht nicht] --- js/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/index.js b/js/index.js index 162a810..8b5f6ca 100644 --- a/js/index.js +++ b/js/index.js @@ -15,8 +15,9 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ + function fail(text){ - alert("Etwas ist schiefgelaufen: " + text); + alert("Etwas ist schiefgelaufen: " + text.toString()); } function download_pdf(link){ @@ -24,15 +25,20 @@ function download_pdf(link){ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){ fileSystem.root.getFile(filename, {create: true, exclusive: false}, function(fileEntry){ + console.log("Bereite Download vor"); var localPath = fileEntry.fullPath; - if(device.platform == "Android" && localPath.indexOf("file://") == 0){ + if(/*device.platform == "Android" && /* TODO fehleranfällig? */localPath.indexOf("file://") == 0){ localPath = localPath.substring(7); } var ft = new FileTransfer(); + console.log("Bereit für Download " + ft); ft.download(link, localPath, function(entry){ + console.log("foo"); $('#input').attr('src', entry.fullPath); + console.log("Download fertig, parse PDF"); + var input = document.getElementById("input"); var processor = document.getElementById("processor"); var output = document.getElementById("output"); -- cgit v1.3.1