From 8782eeec561e490b4262ba8983e69623daaf5845 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 3 Oct 2015 20:27:15 +1300 Subject: Add space after function keyword --- web/app/view/BaseEditDialogController.js | 6 +++--- web/app/view/CommandDialogController.js | 6 +++--- web/app/view/DeviceController.js | 24 ++++++++++++------------ web/app/view/LoginController.js | 20 ++++++++++---------- web/app/view/Map.js | 4 ++-- web/app/view/MapController.js | 22 +++++++++++----------- web/app/view/RegisterController.js | 4 ++-- web/app/view/ReportController.js | 10 +++++----- web/app/view/StateController.js | 12 ++++++------ web/app/view/user/UserController.js | 14 +++++++------- web/app/view/user/UserDialogController.js | 8 ++++---- 11 files changed, 65 insertions(+), 65 deletions(-) (limited to 'web/app/view') diff --git a/web/app/view/BaseEditDialogController.js b/web/app/view/BaseEditDialogController.js index 0c45b3097..3b43cacf3 100644 --- a/web/app/view/BaseEditDialogController.js +++ b/web/app/view/BaseEditDialogController.js @@ -18,7 +18,7 @@ Ext.define('Traccar.view.BaseEditDialogController', { extend: 'Ext.app.ViewController', alias: 'controller.baseEditDialog', - onSaveClick: function(button) { + onSaveClick: function (button) { var dialog, store, record; dialog = button.up('window').down('form'); dialog.updateRecord(); @@ -29,10 +29,10 @@ Ext.define('Traccar.view.BaseEditDialogController', { store.add(record); } store.sync({ - success: function() { + success: function () { store.reload(); // workaround for selection problem }, - failure: function(batch) { + failure: function (batch) { store.rejectChanges(); Traccar.ErrorManager.check(true, batch.exceptions[0].getResponse()); } diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js index 6aba4a6f1..88e72d6e3 100644 --- a/web/app/view/CommandDialogController.js +++ b/web/app/view/CommandDialogController.js @@ -18,12 +18,12 @@ Ext.define('Traccar.view.CommandDialogController', { extend: 'Ext.app.ViewController', alias: 'controller.commandDialog', - onSelect: function(selected) { + onSelect: function (selected) { this.lookupReference('paramPositionPeriodic').setHidden( selected.getValue() !== 'positionPeriodic'); }, - onSendClick: function(button) { + onSendClick: function (button) { var attributes, value, record, form; form = button.up('window').down('form'); @@ -48,7 +48,7 @@ Ext.define('Traccar.view.CommandDialogController', { }); }, - onSendResult: function(options, success, response) { + onSendResult: function (options, success, response) { if (Traccar.ErrorManager.check(success, response)) { Ext.toast(strings.commandSent); this.closeView(); diff --git a/web/app/view/DeviceController.js b/web/app/view/DeviceController.js index d714d89d4..64b3b8826 100644 --- a/web/app/view/DeviceController.js +++ b/web/app/view/DeviceController.js @@ -36,18 +36,18 @@ Ext.define('Traccar.view.DeviceController', { } }, - init: function() { + init: function () { if (Traccar.app.getUser().get('admin')) { this.lookupReference('settingsServerButton').setHidden(false); this.lookupReference('settingsUsersButton').setHidden(false); } }, - onLogoutClick: function() { + onLogoutClick: function () { Ext.create('Traccar.view.LoginController').logout(); }, - onAddClick: function() { + onAddClick: function () { var device, dialog; device = Ext.create('Traccar.model.Device'); device.store = this.getView().getStore(); @@ -56,7 +56,7 @@ Ext.define('Traccar.view.DeviceController', { dialog.show(); }, - onEditClick: function() { + onEditClick: function () { var device, dialog; device = this.getView().getSelectionModel().getSelection()[0]; dialog = Ext.create('Traccar.view.DeviceDialog'); @@ -64,7 +64,7 @@ Ext.define('Traccar.view.DeviceController', { dialog.show(); }, - onRemoveClick: function() { + onRemoveClick: function () { var device = this.getView().getSelectionModel().getSelection()[0]; Ext.Msg.show({ title: strings.deviceDialog, @@ -74,7 +74,7 @@ Ext.define('Traccar.view.DeviceController', { yes: strings.sharedRemove, no: strings.sharedCancel }, - fn: function(btn) { + fn: function (btn) { var store; if (btn === 'yes') { store = Ext.getStore('Devices'); @@ -85,7 +85,7 @@ Ext.define('Traccar.view.DeviceController', { }); }, - onCommandClick: function() { + onCommandClick: function () { var device, command, dialog; device = this.getView().getSelectionModel().getSelection()[0]; command = Ext.create('Traccar.model.Command'); @@ -95,7 +95,7 @@ Ext.define('Traccar.view.DeviceController', { dialog.show(); }, - onSelectionChange: function(selected) { + onSelectionChange: function (selected) { var empty = selected.getCount() === 0; this.lookupReference('deviceEditButton').setDisabled(empty); this.lookupReference('deviceRemoveButton').setDisabled(empty); @@ -105,19 +105,19 @@ Ext.define('Traccar.view.DeviceController', { } }, - onUserClick: function() { + onUserClick: function () { var dialog = Ext.create('Traccar.view.user.UserDialog'); dialog.down('form').loadRecord(Traccar.app.getUser()); dialog.show(); }, - onServerClick: function() { + onServerClick: function () { var dialog = Ext.create('Traccar.view.ServerDialog'); dialog.down('form').loadRecord(Traccar.app.getServer()); dialog.show(); }, - onUsersClick: function() { + onUsersClick: function () { Ext.create('Ext.window.Window', { title: strings.settingsUsers, width: styles.windowWidth, @@ -130,7 +130,7 @@ Ext.define('Traccar.view.DeviceController', { }).show(); }, - selectReport: function(position) { + selectReport: function (position) { if (position !== undefined) { this.getView().getSelectionModel().deselectAll(); } diff --git a/web/app/view/LoginController.js b/web/app/view/LoginController.js index f6b2fe228..bc73661ed 100644 --- a/web/app/view/LoginController.js +++ b/web/app/view/LoginController.js @@ -22,13 +22,13 @@ Ext.define('Traccar.view.LoginController', { 'Traccar.view.Register' ], - init: function() { + init: function () { this.lookupReference('registerButton').setDisabled( !Traccar.app.getServer().get('registration')); this.lookupReference('languageField').setValue(language); }, - login: function() { + login: function () { var form = this.lookupReference('form'); if (form.isValid()) { Ext.getBody().mask(strings.sharedLoading); @@ -36,7 +36,7 @@ Ext.define('Traccar.view.LoginController', { scope: this, url: '/api/login', params: form.getValues(), - callback: function(options, success, response) { + callback: function (options, success, response) { Ext.getBody().unmask(); if (Traccar.ErrorManager.check(success, response)) { var result = Ext.decode(response.responseText); @@ -53,17 +53,17 @@ Ext.define('Traccar.view.LoginController', { } }, - logout: function() { + logout: function () { Ext.Ajax.request({ scope: this, url: '/api/logout', - callback: function() { + callback: function () { window.location.reload(); } }); }, - onSelectLanguage: function(selected) { + onSelectLanguage: function (selected) { var paramName = 'locale'; var paramValue = selected.getValue(); var url = window.location.href; @@ -83,22 +83,22 @@ Ext.define('Traccar.view.LoginController', { window.location.href = url; }, - onAfterRender: function(field) { + onAfterRender: function (field) { field.focus(); }, - onSpecialKey: function(field, e) { + onSpecialKey: function (field, e) { if (e.getKey() === e.ENTER) { this.login(); } }, - onLoginClick: function() { + onLoginClick: function () { Ext.getElementById('submitButton').click(); this.login(); }, - onRegisterClick: function() { + onRegisterClick: function () { Ext.create('Traccar.view.login.Register').show(); } }); diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 5d2fd579c..63be7f666 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -28,7 +28,7 @@ Ext.define('Traccar.view.Map', { layout: 'fit', listeners: { - afterrender: function() { + afterrender: function () { var user = Traccar.app.getUser(); var server = Traccar.app.getServer(); @@ -79,7 +79,7 @@ Ext.define('Traccar.view.Map', { }); }, - resize: function() { + resize: function () { this.map.updateSize(); } } diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 4979cd920..66cbe6b31 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -31,19 +31,19 @@ Ext.define('Traccar.view.MapController', { } }, - init: function() { + init: function () { this.liveData = {}; this.update(true); }, - update: function(first) { + update: function (first) { Ext.Ajax.request({ scope: this, url: '/api/async', params: { first: first }, - success: function(response) { + success: function (response) { var data = Ext.decode(response.responseText).data; var i; @@ -79,13 +79,13 @@ Ext.define('Traccar.view.MapController', { this.update(false); }, - failure: function() { + failure: function () { // TODO: error } }); }, - getLineStyle: function() { + getLineStyle: function () { return new ol.style.Style({ stroke: new ol.style.Stroke({ color: styles.mapStrokeColor, @@ -94,7 +94,7 @@ Ext.define('Traccar.view.MapController', { }); }, - getMarkerStyle: function(radius, color) { + getMarkerStyle: function (radius, color) { /*return new ol.style.Style({ text: new ol.style.Text({ text: '\uf041', @@ -123,7 +123,7 @@ Ext.define('Traccar.view.MapController', { }); }, - reportShow: function() { + reportShow: function () { this.reportClear(); var vectorSource = this.getView().vectorSource; @@ -163,7 +163,7 @@ Ext.define('Traccar.view.MapController', { } }, - reportClear: function() { + reportClear: function () { var index; var vectorSource = this.getView().vectorSource; @@ -182,7 +182,7 @@ Ext.define('Traccar.view.MapController', { } }, - selectPosition: function(feature) { + selectPosition: function (feature) { if (this.currentFeature !== undefined) { this.currentFeature.setStyle(this.currentFeature.get('originalStyle')); } @@ -201,11 +201,11 @@ Ext.define('Traccar.view.MapController', { this.currentFeature = feature; }, - selectDevice: function(device) { + selectDevice: function (device) { this.selectPosition(this.liveData[device.get('id')]); }, - selectReport: function(position) { + selectReport: function (position) { if (this.reportRoutePoints[position.get('id')] !== undefined) { this.selectPosition(this.reportRoutePoints[position.get('id')]); } diff --git a/web/app/view/RegisterController.js b/web/app/view/RegisterController.js index b470aa343..2547d631c 100644 --- a/web/app/view/RegisterController.js +++ b/web/app/view/RegisterController.js @@ -18,7 +18,7 @@ Ext.define('Traccar.view.RegisterController', { extend: 'Ext.app.ViewController', alias: 'controller.register', - onCreateClick: function() { + onCreateClick: function () { var form = this.lookupReference('form'); if (form.isValid()) { Ext.Ajax.request({ @@ -30,7 +30,7 @@ Ext.define('Traccar.view.RegisterController', { } }, - onCreateReturn: function(options, success, response) { + onCreateReturn: function (options, success, response) { if (Traccar.ErrorManager.check(success, response)) { this.closeView(); Ext.toast(strings.loginCreated); diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 0b3e30f17..99c1a9b07 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -28,7 +28,7 @@ Ext.define('Traccar.view.ReportController', { } }, - onShowClick: function() { + onShowClick: function () { var deviceId, fromDate, fromTime, from, toDate, toTime, to, store; deviceId = this.lookupReference('deviceField').getValue(); @@ -55,24 +55,24 @@ Ext.define('Traccar.view.ReportController', { to: to.toISOString() }, scope: this, - callback: function() { + callback: function () { this.fireEvent("reportShow"); } }); }, - onClearClick: function() { + onClearClick: function () { Ext.getStore('Positions').removeAll(); this.fireEvent("reportClear"); }, - onSelectionChange: function(selected) { + onSelectionChange: function (selected) { if (selected.getCount() > 0) { this.fireEvent("selectReport", selected.getLastSelected()); } }, - selectDevice: function(device) { + selectDevice: function (device) { if (device !== undefined) { this.getView().getSelectionModel().deselectAll(); } diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index dc2ddfb2b..ce9a21af4 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -28,7 +28,7 @@ Ext.define('Traccar.view.StateController', { } }, - init: function() { + init: function () { var store = Ext.getStore('LatestPositions'); store.on('add', this.add, this); store.on('update', this.update, this); @@ -73,7 +73,7 @@ Ext.define('Traccar.view.StateController', { } }, - formatValue: function(value) { + formatValue: function (value) { if (typeof(id) === 'number') { return value.toFixed(2); } else { @@ -81,7 +81,7 @@ Ext.define('Traccar.view.StateController', { } }, - updatePosition: function(position) { + updatePosition: function (position) { var attributes, value, unit, store, key; store = Ext.getStore('Attributes'); store.removeAll(); @@ -112,7 +112,7 @@ Ext.define('Traccar.view.StateController', { } }, - selectDevice: function(device) { + selectDevice: function (device) { var found; this.deviceId = device.get('id'); found = Ext.getStore('LatestPositions').query('deviceId', this.deviceId); @@ -123,13 +123,13 @@ Ext.define('Traccar.view.StateController', { } }, - add: function(store, data) { + add: function (store, data) { if (this.deviceId === data[0].get('deviceId')) { this.updatePosition(data[0]); } }, - update: function(store, data) { + update: function (store, data) { if (this.deviceId === data.get('deviceId')) { this.updatePosition(data); } diff --git a/web/app/view/user/UserController.js b/web/app/view/user/UserController.js index 156d33a86..507fd5a5c 100644 --- a/web/app/view/user/UserController.js +++ b/web/app/view/user/UserController.js @@ -22,25 +22,25 @@ Ext.define('Traccar.view.user.UserController', { 'Traccar.view.user.UserDialog' ], - init: function() { + init: function () { Ext.getStore('Users').load(); }, - onAddClick: function() { + onAddClick: function () { var user = Ext.create('Traccar.model.User'); var dialog = Ext.create('Traccar.view.user.UserDialog'); dialog.down('form').loadRecord(user); dialog.show(); }, - onEditClick: function() { + onEditClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; var dialog = Ext.create('Traccar.view.user.UserDialog'); dialog.down('form').loadRecord(user); dialog.show(); }, - onRemoveClick: function() { + onRemoveClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; Ext.Msg.show({ title: strings.settingsUser, @@ -50,7 +50,7 @@ Ext.define('Traccar.view.user.UserController', { yes: strings.sharedRemove, no: strings.sharedCancel }, - fn: function(btn) { + fn: function (btn) { if (btn === 'yes') { var store = Ext.getStore('Users'); store.remove(user); @@ -60,7 +60,7 @@ Ext.define('Traccar.view.user.UserController', { }); }, - onDevicesClick: function() { + onDevicesClick: function () { // TODO show devices /*Ext.create('Ext.window.Window', { title: strings.settingsUsers, @@ -74,7 +74,7 @@ Ext.define('Traccar.view.user.UserController', { }).show();*/ }, - onSelectionChange: function(selected) { + onSelectionChange: function (selected) { var disabled = selected.length > 0; this.lookupReference('userEditButton').setDisabled(disabled); this.lookupReference('userRemoveButton').setDisabled(disabled); diff --git a/web/app/view/user/UserDialogController.js b/web/app/view/user/UserDialogController.js index dd3109d37..40f938b5c 100644 --- a/web/app/view/user/UserDialogController.js +++ b/web/app/view/user/UserDialogController.js @@ -18,13 +18,13 @@ Ext.define('Traccar.view.user.UserDialogController', { extend: 'Ext.app.ViewController', alias: 'controller.userDialog', - init: function() { + init: function () { if (Traccar.app.getUser().get('admin')) { this.lookupReference('adminField').setDisabled(false); } }, - onSaveClick: function(button) { + onSaveClick: function (button) { var dialog = button.up('window').down('form'); dialog.updateRecord(); var record = dialog.getRecord(); @@ -36,7 +36,7 @@ Ext.define('Traccar.view.user.UserDialogController', { store.add(record); } store.sync({ - failure: function(batch) { + failure: function (batch) { store.rejectChanges(); // TODO Traccar.ErrorManager.check(true, batch.exceptions[0].getResponse()); } @@ -45,7 +45,7 @@ Ext.define('Traccar.view.user.UserDialogController', { button.up('window').close(); }, - onCancelClick: function(button) { + onCancelClick: function (button) { button.up('window').close(); } -- cgit v1.2.3