diff options
| -rw-r--r-- | config.xml | 1 | ||||
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | js/index.js | 10 |
3 files changed, 10 insertions, 3 deletions
@@ -50,6 +50,7 @@ <gap:plugin name="Example" /> A list of available plugins are available at https://build.phonegap.com/docs/plugins --> + <gap:plugin name="org.apache.cordova.file-transfer" /> <!-- Define app icon for each platform. --> <icon src="icon.png" /> @@ -58,7 +58,7 @@ </div> </div> </div> - <script type="text/javascript" src="phonegap.js"></script> + <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> <script type="text/javascript"> app.initialize(); 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"); |
