X-Git-Url: https://git.mdrn.pl/wl-mobile.git/blobdiff_plain/4aa83d4ec5f1b6d86b922e022df16de4fe373ea8..91d4143f8e07f469843b2265ce3120bbd64e1fde:/assets/www/js/assetcopy.js diff --git a/assets/www/js/assetcopy.js b/assets/www/js/assetcopy.js new file mode 100644 index 0000000..a9bc86f --- /dev/null +++ b/assets/www/js/assetcopy.js @@ -0,0 +1,23 @@ +/* + * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later. + * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. + */ + +/** + * + * @return Object literal singleton instance of AssetCopy + */ +var AssetCopy = { + /** + * @param asset Path to the asset (relative to assets dir) + * @param target Path to DB file (relative to app db files dir) + * @param overwrite + * @param win Success callback + * @param fail Error callback + */ + copy: function(asset, target, overwrite, win, fail) { + if(overwrite==false) overwrite="false"; + else overwrite="true"; + PhoneGap.exec(win, fail, "AssetCopy", "copy", [asset, target, overwrite]); + }, +};