Skip to content

Commit

Permalink
Use static Ext classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Feb 2, 2015
1 parent b79c04d commit 0b166ca
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions web/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
Ext.application({
name: 'Traccar',
requires: [
'Strings',
'Styles',
'Login',
'MainView'
],
Expand Down
2 changes: 1 addition & 1 deletion web/DeviceView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Ext.define('DeviceView', {
extend: 'Ext.form.Panel',
xtype: 'device-view',

title: strings.device_title
title: Strings.device_title
});
12 changes: 6 additions & 6 deletions web/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }]
});
2 changes: 1 addition & 1 deletion web/MainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions web/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
5 changes: 3 additions & 2 deletions web/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/

var strings = {
Ext.define('Strings', {
singleton: true,

login_title: 'Login',
login_user: 'User',
Expand All @@ -26,4 +27,4 @@ var strings = {

map_title: 'Map'

};
});
5 changes: 3 additions & 2 deletions web/Styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/

var styles = {
Ext.define('Styles', {
singleton: true,

panel_padding: 10,

Expand All @@ -24,4 +25,4 @@ var styles = {
map_zoom: 6,
map_max_zoom: 16

};
});
2 changes: 0 additions & 2 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 0b166ca

Please sign in to comment.