From 48f981a2a9755fb0af6497020e499bb0883e0e1f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 3 Oct 2015 21:01:45 +1300 Subject: Enable JavaScript strict mode --- web/app/store/Attributes.js | 18 ++++++++++------ web/app/store/CommandTypes.js | 38 ++++++++++++++++++--------------- web/app/store/Devices.js | 44 +++++++++++++++++++++----------------- web/app/store/DistanceUnits.js | 46 ++++++++++++++++++++++------------------ web/app/store/Languages.js | 34 ++++++++++++++++------------- web/app/store/LatestPositions.js | 12 +++++++---- web/app/store/MapTypes.js | 38 ++++++++++++++++++--------------- web/app/store/Positions.js | 26 +++++++++++++---------- web/app/store/SpeedUnits.js | 46 ++++++++++++++++++++++------------------ web/app/store/TimeUnits.js | 32 ++++++++++++++++------------ web/app/store/Users.js | 44 +++++++++++++++++++++----------------- 11 files changed, 211 insertions(+), 167 deletions(-) (limited to 'web/app/store') diff --git a/web/app/store/Attributes.js b/web/app/store/Attributes.js index 2019582e5..a63701fdc 100644 --- a/web/app/store/Attributes.js +++ b/web/app/store/Attributes.js @@ -13,12 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.Attributes', { - extend: 'Ext.data.Store', - model: 'Traccar.model.Attribute', + Ext.define('Traccar.store.Attributes', { + extend: 'Ext.data.Store', + model: 'Traccar.model.Attribute', - sorters: [{ - property: 'priority' - }] -}); + sorters: [{ + property: 'priority' + }] + }); + +})(); diff --git a/web/app/store/CommandTypes.js b/web/app/store/CommandTypes.js index 8ff78b5df..ed47d6d68 100644 --- a/web/app/store/CommandTypes.js +++ b/web/app/store/CommandTypes.js @@ -13,22 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.CommandTypes', { - extend: 'Ext.data.Store', - fields: ['key', 'name'], + Ext.define('Traccar.store.CommandTypes', { + extend: 'Ext.data.Store', + fields: ['key', 'name'], - data: [{ - key: 'positionPeriodic', - name: strings.commandPositionPeriodic - }, { - key: 'positionStop', - name: strings.commandPositionStop - }, { - key: 'engineStop', - name: strings.commandEngineStop - }, { - key: 'engineResume', - name: strings.commandEngineResume - }] -}); + data: [{ + key: 'positionPeriodic', + name: strings.commandPositionPeriodic + }, { + key: 'positionStop', + name: strings.commandPositionStop + }, { + key: 'engineStop', + name: strings.commandEngineStop + }, { + key: 'engineResume', + name: strings.commandEngineResume + }] + }); + +})(); diff --git a/web/app/store/Devices.js b/web/app/store/Devices.js index 24777de5a..05da6a194 100644 --- a/web/app/store/Devices.js +++ b/web/app/store/Devices.js @@ -13,26 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.Devices', { - extend: 'Ext.data.Store', - model: 'Traccar.model.Device', + Ext.define('Traccar.store.Devices', { + extend: 'Ext.data.Store', + model: 'Traccar.model.Device', - proxy: { - type: 'ajax', - api: { - create: '/api/device/add', - read: '/api/device/get', - update: '/api/device/update', - destroy: '/api/device/remove' - }, - reader: { - type: 'json', - rootProperty: 'data' - }, - writer: { - type: 'json', - writeAllFields: true + proxy: { + type: 'ajax', + api: { + create: '/api/device/add', + read: '/api/device/get', + update: '/api/device/update', + destroy: '/api/device/remove' + }, + reader: { + type: 'json', + rootProperty: 'data' + }, + writer: { + type: 'json', + writeAllFields: true + } } - } -}); + }); + +})(); diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js index bcccc0703..59e7f6396 100644 --- a/web/app/store/DistanceUnits.js +++ b/web/app/store/DistanceUnits.js @@ -13,28 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.DistanceUnits', { - extend: 'Ext.data.Store', - fields: ['key', 'name', 'factor'], + Ext.define('Traccar.store.DistanceUnits', { + extend: 'Ext.data.Store', + fields: ['key', 'name', 'factor'], - data: [{ - key: 'km', - name: strings.sharedKm, - factor: 0.001 - }, { - key: 'mi', - name: strings.sharedMi, - factor: 0.00621371 - }], + data: [{ + key: 'km', + name: strings.sharedKm, + factor: 0.001 + }, { + key: 'mi', + name: strings.sharedMi, + factor: 0.00621371 + }], - formatValue: function (value, unit) { - var model; - if (unit) { - model = this.findRecord('key', unit); - return (value * model.get('factor')).toFixed(2) + ' ' + model.get('name'); - } else { - return value; + formatValue: function (value, unit) { + var model; + if (unit) { + model = this.findRecord('key', unit); + return (value * model.get('factor')).toFixed(2) + ' ' + model.get('name'); + } else { + return value; + } } - } -}); + }); + +})(); diff --git a/web/app/store/Languages.js b/web/app/store/Languages.js index 22685173a..66d3e6176 100644 --- a/web/app/store/Languages.js +++ b/web/app/store/Languages.js @@ -13,21 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.Languages', { - extend: 'Ext.data.Store', - fields: ['code', 'name'], + Ext.define('Traccar.store.Languages', { + extend: 'Ext.data.Store', + fields: ['code', 'name'], - data: (function () { - var code, data = []; - for (code in availableLanguages) { - if (availableLanguages.hasOwnProperty(code)) { - data.push({ - code: code, - name: availableLanguages[code].name - }); + data: (function () { + var code, data = []; + for (code in availableLanguages) { + if (availableLanguages.hasOwnProperty(code)) { + data.push({ + code: code, + name: availableLanguages[code].name + }); + } } - } - return data; - }()) -}); + return data; + }()) + }); + +})(); diff --git a/web/app/store/LatestPositions.js b/web/app/store/LatestPositions.js index c656bdcb8..3bd58bd04 100644 --- a/web/app/store/LatestPositions.js +++ b/web/app/store/LatestPositions.js @@ -13,8 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.LatestPositions', { - extend: 'Ext.data.Store', - model: 'Traccar.model.Position' -}); + Ext.define('Traccar.store.LatestPositions', { + extend: 'Ext.data.Store', + model: 'Traccar.model.Position' + }); + +})(); diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js index 5f83940c9..ba241504e 100644 --- a/web/app/store/MapTypes.js +++ b/web/app/store/MapTypes.js @@ -13,22 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.MapTypes', { - extend: 'Ext.data.Store', - fields: ['key', 'name'], + Ext.define('Traccar.store.MapTypes', { + extend: 'Ext.data.Store', + fields: ['key', 'name'], - data: [{ - key: 'osm', - name: strings.mapOsm - }, { - key: 'bingRoad', - name: strings.mapBingRoad - }, { - key: 'bingAerial', - name: strings.mapBingAerial - }, { - key: 'custom', - name: strings.mapCustom - }] -}); + data: [{ + key: 'osm', + name: strings.mapOsm + }, { + key: 'bingRoad', + name: strings.mapBingRoad + }, { + key: 'bingAerial', + name: strings.mapBingAerial + }, { + key: 'custom', + name: strings.mapCustom + }] + }); + +})(); diff --git a/web/app/store/Positions.js b/web/app/store/Positions.js index 7de54a8d2..415e26cbe 100644 --- a/web/app/store/Positions.js +++ b/web/app/store/Positions.js @@ -13,17 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.Positions', { - extend: 'Ext.data.Store', - model: 'Traccar.model.Position', + Ext.define('Traccar.store.Positions', { + extend: 'Ext.data.Store', + model: 'Traccar.model.Position', - proxy: { - type: 'ajax', - url: '/api/position/get', - reader: { - type: 'json', - rootProperty: 'data' + proxy: { + type: 'ajax', + url: '/api/position/get', + reader: { + type: 'json', + rootProperty: 'data' + } } - } -}); + }); + +})(); diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js index 00d2e1aba..1ff6cd50e 100644 --- a/web/app/store/SpeedUnits.js +++ b/web/app/store/SpeedUnits.js @@ -13,28 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.SpeedUnits', { - extend: 'Ext.data.Store', - fields: ['key', 'name', 'factor'], + Ext.define('Traccar.store.SpeedUnits', { + extend: 'Ext.data.Store', + fields: ['key', 'name', 'factor'], - data: [{ - key: 'kmh', - name: strings.sharedKmh, - factor: 1.852 - }, { - key: 'mph', - name: strings.sharedMph, - factor: 1.15078 - }], + data: [{ + key: 'kmh', + name: strings.sharedKmh, + factor: 1.852 + }, { + key: 'mph', + name: strings.sharedMph, + factor: 1.15078 + }], - formatValue: function (value, unit) { - var model; - if (unit) { - model = this.findRecord('key', unit); - return (value * model.get('factor')).toFixed(1) + ' ' + model.get('name'); - } else { - return value; + formatValue: function (value, unit) { + var model; + if (unit) { + model = this.findRecord('key', unit); + return (value * model.get('factor')).toFixed(1) + ' ' + model.get('name'); + } else { + return value; + } } - } -}); + }); + +})(); diff --git a/web/app/store/TimeUnits.js b/web/app/store/TimeUnits.js index 047fd6016..61246c520 100644 --- a/web/app/store/TimeUnits.js +++ b/web/app/store/TimeUnits.js @@ -13,19 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.TimeUnits', { - extend: 'Ext.data.Store', - fields: ['name', 'factor'], + Ext.define('Traccar.store.TimeUnits', { + extend: 'Ext.data.Store', + fields: ['name', 'factor'], - data: [{ - name: strings.sharedSecond, - factor: 1 - }, { - name: strings.sharedMinute, - factor: 60 - }, { - name: strings.sharedHour, - factor: 3600 - }] -}); + data: [{ + name: strings.sharedSecond, + factor: 1 + }, { + name: strings.sharedMinute, + factor: 60 + }, { + name: strings.sharedHour, + factor: 3600 + }] + }); + +})(); diff --git a/web/app/store/Users.js b/web/app/store/Users.js index 004dc727e..908e8eaf9 100644 --- a/web/app/store/Users.js +++ b/web/app/store/Users.js @@ -13,26 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.store.Users', { - extend: 'Ext.data.Store', - model: 'Traccar.model.User', + Ext.define('Traccar.store.Users', { + extend: 'Ext.data.Store', + model: 'Traccar.model.User', - proxy: { - type: 'ajax', - api: { - create: '/api/user/add', - read: '/api/user/get', - update: '/api/user/update', - destroy: '/api/user/remove' - }, - reader: { - type: 'json', - rootProperty: 'data' - }, - writer: { - type: 'json', - writeAllFields: true + proxy: { + type: 'ajax', + api: { + create: '/api/user/add', + read: '/api/user/get', + update: '/api/user/update', + destroy: '/api/user/remove' + }, + reader: { + type: 'json', + rootProperty: 'data' + }, + writer: { + type: 'json', + writeAllFields: true + } } - } -}); + }); + +})(); -- cgit v1.2.3