offline version
[wl-mobile.git] / assets / www / js / assetcopy.js
1 /*
2  * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later.
3  * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4  */
5
6 /**
7  *  
8  * @return Object literal singleton instance of AssetCopy
9  */
10 var AssetCopy = { 
11         /**
12      * @param asset Path to the asset (relative to assets dir)
13      * @param target Path to DB file (relative to app db files dir)
14      * @param overwrite
15      * @param win Success callback
16      * @param fail Error callback
17      */
18     copy: function(asset, target, overwrite, win, fail) {
19                 if(overwrite==false) overwrite="false";
20                 else overwrite="true";
21                 PhoneGap.exec(win, fail, "AssetCopy", "copy", [asset, target, overwrite]);
22         },
23 };