This repository was archived by the owner on Apr 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
136 lines (119 loc) · 4.99 KB
/
app.js
File metadata and controls
136 lines (119 loc) · 4.99 KB
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
/*--------------------------------------------------------------------------------+
- Dateiname: /app.js
- Beschreibung: Einstieg für die Applikation.
- Datum: 25.11.2013
- Autor(en): Andreas Gärtner <andreas.gaertner@hotmail.com>
+--------------------------------------------------------------------------------+
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or any later version.
+--------------------------------------------------------------------------------+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, see <http://www.gnu.org/licenses/>.
+--------------------------------------------------------------------------------+
Inoffizielle deutsche Übersetzung (http://www.gnu.de/documents/gpl.de.html):
Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU
General Public License, wie von der Free Software Foundation veröffentlicht,
weitergeben und/oder modifizieren, entweder gemäß Version 3 der Lizenz oder
jeder späteren Version.
+--------------------------------------------------------------------------------+
Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß es Ihnen von
Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie
der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details finden
Sie in der GNU General Public License.
Sie sollten ein Exemplar der GNU General Public License zusammen mit diesem
Programm erhalten haben. Falls nicht, siehe <http://www.gnu.org/licenses/>.
+--------------------------------------------------------------------------------+
*/
Ext.require([
'Ext.viewport.Viewport'
]);
Ext.application({
name: 'LearningApp',
appFolder: 'app',
requires: [
'LearningApp.view.Main',
'LearningApp.proxy.Proxy',
'LearningApp.prototype.CustomMessageBox'
],
viewport: {
autoMaximize: Ext.os.is.iOS && Ext.browser.is.webview
},
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
'114': 'resources/icons/Icon@2x.png', // Retina iPhone
'144': 'resources/icons/Icon~ipad@2x.png' // Retina iPad
},
startupImage: {
'320x460': 'resources/startup/320x460.jpg',
'640x920': 'resources/startup/640x920.png', // Retina iPhone
'768x1004': 'resources/startup/768x1004.png',
'748x1024': 'resources/startup/748x1024.png',
'1536x2008': 'resources/startup/1536x2008.png', // Retina iPad, Portrait
'1496x2048': 'resources/startup/1496x2048.png' // Retina iPad, Landscape
},
models: [
'CardIndexModel',
'Category',
'Question'
],
stores: [
'CardIndexStore',
'QuestionStore'
],
controllers: [
'Navigation',
'LoginController',
'AnswerController',
'StorageController'
],
fullscreen: true,
isIconPrecomposed: true,
statusBarStyle: 'default',
/**
* app configuration
*/
daysUntilReloadData: 0,
daysUntilLoginExpires: 14,
randomQuestionCount: 10,
launch: function() {
var me = this;
this.storageController = this.getController('StorageController');
this.proxy = Ext.create('LearningApp.proxy.Proxy');
this.main = Ext.create('LearningApp.view.Main');
this.getController('LoginController').checkLogin(function(loginState) {
me.main.initializeComponents(loginState);
Ext.Viewport.add(me.main);
});
},
setMasked: function(message, promise) {
Ext.Viewport.setMasked({xtype:'loadmask', message: message});
Ext.create('Ext.util.DelayedTask', promise, this).delay(1);
},
/** destroy loading indicator */
closeSplashscreen: function () {
if (!LearningApp.app.scDestroyed && LearningApp.app.appLoadingFinished && window.closeSplashscreen) {
LearningApp.app.scDestroyed = true;
Ext.fly('splashScreenContainer').destroy();
} else {
Ext.create('Ext.util.DelayedTask', function () {
LearningApp.app.closeSplashscreen();
}).delay(500);
}
},
onUpdated: function() {
Ext.Msg.confirm(
"Update",
"Diese Applikation wurde erfolgreich auf die neuste Version aktualisiert. Möchten Sie die App neustarten?",
function(buttonId) {
if (buttonId === 'yes') {
window.location.reload();
}
}
);
}
});