From 648c7684898f0056f0202b6b43ba9f5f11655703 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 23 Sep 2018 15:09:56 +1200 Subject: Implement push notifications --- web/load.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/load.js') diff --git a/web/load.js b/web/load.js index 0418a131..552b167a 100644 --- a/web/load.js +++ b/web/load.js @@ -28,6 +28,10 @@ debugMode = document.getElementById('loadScript').getAttribute('mode') === 'debug'; touchMode = 'ontouchstart' in window || navigator.maxTouchPoints; + window.updateNotificationToken = function (token) { + Traccar.app.updateNotificationToken(token); + }; + locale = {}; window.Locale = locale; -- cgit v1.2.3 From e029756644581346a42f162a6505dda717a8c572 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 1 Feb 2019 23:55:49 -0800 Subject: Update JavaScript libraries --- web/app/view/map/BaseMap.js | 7 ++++++- web/app/view/map/MapMarkerController.js | 2 +- web/load.js | 35 ++++++++++++++------------------- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'web/load.js') diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 015cddd0..f973fb86 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -232,7 +232,12 @@ Ext.define('Traccar.view.map.BaseMap', { } } }, function () { + var projection; proj4.defs('BD-MC', '+proj=merc +lon_0=0 +units=m +ellps=clrk66 +no_defs'); proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'); - ol.proj.get('EPSG:3395').setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]); + ol.proj.proj4.register(proj4); + projection = ol.proj.get('EPSG:3395'); + if (projection) { + projection.setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]); + } }); diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index bf6b0d49..28f1226e 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -217,7 +217,7 @@ Ext.define('Traccar.view.map.MapMarkerController', { projection = mapView.getProjection(); center = ol.proj.fromLonLat([position.get('longitude'), position.get('latitude')]); pointResolution = ol.proj.getPointResolution(projection, mapView.getResolution(), center); - radius = position.get('accuracy') / ol.proj.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution; + radius = position.get('accuracy') / ol.proj.Units.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution; if (feature) { feature.getGeometry().setCenter(center); diff --git a/web/load.js b/web/load.js index 552b167a..e72c8baa 100644 --- a/web/load.js +++ b/web/load.js @@ -1,5 +1,5 @@ (function () { - var debugMode, touchMode, locale, localeParameter, extjsVersion, proj4jsVersion, fontAwesomeVersion, olVersion, i, language, languages, languageDefault; + var debugMode, touchMode, locale, localeParameter, extjsVersion, proj4jsVersion, olVersion, i, language, languages, languageDefault; function addStyleFile(file) { var link = document.createElement('link'); @@ -148,35 +148,30 @@ } extjsVersion = '6.2.0'; - fontAwesomeVersion = '5.2.0'; - olVersion = '4.6.5'; - proj4jsVersion = '2.4.4'; + olVersion = '5.3.0'; + proj4jsVersion = '2.5.0'; if (debugMode) { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all-debug.js'); - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts-debug.js'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all-debug.js'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts-debug.js'); } else { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all.js'); - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts.js'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all.js'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts.js'); } - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/locale/locale-' + locale.languages[locale.language].code + '.js'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/locale/locale-' + locale.languages[locale.language].code + '.js'); - addStyleFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/resources/theme-triton-all.css'); - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/theme-triton.js'); + addStyleFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/resources/theme-triton-all.css'); + addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/theme-triton.js'); - addStyleFile('//cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/triton/resources/charts-all.css'); + addStyleFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/triton/resources/charts-all.css'); - addStyleFile('//cdnjs.cloudflare.com/ajax/libs/ol3/' + olVersion + '/ol.css'); - if (debugMode) { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/ol3/' + olVersion + '/ol-debug.js'); - } else { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/ol3/' + olVersion + '/ol.js'); - } + addStyleFile('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v' + olVersion + '/css/ol.css'); + addScriptFile('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v' + olVersion + '/build/ol.js'); if (debugMode) { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/proj4js/' + proj4jsVersion + '/proj4-src.js'); + addScriptFile('https://cdn.jsdelivr.net/npm/proj4@' + proj4jsVersion + '/dist/proj4-src.js'); } else { - addScriptFile('//cdnjs.cloudflare.com/ajax/libs/proj4js/' + proj4jsVersion + '/proj4.js'); + addScriptFile('https://cdn.jsdelivr.net/npm/proj4@' + proj4jsVersion + '/dist/proj4.js'); } window.Images = ['arrow', 'default', 'animal', 'bicycle', 'boat', 'bus', 'car', 'crane', 'helicopter', 'motorcycle', -- cgit v1.2.3 From b67842209def01587beae78a1bcb25aac58a11e8 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 25 Apr 2019 11:55:20 -0300 Subject: Add Scooter category --- web/images/scooter.svg | 11 +++++++++++ web/l10n/en.json | 5 +++-- web/l10n/pt_BR.json | 3 ++- web/load.js | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 web/images/scooter.svg (limited to 'web/load.js') diff --git a/web/images/scooter.svg b/web/images/scooter.svg new file mode 100644 index 00000000..7295b415 --- /dev/null +++ b/web/images/scooter.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/web/l10n/en.json b/web/l10n/en.json index 183bc885..59b93545 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -1,4 +1,4 @@ -{ +pt{ "sharedLoading": "Loading...", "sharedHide": "Hide", "sharedSave": "Save", @@ -424,6 +424,7 @@ "categoryTrolleybus": "Trolleybus", "categoryTruck": "Truck", "categoryVan": "Van", + "categoryScooter": "Scooter", "maintenanceStart": "Start", "maintenancePeriod": "Period" -} \ No newline at end of file +} diff --git a/web/l10n/pt_BR.json b/web/l10n/pt_BR.json index cee1066e..102ea877 100644 --- a/web/l10n/pt_BR.json +++ b/web/l10n/pt_BR.json @@ -424,6 +424,7 @@ "categoryTrolleybus": "Ônibus Elétrico", "categoryTruck": "Caminhão", "categoryVan": "Van", + "categoryScooter": "Patinete", "maintenanceStart": "Começar", "maintenancePeriod": "Período" -} \ No newline at end of file +} diff --git a/web/load.js b/web/load.js index e72c8baa..59b0e527 100644 --- a/web/load.js +++ b/web/load.js @@ -175,7 +175,7 @@ } window.Images = ['arrow', 'default', 'animal', 'bicycle', 'boat', 'bus', 'car', 'crane', 'helicopter', 'motorcycle', - 'offroad', 'person', 'pickup', 'plane', 'ship', 'tractor', 'train', 'tram', 'trolleybus', 'truck', 'van']; + 'offroad', 'person', 'pickup', 'plane', 'ship', 'tractor', 'train', 'tram', 'trolleybus', 'truck', 'van', 'scooter']; for (i = 0; i < window.Images.length; i++) { addSvgFile('images/' + window.Images[i] + '.svg', window.Images[i] + 'Svg'); -- cgit v1.2.3 From c6b57da224d30f48d394b4b0319ca9e30797186d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Jan 2020 13:00:10 -0800 Subject: Update JavaScript libraries --- web/load.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/load.js') diff --git a/web/load.js b/web/load.js index 59b0e527..baa03d4d 100644 --- a/web/load.js +++ b/web/load.js @@ -148,8 +148,8 @@ } extjsVersion = '6.2.0'; - olVersion = '5.3.0'; - proj4jsVersion = '2.5.0'; + olVersion = '6.1.1'; + proj4jsVersion = '2.6.0'; if (debugMode) { addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all-debug.js'); -- cgit v1.2.3 From f5165c8e897e8d9cf4219d943e2d34b61adb48b5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 10 Mar 2020 19:23:21 -0700 Subject: Update CDN dependencies --- web/load.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'web/load.js') diff --git a/web/load.js b/web/load.js index baa03d4d..f22f0adc 100644 --- a/web/load.js +++ b/web/load.js @@ -148,30 +148,30 @@ } extjsVersion = '6.2.0'; - olVersion = '6.1.1'; + olVersion = '6.2.1'; proj4jsVersion = '2.6.0'; if (debugMode) { - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all-debug.js'); - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts-debug.js'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/ext-all-debug.js'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/packages/charts/classic/charts-debug.js'); } else { - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/ext-all.js'); - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/charts.js'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/ext-all.js'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/packages/charts/classic/charts.js'); } - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/locale/locale-' + locale.languages[locale.language].code + '.js'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/classic/locale/locale-' + locale.languages[locale.language].code + '.js'); - addStyleFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/resources/theme-triton-all.css'); - addScriptFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/classic/theme-triton/theme-triton.js'); + addStyleFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/classic/theme-triton/resources/theme-triton-all.css'); + addScriptFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/classic/theme-triton/theme-triton.js'); - addStyleFile('https://cdnjs.cloudflare.com/ajax/libs/extjs/' + extjsVersion + '/packages/charts/classic/triton/resources/charts-all.css'); + addStyleFile('https://cdn.traccar.com/js/extjs/' + extjsVersion + '/packages/charts/classic/triton/resources/charts-all.css'); - addStyleFile('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v' + olVersion + '/css/ol.css'); - addScriptFile('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v' + olVersion + '/build/ol.js'); + addStyleFile('https://cdn.traccar.com/js/ol/' + olVersion + '/ol.css'); + addScriptFile('https://cdn.traccar.com/js/ol/' + olVersion + '/ol.js'); if (debugMode) { - addScriptFile('https://cdn.jsdelivr.net/npm/proj4@' + proj4jsVersion + '/dist/proj4-src.js'); + addScriptFile('https://cdn.traccar.com/js/proj4js/' + proj4jsVersion + '/proj4-src.js'); } else { - addScriptFile('https://cdn.jsdelivr.net/npm/proj4@' + proj4jsVersion + '/dist/proj4.js'); + addScriptFile('https://cdn.traccar.com/js/proj4js/' + proj4jsVersion + '/proj4.js'); } window.Images = ['arrow', 'default', 'animal', 'bicycle', 'boat', 'bus', 'car', 'crane', 'helicopter', 'motorcycle', -- cgit v1.2.3