nicer spinner animation, some cleaning
[wl-mobile.git] / assets / www / js / dbput.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 DBPut
9  */
10 var DBPut = { 
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         put: function(asset, target, overwrite, win, fail) {
19                 if (overwrite==false) overwrite="false";
20                 else overwrite="true";
21                 return PhoneGap.exec(
22                         win, 
23                         fail, 
24                         "DBPut", 
25                         "put", 
26                         [asset, target, overwrite]
27                 );
28         },
29         fetch: function(url, win, fail) {
30                 return PhoneGap.exec(
31                         win, 
32                         fail, 
33                         "DBPut", 
34                         "fetch", 
35                         [url]
36                 );
37         }
38 };
39