This repository has been archived by the owner on Nov 29, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
/
settings.js
85 lines (68 loc) · 1.74 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* Controller for the settings screen
*
* @class Controllers.settings
* @uses core
*/
var APP = require("core");
/**
* Initializes the controller
*/
$.init = function() {
APP.log("debug", "settings.init");
if(!APP.LEGAL.TOS && !APP.LEGAL.PRIVACY) {
$.container.remove($.legal_table);
} else if(!APP.LEGAL.TOS || !APP.LEGAL.PRIVACY) {
if(!APP.LEGAL.TOS) {
setTimeout(function() {
$.legal_table.deleteRow(0);
}, 1);
}
if(!APP.LEGAL.PRIVACY) {
setTimeout(function() {
$.legal_table.deleteRow(1);
}, 1);
}
$.legal_table.height = "45dp";
}
if(!Ti.UI.createEmailDialog().isSupported) {
$.container.remove($.logs_table);
}
$.copyright.text = APP.LEGAL.COPYRIGHT + " v" + APP.VERSION;
$.chariti.text = "ChariTi © 2013 Matthew Congrove v" + APP.CVERSION;
$.NavigationBar.setBackgroundColor(APP.Settings.colors.primary);
if(APP.Settings.useSlideMenu) {
$.NavigationBar.showMenu(function(_event) {
APP.toggleMenu();
});
} else {
$.NavigationBar.showBack(function(_event) {
APP.removeChild(true);
});
}
};
// Event listeners
$.terms.addEventListener("click", function(_event) {
APP.log("debug", "settings @terms");
APP.addChild("settings_legal", {
title: "Terms of Service",
url: APP.LEGAL.TOS
}, true);
});
$.privacy.addEventListener("click", function(_event) {
APP.log("debug", "settings @privacy");
APP.addChild("settings_legal", {
title: "Privacy Policy",
url: APP.LEGAL.PRIVACY
}, true);
});
$.acknowledgements.addEventListener("click", function(_event) {
APP.log("debug", "settings @credits");
APP.addChild("settings_credits", {}, true);
});
$.logs.addEventListener("click", function(_event) {
APP.log("debug", "settings @logs");
APP.logSend();
});
// Kick off the init
$.init();