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