-
Notifications
You must be signed in to change notification settings - Fork 19
/
app.js
132 lines (127 loc) · 3.58 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
/*
* File: app.js
*
* This file was generated by Sencha Architect version 2.0.0.
* http://www.sencha.com/products/architect/
*
* This file requires use of the Sencha Touch 2.0.x library, under independent license.
* License of Sencha Architect does not include license for Sencha Touch 2.0.x. For more
* details see http://www.sencha.com/license or contact [email protected].
*
* This file will be auto-generated each and everytime you save your project.
*
* Do NOT hand edit this file.
*/
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.device': 'device/'
}
});
Ext.application({
requires: [
'Ext.device.Camera'
],
models: [
'Contact',
'Group'
],
stores: [
'ContactStore',
'GroupStore'
],
views: [
'Main',
'Info',
'Form',
'Picture',
'ContactList',
'FavoriteView',
'GroupList',
'ContactOrder'
],
name: 'Contact',
controllers: [
'Contacts'
],
launch: function() {
Ext.require('Ext.device.*');
Ext.util.Format.empty = function(value, defaultValue) {
return !Ext.isEmpty(value) ? value : defaultValue;
};
Ext.util.Format.undef = function(value, defaultValue) {
return Ext.isDefined(value) ? value : defaultValue;
};
var cs = Ext.StoreMgr.lookup('ContactStore');
var gs = Ext.StoreMgr.lookup('GroupStore');
if (!cs.getCount() || !gs.getCount()) {
Ext.Msg.alert('Intro', 'Setting up default database.');
// Add demo contacts
cs.add({
firstName: 'Aaron',
lastName: 'Conran',
emailAddress: '[email protected]',
phoneNumber: '443-555-1234',
group: 'Sencha'
});
cs.add({
firstName: 'Aditya',
lastName: 'Bansod',
phoneNumber: '555-555-1234',
group: 'Sencha'
});
cs.add({
firstName: 'Luca',
lastName: 'Candela',
phoneNumber: '555-555-1234',
group: 'Sencha'
});
cs.add({
firstName: 'Tommy',
lastName: 'Maintz',
isFavorite: true,
phoneNumber: '717-555-1234',
group: 'Sencha'
});
cs.add({
firstName: 'Nige',
lastName: '(Animal) White',
isFavorite: true,
phoneNumber: '555-555-1234',
group: 'Sencha'
});
cs.add({
firstName: 'Osvaldo',
lastName: 'Brignoni',
phoneNumber: '555-555-1234',
group: 'Github'
});
cs.add({
firstName: 'Tom',
lastName: 'Hanks',
phoneNumber: '555-555-1234',
group: 'Movie Stars'
});
cs.add({
firstName: 'Julia',
lastName: 'Roberts',
phoneNumber: '555-555-1234',
group: 'Movie Stars'
});
//Add demo groups
gs.add({
name: 'Contacts' // Default group
});
gs.add({
name: 'Github'
});
gs.add({
name: 'Movie Stars'
});
gs.add({
name: 'Sencha'
});
}
Ext.create('Contact.view.Main', {fullscreen: true});
}
});