From 36c7e2c8e2aa1ed7e631fe0b7731a1a3580edea9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Jan 2016 00:06:37 +0100 Subject: [PATCH] Cordova plugin file und file-transfer geadded --- package.json | 4 +- platforms/android/AndroidManifest.xml | 1 + platforms/android/android.json | 217 +- .../android/assets/www/cordova_plugins.js | 187 +- platforms/android/assets/www/index.html | 2 +- .../android/assets/www/js/controllers.js | 70 +- platforms/android/assets/www/js/services.js | 55 +- .../www/FileTransfer.js | 237 ++ .../www/FileTransferError.js | 43 + .../cordova-plugin-file/www/DirectoryEntry.js | 119 + .../www/DirectoryReader.js | 75 + .../plugins/cordova-plugin-file/www/Entry.js | 262 ++ .../plugins/cordova-plugin-file/www/File.js | 81 + .../cordova-plugin-file/www/FileEntry.js | 83 + .../cordova-plugin-file/www/FileError.js | 48 + .../cordova-plugin-file/www/FileReader.js | 392 ++ .../cordova-plugin-file/www/FileSystem.js | 50 + .../www/FileUploadOptions.js | 43 + .../www/FileUploadResult.js | 31 + .../cordova-plugin-file/www/FileWriter.js | 304 ++ .../plugins/cordova-plugin-file/www/Flags.js | 38 + .../www/LocalFileSystem.js | 25 + .../cordova-plugin-file/www/Metadata.js | 42 + .../cordova-plugin-file/www/ProgressEvent.js | 69 + .../www/android/FileSystem.js | 38 + .../www/fileSystemPaths.js | 65 + .../www/fileSystems-roots.js | 46 + .../cordova-plugin-file/www/fileSystems.js | 27 + .../www/requestFileSystem.js | 78 + .../www/resolveLocalFileSystemURI.js | 89 + .../assets/www/templates/tab-dash.html | 6 +- .../android/platform_www/cordova_plugins.js | 187 +- .../www/FileTransfer.js | 237 ++ .../www/FileTransferError.js | 43 + .../cordova-plugin-file/www/DirectoryEntry.js | 119 + .../www/DirectoryReader.js | 75 + .../plugins/cordova-plugin-file/www/Entry.js | 262 ++ .../plugins/cordova-plugin-file/www/File.js | 81 + .../cordova-plugin-file/www/FileEntry.js | 83 + .../cordova-plugin-file/www/FileError.js | 48 + .../cordova-plugin-file/www/FileReader.js | 392 ++ .../cordova-plugin-file/www/FileSystem.js | 50 + .../www/FileUploadOptions.js | 43 + .../www/FileUploadResult.js | 31 + .../cordova-plugin-file/www/FileWriter.js | 304 ++ .../plugins/cordova-plugin-file/www/Flags.js | 38 + .../www/LocalFileSystem.js | 25 + .../cordova-plugin-file/www/Metadata.js | 42 + .../cordova-plugin-file/www/ProgressEvent.js | 69 + .../www/android/FileSystem.js | 38 + .../www/fileSystemPaths.js | 65 + .../www/fileSystems-roots.js | 46 + .../cordova-plugin-file/www/fileSystems.js | 27 + .../www/requestFileSystem.js | 78 + .../www/resolveLocalFileSystemURI.js | 89 + platforms/android/res/xml/config.xml | 8 + .../apache/cordova/file/AssetFilesystem.java | 283 ++ .../cordova/file/ContentFilesystem.java | 215 + .../apache/cordova/file/DirectoryManager.java | 133 + .../cordova/file/EncodingException.java | 29 + .../cordova/file/FileExistsException.java | 29 + .../org/apache/cordova/file/FileUtils.java | 1022 +++++ .../org/apache/cordova/file/Filesystem.java | 325 ++ .../file/InvalidModificationException.java | 30 + .../apache/cordova/file/LocalFilesystem.java | 505 +++ .../cordova/file/LocalFilesystemURL.java | 64 + .../file/NoModificationAllowedException.java | 29 + .../cordova/file/TypeMismatchException.java | 30 + .../filetransfer/FileProgressResult.java | 63 + .../cordova/filetransfer/FileTransfer.java | 1025 +++++ .../filetransfer/FileUploadResult.java | 73 + plugins/android.json | 6 + .../CONTRIBUTING.md | 37 + plugins/cordova-plugin-file-transfer/LICENSE | 202 + plugins/cordova-plugin-file-transfer/NOTICE | 8 + .../cordova-plugin-file-transfer/README.md | 310 ++ .../RELEASENOTES.md | 240 ++ .../doc/de/README.md | 311 ++ .../doc/de/index.md | 302 ++ .../doc/es/README.md | 311 ++ .../doc/es/index.md | 262 ++ .../doc/fr/README.md | 270 ++ .../doc/fr/index.md | 261 ++ .../doc/it/README.md | 311 ++ .../doc/it/index.md | 302 ++ .../doc/ja/README.md | 311 ++ .../doc/ja/index.md | 302 ++ .../doc/ko/README.md | 311 ++ .../doc/ko/index.md | 302 ++ .../doc/pl/README.md | 311 ++ .../doc/pl/index.md | 302 ++ .../doc/ru/index.md | 290 ++ .../doc/zh/README.md | 311 ++ .../doc/zh/index.md | 302 ++ .../cordova-plugin-file-transfer/package.json | 47 + .../cordova-plugin-file-transfer/plugin.xml | 170 + .../src/amazon/FileTransfer.java | 898 ++++ .../src/android/FileProgressResult.java | 63 + .../src/android/FileTransfer.java | 1025 +++++ .../src/android/FileUploadResult.java | 73 + .../src/ios/CDVFileTransfer.h | 88 + .../src/ios/CDVFileTransfer.m | 808 ++++ .../src/ubuntu/file-transfer.cpp | 265 ++ .../src/ubuntu/file-transfer.h | 103 + .../src/windows/FileTransferProxy.js | 425 ++ .../src/wp/FileTransfer.cs | 994 +++++ .../tests/plugin.xml | 30 + .../tests/tests.js | 1045 +++++ .../www/FileTransfer.js | 235 ++ .../www/FileTransferError.js | 41 + .../www/blackberry10/FileTransfer.js | 188 + .../www/blackberry10/FileTransferProxy.js | 36 + .../www/blackberry10/xhrFileTransfer.js | 259 ++ .../www/browser/FileTransfer.js | 328 ++ .../www/firefoxos/FileTransferProxy.js | 223 + .../www/wp7/base64.js | 71 + plugins/cordova-plugin-file/CONTRIBUTING.md | 37 + plugins/cordova-plugin-file/LICENSE | 202 + plugins/cordova-plugin-file/NOTICE | 5 + plugins/cordova-plugin-file/README.md | 450 ++ plugins/cordova-plugin-file/RELEASENOTES.md | 370 ++ plugins/cordova-plugin-file/doc/de/README.md | 335 ++ plugins/cordova-plugin-file/doc/de/index.md | 338 ++ plugins/cordova-plugin-file/doc/de/plugins.md | 101 + plugins/cordova-plugin-file/doc/es/README.md | 335 ++ plugins/cordova-plugin-file/doc/es/index.md | 336 ++ plugins/cordova-plugin-file/doc/es/plugins.md | 101 + plugins/cordova-plugin-file/doc/fr/README.md | 328 ++ plugins/cordova-plugin-file/doc/fr/index.md | 331 ++ plugins/cordova-plugin-file/doc/fr/plugins.md | 101 + plugins/cordova-plugin-file/doc/it/README.md | 335 ++ plugins/cordova-plugin-file/doc/it/index.md | 338 ++ plugins/cordova-plugin-file/doc/it/plugins.md | 101 + plugins/cordova-plugin-file/doc/ja/README.md | 335 ++ plugins/cordova-plugin-file/doc/ja/index.md | 338 ++ plugins/cordova-plugin-file/doc/ja/plugins.md | 101 + plugins/cordova-plugin-file/doc/ko/README.md | 335 ++ plugins/cordova-plugin-file/doc/ko/index.md | 338 ++ plugins/cordova-plugin-file/doc/ko/plugins.md | 101 + plugins/cordova-plugin-file/doc/pl/README.md | 335 ++ plugins/cordova-plugin-file/doc/pl/index.md | 338 ++ plugins/cordova-plugin-file/doc/pl/plugins.md | 101 + plugins/cordova-plugin-file/doc/plugins.md | 120 + plugins/cordova-plugin-file/doc/ru/index.md | 275 ++ plugins/cordova-plugin-file/doc/ru/plugins.md | 124 + plugins/cordova-plugin-file/doc/zh/README.md | 335 ++ plugins/cordova-plugin-file/doc/zh/index.md | 343 ++ plugins/cordova-plugin-file/doc/zh/plugins.md | 101 + plugins/cordova-plugin-file/package.json | 41 + plugins/cordova-plugin-file/plugin.xml | 385 ++ .../src/android/AssetFilesystem.java | 283 ++ .../src/android/ContentFilesystem.java | 215 + .../src/android/DirectoryManager.java | 133 + .../src/android/EncodingException.java | 29 + .../src/android/FileExistsException.java | 29 + .../src/android/FileUtils.java | 1022 +++++ .../src/android/Filesystem.java | 325 ++ .../android/InvalidModificationException.java | 30 + .../src/android/LocalFilesystem.java | 505 +++ .../src/android/LocalFilesystemURL.java | 64 + .../NoModificationAllowedException.java | 29 + .../src/android/TypeMismatchException.java | 30 + .../src/android/build-extras.gradle | 47 + .../src/blackberry10/index.js | 44 + .../src/browser/FileProxy.js | 964 +++++ .../src/firefoxos/FileProxy.js | 785 ++++ .../src/ios/CDVAssetLibraryFilesystem.h | 30 + .../src/ios/CDVAssetLibraryFilesystem.m | 253 ++ plugins/cordova-plugin-file/src/ios/CDVFile.h | 157 + plugins/cordova-plugin-file/src/ios/CDVFile.m | 1106 +++++ .../src/ios/CDVLocalFilesystem.h | 32 + .../src/ios/CDVLocalFilesystem.m | 734 ++++ .../cordova-plugin-file/src/ubuntu/file.cpp | 912 ++++ plugins/cordova-plugin-file/src/ubuntu/file.h | 81 + .../src/windows/FileProxy.js | 1186 ++++++ plugins/cordova-plugin-file/src/wp/File.cs | 1800 ++++++++ plugins/cordova-plugin-file/tests/plugin.xml | 42 + .../src/android/TestContentProvider.java | 96 + plugins/cordova-plugin-file/tests/tests.js | 3682 +++++++++++++++++ .../cordova-plugin-file/www/DirectoryEntry.js | 117 + .../www/DirectoryReader.js | 73 + plugins/cordova-plugin-file/www/Entry.js | 260 ++ plugins/cordova-plugin-file/www/File.js | 79 + plugins/cordova-plugin-file/www/FileEntry.js | 81 + plugins/cordova-plugin-file/www/FileError.js | 46 + plugins/cordova-plugin-file/www/FileReader.js | 390 ++ plugins/cordova-plugin-file/www/FileSystem.js | 48 + .../www/FileUploadOptions.js | 41 + .../www/FileUploadResult.js | 30 + plugins/cordova-plugin-file/www/FileWriter.js | 302 ++ plugins/cordova-plugin-file/www/Flags.js | 36 + .../www/LocalFileSystem.js | 23 + plugins/cordova-plugin-file/www/Metadata.js | 40 + .../cordova-plugin-file/www/ProgressEvent.js | 67 + .../www/android/FileSystem.js | 36 + .../www/blackberry10/FileProxy.js | 51 + .../www/blackberry10/FileSystem.js | 46 + .../www/blackberry10/copyTo.js | 141 + .../www/blackberry10/createEntryFromNative.js | 77 + .../www/blackberry10/getDirectory.js | 72 + .../www/blackberry10/getFile.js | 57 + .../www/blackberry10/getFileMetadata.js | 65 + .../www/blackberry10/getMetadata.js | 54 + .../www/blackberry10/getParent.js | 57 + .../www/blackberry10/info.js | 52 + .../www/blackberry10/moveTo.js | 39 + .../www/blackberry10/readAsArrayBuffer.js | 68 + .../www/blackberry10/readAsBinaryString.js | 68 + .../www/blackberry10/readAsDataURL.js | 65 + .../www/blackberry10/readAsText.js | 77 + .../www/blackberry10/readEntries.js | 71 + .../www/blackberry10/remove.js | 61 + .../www/blackberry10/removeRecursively.js | 62 + .../www/blackberry10/requestAllFileSystems.js | 42 + .../www/blackberry10/requestAnimationFrame.js | 38 + .../www/blackberry10/requestFileSystem.js | 53 + .../blackberry10/resolveLocalFileSystemURI.js | 172 + .../www/blackberry10/setMetadata.js | 33 + .../www/blackberry10/truncate.js | 74 + .../www/blackberry10/write.js | 73 + .../www/browser/FileSystem.js | 31 + .../www/browser/Preparing.js | 187 + .../www/fileSystemPaths.js | 63 + .../www/fileSystems-roots.js | 44 + .../cordova-plugin-file/www/fileSystems.js | 25 + .../www/firefoxos/FileSystem.js | 29 + .../cordova-plugin-file/www/ios/FileSystem.js | 30 + .../www/requestFileSystem.js | 76 + .../www/resolveLocalFileSystemURI.js | 87 + .../www/ubuntu/FileSystem.js | 34 + .../www/ubuntu/FileWriter.js | 135 + .../www/ubuntu/fileSystems-roots.js | 53 + .../www/wp/FileUploadOptions.js | 49 + plugins/fetch.json | 16 + 234 files changed, 49402 insertions(+), 81 deletions(-) create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/Entry.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/File.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileEntry.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileError.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileReader.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileSystem.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileUploadOptions.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileUploadResult.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/FileWriter.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/Flags.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/LocalFileSystem.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/Metadata.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/ProgressEvent.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/android/FileSystem.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/fileSystemPaths.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/fileSystems-roots.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/fileSystems.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/requestFileSystem.js create mode 100644 platforms/android/assets/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/DirectoryReader.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/Entry.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/File.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileEntry.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileError.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileReader.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileSystem.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadOptions.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileUploadResult.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/FileWriter.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/Flags.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/LocalFileSystem.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/Metadata.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/ProgressEvent.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/android/FileSystem.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystemPaths.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems-roots.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/fileSystems.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/requestFileSystem.js create mode 100644 platforms/android/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js create mode 100644 platforms/android/src/org/apache/cordova/file/AssetFilesystem.java create mode 100644 platforms/android/src/org/apache/cordova/file/ContentFilesystem.java create mode 100644 platforms/android/src/org/apache/cordova/file/DirectoryManager.java create mode 100644 platforms/android/src/org/apache/cordova/file/EncodingException.java create mode 100644 platforms/android/src/org/apache/cordova/file/FileExistsException.java create mode 100644 platforms/android/src/org/apache/cordova/file/FileUtils.java create mode 100644 platforms/android/src/org/apache/cordova/file/Filesystem.java create mode 100644 platforms/android/src/org/apache/cordova/file/InvalidModificationException.java create mode 100644 platforms/android/src/org/apache/cordova/file/LocalFilesystem.java create mode 100644 platforms/android/src/org/apache/cordova/file/LocalFilesystemURL.java create mode 100644 platforms/android/src/org/apache/cordova/file/NoModificationAllowedException.java create mode 100644 platforms/android/src/org/apache/cordova/file/TypeMismatchException.java create mode 100644 platforms/android/src/org/apache/cordova/filetransfer/FileProgressResult.java create mode 100644 platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java create mode 100644 platforms/android/src/org/apache/cordova/filetransfer/FileUploadResult.java create mode 100644 plugins/cordova-plugin-file-transfer/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-file-transfer/LICENSE create mode 100644 plugins/cordova-plugin-file-transfer/NOTICE create mode 100644 plugins/cordova-plugin-file-transfer/README.md create mode 100644 plugins/cordova-plugin-file-transfer/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/de/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/de/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/es/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/es/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/fr/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/fr/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/it/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/it/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/ja/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/ja/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/ko/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/ko/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/pl/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/pl/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/ru/index.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/zh/README.md create mode 100644 plugins/cordova-plugin-file-transfer/doc/zh/index.md create mode 100644 plugins/cordova-plugin-file-transfer/package.json create mode 100644 plugins/cordova-plugin-file-transfer/plugin.xml create mode 100644 plugins/cordova-plugin-file-transfer/src/amazon/FileTransfer.java create mode 100644 plugins/cordova-plugin-file-transfer/src/android/FileProgressResult.java create mode 100644 plugins/cordova-plugin-file-transfer/src/android/FileTransfer.java create mode 100644 plugins/cordova-plugin-file-transfer/src/android/FileUploadResult.java create mode 100644 plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.h create mode 100644 plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.m create mode 100644 plugins/cordova-plugin-file-transfer/src/ubuntu/file-transfer.cpp create mode 100644 plugins/cordova-plugin-file-transfer/src/ubuntu/file-transfer.h create mode 100644 plugins/cordova-plugin-file-transfer/src/windows/FileTransferProxy.js create mode 100644 plugins/cordova-plugin-file-transfer/src/wp/FileTransfer.cs create mode 100644 plugins/cordova-plugin-file-transfer/tests/plugin.xml create mode 100644 plugins/cordova-plugin-file-transfer/tests/tests.js create mode 100644 plugins/cordova-plugin-file-transfer/www/FileTransfer.js create mode 100644 plugins/cordova-plugin-file-transfer/www/FileTransferError.js create mode 100644 plugins/cordova-plugin-file-transfer/www/blackberry10/FileTransfer.js create mode 100644 plugins/cordova-plugin-file-transfer/www/blackberry10/FileTransferProxy.js create mode 100644 plugins/cordova-plugin-file-transfer/www/blackberry10/xhrFileTransfer.js create mode 100644 plugins/cordova-plugin-file-transfer/www/browser/FileTransfer.js create mode 100644 plugins/cordova-plugin-file-transfer/www/firefoxos/FileTransferProxy.js create mode 100644 plugins/cordova-plugin-file-transfer/www/wp7/base64.js create mode 100644 plugins/cordova-plugin-file/CONTRIBUTING.md create mode 100644 plugins/cordova-plugin-file/LICENSE create mode 100644 plugins/cordova-plugin-file/NOTICE create mode 100644 plugins/cordova-plugin-file/README.md create mode 100644 plugins/cordova-plugin-file/RELEASENOTES.md create mode 100644 plugins/cordova-plugin-file/doc/de/README.md create mode 100644 plugins/cordova-plugin-file/doc/de/index.md create mode 100644 plugins/cordova-plugin-file/doc/de/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/es/README.md create mode 100644 plugins/cordova-plugin-file/doc/es/index.md create mode 100644 plugins/cordova-plugin-file/doc/es/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/fr/README.md create mode 100644 plugins/cordova-plugin-file/doc/fr/index.md create mode 100644 plugins/cordova-plugin-file/doc/fr/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/it/README.md create mode 100644 plugins/cordova-plugin-file/doc/it/index.md create mode 100644 plugins/cordova-plugin-file/doc/it/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/ja/README.md create mode 100644 plugins/cordova-plugin-file/doc/ja/index.md create mode 100644 plugins/cordova-plugin-file/doc/ja/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/ko/README.md create mode 100644 plugins/cordova-plugin-file/doc/ko/index.md create mode 100644 plugins/cordova-plugin-file/doc/ko/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/pl/README.md create mode 100644 plugins/cordova-plugin-file/doc/pl/index.md create mode 100644 plugins/cordova-plugin-file/doc/pl/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/ru/index.md create mode 100644 plugins/cordova-plugin-file/doc/ru/plugins.md create mode 100644 plugins/cordova-plugin-file/doc/zh/README.md create mode 100644 plugins/cordova-plugin-file/doc/zh/index.md create mode 100644 plugins/cordova-plugin-file/doc/zh/plugins.md create mode 100644 plugins/cordova-plugin-file/package.json create mode 100644 plugins/cordova-plugin-file/plugin.xml create mode 100644 plugins/cordova-plugin-file/src/android/AssetFilesystem.java create mode 100644 plugins/cordova-plugin-file/src/android/ContentFilesystem.java create mode 100644 plugins/cordova-plugin-file/src/android/DirectoryManager.java create mode 100644 plugins/cordova-plugin-file/src/android/EncodingException.java create mode 100644 plugins/cordova-plugin-file/src/android/FileExistsException.java create mode 100644 plugins/cordova-plugin-file/src/android/FileUtils.java create mode 100644 plugins/cordova-plugin-file/src/android/Filesystem.java create mode 100644 plugins/cordova-plugin-file/src/android/InvalidModificationException.java create mode 100644 plugins/cordova-plugin-file/src/android/LocalFilesystem.java create mode 100644 plugins/cordova-plugin-file/src/android/LocalFilesystemURL.java create mode 100644 plugins/cordova-plugin-file/src/android/NoModificationAllowedException.java create mode 100644 plugins/cordova-plugin-file/src/android/TypeMismatchException.java create mode 100644 plugins/cordova-plugin-file/src/android/build-extras.gradle create mode 100644 plugins/cordova-plugin-file/src/blackberry10/index.js create mode 100644 plugins/cordova-plugin-file/src/browser/FileProxy.js create mode 100644 plugins/cordova-plugin-file/src/firefoxos/FileProxy.js create mode 100644 plugins/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.h create mode 100644 plugins/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.m create mode 100644 plugins/cordova-plugin-file/src/ios/CDVFile.h create mode 100644 plugins/cordova-plugin-file/src/ios/CDVFile.m create mode 100644 plugins/cordova-plugin-file/src/ios/CDVLocalFilesystem.h create mode 100644 plugins/cordova-plugin-file/src/ios/CDVLocalFilesystem.m create mode 100644 plugins/cordova-plugin-file/src/ubuntu/file.cpp create mode 100644 plugins/cordova-plugin-file/src/ubuntu/file.h create mode 100644 plugins/cordova-plugin-file/src/windows/FileProxy.js create mode 100644 plugins/cordova-plugin-file/src/wp/File.cs create mode 100644 plugins/cordova-plugin-file/tests/plugin.xml create mode 100644 plugins/cordova-plugin-file/tests/src/android/TestContentProvider.java create mode 100644 plugins/cordova-plugin-file/tests/tests.js create mode 100644 plugins/cordova-plugin-file/www/DirectoryEntry.js create mode 100644 plugins/cordova-plugin-file/www/DirectoryReader.js create mode 100644 plugins/cordova-plugin-file/www/Entry.js create mode 100644 plugins/cordova-plugin-file/www/File.js create mode 100644 plugins/cordova-plugin-file/www/FileEntry.js create mode 100644 plugins/cordova-plugin-file/www/FileError.js create mode 100644 plugins/cordova-plugin-file/www/FileReader.js create mode 100644 plugins/cordova-plugin-file/www/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/FileUploadOptions.js create mode 100644 plugins/cordova-plugin-file/www/FileUploadResult.js create mode 100644 plugins/cordova-plugin-file/www/FileWriter.js create mode 100644 plugins/cordova-plugin-file/www/Flags.js create mode 100644 plugins/cordova-plugin-file/www/LocalFileSystem.js create mode 100644 plugins/cordova-plugin-file/www/Metadata.js create mode 100644 plugins/cordova-plugin-file/www/ProgressEvent.js create mode 100644 plugins/cordova-plugin-file/www/android/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/FileProxy.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/copyTo.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/createEntryFromNative.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/getDirectory.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/getFile.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/getFileMetadata.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/getMetadata.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/getParent.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/info.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/moveTo.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/readAsArrayBuffer.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/readAsBinaryString.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/readAsDataURL.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/readAsText.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/readEntries.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/remove.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/removeRecursively.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/requestAllFileSystems.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/requestAnimationFrame.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/requestFileSystem.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/resolveLocalFileSystemURI.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/setMetadata.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/truncate.js create mode 100644 plugins/cordova-plugin-file/www/blackberry10/write.js create mode 100644 plugins/cordova-plugin-file/www/browser/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/browser/Preparing.js create mode 100644 plugins/cordova-plugin-file/www/fileSystemPaths.js create mode 100644 plugins/cordova-plugin-file/www/fileSystems-roots.js create mode 100644 plugins/cordova-plugin-file/www/fileSystems.js create mode 100644 plugins/cordova-plugin-file/www/firefoxos/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/ios/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/requestFileSystem.js create mode 100644 plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js create mode 100644 plugins/cordova-plugin-file/www/ubuntu/FileSystem.js create mode 100644 plugins/cordova-plugin-file/www/ubuntu/FileWriter.js create mode 100644 plugins/cordova-plugin-file/www/ubuntu/fileSystems-roots.js create mode 100644 plugins/cordova-plugin-file/www/wp/FileUploadOptions.js diff --git a/package.json b/package.json index 7f16885..727a0e3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard", - "cordova-plugin-inappbrowser" + "cordova-plugin-inappbrowser", + "cordova-plugin-file", + "org.apache.cordova.file-transfer" ], "cordovaPlatforms": [ "android" diff --git a/platforms/android/AndroidManifest.xml b/platforms/android/AndroidManifest.xml index 8b810ac..44d6674 100644 --- a/platforms/android/AndroidManifest.xml +++ b/platforms/android/AndroidManifest.xml @@ -14,4 +14,5 @@ + diff --git a/platforms/android/android.json b/platforms/android/android.json index ebd9a8d..6074b4f 100644 --- a/platforms/android/android.json +++ b/platforms/android/android.json @@ -12,6 +12,12 @@ "xml": "", "count": 1 } + ], + "/*": [ + { + "xml": "", + "count": 2 + } ] } }, @@ -45,6 +51,14 @@ { "xml": "", "count": 1 + }, + { + "xml": "", + "count": 1 + }, + { + "xml": "", + "count": 1 } ] } @@ -58,6 +72,16 @@ } ] } + }, + "config.xml": { + "parents": { + "/*": [ + { + "xml": "", + "count": 1 + } + ] + } } } }, @@ -86,6 +110,12 @@ }, "cordova-plugin-inappbrowser": { "PACKAGE_NAME": "com.raataar.wolle_rosen_kaufen" + }, + "cordova-plugin-file": { + "PACKAGE_NAME": "com.raataar.wolle_rosen_kaufen" + }, + "cordova-plugin-file-transfer": { + "PACKAGE_NAME": "com.raataar.wolle_rosen_kaufen" } }, "dependent_plugins": {}, @@ -145,6 +175,189 @@ "cordova.InAppBrowser.open", "window.open" ] + }, + { + "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js", + "id": "cordova-plugin-file.DirectoryEntry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.DirectoryEntry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/DirectoryReader.js", + "id": "cordova-plugin-file.DirectoryReader", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.DirectoryReader" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Entry.js", + "id": "cordova-plugin-file.Entry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Entry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/File.js", + "id": "cordova-plugin-file.File", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.File" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileEntry.js", + "id": "cordova-plugin-file.FileEntry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileEntry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileError.js", + "id": "cordova-plugin-file.FileError", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileError" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileReader.js", + "id": "cordova-plugin-file.FileReader", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileReader" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileSystem.js", + "id": "cordova-plugin-file.FileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js", + "id": "cordova-plugin-file.FileUploadOptions", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileUploadOptions" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileUploadResult.js", + "id": "cordova-plugin-file.FileUploadResult", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileUploadResult" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileWriter.js", + "id": "cordova-plugin-file.FileWriter", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileWriter" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Flags.js", + "id": "cordova-plugin-file.Flags", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Flags" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js", + "id": "cordova-plugin-file.LocalFileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.LocalFileSystem" + ], + "merges": [ + "window" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Metadata.js", + "id": "cordova-plugin-file.Metadata", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Metadata" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/ProgressEvent.js", + "id": "cordova-plugin-file.ProgressEvent", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.ProgressEvent" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystems.js", + "id": "cordova-plugin-file.fileSystems", + "pluginId": "cordova-plugin-file" + }, + { + "file": "plugins/cordova-plugin-file/www/requestFileSystem.js", + "id": "cordova-plugin-file.requestFileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.requestFileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js", + "id": "cordova-plugin-file.resolveLocalFileSystemURI", + "pluginId": "cordova-plugin-file", + "merges": [ + "window" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/android/FileSystem.js", + "id": "cordova-plugin-file.androidFileSystem", + "pluginId": "cordova-plugin-file", + "merges": [ + "FileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js", + "id": "cordova-plugin-file.fileSystems-roots", + "pluginId": "cordova-plugin-file", + "runs": true + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js", + "id": "cordova-plugin-file.fileSystemPaths", + "pluginId": "cordova-plugin-file", + "merges": [ + "cordova" + ], + "runs": true + }, + { + "file": "plugins/cordova-plugin-file-transfer/www/FileTransferError.js", + "id": "cordova-plugin-file-transfer.FileTransferError", + "pluginId": "cordova-plugin-file-transfer", + "clobbers": [ + "window.FileTransferError" + ] + }, + { + "file": "plugins/cordova-plugin-file-transfer/www/FileTransfer.js", + "id": "cordova-plugin-file-transfer.FileTransfer", + "pluginId": "cordova-plugin-file-transfer", + "clobbers": [ + "window.FileTransfer" + ] } ], "plugin_metadata": { @@ -155,6 +368,8 @@ "cordova-plugin-statusbar": "2.0.0", "cordova-plugin-whitelist": "1.2.0", "ionic-plugin-keyboard": "1.0.8", - "cordova-plugin-inappbrowser": "1.1.1" + "cordova-plugin-inappbrowser": "1.1.1", + "cordova-plugin-file": "3.0.0", + "cordova-plugin-file-transfer": "1.4.0" } } \ No newline at end of file diff --git a/platforms/android/assets/www/cordova_plugins.js b/platforms/android/assets/www/cordova_plugins.js index d0dae10..e310c63 100644 --- a/platforms/android/assets/www/cordova_plugins.js +++ b/platforms/android/assets/www/cordova_plugins.js @@ -55,6 +55,189 @@ module.exports = [ "cordova.InAppBrowser.open", "window.open" ] + }, + { + "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js", + "id": "cordova-plugin-file.DirectoryEntry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.DirectoryEntry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/DirectoryReader.js", + "id": "cordova-plugin-file.DirectoryReader", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.DirectoryReader" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Entry.js", + "id": "cordova-plugin-file.Entry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Entry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/File.js", + "id": "cordova-plugin-file.File", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.File" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileEntry.js", + "id": "cordova-plugin-file.FileEntry", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileEntry" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileError.js", + "id": "cordova-plugin-file.FileError", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileError" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileReader.js", + "id": "cordova-plugin-file.FileReader", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileReader" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileSystem.js", + "id": "cordova-plugin-file.FileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js", + "id": "cordova-plugin-file.FileUploadOptions", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileUploadOptions" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileUploadResult.js", + "id": "cordova-plugin-file.FileUploadResult", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileUploadResult" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/FileWriter.js", + "id": "cordova-plugin-file.FileWriter", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.FileWriter" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Flags.js", + "id": "cordova-plugin-file.Flags", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Flags" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js", + "id": "cordova-plugin-file.LocalFileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.LocalFileSystem" + ], + "merges": [ + "window" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/Metadata.js", + "id": "cordova-plugin-file.Metadata", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.Metadata" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/ProgressEvent.js", + "id": "cordova-plugin-file.ProgressEvent", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.ProgressEvent" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystems.js", + "id": "cordova-plugin-file.fileSystems", + "pluginId": "cordova-plugin-file" + }, + { + "file": "plugins/cordova-plugin-file/www/requestFileSystem.js", + "id": "cordova-plugin-file.requestFileSystem", + "pluginId": "cordova-plugin-file", + "clobbers": [ + "window.requestFileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js", + "id": "cordova-plugin-file.resolveLocalFileSystemURI", + "pluginId": "cordova-plugin-file", + "merges": [ + "window" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/android/FileSystem.js", + "id": "cordova-plugin-file.androidFileSystem", + "pluginId": "cordova-plugin-file", + "merges": [ + "FileSystem" + ] + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystems-roots.js", + "id": "cordova-plugin-file.fileSystems-roots", + "pluginId": "cordova-plugin-file", + "runs": true + }, + { + "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js", + "id": "cordova-plugin-file.fileSystemPaths", + "pluginId": "cordova-plugin-file", + "merges": [ + "cordova" + ], + "runs": true + }, + { + "file": "plugins/cordova-plugin-file-transfer/www/FileTransferError.js", + "id": "cordova-plugin-file-transfer.FileTransferError", + "pluginId": "cordova-plugin-file-transfer", + "clobbers": [ + "window.FileTransferError" + ] + }, + { + "file": "plugins/cordova-plugin-file-transfer/www/FileTransfer.js", + "id": "cordova-plugin-file-transfer.FileTransfer", + "pluginId": "cordova-plugin-file-transfer", + "clobbers": [ + "window.FileTransfer" + ] } ]; module.exports.metadata = @@ -67,7 +250,9 @@ module.exports.metadata = "cordova-plugin-statusbar": "2.0.0", "cordova-plugin-whitelist": "1.2.0", "ionic-plugin-keyboard": "1.0.8", - "cordova-plugin-inappbrowser": "1.1.1" + "cordova-plugin-inappbrowser": "1.1.1", + "cordova-plugin-file": "3.0.0", + "cordova-plugin-file-transfer": "1.4.0" } // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/platforms/android/assets/www/index.html b/platforms/android/assets/www/index.html index b4066a8..387514f 100644 --- a/platforms/android/assets/www/index.html +++ b/platforms/android/assets/www/index.html @@ -25,7 +25,7 @@ - + diff --git a/platforms/android/assets/www/js/controllers.js b/platforms/android/assets/www/js/controllers.js index d2641b8..ec6a833 100644 --- a/platforms/android/assets/www/js/controllers.js +++ b/platforms/android/assets/www/js/controllers.js @@ -1,25 +1,14 @@ angular.module('starter.controllers', []) -.controller('DashCtrl', function($scope,$ionicPopup,$http) { +.controller('DashCtrl', function($scope,$ionicPopup,$http, $localstorage) { $scope.preis=""; $scope.name=""; $scope.freitext=""; - var showAlert=0; + $scope.items=[]; + $scope.item=[]; $scope.validate = function() { - showAlert=0; - if ($scope.name.length < 1){ - showAlert=1; - } - if ($scope.freitext.length < 1){ - showAlert=1; - } - - if (showAlert==1){ - $scope.showAlert(); - return; - } var link = 'http://api.raataar.de/rosen/vorschau.php'; @@ -31,21 +20,19 @@ angular.module('starter.controllers', []) }; - $scope.showAlert = function() { - var alertPopup = $ionicPopup.alert({ - title: 'Uuuupppsssiii', - template: 'Bitte prüfe deine Eingaben.' - }); - alertPopup.then(function(res) { - console.log('Thank you for not eating my delicious ice cream cone'); - }); - }; + $scope.loaddata = function() { + $scope.items=$localstorage.getObject('items'); + alert(JSON.stringify($scope.items)); + }; - function buysuccessHandler (result) { - inappbilling.consumePurchase(successHandler, errorHandler, "3xrose"); - } + $scope.savedata = function() { + $scope.item={name: $scope.name, freitext: $scope.freitext, rosen: $scope.preis, bild: "test"}; + alert(JSON.stringify($scope.item)); + $scope.items.push($scope.item); + $localstorage.setObject('items',$scope.items); + }; - function successHandler (result) { + function successBuyHandler (result) { var strResult = ""; if(typeof result === 'object') { strResult = JSON.stringify(result); @@ -55,16 +42,35 @@ angular.module('starter.controllers', []) alert("SUCCESS: \r\n"+strResult ); } - function errorHandler (error) { + function successConsumeHandler (result) { + var strResult = ""; + if(typeof result === 'object') { + strResult = JSON.stringify(result); + } else { + strResult = result; + } + alert("SUCCESS: \r\n"+strResult ); + } + + function errorBuyHandler (error) { alert("ERROR: \r\n"+error ); - } + } - $scope.buyAdFree = function() { + function errorConsumeHandler (error) { + alert("ERROR: \r\n"+error ); + } - alert($scope.preis); + + function buysuccessHandler (result) { + inappbilling.consumePurchase(successConsumeHandler, errorConsumeHandler, $scope.preis); + } + + $scope.buyRose = function() { + + //alert($scope.preis); if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") { - inappbilling.buy(buysuccessHandler, errorHandler,"3xrose"); + inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis); } } diff --git a/platforms/android/assets/www/js/services.js b/platforms/android/assets/www/js/services.js index 73837bf..ac7c5b6 100644 --- a/platforms/android/assets/www/js/services.js +++ b/platforms/android/assets/www/js/services.js @@ -1,50 +1,19 @@ angular.module('starter.services', []) -.factory('Chats', function() { - // Might use a resource here that returns a JSON array - - // Some fake testing data - var chats = [{ - id: 0, - name: 'Ben Sparrow', - lastText: 'You on your way?', - face: 'img/ben.png' - }, { - id: 1, - name: 'Max Lynx', - lastText: 'Hey, it\'s me', - face: 'img/max.png' - }, { - id: 2, - name: 'Adam Bradleyson', - lastText: 'I should buy a boat', - face: 'img/adam.jpg' - }, { - id: 3, - name: 'Perry Governor', - lastText: 'Look at my mukluks!', - face: 'img/perry.png' - }, { - id: 4, - name: 'Mike Harrington', - lastText: 'This is wicked good ice cream.', - face: 'img/mike.png' - }]; +.factory('$localstorage', ['$window', function($window) { return { - all: function() { - return chats; + set: function(key, value) { + $window.localStorage[key] = value; }, - remove: function(chat) { - chats.splice(chats.indexOf(chat), 1); + get: function(key, defaultValue) { + return $window.localStorage[key] || defaultValue; }, - get: function(chatId) { - for (var i = 0; i < chats.length; i++) { - if (chats[i].id === parseInt(chatId)) { - return chats[i]; - } - } - return null; + setObject: function(key, value) { + $window.localStorage[key] = JSON.stringify(value); + }, + getObject: function(key) { + return JSON.parse($window.localStorage[key] || '{}'); } - }; -}); + } +}]); diff --git a/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js b/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js new file mode 100644 index 0000000..ff0e6c9 --- /dev/null +++ b/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js @@ -0,0 +1,237 @@ +cordova.define("cordova-plugin-file-transfer.FileTransfer", function(require, exports, module) { /* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var argscheck = require('cordova/argscheck'), + exec = require('cordova/exec'), + FileTransferError = require('./FileTransferError'), + ProgressEvent = require('cordova-plugin-file.ProgressEvent'); + +function newProgressEvent(result) { + var pe = new ProgressEvent(); + pe.lengthComputable = result.lengthComputable; + pe.loaded = result.loaded; + pe.total = result.total; + return pe; +} + +function getUrlCredentials(urlString) { + var credentialsPattern = /^https?\:\/\/(?:(?:(([^:@\/]*)(?::([^@\/]*))?)?@)?([^:\/?#]*)(?::(\d*))?).*$/, + credentials = credentialsPattern.exec(urlString); + + return credentials && credentials[1]; +} + +function getBasicAuthHeader(urlString) { + var header = null; + + + // This is changed due to MS Windows doesn't support credentials in http uris + // so we detect them by regexp and strip off from result url + // Proof: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/a327cf3c-f033-4a54-8b7f-03c56ba3203f/windows-foundation-uri-security-problem + + if (window.btoa) { + var credentials = getUrlCredentials(urlString); + if (credentials) { + var authHeader = "Authorization"; + var authHeaderValue = "Basic " + window.btoa(credentials); + + header = { + name : authHeader, + value : authHeaderValue + }; + } + } + + return header; +} + +function convertHeadersToArray(headers) { + var result = []; + for (var header in headers) { + if (headers.hasOwnProperty(header)) { + var headerValue = headers[header]; + result.push({ + name: header, + value: headerValue.toString() + }); + } + } + return result; +} + +var idCounter = 0; + +/** + * FileTransfer uploads a file to a remote server. + * @constructor + */ +var FileTransfer = function() { + this._id = ++idCounter; + this.onprogress = null; // optional callback +}; + +/** +* Given an absolute file path, uploads a file on the device to a remote server +* using a multipart HTTP request. +* @param filePath {String} Full path of the file on the device +* @param server {String} URL of the server to receive the file +* @param successCallback (Function} Callback to be invoked when upload has completed +* @param errorCallback {Function} Callback to be invoked upon error +* @param options {FileUploadOptions} Optional parameters such as file name and mimetype +* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false +*/ +FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { + argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments); + // check for options + var fileKey = null; + var fileName = null; + var mimeType = null; + var params = null; + var chunkedMode = true; + var headers = null; + var httpMethod = null; + var basicAuthHeader = getBasicAuthHeader(server); + if (basicAuthHeader) { + server = server.replace(getUrlCredentials(server) + '@', ''); + + options = options || {}; + options.headers = options.headers || {}; + options.headers[basicAuthHeader.name] = basicAuthHeader.value; + } + + if (options) { + fileKey = options.fileKey; + fileName = options.fileName; + mimeType = options.mimeType; + headers = options.headers; + httpMethod = options.httpMethod || "POST"; + if (httpMethod.toUpperCase() == "PUT"){ + httpMethod = "PUT"; + } else { + httpMethod = "POST"; + } + if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { + chunkedMode = options.chunkedMode; + } + if (options.params) { + params = options.params; + } + else { + params = {}; + } + } + + if (cordova.platformId === "windowsphone") { + headers = headers && convertHeadersToArray(headers); + params = params && convertHeadersToArray(params); + } + + var fail = errorCallback && function(e) { + var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body, e.exception); + errorCallback(error); + }; + + var self = this; + var win = function(result) { + if (typeof result.lengthComputable != "undefined") { + if (self.onprogress) { + self.onprogress(newProgressEvent(result)); + } + } else { + successCallback && successCallback(result); + } + }; + exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]); +}; + +/** + * Downloads a file form a given URL and saves it to the specified directory. + * @param source {String} URL of the server to receive the file + * @param target {String} Full path of the file on the device + * @param successCallback (Function} Callback to be invoked when upload has completed + * @param errorCallback {Function} Callback to be invoked upon error + * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false + * @param options {FileDownloadOptions} Optional parameters such as headers + */ +FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) { + argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments); + var self = this; + + var basicAuthHeader = getBasicAuthHeader(source); + if (basicAuthHeader) { + source = source.replace(getUrlCredentials(source) + '@', ''); + + options = options || {}; + options.headers = options.headers || {}; + options.headers[basicAuthHeader.name] = basicAuthHeader.value; + } + + var headers = null; + if (options) { + headers = options.headers || null; + } + + if (cordova.platformId === "windowsphone" && headers) { + headers = convertHeadersToArray(headers); + } + + var win = function(result) { + if (typeof result.lengthComputable != "undefined") { + if (self.onprogress) { + return self.onprogress(newProgressEvent(result)); + } + } else if (successCallback) { + var entry = null; + if (result.isDirectory) { + entry = new (require('cordova-plugin-file.DirectoryEntry'))(); + } + else if (result.isFile) { + entry = new (require('cordova-plugin-file.FileEntry'))(); + } + entry.isDirectory = result.isDirectory; + entry.isFile = result.isFile; + entry.name = result.name; + entry.fullPath = result.fullPath; + entry.filesystem = new FileSystem(result.filesystemName || (result.filesystem == window.PERSISTENT ? 'persistent' : 'temporary')); + entry.nativeURL = result.nativeURL; + successCallback(entry); + } + }; + + var fail = errorCallback && function(e) { + var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body, e.exception); + errorCallback(error); + }; + + exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]); +}; + +/** + * Aborts the ongoing file transfer on this object. The original error + * callback for the file transfer will be called if necessary. + */ +FileTransfer.prototype.abort = function() { + exec(null, null, 'FileTransfer', 'abort', [this._id]); +}; + +module.exports = FileTransfer; + +}); diff --git a/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js b/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js new file mode 100644 index 0000000..8339c2b --- /dev/null +++ b/platforms/android/assets/www/plugins/cordova-plugin-file-transfer/www/FileTransferError.js @@ -0,0 +1,43 @@ +cordova.define("cordova-plugin-file-transfer.FileTransferError", function(require, exports, module) { /* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/** + * FileTransferError + * @constructor + */ +var FileTransferError = function(code, source, target, status, body, exception) { + this.code = code || null; + this.source = source || null; + this.target = target || null; + this.http_status = status || null; + this.body = body || null; + this.exception = exception || null; +}; + +FileTransferError.FILE_NOT_FOUND_ERR = 1; +FileTransferError.INVALID_URL_ERR = 2; +FileTransferError.CONNECTION_ERR = 3; +FileTransferError.ABORT_ERR = 4; +FileTransferError.NOT_MODIFIED_ERR = 5; + +module.exports = FileTransferError; + +}); diff --git a/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js new file mode 100644 index 0000000..464d339 --- /dev/null +++ b/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryEntry.js @@ -0,0 +1,119 @@ +cordova.define("cordova-plugin-file.DirectoryEntry", function(require, exports, module) { /* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var argscheck = require('cordova/argscheck'), + utils = require('cordova/utils'), + exec = require('cordova/exec'), + Entry = require('./Entry'), + FileError = require('./FileError'), + DirectoryReader = require('./DirectoryReader'); + +/** + * An interface representing a directory on the file system. + * + * {boolean} isFile always false (readonly) + * {boolean} isDirectory always true (readonly) + * {DOMString} name of the directory, excluding the path leading to it (readonly) + * {DOMString} fullPath the absolute full path to the directory (readonly) + * {FileSystem} filesystem on which the directory resides (readonly) + */ +var DirectoryEntry = function(name, fullPath, fileSystem, nativeURL) { + + // add trailing slash if it is missing + if ((fullPath) && !/\/$/.test(fullPath)) { + fullPath += "/"; + } + // add trailing slash if it is missing + if (nativeURL && !/\/$/.test(nativeURL)) { + nativeURL += "/"; + } + DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL); +}; + +utils.extend(DirectoryEntry, Entry); + +/** + * Creates a new DirectoryReader to read entries from this directory + */ +DirectoryEntry.prototype.createReader = function() { + return new DirectoryReader(this.toInternalURL()); +}; + +/** + * Creates or looks up a directory + * + * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory + * @param {Flags} options to create or exclusively create the directory + * @param {Function} successCallback is called with the new entry + * @param {Function} errorCallback is called with a FileError + */ +DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { + argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments); + var fs = this.filesystem; + var win = successCallback && function(result) { + var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL); + successCallback(entry); + }; + var fail = errorCallback && function(code) { + errorCallback(new FileError(code)); + }; + exec(win, fail, "File", "getDirectory", [this.toInternalURL(), path, options]); +}; + +/** + * Deletes a directory and all of it's contents + * + * @param {Function} successCallback is called with no parameters + * @param {Function} errorCallback is called with a FileError + */ +DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { + argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments); + var fail = errorCallback && function(code) { + errorCallback(new FileError(code)); + }; + exec(successCallback, fail, "File", "removeRecursively", [this.toInternalURL()]); +}; + +/** + * Creates or looks up a file + * + * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file + * @param {Flags} options to create or exclusively create the file + * @param {Function} successCallback is called with the new entry + * @param {Function} errorCallback is called with a FileError + */ +DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { + argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments); + var fs = this.filesystem; + var win = successCallback && function(result) { + var FileEntry = require('./FileEntry'); + var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL); + successCallback(entry); + }; + var fail = errorCallback && function(code) { + errorCallback(new FileError(code)); + }; + exec(win, fail, "File", "getFile", [this.toInternalURL(), path, options]); +}; + +module.exports = DirectoryEntry; + +}); diff --git a/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js b/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js new file mode 100644 index 0000000..921b486 --- /dev/null +++ b/platforms/android/assets/www/plugins/cordova-plugin-file/www/DirectoryReader.js @@ -0,0 +1,75 @@ +cordova.define("cordova-plugin-file.DirectoryReader", function(require, exports, module) { /* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var exec = require('cordova/exec'), + FileError = require('./FileError') ; + +/** + * An interface that lists the files and directories in a directory. + */ +function DirectoryReader(localURL) { + this.localURL = localURL || null; + this.hasReadEntries = false; +} + +/** + * Returns a list of entries from a directory. + * + * @param {Function} successCallback is called with a list of entries + * @param {Function} errorCallback is called with a FileError + */ +DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { + // If we've already read and passed on this directory's entries, return an empty list. + if (this.hasReadEntries) { + successCallback([]); + return; + } + var reader = this; + var win = typeof successCallback !== 'function' ? null : function(result) { + var retVal = []; + for (var i=0; i or + *