diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 13:39:53 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 13:39:53 +1300 |
commit | 001424d7ada69390fd7ebea8e585fb0408e147ac (patch) | |
tree | d4bac262bbb0cc2122626004b95eb2d57e089937 /web/app/Application.js | |
parent | 00ebfd00f204bdfbd8e66254b79c7b8814d7ee3b (diff) | |
download | trackermap-server-001424d7ada69390fd7ebea8e585fb0408e147ac.tar.gz trackermap-server-001424d7ada69390fd7ebea8e585fb0408e147ac.tar.bz2 trackermap-server-001424d7ada69390fd7ebea8e585fb0408e147ac.zip |
More clean up for web interface
Diffstat (limited to 'web/app/Application.js')
-rw-r--r-- | web/app/Application.js | 124 |
1 files changed, 64 insertions, 60 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index 67dc96536..def000f04 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -13,67 +13,71 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function() { + "use strict"; -Ext.define('Traccar.Application', { - extend: 'Ext.app.Application', - name: 'Traccar', + Ext.define('Traccar.Application', { + extend: 'Ext.app.Application', + name: 'Traccar', - requires: [ - 'Traccar.Resources', - 'Traccar.ErrorManager', - 'Traccar.AttributeFormatter' - ], - - models: [ - 'Server', - 'User', - 'Device', - 'Position', - 'Attribute', - 'Command' - ], - - stores: [ - 'Devices', - 'Positions', - 'LatestPositions', - 'Users', - 'Attributes', - 'MapTypes', - 'DistanceUnits', - 'SpeedUnits', - 'CommandTypes', - 'TimeUnits', - 'Languages' - ], + requires: [ + 'Traccar.Resources', + 'Traccar.ErrorManager', + 'Traccar.AttributeFormatter' + ], - controllers: [ - 'Root' - ], - - setUser: function(data) { - var reader = Ext.create('Ext.data.reader.Json', { - model: 'Traccar.model.User' - }); - this.user = reader.readRecords(data).getRecords()[0]; - }, - - getUser: function() { - return this.user; - }, - - setServer: function(data) { - var reader = Ext.create('Ext.data.reader.Json', { - model: 'Traccar.model.Server' - }); - this.server = reader.readRecords(data).getRecords()[0]; - }, - - getServer: function() { - return this.server; - }, + models: [ + 'Server', + 'User', + 'Device', + 'Position', + 'Attribute', + 'Command' + ], - getPreference: function(key, defaultValue) { - return this.getUser().get(key) || this.getServer().get(key) || defaultValue; - } -}); + stores: [ + 'Devices', + 'Positions', + 'LatestPositions', + 'Users', + 'Attributes', + 'MapTypes', + 'DistanceUnits', + 'SpeedUnits', + 'CommandTypes', + 'TimeUnits', + 'Languages' + ], + + controllers: [ + 'Root' + ], + + setUser: function(data) { + var reader = Ext.create('Ext.data.reader.Json', { + model: 'Traccar.model.User' + }); + this.user = reader.readRecords(data).getRecords()[0]; + }, + + getUser: function() { + return this.user; + }, + + setServer: function(data) { + var reader = Ext.create('Ext.data.reader.Json', { + model: 'Traccar.model.Server' + }); + this.server = reader.readRecords(data).getRecords()[0]; + }, + + getServer: function() { + return this.server; + }, + + getPreference: function(key, defaultValue) { + return this.getUser().get(key) || this.getServer().get(key) || defaultValue; + } + }); + +})(); |