-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
139 lines (134 loc) · 5.4 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
/*
This file is generated and updated by Sencha Cmd. You can edit this file as
needed for your application, but these edits will have to be merged by
Sencha Cmd when it performs code generation tasks such as generating new
models, controllers or views and when running "sencha app upgrade".
Ideally changes to this file would be limited and most work would be done
in other places (such as Controllers). If Sencha Cmd cannot merge your
changes and its generated code, it will produce a "merge conflict" that you
will need to resolve manually.
*/
// DO NOT DELETE - this directive is required for Sencha Cmd packages to work.
//@require @packageOverrides
//<debug>
Ext.Loader.setPath({
'Ext': 'touch/src'
});
//</debug>
Ext.application({
name: 'MathPASS',
viewport: {},
requires: [
'Ext.MessageBox',
'Ext.form.Panel',
'Ext.form.FieldSet',
'Ext.field.Select',
'Ext.TitleBar',
'Ext.data.Store',
'MathPASS.view.studentMain',
'MathPASS.view.teacherMain',
'MathPASS.view.administratorMain'
],
views: [
'Main',
'register',
'homepage',
'practice',
'information',
'contactus',
'studentFindaClass',
'studentGrades',
'studentMain',
'studentpage',
'administratorItAnaly',
'administratorMain',
'administratorProblems',
'administratorUsers',
'teacherAssignments',
'exportgrade',
'teacherItemAnalysis',
'teacherMain',
'teacherpage',
'ChapterList',
'ChapterListItem',
'ProblemList',
'ProblemListItem',
'ProblemSet'
],
models:[
'login',
'register',
'userinfo',
'contactus',
'pcourse',
'Chapter',
'Problem',
'Class',
'Assignment'
],
controllers:[
'register',
'login',
'contactus',
'practice',
'exportgrade',
'TeachersAssignments',
'ProblemSet'
],
stores:[
'userinfo',
'Chapter',
'pcourse',
'Problem',
'Class',
'Assignment_teacher'
],
launch: function() {
// Initialize the main view
var userInfoData=Ext.getStore('UserInfo');
if(null!=userInfoData.getAt(0)){
var status = userInfoData.getAt(0).get('login_status');
var firstName = userInfoData.getAt(0).get('firstName');
var lastName = userInfoData.getAt(0).get('lastName');
var finallyValue = firstName+lastName;
if(status==3){
Ext.Viewport.add(Ext.create('MathPASS.view.studentMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.Main'));
Ext.Viewport.add(Ext.create('MathPASS.view.register'));
Ext.Viewport.add(Ext.create('MathPASS.view.teacherMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.administratorMain'));
Ext.getCmp('studentpageview').down('label').setHtml(finallyValue);
}else if(status==2){
Ext.Viewport.add(Ext.create('MathPASS.view.teacherMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.Main'));
Ext.Viewport.add(Ext.create('MathPASS.view.register'));
Ext.Viewport.add(Ext.create('MathPASS.view.studentMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.administratorMain'));
Ext.getCmp('teacherpageview').down('label').setHtml(finallyValue);
}else if(status==1){
Ext.Viewport.add(Ext.create('MathPASS.view.administratorMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.Main'));
Ext.Viewport.add(Ext.create('MathPASS.view.register'));
Ext.Viewport.add(Ext.create('MathPASS.view.studentMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.teacherMain'));
}
}else{
Ext.Viewport.add(Ext.create('MathPASS.view.Main'));
Ext.Viewport.add(Ext.create('MathPASS.view.register'));
Ext.Viewport.add(Ext.create('MathPASS.view.studentMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.teacherMain'));
Ext.Viewport.add(Ext.create('MathPASS.view.administratorMain'));
}
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) {
if (buttonId === 'yes') {
window.location.reload();
}
}
);
}
});