aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/Application.js2
-rw-r--r--web/DeviceView.js2
-rw-r--r--web/Login.js12
-rw-r--r--web/MainView.js2
-rw-r--r--web/MapView.js12
-rw-r--r--web/Strings.js5
-rw-r--r--web/Styles.js5
-rw-r--r--web/index.html2
8 files changed, 22 insertions, 20 deletions
diff --git a/web/Application.js b/web/Application.js
index 12ece2e51..a1794770a 100644
--- a/web/Application.js
+++ b/web/Application.js
@@ -17,6 +17,8 @@
Ext.application({
name: 'Traccar',
requires: [
+ 'Strings',
+ 'Styles',
'Login',
'MainView'
],
diff --git a/web/DeviceView.js b/web/DeviceView.js
index cf5502418..6d475e406 100644
--- a/web/DeviceView.js
+++ b/web/DeviceView.js
@@ -18,5 +18,5 @@ Ext.define('DeviceView', {
extend: 'Ext.form.Panel',
xtype: 'device-view',
- title: strings.device_title
+ title: Strings.device_title
});
diff --git a/web/Login.js b/web/Login.js
index d06506480..6c42d7ddb 100644
--- a/web/Login.js
+++ b/web/Login.js
@@ -19,31 +19,31 @@ Ext.define('LoginForm', {
xtype: 'login-form',
defaultType: 'textfield',
- bodyPadding: styles.panel_padding,
+ bodyPadding: Styles.panel_padding,
defaults: { anchor: '100%' },
items: [{
allowBlank: false,
- fieldLabel: strings.login_user,
+ fieldLabel: Strings.login_user,
name: 'user'
}, {
allowBlank: false,
- fieldLabel: strings.login_password,
+ fieldLabel: Strings.login_password,
name: 'password',
inputType: 'password'
}],
buttons: [
- { text: strings.login_register },
- { text: strings.login_login }
+ { text: Strings.login_register },
+ { text: Strings.login_login }
]
});
Ext.define('Login', {
extend: 'Ext.window.Window',
- title: strings.login_title,
+ title: Strings.login_title,
items: [{ xtype: 'login-form' }]
});
diff --git a/web/MainView.js b/web/MainView.js
index 3aaeb1ef4..e736b82b8 100644
--- a/web/MainView.js
+++ b/web/MainView.js
@@ -32,7 +32,7 @@ Ext.define('MainView', {
items: [{
region:'west',
xtype: 'device-view',
- width: styles.device_width
+ width: Styles.device_width
}, {
region: 'center',
xtype: 'map-view',
diff --git a/web/MapView.js b/web/MapView.js
index 4cc809860..6e9ca0325 100644
--- a/web/MapView.js
+++ b/web/MapView.js
@@ -18,24 +18,24 @@ Ext.define('MapView', {
extend: 'Ext.form.Panel',
xtype: 'map-view',
- title: strings.map_title,
+ title: Strings.map_title,
layout: 'fit',
listeners: {
afterrender: function() {
- /*var layer = new ol.layer.Tile({source: new ol.source.BingMaps({
+ /*var layer = new ol.layer.Tile({ source: new ol.source.BingMaps({
key: 'AseEs0DLJhLlTNoxbNXu7DGsnnH4UoWuGue7-irwKkE3fffaClwc9q_Mr6AyHY8F',
imagerySet: 'Road'
})});*/
- var layer = new ol.layer.Tile({source: new ol.source.OSM({
+ var layer = new ol.layer.Tile({ source: new ol.source.OSM({
})});
var view = new ol.View({
- center: ol.proj.transform(styles.map_center, 'EPSG:4326', 'EPSG:3857'),
- zoom: styles.map_zoom,
- maxZoom: styles.map_max_zoom
+ center: ol.proj.transform(Styles.map_center, 'EPSG:4326', 'EPSG:3857'),
+ zoom: Styles.map_zoom,
+ maxZoom: Styles.map_max_zoom
});
this.map = new ol.Map({
diff --git a/web/Strings.js b/web/Strings.js
index a08791973..5d310fb4c 100644
--- a/web/Strings.js
+++ b/web/Strings.js
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-var strings = {
+Ext.define('Strings', {
+ singleton: true,
login_title: 'Login',
login_user: 'User',
@@ -26,4 +27,4 @@ var strings = {
map_title: 'Map'
-};
+});
diff --git a/web/Styles.js b/web/Styles.js
index 3feca2700..ea154ba2e 100644
--- a/web/Styles.js
+++ b/web/Styles.js
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-var styles = {
+Ext.define('Styles', {
+ singleton: true,
panel_padding: 10,
@@ -24,4 +25,4 @@ var styles = {
map_zoom: 6,
map_max_zoom: 16
-};
+});
diff --git a/web/index.html b/web/index.html
index ef4900bfb..82c6b2660 100644
--- a/web/index.html
+++ b/web/index.html
@@ -7,8 +7,6 @@
<script type="text/javascript" src="//cdn.sencha.com/ext/gpl/5.1.0/build/ext-all.js"></script>
<script type="text/javascript" src="//cdn.sencha.com/ext/gpl/5.1.0/build/packages/ext-theme-neptune/build/ext-theme-neptune.js"></script>
<script type="text/javascript" src="//openlayers.org/en/v3.1.1/build/ol.js"></script>
-<script type ="text/javascript" src="Strings.js"></script>
-<script type ="text/javascript" src="Styles.js"></script>
<script type ="text/javascript" src="Application.js"></script>
</head>
<body>