cfdbedea0e622e64062d0393c55386ab95ed07c0
[wl-mobile.git] / assets / www / js / dbput.js
1 /**
2  *  
3  * @return Object literal singleton instance of DBPut
4  */
5 var DBPut = { 
6         /**
7      * @param asset Path to the asset (relative to assets dir)
8      * @param target Path to DB file (relative to app db files dir)
9      * @param overwrite
10      * @param win Success callback
11      * @param fail Error callback
12      */
13         put: function(asset, target, overwrite, win, fail) {
14                 if (overwrite==false) overwrite="false";
15                 else overwrite="true";
16                 return PhoneGap.exec(
17                         win, 
18                         fail, 
19                         "DBPut", 
20                         "put", 
21                         [asset, target, overwrite]
22                 );
23         },
24         fetch: function(url, win, fail) {
25                 return PhoneGap.exec(
26                         win, 
27                         fail, 
28                         "DBPut", 
29                         "fetch", 
30                         [url]
31                 );
32         }
33 };
34