Mercurial > lada > lada-client
annotate app.js @ 801:646779690e20
moved code to request the server version to app.js
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 22 May 2015 12:34:14 +0200 |
parents | ff4330d4aba1 |
children | c6e9bcda69b8 |
rev | line source |
---|---|
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /** |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * Software engineering by Intevation GmbH |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * This file is Free Software under the GNU GPL (v>=3) |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * and comes with ABSOLUTELY NO WARRANTY! Check out |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 * the documentation coming with IMIS-Labordaten-Application for details. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 */ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 Ext.Loader.setConfig({ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 enabled: true, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 paths: { |
724
876456ce0a01
Added new depencies: filesaver[1] and upload[2].
Raimund Renkert <raimund.renkert@intevation.de>
parents:
719
diff
changeset
|
12 'Ext.i18n': 'resources/lib/i18n/', |
876456ce0a01
Added new depencies: filesaver[1] and upload[2].
Raimund Renkert <raimund.renkert@intevation.de>
parents:
719
diff
changeset
|
13 'Ext.ux.upload': 'resources/lib/upload' |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 } |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 Ext.application({ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 // Name of the application. Do not change as this name is used in |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 // references! |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 name: 'Lada', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 // Setting up translations. This is done using a ext-plgin which can be |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 // found on https://github.com/elmasse/Ext.i18n.Bundle |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 requires: [ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 'Lada.override.Table', |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
27 'Lada.override.RestProxy', |
570
1f6a22107c8c
Added override for RowEditor.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
558
diff
changeset
|
28 'Lada.override.RowEditor', |
679
60a3e9809ea4
moved code from translations_de.js into proper overrides
Dustin Demuth <dustin@intevation.de>
parents:
673
diff
changeset
|
29 'Lada.override.i18n.DE', |
60a3e9809ea4
moved code from translations_de.js into proper overrides
Dustin Demuth <dustin@intevation.de>
parents:
673
diff
changeset
|
30 'Lada.override.JSON', |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 'Ext.i18n.Bundle', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 'Ext.layout.container.Column', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 'Lada.store.Datenbasis', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 'Lada.store.Messeinheiten', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 'Lada.store.Messgroessen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 'Lada.store.Messmethoden', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 'Lada.store.Messstellen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 'Lada.store.Netzbetreiber', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 'Lada.store.Locations', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 'Lada.store.Pflichtmessgroessen', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 'Lada.store.Probenarten', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 'Lada.store.Probenzusaetze', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 'Lada.store.Staaten', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 'Lada.store.Umwelt', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 'Lada.store.Verwaltungseinheiten' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 ], |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 bundle: { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 bundle: 'Lada', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 lang: 'de-DE', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 path: 'resources/i18n', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 noCache: true |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 // Setting this variable to true triggers loading the Viewport.js |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 // file which sets ob the viewport. |
668
3e91716f5862
Create the viewport manually on application startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
608
diff
changeset
|
56 //autoCreateViewport: true, |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 // Start the application. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 launch: function() { |
716
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
60 Lada.username = ''; |
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
61 Lada.userroles = ''; |
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
62 Lada.logintime = ''; |
798
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
758
diff
changeset
|
63 Lada.mst = []; |
801
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
64 Lada.clientversion = '2.0beta2'; |
716
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
65 |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
66 var queryString = document.location.href.split('?')[1]; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
67 if (queryString) { |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
68 Lada.openIDParams = queryString; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
69 } |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
70 Ext.Ajax.request({ |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
71 url: 'lada-server/login?return_to=' + window.location.href, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
72 method: 'GET', |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
73 headers: { |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
74 'X-OPENID-PARAMS': Lada.openIDParams |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
75 }, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
76 scope: this, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
77 success: this.onLoginSuccess, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
78 failure: this.onLoginFailure |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
79 }); |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
80 }, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
81 |
669 | 82 onLoginFailure: function(response) { |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
83 try { |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
84 var json = Ext.decode(response.responseText); |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
85 if (json) { |
669 | 86 if (json.message === '699') { |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
87 /* This is the unauthorized message with the authentication |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
88 * redirect in the data */ |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
89 var authUrl = json.data; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
90 location.href = authUrl; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
91 return; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
92 } |
669 | 93 if (json.message === '698') { |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
94 /* This is general authentication error */ |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
95 Ext.MessageBox.alert('Kommunikation mit dem Login Server fehlgeschlagen', |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
96 json.data); |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
97 return; |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
98 } |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
99 } |
669 | 100 } |
101 catch (e) { | |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
102 // This is likely a 404 or some unknown error. Show general error then. |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
103 } |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
104 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen', |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
105 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.'); |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
106 }, |
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
107 |
715
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
679
diff
changeset
|
108 onLoginSuccess: function(response) { |
801
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
109 Lada.serverversion = this.getServerVersion(); |
719
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
110 |
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
111 if (!Ext.isIE9m) { |
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
112 /* Strip out the openid query params to look nicers. */ |
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
113 // Not supported in old IE's |
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
114 window.history.pushState(this.name, this.name, window.location.pathname); |
5e91a740aff8
Added a Browser Switch as a function is not available in IE9 and lower
Dustin Demuth <dustin@intevation.de>
parents:
716
diff
changeset
|
115 } |
608
7fd9350eacf9
Add client side openID authentication handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
607
diff
changeset
|
116 |
668
3e91716f5862
Create the viewport manually on application startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
608
diff
changeset
|
117 Ext.create('Lada.view.Viewport'); |
3e91716f5862
Create the viewport manually on application startup.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
608
diff
changeset
|
118 |
715
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
679
diff
changeset
|
119 /* Parse Username and Timestamp */ |
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
679
diff
changeset
|
120 var json = Ext.decode(response.responseText); |
716
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
121 Lada.username = json.data.username; |
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
122 Lada.userroles = json.data.roles; |
b400629a2575
Added Logininformation to a Popup in Viewport
Dustin Demuth <dustin@intevation.de>
parents:
715
diff
changeset
|
123 Lada.logintime = json.data.servertime; |
798
ff4330d4aba1
Filter Messtellen in Probeform and Messprogramm
Dustin Demuth <dustin@intevation.de>
parents:
758
diff
changeset
|
124 Lada.mst = json.data.mst; //Store Messstellen this user may select |
715
605bc34b45a0
Disable the Fertig-Flag Checkbox in a Messung when the User is not the owner. Do not enable Form-Children when readonly is set to true. Parse login-response in app.js
Dustin Demuth <dustin@intevation.de>
parents:
679
diff
changeset
|
125 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 Ext.create('Lada.store.Datenbasis', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 storeId: 'datenbasis' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 Ext.create('Lada.store.Messeinheiten', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 storeId: 'messeinheiten' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 Ext.create('Lada.store.Messgroessen', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 storeId: 'messgroessen' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 Ext.create('Lada.store.Messmethoden', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 storeId: 'messmethoden' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 Ext.create('Lada.store.Messstellen', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 storeId: 'messstellen' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 Ext.create('Lada.store.Netzbetreiber', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
142 storeId: 'netzbetreiber' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 Ext.create('Lada.store.Locations', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 storeId: 'locations' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 Ext.create('Lada.store.Pflichtmessgroessen', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 storeId: 'pflichtmessgroessen' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 Ext.create('Lada.store.Probenarten', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 storeId: 'probenarten' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 Ext.create('Lada.store.Probenzusaetze', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 storeId: 'probenzusaetze' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 Ext.create('Lada.store.Staaten', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 storeId: 'staaten' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 Ext.create('Lada.store.Umwelt', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 storeId: 'umwelt' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 Ext.create('Lada.store.Verwaltungseinheiten', { |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 storeId: 'verwaltungseinheiten' |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 }); |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 }, |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 |
801
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
167 getServerVersion: function() { |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
168 var i18n = Lada.getApplication().bundle; |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
169 Ext.Ajax.request({ |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
170 url: '/lada-server/version', |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
171 method: 'GET', |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
172 headers: { |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
173 'X-OPENID-PARAMS': Lada.openIDParams |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
174 }, |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
175 success: function(response) { |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
176 var json = Ext.decode(response.responseText); |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
177 return json.data; |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
178 }, |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
179 failure: function(response) { |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
180 console.log('Error in retrieving the server version.' |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
181 + ' It might be lower than 2.0-beta2' |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
182 + ' Or something is broken...'); |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
183 return i18n.getMsg('err.msg.generic.title'); |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
184 } |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
185 }); |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
186 }, |
646779690e20
moved code to request the server version to app.js
Dustin Demuth <dustin@intevation.de>
parents:
798
diff
changeset
|
187 |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
188 // Define the controllers of the application. They will be initialized |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
189 // first before the application "launch" function is called. |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
190 controllers: [ |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
191 'Lada.controller.Filter', |
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
192 'Lada.controller.FilterResult', |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
580
diff
changeset
|
193 'Lada.controller.form.Probe', |
611
8a156a7fbe67
added a controller for messungforms, modified testdatensatz-widget to load a local store, removed dirtychange listeners from probe-form
Dustin Demuth <dustin@intevation.de>
parents:
607
diff
changeset
|
194 'Lada.controller.form.Messung', |
607
80077aeaa9ed
Load the ort form controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
597
diff
changeset
|
195 'Lada.controller.form.Ort', |
587
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
580
diff
changeset
|
196 'Lada.controller.grid.Ort', |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
580
diff
changeset
|
197 'Lada.controller.grid.Probenzusatzwert', |
cf328526b5bb
Moved controller into subfolders.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
580
diff
changeset
|
198 'Lada.controller.grid.PKommentar', |
597
d2ce1c4c3aad
Add messung kommentare to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
595
diff
changeset
|
199 'Lada.controller.grid.MKommentar', |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
587
diff
changeset
|
200 'Lada.controller.grid.Messung', |
595
a81dafe06d1d
Add status to messung edit window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
590
diff
changeset
|
201 'Lada.controller.grid.Messwert', |
638
d21048cbdbb3
Added controllers for map and location form and handle new locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
611
diff
changeset
|
202 'Lada.controller.grid.Status', |
d21048cbdbb3
Added controllers for map and location form and handle new locations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
611
diff
changeset
|
203 'Lada.controller.Map', |
747
3ffecbce17d6
Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
Dustin Demuth <dustin@intevation.de>
parents:
724
diff
changeset
|
204 'Lada.controller.form.Location', |
754
6b0d0e62f7d7
added Probenintervalle to a Messprogramm... there is still a lot of work needed. For instance for the slider element.
Dustin Demuth <dustin@intevation.de>
parents:
747
diff
changeset
|
205 'Lada.controller.ProbenPlanungSwitcher', |
758
b2fcbdc4969d
Filled MessmethodenGrid with life.
Dustin Demuth <dustin@intevation.de>
parents:
754
diff
changeset
|
206 'Lada.controller.form.Messprogramm', |
b2fcbdc4969d
Filled MessmethodenGrid with life.
Dustin Demuth <dustin@intevation.de>
parents:
754
diff
changeset
|
207 'Lada.controller.grid.Messmethode' |
b2fcbdc4969d
Filled MessmethodenGrid with life.
Dustin Demuth <dustin@intevation.de>
parents:
754
diff
changeset
|
208 ] |
548
d47ee7439f44
Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
209 }); |