summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/index.js10
1 files changed, 8 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
*/
+
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");