diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 18:23:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 18:23:32 +1300 |
commit | 99d132dc78b42b6cc5833b3a7faf30d2fe56186f (patch) | |
tree | 045052b15478c32c44f36a07c70885a756ea19b3 /web/app/controller | |
parent | dcfe1d48998c3fb3baa704fafed43d996f329a07 (diff) | |
download | trackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.gz trackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.bz2 trackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.zip |
Disable JavaScript strict mode
Diffstat (limited to 'web/app/controller')
-rw-r--r-- | web/app/controller/Root.js | 130 |
1 files changed, 63 insertions, 67 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index bb67d4e86..d6dd64830 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -13,81 +13,77 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function () { - 'use strict'; - Ext.define('Traccar.controller.Root', { - extend: 'Ext.app.Controller', +Ext.define('Traccar.controller.Root', { + extend: 'Ext.app.Controller', - requires: [ - 'Traccar.view.Login', - 'Traccar.view.Main', - 'Traccar.view.MainMobile' - ], + requires: [ + 'Traccar.view.Login', + 'Traccar.view.Main', + 'Traccar.view.MainMobile' + ], - init: function () { - var indicator = document.createElement('div'); - indicator.className = 'state-indicator'; - document.body.appendChild(indicator); - this.isPhone = parseInt(window.getComputedStyle(indicator).getPropertyValue('z-index'), 10) !== 0; - }, + init: function () { + var indicator = document.createElement('div'); + indicator.className = 'state-indicator'; + document.body.appendChild(indicator); + this.isPhone = parseInt(window.getComputedStyle(indicator).getPropertyValue('z-index'), 10) !== 0; + }, - onLaunch: function () { - Ext.Ajax.request({ - scope: this, - url: '/api/server/get', - callback: this.onServerReturn - }); - }, + onLaunch: function () { + Ext.Ajax.request({ + scope: this, + url: '/api/server/get', + callback: this.onServerReturn + }); + }, - onServerReturn: function (options, success, response) { - var result; - if (Traccar.ErrorManager.check(success, response)) { - result = Ext.decode(response.responseText); - if (result.success) { - Traccar.app.setServer(result.data); - Ext.Ajax.request({ - scope: this, - url: '/api/session', - callback: this.onSessionReturn - }); - } - } - }, - - onSessionReturn: function (options, success, response) { - var result; - if (Traccar.ErrorManager.check(success, response)) { - result = Ext.decode(response.responseText); - if (result.success) { - Traccar.app.setUser(result.data); - this.loadApp(); - } else { - this.login = Ext.create('widget.login', { - listeners: { - scope: this, - login: this.onLogin - } - }); - this.login.show(); - } + onServerReturn: function (options, success, response) { + var result; + if (Traccar.ErrorManager.check(success, response)) { + result = Ext.decode(response.responseText); + if (result.success) { + Traccar.app.setServer(result.data); + Ext.Ajax.request({ + scope: this, + url: '/api/session', + callback: this.onSessionReturn + }); } - }, - - onLogin: function () { - this.login.close(); - this.loadApp(); - }, + } + }, - loadApp: function () { - Ext.getStore('Devices').load(); - Ext.getBody().empty(); - if (this.isPhone) { - Ext.create('widget.mainMobile'); + onSessionReturn: function (options, success, response) { + var result; + if (Traccar.ErrorManager.check(success, response)) { + result = Ext.decode(response.responseText); + if (result.success) { + Traccar.app.setUser(result.data); + this.loadApp(); } else { - Ext.create('widget.main'); + this.login = Ext.create('widget.login', { + listeners: { + scope: this, + login: this.onLogin + } + }); + this.login.show(); } } - }); + }, -})(); + onLogin: function () { + this.login.close(); + this.loadApp(); + }, + + loadApp: function () { + Ext.getStore('Devices').load(); + Ext.getBody().empty(); + if (this.isPhone) { + Ext.create('widget.mainMobile'); + } else { + Ext.create('widget.main'); + } + } +}); |