aboutsummaryrefslogtreecommitdiff
path: root/web/app/Application.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/Application.js')
-rw-r--r--web/app/Application.js124
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;
+ }
+ });
+
+})();