-
Notifications
You must be signed in to change notification settings - Fork 4
/
mainmenu-controller.js
170 lines (165 loc) · 4.26 KB
/
mainmenu-controller.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
var util = require('util');
var MenuController = require('../controllers/menu-controller');
var MapController = require('../controllers/map-controller');
var Famous = require('../shims/famous');
var templates = require('../lib/templates');
var TemplateController = require('../controllers/template-controller');
var MapSplitController = require('../controllers/mapsplit-controller');
var T = require('../translate');
function MainMenuController(options) {
options = options || {};
options.buttonDescriptors = {
about: {
title: T.span({
ro: 'Despre Deltă',
en: 'About the Delta',
}),
viewController: function () {
return new TemplateController({
template: templates.ghid.about.index,
title: T.span({
ro: 'Despre Deltă',
en: 'About the Delta',
}),
backIcon: 'fa-home',
});
},
},
restricted: {
title: T.span({
ro: 'Zone strict protejate',
en: 'Preserved areas',
}),
viewController: function () {
return new TemplateController({
template: templates.ghid.restricted.index,
title: T.span({
ro: 'Zone strict protejate',
en: 'Preserved areas',
}),
backIcon: 'fa-home',
});
},
},
landmarks: {
title: T.span({
ro: 'Cultură și istorie',
en: 'Culture and history',
}),
viewController: function () {
return new TemplateController({
template: templates.ghid.landmarks.index,
title: T.span({
ro: 'Cultură și istorie',
en: 'Culture and history',
}),
backIcon: 'fa-home',
});
},
},
planning: {
title: T.span({
ro: 'Planificare',
en: 'Planning',
}),
viewController: function () {
return new TemplateController({
template: templates.ghid.planning.index,
title: T.span({
ro: 'Planificare',
en: 'Planning',
}),
backIcon: 'fa-home',
});
},
},
routes: {
title: T.span({
ro: 'Trasee navale',
en: 'Boat routes',
}),
viewController: function () {
return new MapSplitController({
template: templates.ghid.routes.index,
mapOptions: {
preset: 'routes',
},
title: T.span({
ro: 'Trasee navale',
en: 'Boat routes',
}),
backIcon: 'fa-home',
});
},
},
trails: {
title: T.span({
ro: 'Trasee terestre',
en: 'Hiking trails',
}),
viewController: function () {
return new MapSplitController({
template: templates.ghid.trails.index,
mapOptions: {
preset: 'routes',
},
title: T.span({
ro: 'Trasee terestre',
en: 'Hiking trails',
}),
backIcon: 'fa-home',
});
},
},
maps: {
title: T.span({
ro: 'Harta Deltei',
en: 'Map of the Delta',
}),
viewController: function () {
return new MapController({
backIcon: 'fa-home',
});
},
},
settings: {
viewController: function () {
return new TemplateController({
template: templates.ghid.settings.index,
settings: {
lang: {
get: function () {
return T.getLanguage() === 'en';
},
set: function (value) {
T.setLanguage(value? 'en' : 'ro');
},
},
animations: {
get: Famous.AnimationToggle.get,
set: Famous.AnimationToggle.set,
},
},
title: T.span({
ro: 'Setări',
en: 'Settings',
}),
backIcon: 'fa-home',
});
},
}
};
options.buttonLayout = [
['routes', 'trails'],
['landmarks', 'planning'],
['about', 'restricted'],
['maps'],
];
options.title = T.span({
ro: 'Delta Dunării',
en: 'The Danube Delta',
});
MenuController.call(this, options);
}
util.inherits(MainMenuController, MenuController);
module.exports = MainMenuController;