forked from akosma/Sencha-Touch-2-Up-And-Running
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
225 lines (220 loc) · 5.61 KB
/
app.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
var data = [{
title: 'Bare Bones App',
url: 'Chapter_01_Bare_Bones',
chapter: '1. Getting Started',
chapterNumber: 1,
order: 1
}, {
title: 'Sencha Cmd App',
url: 'Chapter_01_Sencha_Cmd',
chapter: '1. Getting Started',
chapterNumber: 1,
order: 2
}, {
title: 'Foundation Classes',
url: 'Chapter_02_Class_System',
chapter: '2. Class System',
chapterNumber: 2,
order: 1
}, {
title: 'Views Catalogue',
url: 'Chapter_03_Views',
chapter: '3. Views',
chapterNumber: 3,
order: 1
}, {
title: 'Layouts and Templates',
url: 'Chapter_03_Layouts',
chapter: '3. Views',
chapterNumber: 3,
order: 2
}, {
title: 'Data Browser App',
url: 'Chapter_04_Data',
chapter: '4. Data',
chapterNumber: 4,
order: 1
}, {
title: 'Server Side HTML',
url: 'Chapter_04_Data/Server/index.php',
chapter: '4. Data',
chapterNumber: 4,
order: 2
}, {
title: 'Server Side JSON',
url: 'Chapter_04_Data/Server/index.php?format=json',
chapter: '4. Data',
chapterNumber: 4,
order: 3
}, {
title: 'Server Side XML',
url: 'Chapter_04_Data/Server/index.php?format=xml',
chapter: '4. Data',
chapterNumber: 4,
order: 4
}, {
title: 'Local Storage',
url: 'Chapter_04_LocalStorage',
chapter: '4. Data',
chapterNumber: 4,
order: 5
}, {
title: 'Data Views',
url: 'Chapter_04_DataViews',
chapter: '4. Data',
chapterNumber: 4,
order: 6
}, {
title: 'Forms',
url: 'Chapter_05_Forms',
chapter: '5. Forms',
chapterNumber: 5,
order: 1
}, {
title: 'Controllers',
url: 'Chapter_06_Controllers',
chapter: '6. Controllers',
chapterNumber: 6,
order: 1
}, {
title: 'Sencha Default',
url: 'Chapter_07_Styles/default_sencha.html',
chapter: '7. Styling Applications',
chapterNumber: 7,
order: 1
}, {
title: 'iOS Style',
url: 'Chapter_07_Styles/default_apple.html',
chapter: '7. Styling Applications',
chapterNumber: 7,
order: 2
}, {
title: 'Android Style',
url: 'Chapter_07_Styles/default_android.html',
chapter: '7. Styling Applications',
chapterNumber: 7,
order: 3
}, {
title: 'BlackBerry 6 Style',
url: 'Chapter_07_Styles/default_bb6.html',
chapter: '7. Styling Applications',
chapterNumber: 7,
order: 4
}, {
title: 'Custom Styles with SASS',
url: 'Chapter_07_Styles',
chapter: '7. Styling Applications',
chapterNumber: 7,
order: 5
}, {
title: 'To Do App',
url: 'Chapter_08_ToDoApp',
chapter: '8. Testing and Debugging',
chapterNumber: 8,
order: 1
}, {
title: 'Jasmine Tests',
url: 'Chapter_08_Jasmine/SpecRunner.html',
chapter: '8. Testing and Debugging',
chapterNumber: 8,
order: 2
}, {
title: 'Siesta Tests',
url: 'Chapter_08_Siesta',
chapter: '8. Testing and Debugging',
chapterNumber: 8,
order: 3
}, {
title: 'JSDuck output',
url: 'Chapter_08_JSDuck/#!/api/AkoLib.view.SplitView',
chapter: '8. Testing and Debugging',
chapterNumber: 8,
order: 4
}, {
title: 'Architect',
url: 'Chapter_09_Architect/ToDoList/app.html',
chapter: '9. Sencha Architect',
chapterNumber: 9,
order: 1
}, {
title: 'Device Profiles',
url: 'Chapter_10_Profiles',
chapter: '10. Deployment in Devices',
chapterNumber: 10,
order: 1
}, {
title: 'Device APIs Demo',
url: 'Chapter_10_Device',
chapter: '10. Deployment in Devices',
chapterNumber: 10,
order: 2
}, {
title: 'Universal Application',
url: 'Chapter_10_Universal_App',
chapter: '10. Deployment in Devices',
chapterNumber: 10,
order: 3
}];
var store = Ext.create('Ext.data.Store', {
data: data,
grouper: {
groupFn: function(record) {
return record.get('chapter');
},
sortProperty: 'chapterNumber'
},
sorters: [{
property: 'chapterNumber',
direction: 'ASC'
}, {
property: 'order',
direction: 'ASC'
}]
});
Ext.application({
name: 'SenchaTouch2UpAndRunning',
icon: {
57: 'img/Icon.png',
72: 'img/Icon-iPad.png',
114: 'img/Icon@2x.png', // Retina iPhone
144: 'img/Icon-iPad@2x.png' // Retina iPad
},
// http://www.sencha.com/forum/showthread.php?199382-phoneStartupScreen-doesn-t-work
startupImage: {
'320x460': 'img/Default.png',
'640x920': 'img/Default@2x.png', // Retina iPhone
'640x1096': 'img/Default-568@2x.png', // Retina 4-inch iPhone
'768x1004': 'img/Default-Portrait.png',
'748x1024': 'img/Default-Landscape.png',
'1536x2008': 'img/Default-Portrait@2x.png', // Retina iPad, Portrait
'1496x2048': 'img/Default-Landscape@2x.png' // Retina iPad, Landscape
},
launch: function () {
Ext.Viewport.add({
xtype: 'list',
pinHeaders: false,
fullscreen: true,
itemTpl: '{title}',
store: store,
grouped: true,
indexBar: {
letters: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
},
items: [{
xtype: 'titlebar',
docked: 'top',
title: 'Sencha Touch 2 Book Code'
}, {
xtype: 'titlebar',
docked: 'bottom',
title: 'by Adrian Kosmaczewski'
}],
ui: 'round',
listeners: {
itemtap: function(list, index, target, record, e, eOpts) {
location.href = record.get('url');
}
}
});
}
});